From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Xen-devel" <xen-devel@lists.xenproject.org>
Cc: "Jan Beulich" <jbeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH] x86/traps: Re-enable IRQs after reading cr2 in the #PF handler
Date: Thu, 12 Sep 2024 11:07:34 +0100 [thread overview]
Message-ID: <D4480SHG3YQE.BF44DSHOV7GI@cloud.com> (raw)
In-Reply-To: <f1ee8998-52c1-4c12-9e21-88bdec67f08a@citrix.com>
On Thu Sep 12, 2024 at 10:49 AM BST, Andrew Cooper wrote:
> On 11/09/2024 3:58 pm, Alejandro Vallejo wrote:
> > diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
> > index b8482de8ee..ef803f6288 100644
> > --- a/xen/arch/x86/x86_64/entry.S
> > +++ b/xen/arch/x86/x86_64/entry.S
> > @@ -844,8 +844,7 @@ handle_exception_saved:
> > #elif !defined(CONFIG_PV)
> > ASSERT_CONTEXT_IS_XEN
> > #endif /* CONFIG_PV */
> > - sti
> > -1: movq %rsp,%rdi
> > +1: mov %rsp,%rdi
> > movzbl UREGS_entry_vector(%rsp),%eax
> > #ifdef CONFIG_PERF_COUNTERS
> > lea per_cpu__perfcounters(%rip), %rcx
>
> I'm afraid this isn't correctly. The STI is only on one of two paths to
> the dispatch logic.
>
> Right now, you're re-enabling interrupts even if #PF hits an irqs-off
> region in Xen.
>
> You must not enabled IRQs if going via the exception_with_ints_disabled
> path, which is the user of that 1: label immediately after STI.
>
> ~Andrew
Well, darn. That's a well-hidden Waldo.
I'll send a v2 with conditional enables on C and assembly, and a change of that
label from "1" to ".Lfoo" to clearly imply the control flow might take a
backflip from several miles down the file.
Cheers,
Alejandro
prev parent reply other threads:[~2024-09-12 10:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-11 14:58 [PATCH] x86/traps: Re-enable IRQs after reading cr2 in the #PF handler Alejandro Vallejo
2024-09-11 19:58 ` Frediano Ziglio
2024-09-12 9:41 ` Roger Pau Monné
2024-09-12 9:49 ` Andrew Cooper
2024-09-12 10:07 ` Alejandro Vallejo [this message]
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=D4480SHG3YQE.BF44DSHOV7GI@cloud.com \
--to=alejandro.vallejo@cloud.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.