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

Re: [PATCH 1/2] xen/x86/pvh: use preset XSDT header for XSDT generation


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 15 May 2023 10:48:52 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=0iUFWSD5fZCel+qEQsi7Fu7uh+nvenxPJNXcaoWo3Hs=; b=C1Zkk4duAMzhbrh03IFluw2JbF/3mVxIwY+prhk32q6v0Y/mbkU4LAc1q2hWMhqVT/q6IOq6U7UDnEXE6/p1YNiccyd4ZFHasKcXewA+UdjjpsiTmnT/6t+eG8AAd/g7cfxIVkbHfPOiV8WSkxjpk4uEUMlfLtlX3vVCf0rgKCh6aiQl88xHl57Nc2GV8Rq6qUb8sVReEY1RD9r8LJ5aRoDT0VcMz6QM3plc9mXdrPrECQbHX3luutj32Vgm+sfxByC+i5hHkA5SVbH8rcFQXF1xpTpxwn8pxn1ERN06VpU1fy1YPhOov5j1o159R5RJiXD8gOnAOaF0KcE3ywnwZA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KSAJt/emBqfM8SCTEWERw99ZOzVovi9hWcuaCpTZfqVBADHLIzxtei42DlY58SoYM0wThxTMr2HHlpzCGLPznh1k+dPhrGJL6aD6oAXEyUaD6iqNcoxPOYVtQri5iNZVGiZXQi+zRZd1G1i1FZBTKtLITGI0UmAXG7GIJsDqHGnlZ8NeXbuSa8si+Oxi13OApBwZIEOa2rySslKA4zxIbp7MuXxemRivmgUOG7eCzPx2NMPdmjyd5NcK6JJBHWb5nPfQ6iPgvl0r/mg8Z9j8xNZgEyO0mT2bQAytJHmWLMEwN6Tg4EYhK8pTwy3rRPBeT+9su/jgK6DS8XcntpVhxA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: andrew.cooper3@xxxxxxxxxx, jbeulich@xxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, Xenia.Ragiadakou@xxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • Delivery-date: Mon, 15 May 2023 08:49:17 +0000
  • Ironport-data: A9a23:kHIjzql4o6DnmNVI5R43XDvo5gxhJ0RdPkR7XQ2eYbSJt1+Wr1Gzt xJNXmyBb/iOZTahLtglPYq//UwC78TdzdNlSgJrrXpnEyMWpZLJC+rCIxarNUt+DCFhoGFPt JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq LvartbWfVSowFaYCEpNg064gE4p7aWaVA8w5ARkPqgW5QKGzhH5MbpETU2PByqgKmVrNrbSq 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/ f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3 cU8dR8RVUmCvOuJ6aOiVrR0mfk5HMa+aevzulk4pd3YJdAPZMmbBoD1v5pf1jp2gd1SF/HDY cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkVE3ieC0WDbWUoXiqcF9hEGXq 3iA523kKhobKMae2XyO9XfEaurnxHuqAN9KRePgnhJsqE2znkMsKE0Ibxyykdaw2krjYfUCB FNBr0LCqoB3riRHVOLVRAakqXSJuhodXdt4EOAg7gyJjK3O7G6xBGIJUzpAY9wOr9ItSHoh0 Vrht8PkA3ljvaOYTVqZ96yItnWiNC4NN2gAaCQYCwwf7LHLkIw1jxuJdN9sEae5h97yBBn5x jzMpy87750IkcMF3qO8u0vbijihopzISA8d7wDbGGmi62tEiJWNYoWp7R3e8qxGJYPAFl2Z5 iFcwo6Z8fwECoyLmGqVWuIREbq15vGDdjrBnVpoGJpn/DOok5K+Qb1tDPhFDB8BGq45lfXBO Sc/ZSs5CEdvAUaX
  • Ironport-hdrordr: A9a23:AWX7yqsJEX0/PZvBWFl68tN57skDgNV00zEX/kB9WHVpm6yj+v xGUs566faUskd2ZJhEo7q90ca7Lk80maQa3WBVB8bBYOCEghrOEGgB1/qA/9SIIUSXmtK1l5 0QFpSWYOeaMbEQt7ef3ODXKbcdKNnsytHWuQ/dpU0dMz2DvctbnnZE4gXwKDwHeOFfb6BJba Z1fqB81kedkXJ8VLXCOlA1G9Ltivfsj5zcbRsPF3ccmXWzZWPB0s+AL/CAtC1uKQ9y/Q==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, May 12, 2023 at 06:17:19PM -0700, Stefano Stabellini wrote:
> From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
> 
> Xen always generates a XSDT table even if the firmware provided a RSDT
> table. Instead of copying the XSDT header from the firmware table (that
> might be missing), generate the XSDT header from a preset.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
> ---
>  xen/arch/x86/hvm/dom0_build.c | 32 +++++++++-----------------------
>  1 file changed, 9 insertions(+), 23 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
> index 307edc6a8c..5fde769863 100644
> --- a/xen/arch/x86/hvm/dom0_build.c
> +++ b/xen/arch/x86/hvm/dom0_build.c
> @@ -963,13 +963,18 @@ static int __init pvh_setup_acpi_xsdt(struct domain *d, 
> paddr_t madt_addr,
>                                        paddr_t *addr)
>  {
>      struct acpi_table_xsdt *xsdt;
> -    struct acpi_table_header *table;
> -    struct acpi_table_rsdp *rsdp;
>      const struct acpi_table_desc *tables = acpi_gbl_root_table_list.tables;
>      unsigned long size = sizeof(*xsdt);
>      unsigned int i, j, num_tables = 0;
> -    paddr_t xsdt_paddr;
>      int rc;
> +    struct acpi_table_header header = {
> +        .signature    = "XSDT",
> +        .length       = sizeof(struct acpi_table_header),
> +        .revision     = 0x1,
> +        .oem_id       = "Xen",
> +        .oem_table_id = "HVM",

I think this is wrong, as according to the spec the OEM Table ID must
match the OEM Table ID in the FADT.

We likely want to copy the OEM ID and OEM Table ID from the RSDP, and
possibly also the other OEM related fields.

Alternatively we might want to copy and use the RSDT on systems that
lack an XSDT, or even just copy the header from the RSDT into Xen's
crafted XSDT, since the format of the RSDP and the XSDT headers are
exactly the same (the difference is in the size of the description
headers that come after).

> +        .oem_revision = 0,
> +    };

This wants to be initdata static const if we go down this route.

Thanks, Roger.



 


Rackspace

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