On 2025/6/5 20:50, Roger Pau Monné wrote: > On Mon, May 26, 2025 at 05:45:53PM +0800, Jiqian Chen wrote: >> + }; \ >> + static vpci_capability_t *const finit##_entry \ >> + __used_section(".data.vpci") = &finit##_t > > IMO this should better use .rodata instead of .data. Is below change correct?
+ static const vpci_capability_t *const finit##_entry \ + __used_section(".rodata") = &finit##_t > Not that it matters much in practice, as we place it in .rodata anyway. Note > however you will have to move the placement of the VPCI_ARRAY in the > linker script ahead of *(.rodata.*), otherwise that section match will > consume the vPCI data. I am sorry, how to move it ahead of *(.rodata.*) ? Is below change correct? diff --git a/xen/include/xen/xen.lds.h b/xen/include/xen/xen.lds.h index 793d0e11450c..3817642135aa 100644 --- a/xen/include/xen/xen.lds.h +++ b/xen/include/xen/xen.lds.h @@ -188,7 +188,7 @@ #define VPCI_ARRAY \ . = ALIGN(POINTER_ALIGN); \ __start_vpci_array = .; \ - *(SORT(.data.vpci.*)) \ + *(.rodata) \ __end_vpci_array = .; > >> + >> +#define REGISTER_VPCI_CAP(cap, finit, fclean) \ >> + REGISTER_PCI_CAPABILITY(cap, finit, fclean, false) >> +#define REGISTER_VPCI_EXTCAP(cap, finit, fclean) \ >> + REGISTER_PCI_CAPABILITY(cap, finit, fclean, true) > > Since you are modifying those, can use 4 spaces as indentation? > There's no need to have such padding. > > Thanks, Roger. -- Best regards, Jiqian Chen.