All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] x86/vlapic: size the all-ones broadcast by the sender's mode
@ 2026-11-19 22:00 Stefano Stabellini
  2026-11-19 22:00 ` [PATCH 2/2] x86/passthrough: skip disabled vLAPICs in vector_hashing_dest() Stefano Stabellini
  2026-11-20  8:58 ` [PATCH 1/2] x86/vlapic: size the all-ones broadcast by the sender's mode Jan Beulich
  0 siblings, 2 replies; 5+ messages in thread
From: Stefano Stabellini @ 2026-11-19 22:00 UTC (permalink / raw)
  To: xen-devel
  Cc: stefano.stabellini, Andrew Cooper, Jan Beulich,
	Roger Pau Monné, Teddy Astie

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@citrix.com>
Link: https://lore.kernel.org/xen-devel/95e0e0fb-2978-4c87-b723-fb7c30f36883@citrix.com/
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
CC: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Roger Pau Monné <roger@xenproject.org>
CC: Teddy Astie <teddy.astie@vates.tech>

 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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-20 21:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 22:00 [PATCH 1/2] x86/vlapic: size the all-ones broadcast by the sender's mode Stefano Stabellini
2026-11-19 22:00 ` [PATCH 2/2] x86/passthrough: skip disabled vLAPICs in vector_hashing_dest() Stefano Stabellini
2026-11-20  8:24   ` Jan Beulich
2026-11-20  8:58 ` [PATCH 1/2] x86/vlapic: size the all-ones broadcast by the sender's mode Jan Beulich
2026-11-20 21:55   ` Stefano Stabellini

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.