Commit cdd77e87eae52b7251acc5990207a1c4500a84ce
Committed by
Rusty Russell
1 parent
4ae8537072
Exists in
smarc-imx_3.14.28_1.0.0_ga
and in
1 other branch
x86, asmlinkage, lguest: Pass in globals into assembler statement
Tell the compiler that the inline assembler statement references lguest_entry. This fixes compile problems with LTO where the variable and the assembler code may end up in different files. Cc: x86@kernel.org Cc: rusty@rustcorp.com.au Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Showing 1 changed file with 4 additions and 2 deletions Side-by-side Diff
drivers/lguest/x86/core.c
... | ... | @@ -157,7 +157,7 @@ |
157 | 157 | * stack, then the address of this call. This stack layout happens to |
158 | 158 | * exactly match the stack layout created by an interrupt... |
159 | 159 | */ |
160 | - asm volatile("pushf; lcall *lguest_entry" | |
160 | + asm volatile("pushf; lcall *%4" | |
161 | 161 | /* |
162 | 162 | * This is how we tell GCC that %eax ("a") and %ebx ("b") |
163 | 163 | * are changed by this routine. The "=" means output. |
... | ... | @@ -169,7 +169,9 @@ |
169 | 169 | * physical address of the Guest's top-level page |
170 | 170 | * directory. |
171 | 171 | */ |
172 | - : "0"(pages), "1"(__pa(cpu->lg->pgdirs[cpu->cpu_pgd].pgdir)) | |
172 | + : "0"(pages), | |
173 | + "1"(__pa(cpu->lg->pgdirs[cpu->cpu_pgd].pgdir)), | |
174 | + "m"(lguest_entry) | |
173 | 175 | /* |
174 | 176 | * We tell gcc that all these registers could change, |
175 | 177 | * which means we don't have to save and restore them in |