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

[PATCH 1/2] x86/vlapic: size the all-ones broadcast by the sender's mode


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • Date: Thu, 19 Nov 2026 14:00:01 -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=ay71OTXEc2b2PcH81duJHY+HzzXE2LrrUJCJt2DtFNA=; b=N//ANvN1fvfc63cnhjhwAraeEN/BznaH8fkiZOzKeS9dZ/B3Zx6K/q3Pt1xzMJRMe2gu9tT2V0xmLzM9irJlZA/GHerdcv+EInLnCtR5ZVvnwVDFeYz2HzpbYzyL6uZw+QsS7I5D2CCjwSXeFsCfeYAGWvXlKfH/p5iQTTAx5bhDqdKw18qE868yoOYfqPcbEfUEtgXvpEhcSUcP+Pd93Bjzs0qpg0MhgdH9qKPytcf5mUpMyfV6SxjuNo49qW7w9kxagq1KCAqPx2Y4/gwMJPcujLKxy0Nt3h45R9MYrVgpWtbuTpCYAkNW3dM4bXSr9JPTPkOjs0gUoCrZu1SXXQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UOohB+t4Ce+LjSS72BAfvXSroxs54r43gv+tWWjEzgkx/MoKzZlJjohiP7GpCVIYl47iR0NIEZFZE9zlGIwKOrgX+Y2hsqU2PIvfarCuKvq/NrwKKPxpjUI0dILsGHhOVt2acKdnhEBDK1BWev5G1JJ7RT13fwdFEVMWk0X3/pZHBD5y/tUM/4/3IrDFJpkN+TCUVPzVInL1dF3ffWnN/YN0K1LR9KuCf70A8fh/liwykGHiSXRRgRN7o2Uc/vNCB9W+or0vAAbaZYC3QzzxlRTlR8cgcSNbf3iVledVw3raYNt+ooW5LPc10pPhoJiKYDBtA8v7jKsn1hGjViWWTQ==
  • 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>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
  • Delivery-date: Thu, 19 Nov 2026 22:00:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

vlapic_match_dest() detects a broadcast by comparing the destination
with all ones in the target's mode, but an IPI's destination has the
width of the sender's mode.

Use the sender's mode when there is one, as is_multicast_dest() does:
whether a destination is a broadcast is decided by the sender. vIO-APIC
and MSI destinations have no sender and are still compared in the
target's mode.

Fixes: 82d29b97d013 ("x86/vlapic: accept a logical destination of all ones as a 
broadcast")
Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Link: 
https://lore.kernel.org/xen-devel/95e0e0fb-2978-4c87-b723-fb7c30f36883@xxxxxxxxxx/
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>

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

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 50b515d254..b7861bd2ba 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -247,8 +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) )
+        /*
+         * All ones is a broadcast in either destination mode.  An IPI's
+         * destination has the width of its sender's mode; IO-APIC and MSI
+         * destinations are compared in the target's.
+         */
+        if ( dest == _VLAPIC_ID(source ?: target, 0xffffffffU) )
             return true;
         if ( dest_mode )
             return vlapic_match_logical_addr(target, dest);
-- 
2.47.3




 


Rackspace

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