From: Demi Marie Obenour <demi@invisiblethingslab.com>
To: Ard Biesheuvel <ardb@kernel.org>, Juergen Gross <jgross@suse.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: "Demi Marie Obenour" <demi@invisiblethingslab.com>,
"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
xen-devel@lists.xenproject.org
Subject: [PATCH v3 5/5] efi: Warn if trying to reserve memory under Xen
Date: Thu, 19 Jan 2023 14:04:00 -0500 [thread overview]
Message-ID: <e51d5abde5c5dfd122cb96f71d0dd8acc0cd358d.1669264419.git.demi@invisiblethingslab.com> (raw)
In-Reply-To: <b18879e0329c785d35f2aa2164413bb56419c684.1674153153.git.demi@invisiblethingslab.com>
Doing so cannot work and should never happen.
Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
drivers/firmware/efi/efi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index b49fcde06ca0ff5347047666f38b9309bd9cfe26..902f323499d8acc4f2b846a78993eb201448acad 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -519,6 +519,10 @@ void __init __weak efi_arch_mem_reserve(phys_addr_t addr, u64 size) {}
*/
void __init efi_mem_reserve(phys_addr_t addr, u64 size)
{
+ /* efi_mem_reserve() does not work under Xen */
+ if (WARN_ON_ONCE(efi_enabled(EFI_PARAVIRT)))
+ return;
+
if (!memblock_is_region_reserved(addr, size))
memblock_reserve(addr, size);
--
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab
next prev parent reply other threads:[~2023-01-19 19:08 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-03 11:26 [PATCH v2 0/6] efi/x86: Avoid corrupted config tables under Xen Ard Biesheuvel
2022-10-03 11:26 ` [PATCH v2 1/6] efi: Move EFI fake memmap support into x86 arch tree Ard Biesheuvel
2022-10-03 11:26 ` [PATCH v2 2/6] efi: memmap: Move manipulation routines " Ard Biesheuvel
2022-10-03 11:26 ` [PATCH v2 3/6] efi: xen: Set EFI_PARAVIRT for Xen dom0 boot on all architectures Ard Biesheuvel
2022-10-03 11:26 ` [PATCH v2 4/6] efi: memmap: Disregard bogus entries instead of returning them Ard Biesheuvel
2022-10-03 15:18 ` Demi Marie Obenour
2022-10-03 15:57 ` Ard Biesheuvel
2022-10-03 11:26 ` [PATCH v2 5/6] efi: xen: Implement memory descriptor lookup based on hypercall Ard Biesheuvel
2022-10-03 15:29 ` Demi Marie Obenour
2022-10-03 15:59 ` Ard Biesheuvel
2022-10-03 16:04 ` Marek Marczykowski-Górecki
2022-10-03 16:22 ` Demi Marie Obenour
2022-10-03 16:37 ` Ard Biesheuvel
2022-10-03 17:04 ` Marek Marczykowski-Górecki
2022-10-03 17:04 ` Marek Marczykowski-Górecki
2022-10-03 17:57 ` Demi Marie Obenour
2022-10-03 18:01 ` Marek Marczykowski-Górecki
2023-01-15 13:31 ` Marek Marczykowski-Górecki
2022-11-19 1:10 ` Demi Marie Obenour
2022-10-03 11:26 ` [PATCH v2 6/6] efi: Apply allowlist to EFI configuration tables when running under Xen Ard Biesheuvel
2022-12-06 23:19 ` Demi Marie Obenour
2023-01-19 19:03 ` [PATCH v3 0/5] efi: Support ESRT " Demi Marie Obenour
2023-01-19 19:03 ` [PATCH v3 1/5] efi: memmap: Disregard bogus entries instead of returning them Demi Marie Obenour
2023-01-19 19:03 ` [PATCH v3 2/5] efi: xen: Implement memory descriptor lookup based on hypercall Demi Marie Obenour
2023-01-19 19:03 ` [PATCH v3 3/5] efi: Apply allowlist to EFI configuration tables when running under Xen Demi Marie Obenour
2023-01-19 19:03 ` [PATCH v3 4/5] efi: Actually enable the ESRT " Demi Marie Obenour
2023-01-19 19:04 ` Demi Marie Obenour [this message]
2023-01-23 7:30 ` [PATCH v3 0/5] efi: Support " Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e51d5abde5c5dfd122cb96f71d0dd8acc0cd358d.1669264419.git.demi@invisiblethingslab.com \
--to=demi@invisiblethingslab.com \
--cc=ardb@kernel.org \
--cc=jgross@suse.com \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marmarek@invisiblethingslab.com \
--cc=oleksandr_tyshchenko@epam.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.