From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, X86 ML <x86@kernel.org>,
Lai Jiangshan <jiangshan.ljs@antgroup.com>,
Joerg Roedel <jroedel@suse.de>, Andy Lutomirski <luto@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] x86/sev: Add ENCODE_FRAME_POINTER after stack changed for #VC
Date: Fri, 18 Mar 2022 10:03:12 -0700 [thread overview]
Message-ID: <20220318170312.rc2zgtubddg4dpya@treble> (raw)
In-Reply-To: <CAJhGHyC1qPee2QOpgR8B+2Sd+XzfoJD3NL9biFZ5gKE-B9r_rQ@mail.gmail.com>
On Fri, Mar 18, 2022 at 09:14:09AM +0800, Lai Jiangshan wrote:
> On Fri, Mar 18, 2022 at 6:19 AM Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> >
> > On Wed, Mar 16, 2022 at 12:16:12PM +0800, Lai Jiangshan wrote:
> > > From: Lai Jiangshan <jiangshan.ljs@antgroup.com>
> > >
> > > In idtentry_vc(), the real frame is changed after it switches to new
> > > stack, ENCODE_FRAME_POINTER should be called in case for unwinder.
> > >
> > > Cc: Joerg Roedel <jroedel@suse.de>
> > > Cc: Josh Poimboeuf <jpoimboe@redhat.com>
> > > Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
> > > ---
> > > arch/x86/entry/entry_64.S | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
> > > index e20eabaa56b8..f99f2881ed83 100644
> > > --- a/arch/x86/entry/entry_64.S
> > > +++ b/arch/x86/entry/entry_64.S
> > > @@ -540,6 +540,7 @@ SYM_CODE_START(\asmsym)
> > > call vc_switch_off_ist
> > > movq %rax, %rsp /* Switch to new stack */
> > >
> > > + ENCODE_FRAME_POINTER
> > > UNWIND_HINT_REGS
> > >
> > > /* Update pt_regs */
> >
> > Looks right to me. Any chance you have the ability to test this
> > scenario by unwinding from #VC with CONFIG_FRAME_POINTER?
> >
>
> I don't have the hardware to test it. Actually, it was you to
> inspire me to find this in the conversation of my patchset when
> I tried to search all the code of switching of %rsp to see how
> ENCODE_FRAME_POINTER and UNWIND_HINT_REGS are used once more.
Ok, maybe Joerg can test it. It looks obviously right to me though.
Since it fixes a real frame pointer unwinding bug, it probably needs:
Fixes: a13644f3a53d ("x86/entry/64: Add entry code for #VC handler")
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
--
Josh
next prev parent reply other threads:[~2022-03-18 17:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-16 4:16 Lai Jiangshan
2022-03-17 22:19 ` Josh Poimboeuf
2022-03-18 1:14 ` Lai Jiangshan
2022-03-18 17:03 ` Josh Poimboeuf [this message]
2022-04-12 12:24 ` Lai Jiangshan
2022-04-27 8:26 ` Lai Jiangshan
2022-05-13 9:04 ` Lai Jiangshan
2022-05-18 18:44 ` [tip: x86/sev] x86/sev: Annotate stack change in the #VC handler tip-bot2 for Lai Jiangshan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220318170312.rc2zgtubddg4dpya@treble \
--to=jpoimboe@redhat.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jiangshan.ljs@antgroup.com \
--cc=jiangshanlai@gmail.com \
--cc=jroedel@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®