[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 04/10] vpci: Refactor REGISTER_VPCI_INIT


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Date: Mon, 9 Jun 2025 07:50:21 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EDxaw/c+RqHUnZ8gksJuimafw04no1Sl+VNFdaQb/DU=; b=Tva3Hjen3EYsuSj2Eg2Yo2tCYLvEhtSIcvWb59nTu7NGlt7tP5jirZ9crqejdtfBI9nctRFb3QFevaSBd911CSQ2cMsH+b/uL/WysV8ut6B2rcc9wra/sdlLzRyZjoUA28Mg+wAD1fB5qKlzwQqEIbH9oy0fh9LfDZIM9fmSUb3wnYPZdlAAhsbPbIeYGgUNL8Dc4RSQ5cJcc1sYQoYpMar3UD2hNLOgTvxDjjeh0HEqADn1lJ/FKZFa8AI0qGkzE0OQyw8SLXapVj77lQ46VoNIKZH/0uNstEnmjhGcpbmmKKgkleGk6mjRtvuMFYF2grnI/1C7djo0keUkeTOKLQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lV8838/isRcgM8PDKODHwtBgS8AXAOvigH4uDRBGnL56KY9dSXiNaDEnnHxgZ+MZjRVTd48gVf7YmP1ACdF+l+5LT8eKlyXz01FgaPT8Ryx20D1kxZeV9U3i6nkHT09ItQ+H5vzJsiuRHQZnx2FQGfCWLf3G4IUAYjjzKxmYZ9NZCf7VBlJhIKzzfS3zfeNXwU1IgrtjiONVeHK5ilQlOuLzT6CZ+4r64ynhePghXO7Ps5xwCAdTlly0B6dNFNVm5Hlok90uHPcUNkOXGEzXtsT38dXhJSVykyeo0UlnpvIRCo+LuKqwKMlY0KXPJt7JTNEY9w8lMX4ttWzRr1j2Cg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Orzel, Michal" <Michal.Orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Huang, Ray" <Ray.Huang@xxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Delivery-date: Mon, 09 Jun 2025 07:50:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbziMOHCuaHG697kCTYWoBETQpzrP0lKSAgAGsWwD//4WWAIAAI9IAgAUkMwA=
  • Thread-topic: [PATCH v5 04/10] vpci: Refactor REGISTER_VPCI_INIT

On 2025/6/6 17:14, Roger Pau Monné wrote:
> On Fri, Jun 06, 2025 at 09:05:48AM +0200, Jan Beulich wrote:
>> On 06.06.2025 08:29, Chen, Jiqian wrote:
>>> 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
>>
>> No, specifically because ...
>>
>>>> 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)             \
>>
>> ... this isn't - you'd move _all_ of .rodata into here, which definitely
>> isn't what you want. What I understand Roger meant was a .rodata-like
>> section, e.g. .rodata.vpci.* (much like it was .data.vpci.* before).
> 
> Indeed, my suggestion was merely to use .rodata instead of .data, as
> that's more accurate IMO.  I think it should be *(.rodata.vpci) (and
> same section change for the __used_section() attribute.

If I understand correctly, the next version will be:

+    static const vpci_capability_t *const finit##_entry  \
+        __used_section(".rodata.vpci") = &finit##_t
+

and

 #define VPCI_ARRAY               \
        . = ALIGN(POINTER_ALIGN); \
        __start_vpci_array = .;   \
-       *(SORT(.data.vpci.*))     \
+       *(.rodata.vpci)           \
        __end_vpci_array = .;

But, that encountered an warning when compiling.
" {standard input}: Assembler messages:
{standard input}:1160: Warning: setting incorrect section attributes for 
.rodata.vpci
{standard input}: Assembler messages:
{standard input}:3034: Warning: setting incorrect section attributes for 
.rodata.vpci
{standard input}: Assembler messages:
{standard input}:6686: Warning: setting incorrect section attributes for 
.rodata.vpci "

And, during booting Xen, all value of __start_vpci_array is incorrect.
Do I miss anything?

> 
> Thanks, Roger.

-- 
Best regards,
Jiqian Chen.

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.