[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] xen/x86/pvh: handle ACPI RSDT table in PVH Dom0 build
- To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Fri, 26 May 2023 14:43:43 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=LbQjKUhKwl5FaUv+O+ExmUqYGjiB6T0MjPVKu0iLULw=; b=Lhi4uaYBB3336tfbjiEfxpduX4ua0lSdK6XeGfQJe1JxUZJR30c/77iAusJg3qt2SJ1pWYf+vplF0dZb/w9FMOt3isbFkHhGvS15CbDa8KGkDMzwRU/KQHhkN/e+sPczYEdp7KyIIJM3BRt/jC/0RPUzfdNEXrQ3e8CuUMSMhCUFrRbjRgGH+d+3PRQqRH8x/BWx9Ov+1acfW27dGoVmU3rJfL8GGsZtT0VVExwk4funphrBM+x2YZmFPt9z0vRTk6Qglvp5QZhDrJJZPRNtYJ7AKDU+CEvrQp3KfO2qAfYJ8U01tBHD6mhmUcvb3j9vKZgdpaSMQKivJgkMy/Ghjg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RvMk3VylcAy5f8Nly3tOySrIRrT5xSA1aHhMmZeAHGg5pWXRt+6WigUSLM1vTKNh20tlqRFF2ZPDA/RYadE1L1630ws6VMoQvMxU+LIp/xU/3B0uBv+DPvIRAgmrxWzcwLz+qrhIJHk7D/QV/B0nzKMDBNc8SQ4xBTbUElsAHNgyNNb0fR8zGXQW1qveCmoTj8HUjw+90sycbz6DeNIo11lPIJ3PmV5T7+j7K0EWw6/WrxTxQV9+HRerjLVGdxCbmq5JlX7jRDJYzUKXNjkdTfoHiDvxhxrxC7GNBgZ3vmNFUBCVbIXU15SwHV2S3pxPY0QIJEIiTc8OVK8bovyVhQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: andrew.cooper3@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, Xenia.Ragiadakou@xxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxx>, roger.pau@xxxxxxxxxx
- Delivery-date: Fri, 26 May 2023 12:43:59 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 26.05.2023 01:18, Stefano Stabellini wrote:
> --- a/xen/arch/x86/hvm/dom0_build.c
> +++ b/xen/arch/x86/hvm/dom0_build.c
> @@ -966,7 +966,16 @@ static int __init pvh_setup_acpi_xsdt(struct domain *d,
> paddr_t madt_addr,
> rc = -EINVAL;
> goto out;
> }
> - xsdt_paddr = rsdp->xsdt_physical_address;
> + /*
> + * Note the header is the same for both RSDT and XSDT, so it's fine to
> + * copy the native RSDT header to the Xen crafted XSDT if no native
> + * XSDT is available.
> + */
> + if ( rsdp->revision > 1 && rsdp->xsdt_physical_address )
> + xsdt_paddr = rsdp->xsdt_physical_address;
> + else
> + xsdt_paddr = rsdp->rsdt_physical_address;
> +
> acpi_os_unmap_memory(rsdp, sizeof(*rsdp));
> table = acpi_os_map_memory(xsdt_paddr, sizeof(*table));
> if ( !table )
To continue context some:
{
printk("Unable to map XSDT\n");
rc = -EINVAL;
goto out;
}
xsdt->header = *table;
acpi_os_unmap_memory(table, sizeof(*table));
You're now pointing the guest's XSDT addr at a table that's really an
RSDT. After copying, I think you want to adjust the table signature
('R' -> 'X'). Luckily a revision of 1 is valid for both tables.
Jan
|