diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2014-07-04 13:41:53 -0400 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2014-07-07 15:29:42 -0400 |
commit | e15dd4949a937d8e8482f37f8fe493357417f203 (patch) | |
tree | d66dba79a540033a0072d7ebfcfa1667783227f2 /arch/arm64/include/asm/efi.h | |
parent | 022ee6c558fc933679e151f00f84332974147fa2 (diff) |
efi/arm64: Preserve FP/SIMD registers on UEFI runtime services calls
According to the UEFI spec section 2.3.6.4, the use of FP/SIMD
instructions is allowed, and should adhere to the AAPCS64 calling
convention, which states that 'only the bottom 64 bits of each value
stored in registers v8-v15 need to be preserved' (section 5.1.2).
This applies equally to UEFI Runtime Services called by the kernel, so
make sure the FP/SIMD register file is preserved in this case. We do this
by enabling the wrappers for UEFI Runtime Services (CONFIG_EFI_RUNTIME_WRAPPERS)
and inserting calls to kernel_neon_begin()and kernel_neon_end() into
these wrappers.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch/arm64/include/asm/efi.h')
-rw-r--r-- | arch/arm64/include/asm/efi.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h index 5a46c4e7f539..375ba342dca6 100644 --- a/arch/arm64/include/asm/efi.h +++ b/arch/arm64/include/asm/efi.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _ASM_EFI_H | 2 | #define _ASM_EFI_H |
3 | 3 | ||
4 | #include <asm/io.h> | 4 | #include <asm/io.h> |
5 | #include <asm/neon.h> | ||
5 | 6 | ||
6 | #ifdef CONFIG_EFI | 7 | #ifdef CONFIG_EFI |
7 | extern void efi_init(void); | 8 | extern void efi_init(void); |
@@ -11,4 +12,24 @@ extern void efi_idmap_init(void); | |||
11 | #define efi_idmap_init() | 12 | #define efi_idmap_init() |
12 | #endif | 13 | #endif |
13 | 14 | ||
15 | #define efi_call_virt(f, ...) \ | ||
16 | ({ \ | ||
17 | efi_##f##_t *__f = efi.systab->runtime->f; \ | ||
18 | efi_status_t __s; \ | ||
19 | \ | ||
20 | kernel_neon_begin(); \ | ||
21 | __s = __f(__VA_ARGS__); \ | ||
22 | kernel_neon_end(); \ | ||
23 | __s; \ | ||
24 | }) | ||
25 | |||
26 | #define __efi_call_virt(f, ...) \ | ||
27 | ({ \ | ||
28 | efi_##f##_t *__f = efi.systab->runtime->f; \ | ||
29 | \ | ||
30 | kernel_neon_begin(); \ | ||
31 | __f(__VA_ARGS__); \ | ||
32 | kernel_neon_end(); \ | ||
33 | }) | ||
34 | |||
14 | #endif /* _ASM_EFI_H */ | 35 | #endif /* _ASM_EFI_H */ |