On 2025/6/25 22:07, Jan Beulich wrote:
> On 25.06.2025 12:16, Chen, Jiqian wrote:
>> On 2025/6/25 18:03, Jan Beulich wrote:
>>> Also, as said - you will need to check whether other architectures are
>>> different from x86-64 in this regard. We better wouldn't leave a trap here,
>>> for them to fall into when they enable vPCI support. I.e. my recommendation
>>> would be that if in doubt, we put the __aligned() there unconditionally.
>> That's difficult for me to check on all different platforms since I don't 
>> have them all.
> 
> You don't need to have them. You'd need to carefully go through the respective
> section(s) of their psABI-s.
> 
>> So you mean I should remove "#ifdef CONFIG_X86"? Just let __aligned(16) for 
>> all platforms?
> 
> Yes. And, as also said, with a suitable comment please.
Ah, my comment definitely needs your change suggestion.
I wrote a draft as below:

/*
 * Size of vpci_capability is lager than 8 bytes. When it is used as the entry
 * of __start_vpci_array in section, it is 16-byte aligned by assembler, that
 * causes the array length (__end_vpci_array - __start_vpci_array) wrong, so
 * force its definition to use 16-byte aligned here.
 */
struct vpci_capability {
    unsigned int id;
    bool is_ext;
    int (* init)(const struct pci_dev *pdev);
    int (* cleanup)(const struct pci_dev *pdev);
} __attribute__((aligned(16)));

> 
> Jan

-- 
Best regards,
Jiqian Chen.

Reply via email to