[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v9] Preserve the EFI System Resource Table for dom0
- To: Demi Marie Obenour <demi@xxxxxxxxxxxxxxxxxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Mon, 11 Jul 2022 09:20:46 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; 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=FODdx/1HmDE7I6VeO3mvOhyvv5jnWK6h02+qYQ6RbC0=; b=eRf3nXjdJbihXm17E/OEePmX7HDRajNR+1Otwq1h5xXrDWa5ZpAupmVUkRpt6BvO/lj2xloy436AAhpGPHzlBsknoL9z5eMOyqkDsr2WTq+PGm3ElD2JvbdPIYHkcgSrfRXuabmWSy/WTMxPOEb7R1TgzjRAhJlbdL3IWEIRWKJEKFv5HWLBU4MjdnAdz/qoQPFVB9QVLDNXV7C6b5uD5GlMCClypskQSYu+KWGqJn5bCKk5K9Gs5csz7HoAbCxjt5ZPmpDVGmiIJHt3uiiaz1y/hlhgh7kb/jnPAvQnZDQCd9Jxx04j9/f1NlgvUTjbP+Mdim2fTuwwmFSxtKHl2Q==
- 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=FODdx/1HmDE7I6VeO3mvOhyvv5jnWK6h02+qYQ6RbC0=; b=IL3GAOAyWWWyMZE80+WkLJD+vpxMUw8E+MKBjyLaqO5bb1iAo1cKjlwgkzL5xcRtx78llOM6dLl1IVhZRsGKcD2vD6EySa7CHTOTRW/ALx4ec4WPN6hHe1a8sdRh3rqOdetJAbz9STC+Qbdc3M+PM6NrOaCBICLvzar38azP/r6ij891Qz2wyL/ClokHN0lH/lmcznX4lVkXo9Yj199HyJqsTeGHwiQFfJtiH/4HdfSTEhonQxwWUlTH1mKqD5m6HL3IlJoWTb6jZDHedFJlmItA+tAaPzxMsNYeX8lYkxoedrffMDk20Me3OteSJSzLIJB1UjpnzNxhEtlMuMpRYA==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Eo3AD1hSWKynx0vwKtHX+H9mEnWyQBzMpMlQj1t0aePb1zDvqwvPoUQe/i6291GyZkF3qC7zjeZQlEA9kuHcVIhuli7S16aXHQnZZeleZG7Qh75r/5jDcpkE9pnGMZWDVyTc+gmooxtrTHvBUeVKgaB1dz+UGWFEwVVVgs8CHdib/w/9P41yi3W57ya9xt5+kzyKowqxAGPKbM0nkfV0OfdJ+np5lkCgmM8pYRDZex807KCmYE2oB+W+1fCIrReWD5SEYUn9zykHqKmQyy+UicKjuGUKEfwN3MuilVH89fOwkofZ7TO2HvwhQTPmWjX1VaMk49393S9OIbAjKb16Fg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kucPb3IjY34K6uHZ6TjM9nlKrThfEKF4B8VwqpFViCWmsbyZXjEj/q5ADaT4DuC5Mny6id942nJnFHCOEdQUQWMC6F2FkgV6rOz8v4bJnhbni5mmGaTWr1cJNVkmPddlJMiPaWGsXRoSxCLO5xtaQvruAMBDeVhDtQbv7h1CIW9JSpoN9/wqA9OacTbjc7MSfdDCTSJoq5qVhM4ZaBr9sZpLv+yro/3fXy4+f6xox9WCmpCyQch4EWrXXwkwJ6HWmqht/WiFM6cGOi8IOaBi0PNkMXrurd4u/rZjN/Q01BGrNUB46KPqkv6Uh4Gz15iHpa6lNWQrCcYvPjdh71qqXQ==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Xen development discussion <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
- Delivery-date: Mon, 11 Jul 2022 09:21:09 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHYkxKUjUJb6n+aY0G11gulhs4gPq146NqA
- Thread-topic: [PATCH v9] Preserve the EFI System Resource Table for dom0
> On 8 Jul 2022, at 22:34, Demi Marie Obenour <demi@xxxxxxxxxxxxxxxxxxxxxx>
> wrote:
>
> The EFI System Resource Table (ESRT) is necessary for fwupd to identify
> firmware updates to install. According to the UEFI specification §23.4,
> the ESRT shall be stored in memory of type EfiBootServicesData. However,
> memory of type EfiBootServicesData is considered general-purpose memory
> by Xen, so the ESRT needs to be moved somewhere where Xen will not
> overwrite it. Copy the ESRT to memory of type EfiRuntimeServicesData,
> which Xen will not reuse. dom0 can use the ESRT if (and only if) it is
> in memory of type EfiRuntimeServicesData.
>
> Earlier versions of this patch reserved the memory in which the ESRT was
> located. This created awkward alignment problems, and required either
> splitting the E820 table or wasting memory. It also would have required
> a new platform op for dom0 to use to indicate if the ESRT is reserved.
> By copying the ESRT into EfiRuntimeServicesData memory, the E820 table
> does not need to be modified, and dom0 can just check the type of the
> memory region containing the ESRT. The copy is only done if the ESRT is
> not already in EfiRuntimeServicesData memory, avoiding memory leaks on
> repeated kexec.
Hi,
>
> See https://lore.kernel.org/xen-devel/20200818184018.GN1679@mail-itl/T/
> for details. Tested using qemu-system-x86_64 and xen.efi.
Not sure if “Tested using qemu-system-x86_64 and xen.efi.” should be added
in a section like this under your S-o-b:
---
Tested using qemu-system-x86_64 and xen.efi.
---
>
> Signed-off-by: Demi Marie Obenour <demi@xxxxxxxxxxxxxxxxxxxxxx>
I’ve tested UEFI boot on an arm64 machine and Xen+Dom0+ACPI boots fine.
So if in v10 you don’t change anything apart from the style issues mentioned
by Jan, you can keep my tested-by:
Tested-by: Luca Fancellu <luca.fancellu@xxxxxxx>
>
> +static void __init efi_relocate_esrt(EFI_SYSTEM_TABLE *SystemTable)
> +{
> + EFI_STATUS status;
> + UINTN info_size = 0, map_key, mdesc_size;
> + void *memory_map = NULL;
> + UINT32 ver;
> + unsigned int i;
> +
> + for ( ; ; ) {
Here, coding style wants the brackets on a new line (Jan comment):
for ( ; ; )
{
> + status = efi_bs->GetMemoryMap(&info_size, memory_map, &map_key,
> + &mdesc_size, &ver);
>
Cheers,
Luca
|