[PATCH v7 03/10] arch/x86: Do not access EFI memory map if it is not available
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: linux-efi@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Subject: [PATCH v7 03/10] arch/x86: Do not access EFI memory map if it is not available
- From: Daniel Kiper <daniel.kiper@xxxxxxxxxx>
- Date: Mon, 30 Jun 2014 19:52:57 +0200
- Cc: andrew.cooper3@xxxxxxxxxx, boris.ostrovsky@xxxxxxxxxx, david.vrabel@xxxxxxxxxx, eshelton@xxxxxxxxx, fenghua.yu@xxxxxxxxx, hpa@xxxxxxxxx, ian.campbell@xxxxxxxxxx, jbeulich@xxxxxxxx, jeremy@xxxxxxxx, konrad.wilk@xxxxxxxxxx, matt.fleming@xxxxxxxxx, mingo@xxxxxxxxxx, mjg59@xxxxxxxxxxxxx, stefano.stabellini@xxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, tony.luck@xxxxxxxxx
- In-reply-to: <1404150784-27921-1-git-send-email-daniel.kiper@oracle.com>
- List-id: <linux-ia64.vger.kernel.org>
- References: <1404150784-27921-1-git-send-email-daniel.kiper@oracle.com>
Do not access EFI memory map if it is not available. At least
Xen dom0 EFI implementation does not have an access to it.
Signed-off-by: Daniel Kiper <daniel.kiper@xxxxxxxxxx>
---
v6 - suggestions/fixes:
- create this separate patch from main EFI_PARAVIRT patch
(suggested by Matt Fleming).
---
arch/x86/platform/efi/efi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 0ee1f46..d2d3c41 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -1220,6 +1220,9 @@ u64 efi_mem_attributes(unsigned long phys_addr)
efi_memory_desc_t *md;
void *p;
+ if (!efi_enabled(EFI_MEMMAP))
+ return 0;
+
for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
md = p;
if ((md->phys_addr <= phys_addr) &&
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]