[PATCH 03/22] x86/kvm: Fix frame pointer usage in vmx_vmenter()

From: Josh Poimboeuf
Date: Sun Jul 14 2019 - 20:38:49 EST


With CONFIG_FRAME_POINTER, vmx_vmenter() needs to do frame pointer setup
before calling kvm_spurious_fault().

Fixes the following warning:

arch/x86/kvm/vmx/vmenter.o: warning: objtool: vmx_vmenter()+0x14: call without frame pointer save/setup

Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
---
Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Cc: Radim KrÄmÃÅ <rkrcmar@xxxxxxxxxx>
---
arch/x86/kvm/vmx/vmenter.S | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/vmx/vmenter.S b/arch/x86/kvm/vmx/vmenter.S
index d4cb1945b2e3..a2fabe3aaf9c 100644
--- a/arch/x86/kvm/vmx/vmenter.S
+++ b/arch/x86/kvm/vmx/vmenter.S
@@ -4,6 +4,7 @@
#include <asm/bitsperlong.h>
#include <asm/kvm_vcpu_regs.h>
#include <asm/nospec-branch.h>
+#include <asm/frame.h>

#define WORD_SIZE (BITS_PER_LONG / 8)

@@ -44,19 +45,22 @@
* to vmx_vmexit.
*/
ENTRY(vmx_vmenter)
+ FRAME_BEGIN
/* EFLAGS.ZF is set if VMCS.LAUNCHED == 0 */
je 2f

1: vmresume
- ret
+ jmp 4f

2: vmlaunch
- ret
+ jmp 4f

3: cmpb $0, kvm_rebooting
jne 4f
call kvm_spurious_fault
-4: ret
+
+4: FRAME_END
+ ret

.pushsection .fixup, "ax"
5: jmp 3b
--
2.20.1