On 09.02.2026 12:34, Julian Vetter wrote: > --- a/xen/arch/x86/include/asm/hvm/vioapic.h > +++ b/xen/arch/x86/include/asm/hvm/vioapic.h > @@ -32,6 +32,19 @@ > #define VIOAPIC_EDGE_TRIG 0 > #define VIOAPIC_LEVEL_TRIG 1 > > +/* > + * Extract the destination ID from a 64-bit IO-APIC RTE, including the > + * extended bits (55:49) used when XEN_HVM_CPUID_EXT_DEST_ID is advertised. > + */ > +#define IO_APIC_REDIR_DEST_SHIFT 56 > +#define IO_APIC_REDIR_DEST_MASK 0xffULL > +#define IO_APIC_REDIR_EXT_DEST_SHIFT 49 > +#define IO_APIC_REDIR_EXT_DEST_MASK 0x7fULL
Can we please stop introducing pairs of mask and shift values? Already these versus ... > --- a/xen/arch/x86/include/asm/msi.h > +++ b/xen/arch/x86/include/asm/msi.h > @@ -54,6 +54,9 @@ > #define MSI_ADDR_DEST_ID_MASK 0x00ff000 > #define MSI_ADDR_DEST_ID(dest) (((dest) << > MSI_ADDR_DEST_ID_SHIFT) & MSI_ADDR_DEST_ID_MASK) > > +#define MSI_ADDR_EXT_DEST_ID_SHIFT 5 > +#define MSI_ADDR_EXT_DEST_ID_MASK 0x0000fe0 ... this shows one of the problems: It's never clear whether the mask is intended to be applied to the shifted or un-shifted value. Like you have it down here, the mask constant alone is enough. You use it with MASK_EXTR() and MASK_INSR(). Jan
