diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-05 11:16:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-05 11:16:29 -0400 |
commit | 046f153343e33dcad1be7f6249ea6ff1c6fd9b58 (patch) | |
tree | 46da03ea84e1a4fe8eff53891332e715cbf31f3e /arch | |
parent | a0abcf2e8f8017051830f738ac1bf5ef42703243 (diff) | |
parent | e33655a386ed3b26ad36fb97a47ebb1c2ca1e928 (diff) |
Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next
Pull x86 EFI updates from Peter Anvin:
"A collection of EFI changes. The perhaps most important one is to
fully save and restore the FPU state around each invocation of EFI
runtime, and to not choke on non-ASCII characters in the boot stub"
* 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
efivars: Add compatibility code for compat tasks
efivars: Refactor sanity checking code into separate function
efivars: Stop passing a struct argument to efivar_validate()
efivars: Check size of user object
efivars: Use local variables instead of a pointer dereference
x86/efi: Save and restore FPU context around efi_calls (i386)
x86/efi: Save and restore FPU context around efi_calls (x86_64)
x86/efi: Implement a __efi_call_virt macro
x86, fpu: Extend the use of static_cpu_has_safe
x86/efi: Delete most of the efi_call* macros
efi: x86: Handle arbitrary Unicode characters
efi: Add get_dram_base() helper function
efi: Add shared printk wrapper for consistent prefixing
efi: create memory map iteration helper
efi: efi-stub-helper cleanup
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/boot/compressed/eboot.c | 3 | ||||
-rw-r--r-- | arch/x86/boot/compressed/head_64.S | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/efi.h | 100 | ||||
-rw-r--r-- | arch/x86/include/asm/fpu-internal.h | 10 | ||||
-rw-r--r-- | arch/x86/platform/efi/efi.c | 48 | ||||
-rw-r--r-- | arch/x86/platform/efi/efi_stub_64.S | 81 | ||||
-rw-r--r-- | arch/x86/platform/uv/bios_uv.c | 2 |
7 files changed, 67 insertions, 179 deletions
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index 4703a6c4b8e3..0331d765c2bb 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c | |||
@@ -1087,8 +1087,7 @@ struct boot_params *make_boot_params(struct efi_config *c) | |||
1087 | hdr->type_of_loader = 0x21; | 1087 | hdr->type_of_loader = 0x21; |
1088 | 1088 | ||
1089 | /* Convert unicode cmdline to ascii */ | 1089 | /* Convert unicode cmdline to ascii */ |
1090 | cmdline_ptr = efi_convert_cmdline_to_ascii(sys_table, image, | 1090 | cmdline_ptr = efi_convert_cmdline(sys_table, image, &options_size); |
1091 | &options_size); | ||
1092 | if (!cmdline_ptr) | 1091 | if (!cmdline_ptr) |
1093 | goto fail; | 1092 | goto fail; |
1094 | hdr->cmd_line_ptr = (unsigned long)cmdline_ptr; | 1093 | hdr->cmd_line_ptr = (unsigned long)cmdline_ptr; |
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index 0d558ee899ae..2884e0c3e8a5 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S | |||
@@ -452,7 +452,7 @@ efi32_config: | |||
452 | .global efi64_config | 452 | .global efi64_config |
453 | efi64_config: | 453 | efi64_config: |
454 | .fill 11,8,0 | 454 | .fill 11,8,0 |
455 | .quad efi_call6 | 455 | .quad efi_call |
456 | .byte 1 | 456 | .byte 1 |
457 | #endif /* CONFIG_EFI_STUB */ | 457 | #endif /* CONFIG_EFI_STUB */ |
458 | 458 | ||
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 0869434eaf72..1eb5f6433ad8 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _ASM_X86_EFI_H | 1 | #ifndef _ASM_X86_EFI_H |
2 | #define _ASM_X86_EFI_H | 2 | #define _ASM_X86_EFI_H |
3 | 3 | ||
4 | #include <asm/i387.h> | ||
4 | /* | 5 | /* |
5 | * We map the EFI regions needed for runtime services non-contiguously, | 6 | * We map the EFI regions needed for runtime services non-contiguously, |
6 | * with preserved alignment on virtual addresses starting from -4G down | 7 | * with preserved alignment on virtual addresses starting from -4G down |
@@ -27,91 +28,58 @@ | |||
27 | 28 | ||
28 | extern unsigned long asmlinkage efi_call_phys(void *, ...); | 29 | extern unsigned long asmlinkage efi_call_phys(void *, ...); |
29 | 30 | ||
30 | #define efi_call_phys0(f) efi_call_phys(f) | ||
31 | #define efi_call_phys1(f, a1) efi_call_phys(f, a1) | ||
32 | #define efi_call_phys2(f, a1, a2) efi_call_phys(f, a1, a2) | ||
33 | #define efi_call_phys3(f, a1, a2, a3) efi_call_phys(f, a1, a2, a3) | ||
34 | #define efi_call_phys4(f, a1, a2, a3, a4) \ | ||
35 | efi_call_phys(f, a1, a2, a3, a4) | ||
36 | #define efi_call_phys5(f, a1, a2, a3, a4, a5) \ | ||
37 | efi_call_phys(f, a1, a2, a3, a4, a5) | ||
38 | #define efi_call_phys6(f, a1, a2, a3, a4, a5, a6) \ | ||
39 | efi_call_phys(f, a1, a2, a3, a4, a5, a6) | ||
40 | /* | 31 | /* |
41 | * Wrap all the virtual calls in a way that forces the parameters on the stack. | 32 | * Wrap all the virtual calls in a way that forces the parameters on the stack. |
42 | */ | 33 | */ |
43 | 34 | ||
35 | /* Use this macro if your virtual returns a non-void value */ | ||
44 | #define efi_call_virt(f, args...) \ | 36 | #define efi_call_virt(f, args...) \ |
45 | ((efi_##f##_t __attribute__((regparm(0)))*)efi.systab->runtime->f)(args) | 37 | ({ \ |
46 | 38 | efi_status_t __s; \ | |
47 | #define efi_call_virt0(f) efi_call_virt(f) | 39 | kernel_fpu_begin(); \ |
48 | #define efi_call_virt1(f, a1) efi_call_virt(f, a1) | 40 | __s = ((efi_##f##_t __attribute__((regparm(0)))*) \ |
49 | #define efi_call_virt2(f, a1, a2) efi_call_virt(f, a1, a2) | 41 | efi.systab->runtime->f)(args); \ |
50 | #define efi_call_virt3(f, a1, a2, a3) efi_call_virt(f, a1, a2, a3) | 42 | kernel_fpu_end(); \ |
51 | #define efi_call_virt4(f, a1, a2, a3, a4) \ | 43 | __s; \ |
52 | efi_call_virt(f, a1, a2, a3, a4) | 44 | }) |
53 | #define efi_call_virt5(f, a1, a2, a3, a4, a5) \ | 45 | |
54 | efi_call_virt(f, a1, a2, a3, a4, a5) | 46 | /* Use this macro if your virtual call does not return any value */ |
55 | #define efi_call_virt6(f, a1, a2, a3, a4, a5, a6) \ | 47 | #define __efi_call_virt(f, args...) \ |
56 | efi_call_virt(f, a1, a2, a3, a4, a5, a6) | 48 | ({ \ |
49 | kernel_fpu_begin(); \ | ||
50 | ((efi_##f##_t __attribute__((regparm(0)))*) \ | ||
51 | efi.systab->runtime->f)(args); \ | ||
52 | kernel_fpu_end(); \ | ||
53 | }) | ||
57 | 54 | ||
58 | #define efi_ioremap(addr, size, type, attr) ioremap_cache(addr, size) | 55 | #define efi_ioremap(addr, size, type, attr) ioremap_cache(addr, size) |
59 | 56 | ||
60 | #else /* !CONFIG_X86_32 */ | 57 | #else /* !CONFIG_X86_32 */ |
61 | 58 | ||
62 | extern u64 efi_call0(void *fp); | 59 | #define EFI_LOADER_SIGNATURE "EL64" |
63 | extern u64 efi_call1(void *fp, u64 arg1); | 60 | |
64 | extern u64 efi_call2(void *fp, u64 arg1, u64 arg2); | 61 | extern u64 asmlinkage efi_call(void *fp, ...); |
65 | extern u64 efi_call3(void *fp, u64 arg1, u64 arg2, u64 arg3); | 62 | |
66 | extern u64 efi_call4(void *fp, u64 arg1, u64 arg2, u64 arg3, u64 arg4); | 63 | #define efi_call_phys(f, args...) efi_call((f), args) |
67 | extern u64 efi_call5(void *fp, u64 arg1, u64 arg2, u64 arg3, | 64 | |
68 | u64 arg4, u64 arg5); | 65 | #define efi_call_virt(f, ...) \ |
69 | extern u64 efi_call6(void *fp, u64 arg1, u64 arg2, u64 arg3, | ||
70 | u64 arg4, u64 arg5, u64 arg6); | ||
71 | |||
72 | #define efi_call_phys0(f) \ | ||
73 | efi_call0((f)) | ||
74 | #define efi_call_phys1(f, a1) \ | ||
75 | efi_call1((f), (u64)(a1)) | ||
76 | #define efi_call_phys2(f, a1, a2) \ | ||
77 | efi_call2((f), (u64)(a1), (u64)(a2)) | ||
78 | #define efi_call_phys3(f, a1, a2, a3) \ | ||
79 | efi_call3((f), (u64)(a1), (u64)(a2), (u64)(a3)) | ||
80 | #define efi_call_phys4(f, a1, a2, a3, a4) \ | ||
81 | efi_call4((f), (u64)(a1), (u64)(a2), (u64)(a3), \ | ||
82 | (u64)(a4)) | ||
83 | #define efi_call_phys5(f, a1, a2, a3, a4, a5) \ | ||
84 | efi_call5((f), (u64)(a1), (u64)(a2), (u64)(a3), \ | ||
85 | (u64)(a4), (u64)(a5)) | ||
86 | #define efi_call_phys6(f, a1, a2, a3, a4, a5, a6) \ | ||
87 | efi_call6((f), (u64)(a1), (u64)(a2), (u64)(a3), \ | ||
88 | (u64)(a4), (u64)(a5), (u64)(a6)) | ||
89 | |||
90 | #define _efi_call_virtX(x, f, ...) \ | ||
91 | ({ \ | 66 | ({ \ |
92 | efi_status_t __s; \ | 67 | efi_status_t __s; \ |
93 | \ | 68 | \ |
94 | efi_sync_low_kernel_mappings(); \ | 69 | efi_sync_low_kernel_mappings(); \ |
95 | preempt_disable(); \ | 70 | preempt_disable(); \ |
96 | __s = efi_call##x((void *)efi.systab->runtime->f, __VA_ARGS__); \ | 71 | __kernel_fpu_begin(); \ |
72 | __s = efi_call((void *)efi.systab->runtime->f, __VA_ARGS__); \ | ||
73 | __kernel_fpu_end(); \ | ||
97 | preempt_enable(); \ | 74 | preempt_enable(); \ |
98 | __s; \ | 75 | __s; \ |
99 | }) | 76 | }) |
100 | 77 | ||
101 | #define efi_call_virt0(f) \ | 78 | /* |
102 | _efi_call_virtX(0, f) | 79 | * All X86_64 virt calls return non-void values. Thus, use non-void call for |
103 | #define efi_call_virt1(f, a1) \ | 80 | * virt calls that would be void on X86_32. |
104 | _efi_call_virtX(1, f, (u64)(a1)) | 81 | */ |
105 | #define efi_call_virt2(f, a1, a2) \ | 82 | #define __efi_call_virt(f, args...) efi_call_virt(f, args) |
106 | _efi_call_virtX(2, f, (u64)(a1), (u64)(a2)) | ||
107 | #define efi_call_virt3(f, a1, a2, a3) \ | ||
108 | _efi_call_virtX(3, f, (u64)(a1), (u64)(a2), (u64)(a3)) | ||
109 | #define efi_call_virt4(f, a1, a2, a3, a4) \ | ||
110 | _efi_call_virtX(4, f, (u64)(a1), (u64)(a2), (u64)(a3), (u64)(a4)) | ||
111 | #define efi_call_virt5(f, a1, a2, a3, a4, a5) \ | ||
112 | _efi_call_virtX(5, f, (u64)(a1), (u64)(a2), (u64)(a3), (u64)(a4), (u64)(a5)) | ||
113 | #define efi_call_virt6(f, a1, a2, a3, a4, a5, a6) \ | ||
114 | _efi_call_virtX(6, f, (u64)(a1), (u64)(a2), (u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6)) | ||
115 | 83 | ||
116 | extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size, | 84 | extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size, |
117 | u32 type, u64 attribute); | 85 | u32 type, u64 attribute); |
diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h index cea1c76d49bf..115e3689cd53 100644 --- a/arch/x86/include/asm/fpu-internal.h +++ b/arch/x86/include/asm/fpu-internal.h | |||
@@ -87,22 +87,22 @@ static inline int is_x32_frame(void) | |||
87 | 87 | ||
88 | static __always_inline __pure bool use_eager_fpu(void) | 88 | static __always_inline __pure bool use_eager_fpu(void) |
89 | { | 89 | { |
90 | return static_cpu_has(X86_FEATURE_EAGER_FPU); | 90 | return static_cpu_has_safe(X86_FEATURE_EAGER_FPU); |
91 | } | 91 | } |
92 | 92 | ||
93 | static __always_inline __pure bool use_xsaveopt(void) | 93 | static __always_inline __pure bool use_xsaveopt(void) |
94 | { | 94 | { |
95 | return static_cpu_has(X86_FEATURE_XSAVEOPT); | 95 | return static_cpu_has_safe(X86_FEATURE_XSAVEOPT); |
96 | } | 96 | } |
97 | 97 | ||
98 | static __always_inline __pure bool use_xsave(void) | 98 | static __always_inline __pure bool use_xsave(void) |
99 | { | 99 | { |
100 | return static_cpu_has(X86_FEATURE_XSAVE); | 100 | return static_cpu_has_safe(X86_FEATURE_XSAVE); |
101 | } | 101 | } |
102 | 102 | ||
103 | static __always_inline __pure bool use_fxsr(void) | 103 | static __always_inline __pure bool use_fxsr(void) |
104 | { | 104 | { |
105 | return static_cpu_has(X86_FEATURE_FXSR); | 105 | return static_cpu_has_safe(X86_FEATURE_FXSR); |
106 | } | 106 | } |
107 | 107 | ||
108 | static inline void fx_finit(struct i387_fxsave_struct *fx) | 108 | static inline void fx_finit(struct i387_fxsave_struct *fx) |
@@ -293,7 +293,7 @@ static inline int restore_fpu_checking(struct task_struct *tsk) | |||
293 | /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception | 293 | /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception |
294 | is pending. Clear the x87 state here by setting it to fixed | 294 | is pending. Clear the x87 state here by setting it to fixed |
295 | values. "m" is a random variable that should be in L1 */ | 295 | values. "m" is a random variable that should be in L1 */ |
296 | if (unlikely(static_cpu_has(X86_FEATURE_FXSAVE_LEAK))) { | 296 | if (unlikely(static_cpu_has_safe(X86_FEATURE_FXSAVE_LEAK))) { |
297 | asm volatile( | 297 | asm volatile( |
298 | "fnclex\n\t" | 298 | "fnclex\n\t" |
299 | "emms\n\t" | 299 | "emms\n\t" |
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 3781dd39e8bd..835b24820eaa 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c | |||
@@ -110,7 +110,7 @@ static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc) | |||
110 | efi_status_t status; | 110 | efi_status_t status; |
111 | 111 | ||
112 | spin_lock_irqsave(&rtc_lock, flags); | 112 | spin_lock_irqsave(&rtc_lock, flags); |
113 | status = efi_call_virt2(get_time, tm, tc); | 113 | status = efi_call_virt(get_time, tm, tc); |
114 | spin_unlock_irqrestore(&rtc_lock, flags); | 114 | spin_unlock_irqrestore(&rtc_lock, flags); |
115 | return status; | 115 | return status; |
116 | } | 116 | } |
@@ -121,7 +121,7 @@ static efi_status_t virt_efi_set_time(efi_time_t *tm) | |||
121 | efi_status_t status; | 121 | efi_status_t status; |
122 | 122 | ||
123 | spin_lock_irqsave(&rtc_lock, flags); | 123 | spin_lock_irqsave(&rtc_lock, flags); |
124 | status = efi_call_virt1(set_time, tm); | 124 | status = efi_call_virt(set_time, tm); |
125 | spin_unlock_irqrestore(&rtc_lock, flags); | 125 | spin_unlock_irqrestore(&rtc_lock, flags); |
126 | return status; | 126 | return status; |
127 | } | 127 | } |
@@ -134,8 +134,7 @@ static efi_status_t virt_efi_get_wakeup_time(efi_bool_t *enabled, | |||
134 | efi_status_t status; | 134 | efi_status_t status; |
135 | 135 | ||
136 | spin_lock_irqsave(&rtc_lock, flags); | 136 | spin_lock_irqsave(&rtc_lock, flags); |
137 | status = efi_call_virt3(get_wakeup_time, | 137 | status = efi_call_virt(get_wakeup_time, enabled, pending, tm); |
138 | enabled, pending, tm); | ||
139 | spin_unlock_irqrestore(&rtc_lock, flags); | 138 | spin_unlock_irqrestore(&rtc_lock, flags); |
140 | return status; | 139 | return status; |
141 | } | 140 | } |
@@ -146,8 +145,7 @@ static efi_status_t virt_efi_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm) | |||
146 | efi_status_t status; | 145 | efi_status_t status; |
147 | 146 | ||
148 | spin_lock_irqsave(&rtc_lock, flags); | 147 | spin_lock_irqsave(&rtc_lock, flags); |
149 | status = efi_call_virt2(set_wakeup_time, | 148 | status = efi_call_virt(set_wakeup_time, enabled, tm); |
150 | enabled, tm); | ||
151 | spin_unlock_irqrestore(&rtc_lock, flags); | 149 | spin_unlock_irqrestore(&rtc_lock, flags); |
152 | return status; | 150 | return status; |
153 | } | 151 | } |
@@ -158,17 +156,17 @@ static efi_status_t virt_efi_get_variable(efi_char16_t *name, | |||
158 | unsigned long *data_size, | 156 | unsigned long *data_size, |
159 | void *data) | 157 | void *data) |
160 | { | 158 | { |
161 | return efi_call_virt5(get_variable, | 159 | return efi_call_virt(get_variable, |
162 | name, vendor, attr, | 160 | name, vendor, attr, |
163 | data_size, data); | 161 | data_size, data); |
164 | } | 162 | } |
165 | 163 | ||
166 | static efi_status_t virt_efi_get_next_variable(unsigned long *name_size, | 164 | static efi_status_t virt_efi_get_next_variable(unsigned long *name_size, |
167 | efi_char16_t *name, | 165 | efi_char16_t *name, |
168 | efi_guid_t *vendor) | 166 | efi_guid_t *vendor) |
169 | { | 167 | { |
170 | return efi_call_virt3(get_next_variable, | 168 | return efi_call_virt(get_next_variable, |
171 | name_size, name, vendor); | 169 | name_size, name, vendor); |
172 | } | 170 | } |
173 | 171 | ||
174 | static efi_status_t virt_efi_set_variable(efi_char16_t *name, | 172 | static efi_status_t virt_efi_set_variable(efi_char16_t *name, |
@@ -177,9 +175,9 @@ static efi_status_t virt_efi_set_variable(efi_char16_t *name, | |||
177 | unsigned long data_size, | 175 | unsigned long data_size, |
178 | void *data) | 176 | void *data) |
179 | { | 177 | { |
180 | return efi_call_virt5(set_variable, | 178 | return efi_call_virt(set_variable, |
181 | name, vendor, attr, | 179 | name, vendor, attr, |
182 | data_size, data); | 180 | data_size, data); |
183 | } | 181 | } |
184 | 182 | ||
185 | static efi_status_t virt_efi_query_variable_info(u32 attr, | 183 | static efi_status_t virt_efi_query_variable_info(u32 attr, |
@@ -190,13 +188,13 @@ static efi_status_t virt_efi_query_variable_info(u32 attr, | |||
190 | if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION) | 188 | if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION) |
191 | return EFI_UNSUPPORTED; | 189 | return EFI_UNSUPPORTED; |
192 | 190 | ||
193 | return efi_call_virt4(query_variable_info, attr, storage_space, | 191 | return efi_call_virt(query_variable_info, attr, storage_space, |
194 | remaining_space, max_variable_size); | 192 | remaining_space, max_variable_size); |
195 | } | 193 | } |
196 | 194 | ||
197 | static efi_status_t virt_efi_get_next_high_mono_count(u32 *count) | 195 | static efi_status_t virt_efi_get_next_high_mono_count(u32 *count) |
198 | { | 196 | { |
199 | return efi_call_virt1(get_next_high_mono_count, count); | 197 | return efi_call_virt(get_next_high_mono_count, count); |
200 | } | 198 | } |
201 | 199 | ||
202 | static void virt_efi_reset_system(int reset_type, | 200 | static void virt_efi_reset_system(int reset_type, |
@@ -204,8 +202,8 @@ static void virt_efi_reset_system(int reset_type, | |||
204 | unsigned long data_size, | 202 | unsigned long data_size, |
205 | efi_char16_t *data) | 203 | efi_char16_t *data) |
206 | { | 204 | { |
207 | efi_call_virt4(reset_system, reset_type, status, | 205 | __efi_call_virt(reset_system, reset_type, status, |
208 | data_size, data); | 206 | data_size, data); |
209 | } | 207 | } |
210 | 208 | ||
211 | static efi_status_t virt_efi_update_capsule(efi_capsule_header_t **capsules, | 209 | static efi_status_t virt_efi_update_capsule(efi_capsule_header_t **capsules, |
@@ -215,7 +213,7 @@ static efi_status_t virt_efi_update_capsule(efi_capsule_header_t **capsules, | |||
215 | if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION) | 213 | if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION) |
216 | return EFI_UNSUPPORTED; | 214 | return EFI_UNSUPPORTED; |
217 | 215 | ||
218 | return efi_call_virt3(update_capsule, capsules, count, sg_list); | 216 | return efi_call_virt(update_capsule, capsules, count, sg_list); |
219 | } | 217 | } |
220 | 218 | ||
221 | static efi_status_t virt_efi_query_capsule_caps(efi_capsule_header_t **capsules, | 219 | static efi_status_t virt_efi_query_capsule_caps(efi_capsule_header_t **capsules, |
@@ -226,8 +224,8 @@ static efi_status_t virt_efi_query_capsule_caps(efi_capsule_header_t **capsules, | |||
226 | if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION) | 224 | if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION) |
227 | return EFI_UNSUPPORTED; | 225 | return EFI_UNSUPPORTED; |
228 | 226 | ||
229 | return efi_call_virt4(query_capsule_caps, capsules, count, max_size, | 227 | return efi_call_virt(query_capsule_caps, capsules, count, max_size, |
230 | reset_type); | 228 | reset_type); |
231 | } | 229 | } |
232 | 230 | ||
233 | static efi_status_t __init phys_efi_set_virtual_address_map( | 231 | static efi_status_t __init phys_efi_set_virtual_address_map( |
@@ -239,9 +237,9 @@ static efi_status_t __init phys_efi_set_virtual_address_map( | |||
239 | efi_status_t status; | 237 | efi_status_t status; |
240 | 238 | ||
241 | efi_call_phys_prelog(); | 239 | efi_call_phys_prelog(); |
242 | status = efi_call_phys4(efi_phys.set_virtual_address_map, | 240 | status = efi_call_phys(efi_phys.set_virtual_address_map, |
243 | memory_map_size, descriptor_size, | 241 | memory_map_size, descriptor_size, |
244 | descriptor_version, virtual_map); | 242 | descriptor_version, virtual_map); |
245 | efi_call_phys_epilog(); | 243 | efi_call_phys_epilog(); |
246 | return status; | 244 | return status; |
247 | } | 245 | } |
diff --git a/arch/x86/platform/efi/efi_stub_64.S b/arch/x86/platform/efi/efi_stub_64.S index e0984ef0374b..5fcda7272550 100644 --- a/arch/x86/platform/efi/efi_stub_64.S +++ b/arch/x86/platform/efi/efi_stub_64.S | |||
@@ -73,84 +73,7 @@ | |||
73 | 2: | 73 | 2: |
74 | .endm | 74 | .endm |
75 | 75 | ||
76 | ENTRY(efi_call0) | 76 | ENTRY(efi_call) |
77 | SAVE_XMM | ||
78 | subq $32, %rsp | ||
79 | SWITCH_PGT | ||
80 | call *%rdi | ||
81 | RESTORE_PGT | ||
82 | addq $32, %rsp | ||
83 | RESTORE_XMM | ||
84 | ret | ||
85 | ENDPROC(efi_call0) | ||
86 | |||
87 | ENTRY(efi_call1) | ||
88 | SAVE_XMM | ||
89 | subq $32, %rsp | ||
90 | mov %rsi, %rcx | ||
91 | SWITCH_PGT | ||
92 | call *%rdi | ||
93 | RESTORE_PGT | ||
94 | addq $32, %rsp | ||
95 | RESTORE_XMM | ||
96 | ret | ||
97 | ENDPROC(efi_call1) | ||
98 | |||
99 | ENTRY(efi_call2) | ||
100 | SAVE_XMM | ||
101 | subq $32, %rsp | ||
102 | mov %rsi, %rcx | ||
103 | SWITCH_PGT | ||
104 | call *%rdi | ||
105 | RESTORE_PGT | ||
106 | addq $32, %rsp | ||
107 | RESTORE_XMM | ||
108 | ret | ||
109 | ENDPROC(efi_call2) | ||
110 | |||
111 | ENTRY(efi_call3) | ||
112 | SAVE_XMM | ||
113 | subq $32, %rsp | ||
114 | mov %rcx, %r8 | ||
115 | mov %rsi, %rcx | ||
116 | SWITCH_PGT | ||
117 | call *%rdi | ||
118 | RESTORE_PGT | ||
119 | addq $32, %rsp | ||
120 | RESTORE_XMM | ||
121 | ret | ||
122 | ENDPROC(efi_call3) | ||
123 | |||
124 | ENTRY(efi_call4) | ||
125 | SAVE_XMM | ||
126 | subq $32, %rsp | ||
127 | mov %r8, %r9 | ||
128 | mov %rcx, %r8 | ||
129 | mov %rsi, %rcx | ||
130 | SWITCH_PGT | ||
131 | call *%rdi | ||
132 | RESTORE_PGT | ||
133 | addq $32, %rsp | ||
134 | RESTORE_XMM | ||
135 | ret | ||
136 | ENDPROC(efi_call4) | ||
137 | |||
138 | ENTRY(efi_call5) | ||
139 | SAVE_XMM | ||
140 | subq $48, %rsp | ||
141 | mov %r9, 32(%rsp) | ||
142 | mov %r8, %r9 | ||
143 | mov %rcx, %r8 | ||
144 | mov %rsi, %rcx | ||
145 | SWITCH_PGT | ||
146 | call *%rdi | ||
147 | RESTORE_PGT | ||
148 | addq $48, %rsp | ||
149 | RESTORE_XMM | ||
150 | ret | ||
151 | ENDPROC(efi_call5) | ||
152 | |||
153 | ENTRY(efi_call6) | ||
154 | SAVE_XMM | 77 | SAVE_XMM |
155 | mov (%rsp), %rax | 78 | mov (%rsp), %rax |
156 | mov 8(%rax), %rax | 79 | mov 8(%rax), %rax |
@@ -166,7 +89,7 @@ ENTRY(efi_call6) | |||
166 | addq $48, %rsp | 89 | addq $48, %rsp |
167 | RESTORE_XMM | 90 | RESTORE_XMM |
168 | ret | 91 | ret |
169 | ENDPROC(efi_call6) | 92 | ENDPROC(efi_call) |
170 | 93 | ||
171 | #ifdef CONFIG_EFI_MIXED | 94 | #ifdef CONFIG_EFI_MIXED |
172 | 95 | ||
diff --git a/arch/x86/platform/uv/bios_uv.c b/arch/x86/platform/uv/bios_uv.c index 766612137a62..1584cbed0dce 100644 --- a/arch/x86/platform/uv/bios_uv.c +++ b/arch/x86/platform/uv/bios_uv.c | |||
@@ -39,7 +39,7 @@ s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5) | |||
39 | */ | 39 | */ |
40 | return BIOS_STATUS_UNIMPLEMENTED; | 40 | return BIOS_STATUS_UNIMPLEMENTED; |
41 | 41 | ||
42 | ret = efi_call6((void *)__va(tab->function), (u64)which, | 42 | ret = efi_call((void *)__va(tab->function), (u64)which, |
43 | a1, a2, a3, a4, a5); | 43 | a1, a2, a3, a4, a5); |
44 | return ret; | 44 | return ret; |
45 | } | 45 | } |