On 2025/4/23 00:06, Jan Beulich wrote:
> On 21.04.2025 08:18, Jiqian Chen wrote:
>> --- a/xen/include/xen/pci_regs.h
>> +++ b/xen/include/xen/pci_regs.h
>> @@ -449,6 +449,7 @@
>>  #define PCI_EXT_CAP_ID(header)              ((header) & 0x0000ffff)
>>  #define PCI_EXT_CAP_VER(header)             (((header) >> 16) & 0xf)
>>  #define PCI_EXT_CAP_NEXT(header)    (((header) >> 20) & 0xffc)
>> +#define PCI_EXT_CAP_NEXT_MASK               0xFFC00000U
> 
> To avoid introducing redundancy, imo this addition calls for
> 
> #define PCI_EXT_CAP_NEXT(header)      MASK_EXTR(header, PCI_EXT_CAP_NEXT_MASK)
When I tested this locally, I encountered errors: every next position address 
loss two bits zero.
The next register has 12 bits, according to PCI spec, the bottom two bits are 
reserved zero,
so "#define PCI_EXT_CAP_NEXT_MASK 0xFFC00000U" is fine,
but if change this "#define PCI_EXT_CAP_NEXT(header) MASK_EXTR(header, 
PCI_EXT_CAP_NEXT_MASK)",
I need to change PCI_EXT_CAP_NEXT_MASK to be 0xFFF00000U, is it fine?

> 
> now.
> 
> Jan

-- 
Best regards,
Jiqian Chen.

Reply via email to