All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Teddy Astie <teddy.astie@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.pau@citrix.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Bertrand Marquis" <bertrand.marquis@arm.com>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Julian Vetter" <julian.vetter@vates.tech>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 8/9] hvm/ioreq: Negotiate extended destination ID support per ioreq server
Date: Mon, 4 May 2026 15:35:27 +0200	[thread overview]
Message-ID: <23c6c675-70fd-415d-9b3e-6af68258f32d@suse.com> (raw)
In-Reply-To: <1777394145.8631fc262581453bbf619ec5b2062170.19dd4f256ec000f373@vates.tech>

On 28.04.2026 18:35, Teddy Astie wrote:
> Le 27/04/2026 à 15:57, Julian Vetter a écrit :
>> Add a per-server capability flag in XEN_DMOP_create_ioreq_server to
>> signal extended destination ID support. Repurpose the first byte of the
>> existing pad[3] as a flags field, and define
>> XEN_DMOP_IOREQ_SERVER_EXT_DEST_ID (bit 0) for a server to signal it will
>> use XEN_DMOP_bind_pt_msi_irq for all passthrough MSI bindings.
>>
>> Track the flag in struct ioreq_server ext_dest_id.
>> hvm_ext_dest_id_enabled() returns true only if all registered ioreq
>> servers have opted in and at least one server is present. A single
>> server without the flag is sufficient to suppress the feature.
>>
>> Lock the feature at domain creation time:
>> arch_domain_creation_finished() computes the levelled result into struct
>> hvm_domain.ext_dest_id using OR to preserve any value previously
>> restored from an HVM save record. After creation_finished,
>> arch_ioreq_server_create_check() rejects new servers that lack
>> XEN_DMOP_IOREQ_SERVER_EXT_DEST_ID if the feature was already advertised
>> to the guest.
>>
>> Persist the locked state in a new HVM_SAVE_TYPE(EXT_DEST_ID) record so
>> that migration preserves the guest-visible CPUID bit independently of
>> when the device model re-registers its ioreq servers on the destination
>> host.
>>
>> On restore, ioapic_check() uses d->arch.hvm.ext_dest_id (restored from
>> the EXT_DEST_ID record) rather than the per-server dynamic check, since
>> the DM has not yet re-registered its servers at that point.
>>
>> Update xendevicemodel_create_ioreq_server() in libxendevicemodel to
>> accept the new flags parameter, remove
>> xendevicemodel_enable_ext_dest_id(), and fix the
>> xc_hvm_create_ioreq_server() compat wrapper to pass zero flags.
>>
>> Signed-off-by: Julian Vetter <julian.vetter@vates.tech>
> 
> That has somewhat already being discussed previously, but AFAIU, 
> extended destination ID is only meaningful when guest APIC IDs cannot be 
> represented with the "non-extended" model which can only happen in 
> practice when having more than 128 vCPUs in the guest.

As Andrew has been pointing out many times, we need to stop thinking in
terms of 128 vCPU-s being the limit because of the vCPU ID times 2
calculation for the APIC IDs. With a non-HT topology, more than 128
vCPU-s would already be possible from an APIC ID perspective. Hence
tying "extended dest ID" to the vCPU count is unlikely to be viable.

Jan

> I don't think we need to check for device model support unless the guest 
> can have more than 128 vCPUs, where in such case it becomes mandatory 
> (unless some form of interrupt remapping is implemented).
> 
> So I would rather check if domain->max_vcpus is more than 128 and 
> require device models to implement support for extended destination ID 
> in these cases.
> 
> In some way, that would imply that extended destination ID is only 
> exposed to guests with domain->max_vcpus > 128.
> 
> Overall, what I propose would be to keep the new 
> XEN_DMOP_IOREQ_SERVER_EXT_DEST_ID flag, and if d->max_vcpus > 128, we 
> require the device model to support XEN_DMOP_IOREQ_SERVER_EXT_DEST_ID.


  reply	other threads:[~2026-05-04 13:35 UTC|newest]

Thread overview: 31+ 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 [this message]
2026-08-19 14:38   ` Jan Beulich
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=23c6c675-70fd-415d-9b3e-6af68258f32d@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.pau@citrix.com \
    --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.