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

[PATCH v2] x86/vlapic: accept a logical destination of all ones as a broadcast


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • Date: Tue, 17 Nov 2026 15:36:59 -0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AkQcmUworlii0Dce3WHgMWMENlLh/7dG+38fAQC1ih0=; b=k7srr9alQxI8kIGS2dZmmBakp/T5NqdaRgEIa4TuKQxjviw9YeLrmzQgrVbumuwdcXzzyakkA5YJa3rhffI9MmJplAU1a1ZYkRnyaphS6VnP8gH4WvFRm+q1wg07aN6s5leFpq3hxoa/af9mu8G12ky8W/+HKnnoe08LUX/0Ho5wE6TF7r8jrmuQuOd1Qx6Vob4bT2Xqrf2y1JzZ6VV+Cjj4jfK8+VrRE6EHz+3ecJIHdvlyfdI1Ilaslrsru5/RAZ2oXH/2zwvznBqtlWjGJu+7dPZ6dW4V6dlEFEkagAyfi5COuX5Goa6/yYqxQPYS6vKuN6zASnLW8q8BfqZt4w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kqt32TShb88RuAHDNHyKcJPBjYjp1tQ9DM2iGSQQ3OQMyiKik/EGe4YTn9Hux9Op2OruNPYUvQ/zaCOe6rtus0r5lg+zugEGKMkaA50dKU3qEjLWXv4EuBMKwBpJWwl8X6Afv0GXrPT6YwpEbQ2wTKt47jOc+JkO6A6hhSWTTLtgZ8fpLjPUzX5HxzO/xFip1JOhxk2BLcXU7Pogt6qZ8KImX2Ix2YU9soD41BPrjkWEABjG0+i2gCRH0S449A1Ib3zfUAiJ60HsMZMOgGAwuElK4dpCOR93VyWD9Py1yvaPzOB5waFi35fVBMbbnRgg6qYFrCrKD4bi0br6bim8dA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: <stefano.stabellini@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
  • Delivery-date: Tue, 17 Nov 2026 23:37:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

In logical destination mode, a destination of all ones is a broadcast
accepted by every local APIC: 0xff in xAPIC mode, in both the flat and
the cluster model (AMD APM vol. 2, "Receiving System and IPI
Interrupts"), and 0xffffffff in x2APIC mode (AMD APM vol. 2, "x2APIC
Interrupt Command Register (ICR) Operations").

vlapic_match_logical_addr() treated these as ordinary logical
destinations, so a broadcast reached only the vLAPICs whose logical ID
happened to match it. In particular, a vLAPIC whose logical ID is 0
received no logical broadcast at all.

Check for the broadcast in vlapic_match_dest() before telling the two
destination modes apart, as was already done for physical destinations.
A vLAPIC whose destination format register names neither model now
also accepts the broadcast.

Fixes: f9e0cccf7b35 ("x86/HVM: fix ID handling of x2APIC emulation")
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
---
CC: Jan Beulich <jbeulich@xxxxxxxx>,
CC: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>,
CC: Roger Pau Monné <roger@xxxxxxxxxxxxxx>,
CC: Teddy Astie <teddy.astie@xxxxxxxxxx>

v2:
 - Check for the broadcast once in vlapic_match_dest(), before the two
   destination modes are told apart, rather than in each model of
   vlapic_match_logical_addr() (Jan). As a result, a logical broadcast
   now also matches a vLAPIC whose DFR names neither model.
 - Cite the AMD APM by section title (Jan).
 - Add Fixes: tags.

 xen/arch/x86/hvm/vlapic.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 6698779e22..50b515d254 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -247,10 +247,12 @@ bool vlapic_match_dest(
     switch ( short_hand )
     {
     case APIC_DEST_NOSHORT:
+        /* All ones is a broadcast in either destination mode. */
+        if ( dest == _VLAPIC_ID(target, 0xffffffffU) )
+            return true;
         if ( dest_mode )
             return vlapic_match_logical_addr(target, dest);
-        return (dest == _VLAPIC_ID(target, 0xffffffffU)) ||
-               (dest == VLAPIC_ID(target));
+        return dest == VLAPIC_ID(target);
 
     case APIC_DEST_SELF:
         return (target == source);
-- 
2.47.3




 


Rackspace

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