From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Jan Beulich" <jbeulich@suse.com>,
"Roger Pau Monné" <roger@xenproject.org>
Subject: Re: [PATCH] x86/vlapic: Don't change ICR on x2APIC SELF_IPI write
Date: Tue, 20 Oct 2026 00:29:24 +0100 [thread overview]
Message-ID: <ca3d6951-d81f-41f5-b249-e8901f7af7d9@citrix.com> (raw)
In-Reply-To: <6769b61a-89b8-4283-b476-5a1a9aedbd5b@citrix.com>
On 19/10/2026 10:09 pm, Andrew Cooper wrote:
> On 19/10/2026 3:26 pm, Teddy Astie wrote:
>> The Intel SDM (Vol 3A-13.12.11, June 2026) says
>>
>>> The semantics of sending a self-IPI via the SELF IPI register
>>> are identical to sending a self targeted edge triggered fixed
>>> interrupt with the specified vector.
>> However, this is not expected to alter the ICR register.
>>
>> Fix the Xen behavior by sending the Self-IPI directly instead of
>> emulating it by modifying ICR register.
>>
>> Fixes: 21c4d089ba2a ("x86 hvm: x2APIC emulation")
>> Assisted-by: Claude Fable 5.1
>> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
> What matters is the behaviour on real hardware.
>
> If we're taking a strict interpretation, then "identical" means that ICR
> does get mutated.
>
> GNR:
>
> (XEN) '1' pressed -> Extreme debugging in progress...
> (XEN) *** Testing self-IPI
> (XEN) Before: ICR 00000000000010ff, IRR 00000000
> (XEN) After: ICR 00000000000400fc, IRR 90000000
> (XEN) *** SPIV
>
> Turin:
>
> (XEN) '1' pressed -> Extreme debugging in progress...
> (XEN) *** Testing self-IPI
> (XEN) Before: ICR 00000000000000ff, IRR 80000000
> (XEN) After: ICR 00000000000000ff, IRR 90000000
> (XEN) *** SPIV
>
>
> So, AMD doesn't mutate ICR. Intel does.
>
> Weirdly, Intel reads back ICR_BUSY which shouldn't exist in x2APIC,
> while AMD fails to read back the shorthand.
>
> See the attached patch. The test sends SPIV to CPU0 using ICR, then a
> self EVENT_CHECK sampling ICR and IRR before and after. The SPIV
> printk() only gets serviced later, which is why it's the last of the
> printk()s
https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/2965354494
It looks like it's a behavioural difference between Core and Atom. Core
modify ICR, while Atom do not.
Also Atom look to be delivering the "SPIV" IPI too early. That will be
a separate bug.
~Andrew
next prev parent reply other threads:[~2026-10-19 23:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 14:26 [PATCH] x86/vlapic: Don't change ICR on x2APIC SELF_IPI write Teddy Astie
2026-10-19 21:09 ` Andrew Cooper
2026-10-19 23:29 ` Andrew Cooper [this message]
2026-10-23 20:45 ` Andrew Cooper
-- strict thread matches above, loose matches on Subject: below --
2026-10-19 23:40 Christian Ludloff
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=ca3d6951-d81f-41f5-b249-e8901f7af7d9@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=roger@xenproject.org \
--cc=teddy.astie@vates.tech \
--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.