]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
efi: make efi_mem_type() and efi_mem_attributes() work on Xen PV
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Mon, 9 Mar 2026 12:17:22 +0000 (13:17 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Tue, 10 Mar 2026 20:56:27 +0000 (21:56 +0100)
commit80e80a703e18aa7d55fe26e4504c58a6f6c4ff07
tree54ab4407bf1986bcf08ca62ed4b8e2a90512bd82
parent1f318b96cc84d7c2ab792fcc0bfd42a7ca890681
efi: make efi_mem_type() and efi_mem_attributes() work on Xen PV

Xen doesn't give direct access to the EFI memory map, but provides a
hypercall interface for it. efi_mem_desc_lookup() was already adjusted
in aca1d27ac38a "efi: xen: Implement memory descriptor lookup based on
hypercall" to (optionally) use it. Now make efi_mem_type() and
efi_mem_attributes() use common efi_mem_desc_lookup() too.
This also reduces code duplication a bit.
efi_mem_type() retains separate check for -ENOTSUPP error case (even
though no caller seems to rely on this currently).

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
[ardb: Drop erroneous 'const' qualifier]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/efi.c