From: Andrew Cooper <andrew.cooper3@citrix.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>,
Alejandro Vallejo <alejandro.vallejo@cloud.com>,
Xen-devel <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH] xen/x86: On x2APIC mode, derive LDR from APIC_ID
Date: Tue, 14 Nov 2023 14:44:09 +0000 [thread overview]
Message-ID: <2a340b44-9d3e-431f-94d6-e77e6145fc6a@citrix.com> (raw)
In-Reply-To: <ZVOAEFoYFDp8lxCd@macbook.local>
On 14/11/2023 2:11 pm, Roger Pau Monné wrote:
> On Tue, Nov 14, 2023 at 12:55:46PM +0000, Andrew Cooper wrote:
>> On 14/11/2023 12:32 pm, Jan Beulich wrote:
>>> On 14.11.2023 13:18, Alejandro Vallejo wrote:
>>>> On Tue, Nov 14, 2023 at 11:14:22AM +0100, Jan Beulich wrote:
>>>>> On 13.11.2023 18:53, Roger Pau Monné wrote:
>>>> I don't think vlapic_match_logical_addr() is affected. The LDR's are still
>>>> unique in the bogus case so the matching ought to work. Problem would arise
>>>> if the guest makes assumptions about APIC_ID and LDR relationships.
>>> The LDRs still being unique (or not) isn't what I'm concerned about. It is
>>> the function's return value which would be wrong, as the incoming "mda"
>>> presumably was set in its respective field on the assumption that the LDRs
>>> are set in a spec-compliant way. There not having been problem reports
>>> makes me wonder whether any guests actually use logical delivery mode in a
>>> wider fashion.
>> They likely don't.
>>
>> Logical delivery for xAPIC only works in a tiny fraction of cases
>> (assuming correct topology information, which we don't give), and
>> persuading a VM to turn on x2APIC without a vIOMMU is not something
>> we've managed to do in Xen.
> We do, in fact the pvshim (or nested Xen) will run in x2APIC mode if
> available.
> Linux >= 5.17 will also use x2APIC mode if available when running as a
> Xen HVM guest:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c8980fcb210851138cb34c9a8cb0cf0c09f07bf9
Yeah that's never actually been tested with 256 vCPUs.
A VM *must* have either a vIOMMU, or know (via whatever means) that
there are no IO-APICs, or (via whatever means) that all IO-APICs can use
reserved bits for 32k destination APIC ID support.
As it stands, this is just something which will explode on us in the
future. Hopefully the worst that will happen is a panic on boot.
> If a guest has been booted with the bogus LDR we need to keep it on
> migrate, otherwise at least Xen will break (because it does read the
> LDR from the hardware instead of building it based on the APIC ID).
Of course. That would be data corruption otherwise.
> Switching to the correct LDR on APIC reset can be sensible, any APIC
> device reset should be done together with updating whatever registers
> have been previously cached, and OSes don't do APIC resets anyway.
Yes. We can just set it properly on reset and the problem ought to
disappear.
~Andrew
next prev parent reply other threads:[~2023-11-14 14:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-13 16:50 [PATCH] xen/x86: On x2APIC mode, derive LDR from APIC_ID Alejandro Vallejo
2023-11-13 17:53 ` Roger Pau Monné
2023-11-14 10:14 ` Jan Beulich
2023-11-14 11:45 ` Andrew Cooper
2023-11-14 12:18 ` Alejandro Vallejo
2023-11-14 12:32 ` Jan Beulich
2023-11-14 12:55 ` Andrew Cooper
2023-11-14 14:11 ` Roger Pau Monné
2023-11-14 14:22 ` Alejandro Vallejo
2023-11-14 14:44 ` Andrew Cooper [this message]
2023-11-14 15:06 ` Roger Pau Monné
2023-11-14 12:09 ` Alejandro Vallejo
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=2a340b44-9d3e-431f-94d6-e77e6145fc6a@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=alejandro.vallejo@cloud.com \
--cc=jbeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=wl@xen.org \
--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.