From: Jan Beulich <jbeulich@suse.com>
To: Julian Vetter <julian.vetter@vates.tech>
Cc: "Anthony PERARD" <anthony.perard@vates.tech>,
"Juergen Gross" <jgross@suse.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Michal Orzel" <michal.orzel@amd.com>,
"Julien Grall" <julien@xen.org>,
"Roger Pau Monné" <roger@xenproject.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
"Teddy Astie" <teddy.astie@vates.tech>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 8/9] hvm/ioreq: Negotiate extended destination ID support per ioreq server
Date: Fri, 28 Aug 2026 11:22:04 +0200 [thread overview]
Message-ID: <17c4ad74-6108-452d-923b-755fd37e4381@suse.com> (raw)
In-Reply-To: <1787907132.8631fc262581453bbf619ec5b2062170.1a04791cd47000c4f3@vates.tech>
On 28.08.2026 10:52, Julian Vetter wrote:
> On 8/19/26 16:38, Jan Beulich wrote:
>> On 27.04.2026 15:54, Julian Vetter wrote:
>>> @@ -1106,7 +1107,16 @@ int arch_domain_soft_reset(struct domain *d)
>>> void arch_domain_creation_finished(struct domain *d)
>>> {
>>> if ( is_hvm_domain(d) )
>>> + {
>>> + /*
>>> + * Lock the extended destination ID state. OR preserves any value
>>> + * already restored from an HVM save record (migration path). For a
>>> + * fresh domain, ext_dest_id starts false and the dynamic check
>>> + * supplies the levelled result across all registered ioreq servers.
>>> + */
>>> + d->arch.hvm.ext_dest_id |= hvm_ext_dest_id_enabled(d);
>>
>> For an unaware guest, after migration it'll suddenly get the flag set
>> if all servers are capable. That can't be right. It looks pretty much
>> unavoidable for the field to become tristate (unset / false / true).
>
> Thank you Jan. You're right true/false is not enough, but there's one
> migration case left where even a tristate doesn't give a clear answer, I
> believe and I'd like your opinion on that.
>
> Scenario: a domain is migrated (or saved/restored) from a Xen that
> predates this series, onto a new Xen where every registered ioreq server
> has XEN_DMOP_IOREQ_SERVER_EXT_DEST_ID set.
>
> So, the incoming stream would not carry a EXT_DEST_ID record, so
> ext_dest_id_load() never runs and the field would still be
> EXT_DEST_ID_UNSET when arch_domain_creation_finished() runs on the
> destination. The latch then takes the "fresh domain" path and recomputes
> the levelled value, which here comes out ENABLED.
Well - I thought it was clear that by the time the domain is actually
launched, the 3rd ("unset") value would need resolving.
> From that point Xen would interpret the extended destination ID bits
> for this guest. But before the guest ran under a Xen that never
> advertised XEN_HVM_CPUID_EXT_DEST_ID, so it never used those reserved
> bits deliberately, but might have written garbage into them accidentaly.
>
> I see two ways to handle this:
>
> 1. Accept it. Document that migrating in from a pre-feature Xen onto an
> all-opted-in host may turn the feature on, and might now treat non-zero
> reserved bits as extended destionation ID bits.
> 2. Distinguish "fresh domain" from "restored without the record" and
> force the latter to DISABLED. A feature-aware guest then picks the
> feature up on its next reboot on the new host, which matches how every
> other creation-time-levelled property behaves.
Imo 2 is the only viable option.
> The stream is parsed by Xen (the toolstack hands the HVM-context blob to
> XEN_DOMCTL_sethvmcontext -> hvm_load()), so this stays entirely in the
> hypervisor: add a 'bool context_loaded' to 'struct hvm_domain', set it
> in the hvm_load(), and in the latch do
>
> if ( d->arch.hvm.ext_dest_id == EXT_DEST_ID_UNSET )
> d->arch.hvm.ext_dest_id =
> (!d->arch.hvm.context_loaded && hvm_ext_dest_id_enabled(d))
> ? EXT_DEST_ID_ENABLED : EXT_DEST_ID_DISABLED;
>
> This would mean one new bool in 'struct hvm_domain' which covers both
> live migration and xl restore of an old image. What do you think? Would
> this be acceptable?
I don't quite get why that's better than converting the boolean to a
tristate.
Also may I please remind you again to trim your replies? Below here,
for example, there was only reply quoting. That serves no purpose in
your reply. Yet I still needed to scroll through all of it to see
whether there was some other comment of yours. And every other reader
likely will also end up doing so.
Jan
next prev parent reply other threads:[~2026-08-28 9:22 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260427135406.1281424-1-julian.vetter@vates.tech>
2026-04-27 13:53 ` [PATCH v4 1/9] x86/vioapic: Add ioapic_check() to validate IO-APIC state before restore Julian Vetter
2026-04-28 12:06 ` Teddy Astie
2026-06-25 14:46 ` Jan Beulich
2026-04-27 13:53 ` [PATCH v4 2/9] x86/passthrough: Wrap pt_irq_create_bind() restart block in braces Julian Vetter
2026-04-28 12:40 ` Teddy Astie
2026-06-25 15:56 ` Jan Beulich
2026-04-27 13:54 ` [PATCH v4 3/9] x86/passthrough: Extract pt_irq_dpci_setup() from pt_irq_create_bind() Julian Vetter
2026-04-28 12:53 ` Teddy Astie
2026-08-18 14:45 ` Jan Beulich
2026-04-27 13:54 ` [PATCH v4 4/9] x86/passthrough: Extract PT_IRQ_TYPE_MSI body into pt_irq_bind_msi() Julian Vetter
2026-04-28 14:01 ` Teddy Astie
2026-08-18 15:10 ` Jan Beulich
2026-04-27 13:54 ` [PATCH v4 5/9] x86/passthrough: Introduce pt_irq_bind_msi() as canonical MSI bind path Julian Vetter
2026-04-28 15:15 ` Teddy Astie
2026-06-25 15:58 ` Jan Beulich
2026-08-18 16:05 ` Jan Beulich
2026-04-27 13:54 ` [PATCH v4 6/9] x86/hvm: Support extended destination IDs in virtual MSI and IO-APIC Julian Vetter
2026-04-28 15:27 ` Teddy Astie
2026-08-19 12:14 ` Jan Beulich
2026-04-27 13:54 ` [PATCH v4 7/9] x86/dmop: Add XEN_DMOP_{bind,unbind}_pt_msi_irq DM ops Julian Vetter
2026-04-28 16:02 ` Teddy Astie
2026-08-19 12:21 ` Jan Beulich
2026-08-19 13:37 ` Jan Beulich
2026-04-27 13:54 ` [PATCH v4 8/9] hvm/ioreq: Negotiate extended destination ID support per ioreq server Julian Vetter
2026-04-28 16:35 ` Teddy Astie
2026-05-04 13:35 ` Jan Beulich
2026-08-19 14:38 ` Jan Beulich
2026-08-28 8:52 ` Julian Vetter
2026-08-28 9:22 ` Jan Beulich [this message]
2026-04-27 13:54 ` [PATCH v4 9/9] x86/cpuid: Advertise XEN_HVM_CPUID_EXT_DEST_ID when device model opts in Julian Vetter
2026-08-19 15:01 ` Jan Beulich
2026-06-02 12:08 ` [PATCH v4 0/9] x86/hvm: Add Extended MSI destination ID support Julian Vetter
2026-06-02 12:21 ` Jan Beulich
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=17c4ad74-6108-452d-923b-755fd37e4381@suse.com \
--to=jbeulich@suse.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=bertrand.marquis@arm.com \
--cc=jgross@suse.com \
--cc=julian.vetter@vates.tech \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger@xenproject.org \
--cc=sstabellini@kernel.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.