From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:60553 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753942AbcHRMt5 (ORCPT ); Thu, 18 Aug 2016 08:49:57 -0400 From: Jiri Slaby To: stable@vger.kernel.org Cc: Andi Kleen , x86@kernel.org, rusty@rustcorp.com.au, Jiri Slaby Subject: [patch added to 3.12-stable] x86, asmlinkage, lguest: Pass in globals into assembler statement Date: Thu, 18 Aug 2016 14:49:06 +0200 Message-Id: <20160818124953.31969-1-jslaby@suse.cz> Sender: stable-owner@vger.kernel.org List-ID: From: Andi Kleen This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== commit cdd77e87eae52b7251acc5990207a1c4500a84ce upstream. 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 Signed-off-by: Rusty Russell Signed-off-by: Jiri Slaby --- drivers/lguest/x86/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c index 516923926335..922a1acbf652 100644 --- a/drivers/lguest/x86/core.c +++ b/drivers/lguest/x86/core.c @@ -157,7 +157,7 @@ static void run_guest_once(struct lg_cpu *cpu, struct lguest_pages *pages) * stack, then the address of this call. This stack layout happens to * exactly match the stack layout created by an interrupt... */ - asm volatile("pushf; lcall *lguest_entry" + asm volatile("pushf; lcall *%4" /* * This is how we tell GCC that %eax ("a") and %ebx ("b") * are changed by this routine. The "=" means output. @@ -169,7 +169,9 @@ static void run_guest_once(struct lg_cpu *cpu, struct lguest_pages *pages) * physical address of the Guest's top-level page * directory. */ - : "0"(pages), "1"(__pa(cpu->lg->pgdirs[cpu->cpu_pgd].pgdir)) + : "0"(pages), + "1"(__pa(cpu->lg->pgdirs[cpu->cpu_pgd].pgdir)), + "m"(lguest_entry) /* * We tell gcc that all these registers could change, * which means we don't have to save and restore them in -- 2.9.3