[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v5 11/11] x86/cpuid: Advertise XEN_HVM_CPUID_EXT_DEST_ID



Expose the extended-destination-ID feature bit in the HVM hypervisor
CPUID leaf when d->arch.hvm.ext_dest_id is EXT_DEST_ID_ENABLED, i.e. the
domain's ioreq servers all opted in and the value was latched at
creation_finished (or restored from migration).

An older device model that never sets XEN_DMOP_IOREQ_SERVER_EXT_DEST_ID
leaves the bit clear and the guest keeps 8-bit APIC destination IDs.

Signed-off-by: Julian Vetter <julian.vetter@xxxxxxxxxx>
---
Changes in v5:
- Retitled (dropped "when device model opts in").
- Removed the dynamic pre-creation_finished path: guest_cpuid() only
  ever runs for "current", so the value is always latched by the time
  the leaf is read. The check is now just hvm_ext_dest_id_active(d).
- Commit message rewritten to match the new logic.

Signed-off-by: Julian Vetter <julian.vetter@xxxxxxxxxx>
---
 xen/arch/x86/cpuid.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
index a9aeb2d268..1e8dbf8a15 100644
--- a/xen/arch/x86/cpuid.c
+++ b/xen/arch/x86/cpuid.c
@@ -148,6 +148,14 @@ static void cpuid_hypervisor_leaves(const struct vcpu *v, 
uint32_t leaf,
         res->a |= XEN_HVM_CPUID_DOMID_PRESENT;
         res->c = d->domain_id;
 
+        /*
+         * Advertise extended (15-bit) MSI / IO-APIC destination IDs when the
+         * feature was negotiated with the domain's device model(s) and latched
+         * at creation_finished (see hvm_ext_dest_id_enabled()).
+         */
+        if ( hvm_ext_dest_id_active(d) )
+            res->a |= XEN_HVM_CPUID_EXT_DEST_ID;
+
         /*
          * Per-vCPU event channel upcalls are implemented and work
          * correctly with PIRQs routed over event channels.
-- 
2.53.0



--
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.