Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp594552pxb; Wed, 13 Apr 2022 08:24:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyfm52adIzwCFLg53XFcNTmW5Bwh/V8XGDXRndNFZI/g8kaWVe6YfdKldXYCItZFK+BmD8 X-Received: by 2002:a17:902:b613:b0:156:7d82:c09b with SMTP id b19-20020a170902b61300b001567d82c09bmr43386234pls.80.1649863452228; Wed, 13 Apr 2022 08:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649863452; cv=none; d=google.com; s=arc-20160816; b=WLrXZQvpX21IEYomGR5d0UeBaaRmOh/n1ZyhaZLB6Z681Gwwt6fTMSPCNmus1ok35B pZ/oTgSgH4iEj3cbNx5wTxdP4H/QwFGBfkOj3nel8Lt9g1Vmjwiy3Hk8I5B38qa8SO17 fvFncWv5xOfbtpZvEpn1nq8Mlw7x5a9nqED5QJ9XE/WJnx4VCvrpuuP56pMdrsIeQ7SC fdwW2JDxQ4Beu4U43TjSwDxU4dqJIGwpE2UUMMV2L6Ae2HhhGdycYAhZ9/AsY+Vqqbyf UGrkQ7F06x1kPJLUn4tNxJH4l8tEH0viZdlZUh2wkixGjDXt5Gaw9HR7S/NMzCkwksnF 8cxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=wRogKyz2dq+2vxcQK2B+MiPFOoX9By0Up7rAIWGue2w=; b=ElPOyKEqmtKpPMKNkXszw3I8ftAp3HgZA3y1kI5579Dj1efBVxv+TRK26xxQn7edq3 QVd0liEINsCML4DdWtJrLRMjr3BJSUNHTJz0dPWwbLOBu6pwgPh4ljcczauWatdcSxMD pAx5e+Yi448wWLODr+upZCWl2SJ6mhT0OhxSiy2KlPKFPnvX5rxp3adZvDmAGJSdBmCn +PtePKVkS4LQiD7VVrZ+3KlIcBiDI+fRatlrfQEllZonUa+IxTQTPxmyyB5rWXfv6yNs mX2Dmc235JIqOzezgps6wg12hh+1p7MgLst152OLgiY3Jxce8M94+8MzXx2OMePbYOz7 0Zeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b="pp/1Fcf3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020a17090341cc00b00156bddf0f3csi15925510ple.53.2022.04.13.08.23.56; Wed, 13 Apr 2022 08:24:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b="pp/1Fcf3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233111AbiDMMeK (ORCPT + 99 others); Wed, 13 Apr 2022 08:34:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230096AbiDMMeI (ORCPT ); Wed, 13 Apr 2022 08:34:08 -0400 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A479D2C115 for ; Wed, 13 Apr 2022 05:31:46 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4KdhmG0JjTz4xL3; Wed, 13 Apr 2022 22:31:42 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1649853102; bh=wRogKyz2dq+2vxcQK2B+MiPFOoX9By0Up7rAIWGue2w=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=pp/1Fcf34yGDY8rdGzZL4ZZC/QtH6XXJsKWW/odPYUVHxakCpYZ3aqicUaaQocYQ6 XKocItLeJKTZJT3pgLNPHAv87ZsvIkDq1l61o+KCTzCTEzmhwA0wQ2X1BhqAhmuy0d v8xpB5WLOY/jDp2LA5W1bC3nCCOGzP31pQzmP9nDrT8r0/fTNhHU4Kt869D8ZJy/mn NWp8KgU0ED/nk0aLkN4ETSs7cY+lk5jkUra4DrhFh8vnVlcCYHO4Yk0VGgZ9Fks4Q7 d3EbbAsnC4bpnm3/6B1ECfIRyMhvti8GlcxLuDCqeuoHP/rLymFKbNjuk+Mk+tMNI0 KMvU2LeI343YA== From: Michael Ellerman To: Borislav Petkov , Brian Gerst , linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Andy Lutomirski , Thomas Gleixner , "H . Peter Anvin" , Peter Zijlstra Subject: Re: [PATCH 2/4] ELF: Remove elf_core_copy_kernel_regs() In-Reply-To: References: <20220325153953.162643-1-brgerst@gmail.com> <20220325153953.162643-3-brgerst@gmail.com> Date: Wed, 13 Apr 2022 22:31:41 +1000 Message-ID: <87h76x5fma.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Borislav Petkov writes: > + PPC ML as an FYI that this change will come through tip. Ack. cheers > On Fri, Mar 25, 2022 at 11:39:51AM -0400, Brian Gerst wrote: >> x86-32 was the last architecture that implemented separate user and >> kernel registers. >> >> Signed-off-by: Brian Gerst >> --- >> arch/powerpc/kernel/fadump.c | 2 +- >> arch/powerpc/platforms/powernv/opal-core.c | 2 +- >> include/linux/elfcore.h | 9 --------- >> kernel/kexec_core.c | 2 +- >> 4 files changed, 3 insertions(+), 12 deletions(-) >> >> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c >> index 4fdb7c77fda1..c0cf17196d6c 100644 >> --- a/arch/powerpc/kernel/fadump.c >> +++ b/arch/powerpc/kernel/fadump.c >> @@ -752,7 +752,7 @@ u32 *__init fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs) >> * FIXME: How do i get PID? Do I really need it? >> * prstatus.pr_pid = ???? >> */ >> - elf_core_copy_kernel_regs(&prstatus.pr_reg, regs); >> + elf_core_copy_regs(&prstatus.pr_reg, regs); >> buf = append_elf_note(buf, CRASH_CORE_NOTE_NAME, NT_PRSTATUS, >> &prstatus, sizeof(prstatus)); >> return buf; >> diff --git a/arch/powerpc/platforms/powernv/opal-core.c b/arch/powerpc/platforms/powernv/opal-core.c >> index 0331f1973f0e..dd6e99edff76 100644 >> --- a/arch/powerpc/platforms/powernv/opal-core.c >> +++ b/arch/powerpc/platforms/powernv/opal-core.c >> @@ -112,7 +112,7 @@ static void __init fill_prstatus(struct elf_prstatus *prstatus, int pir, >> struct pt_regs *regs) >> { >> memset(prstatus, 0, sizeof(struct elf_prstatus)); >> - elf_core_copy_kernel_regs(&(prstatus->pr_reg), regs); >> + elf_core_copy_regs(&(prstatus->pr_reg), regs); >> >> /* >> * Overload PID with PIR value. >> diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h >> index f8e206e82476..346a8b56cdc8 100644 >> --- a/include/linux/elfcore.h >> +++ b/include/linux/elfcore.h >> @@ -84,15 +84,6 @@ static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *re >> #endif >> } >> >> -static inline void elf_core_copy_kernel_regs(elf_gregset_t *elfregs, struct pt_regs *regs) >> -{ >> -#ifdef ELF_CORE_COPY_KERNEL_REGS >> - ELF_CORE_COPY_KERNEL_REGS((*elfregs), regs); >> -#else >> - elf_core_copy_regs(elfregs, regs); >> -#endif >> -} >> - >> static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs) >> { >> #if defined (ELF_CORE_COPY_TASK_REGS) >> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c >> index 68480f731192..be4b54c2c615 100644 >> --- a/kernel/kexec_core.c >> +++ b/kernel/kexec_core.c >> @@ -1078,7 +1078,7 @@ void crash_save_cpu(struct pt_regs *regs, int cpu) >> return; >> memset(&prstatus, 0, sizeof(prstatus)); >> prstatus.common.pr_pid = current->pid; >> - elf_core_copy_kernel_regs(&prstatus.pr_reg, regs); >> + elf_core_copy_regs(&prstatus.pr_reg, regs); >> buf = append_elf_note(buf, KEXEC_CORE_NOTE_NAME, NT_PRSTATUS, >> &prstatus, sizeof(prstatus)); >> final_note(buf); >> -- >> 2.35.1 >> > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette