Commit-ID:  dcf6fdbaa99fc3a3e38797e6d596c5241de18b9b
Gitweb:     http://git.kernel.org/tip/dcf6fdbaa99fc3a3e38797e6d596c5241de18b9b
Author:     Josh Poimboeuf <jpoim...@redhat.com>
AuthorDate: Fri, 22 Jan 2016 10:16:12 -0600
Committer:  Ingo Molnar <mi...@kernel.org>
CommitDate: Tue, 23 Feb 2016 09:04:00 +0100

x86/kvm: Make test_cc() always inline

With some configs (including allyesconfig), gcc doesn't inline
test_cc().  When that happens, test_cc() doesn't create a stack frame
before inserting the inline asm call instruction.  This breaks frame
pointer convention if CONFIG_FRAME_POINTER is enabled and can result in
a bad stack trace.

Force it to always be inlined so that its containing function's stack
frame can be used.

Suggested-by: Paolo Bonzini <pbonz...@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com>
Acked-by: Paolo Bonzini <pbonz...@redhat.com>
Cc: Andrew Morton <a...@linux-foundation.org>
Cc: Andy Lutomirski <l...@amacapital.net>
Cc: Andy Lutomirski <l...@kernel.org>
Cc: Arnaldo Carvalho de Melo <a...@kernel.org>
Cc: Bernd Petrovitsch <be...@petrovitsch.priv.at>
Cc: Borislav Petkov <b...@alien8.de>
Cc: Brian Gerst <brge...@gmail.com>
Cc: Chris J Arges <chris.j.ar...@canonical.com>
Cc: Denys Vlasenko <dvlas...@redhat.com>
Cc: Gleb Natapov <g...@kernel.org>
Cc: H. Peter Anvin <h...@zytor.com>
Cc: Jiri Slaby <jsl...@suse.cz>
Cc: Linus Torvalds <torva...@linux-foundation.org>
Cc: Michal Marek <mma...@suse.cz>
Cc: Namhyung Kim <namhy...@gmail.com>
Cc: Pedro Alves <pal...@redhat.com>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Thomas Gleixner <t...@linutronix.de>
Cc: k...@vger.kernel.org
Cc: live-patch...@vger.kernel.org
Link: http://lkml.kernel.org/r/20160122161612.ge20...@treble.redhat.com
Signed-off-by: Ingo Molnar <mi...@kernel.org>
---
 arch/x86/kvm/emulate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index aa4d726..80363eb 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -969,7 +969,7 @@ static int em_bsr_c(struct x86_emulate_ctxt *ctxt)
        return fastop(ctxt, em_bsr);
 }
 
-static u8 test_cc(unsigned int condition, unsigned long flags)
+static __always_inline u8 test_cc(unsigned int condition, unsigned long flags)
 {
        u8 rc;
        void (*fop)(void) = (void *)em_setcc + 4 * (condition & 0xf);

Reply via email to