On 25.06.2025 12:03, Jan Beulich wrote: > On 25.06.2025 11:27, Chen, Jiqian wrote: >> If I understand correctly, I need to change the definition of >> vpci_capability_t to be: >> >> typedef struct { >> unsigned int id; >> bool is_ext; >> int (* init)(const struct pci_dev *pdev); >> int (* cleanup)(const struct pci_dev *pdev); >> } >> #ifdef CONFIG_X86 >> __aligned(16) >> #endif >> vpci_capability_t; > > You'll need to check whether this has the intended effect. There are yet more > peculiarities when it comes to attributes on structs, typedefs, and the > combination of the two. I wonder though: Do we really need a typedef here? > Going with just struct vcpi_capability would eliminate concerns over those > peculiarities. > > 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.
And, forgot to say, there definitely wants to be a comment here. Jan