Skip to content

Commit 789957e

Browse files
Ard BiesheuvelIngo Molnar
authored andcommitted
efi/arm*: Take the Memory Attributes table into account
Call into the generic memory attributes table support code at the appropriate times during the init sequence so that the UEFI Runtime Services region are mapped according to the strict permissions it specifies. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk> Cc: Borislav Petkov <bp@alien8.de> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Jones <pjones@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Will Deacon <will.deacon@arm.com> Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/1461614832-17633-15-git-send-email-matt@codeblueprint.co.uk Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 10f0d2f commit 789957e

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

arch/arm64/include/asm/efi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ extern void efi_init(void);
1414

1515
int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md);
1616

17+
#define efi_set_mapping_permissions efi_create_mapping
18+
1719
#define efi_call_virt(f, ...) \
1820
({ \
1921
efi_##f##_t *__f; \

drivers/firmware/efi/arm-init.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ void __init efi_init(void)
206206
return;
207207

208208
reserve_regions();
209+
efi_memattr_init();
209210
early_memunmap(efi.memmap.map, params.mmap_size);
210211

211212
if (IS_ENABLED(CONFIG_ARM)) {

drivers/firmware/efi/arm-runtime.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,15 @@ static bool __init efi_virtmap_init(void)
7777
systab_found = true;
7878
}
7979
}
80-
if (!systab_found)
80+
if (!systab_found) {
8181
pr_err("No virtual mapping found for the UEFI System Table\n");
82-
return systab_found;
82+
return false;
83+
}
84+
85+
if (efi_memattr_apply_permissions(&efi_mm, efi_set_mapping_permissions))
86+
return false;
87+
88+
return true;
8389
}
8490

8591
/*

0 commit comments

Comments
 (0)