diff mbox series

kvm: Disable objtool frame pointer checking for vmenter.S

Message ID 01fae42917bacad18be8d2cbc771353da6603473.1587398610.git.jpoimboe@redhat.com (mailing list archive)
State New, archived
Headers show
Series kvm: Disable objtool frame pointer checking for vmenter.S | expand

Commit Message

Josh Poimboeuf April 20, 2020, 4:17 p.m. UTC
Frame pointers are completely broken by vmenter.S because it clobbers
RBP:

  arch/x86/kvm/svm/vmenter.o: warning: objtool: __svm_vcpu_run()+0xe4: BP used as a scratch register

That's unavoidable, so just skip checking that file when frame pointers
are configured in.

On the other hand, ORC can handle that code just fine, so leave objtool
enabled in the !FRAME_POINTER case.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
 arch/x86/kvm/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Randy Dunlap April 20, 2020, 4:19 p.m. UTC | #1
On 4/20/20 9:17 AM, Josh Poimboeuf wrote:
> Frame pointers are completely broken by vmenter.S because it clobbers
> RBP:
> 
>   arch/x86/kvm/svm/vmenter.o: warning: objtool: __svm_vcpu_run()+0xe4: BP used as a scratch register
> 
> That's unavoidable, so just skip checking that file when frame pointers
> are configured in.
> 
> On the other hand, ORC can handle that code just fine, so leave objtool
> enabled in the !FRAME_POINTER case.
> 
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>

Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested

Thanks.

> ---
>  arch/x86/kvm/Makefile | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/x86/kvm/Makefile b/arch/x86/kvm/Makefile
> index a789759b7261..4a3081e9f4b5 100644
> --- a/arch/x86/kvm/Makefile
> +++ b/arch/x86/kvm/Makefile
> @@ -3,6 +3,10 @@
>  ccflags-y += -Iarch/x86/kvm
>  ccflags-$(CONFIG_KVM_WERROR) += -Werror
>  
> +ifeq ($(CONFIG_FRAME_POINTER),y)
> +OBJECT_FILES_NON_STANDARD_vmenter.o := y
> +endif
> +
>  KVM := ../../../virt/kvm
>  
>  kvm-y			+= $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o \
>
Paolo Bonzini April 20, 2020, 9:10 p.m. UTC | #2
On 20/04/20 18:19, Randy Dunlap wrote:
> Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested

Queued, thanks.

Paolo
diff mbox series

Patch

diff --git a/arch/x86/kvm/Makefile b/arch/x86/kvm/Makefile
index a789759b7261..4a3081e9f4b5 100644
--- a/arch/x86/kvm/Makefile
+++ b/arch/x86/kvm/Makefile
@@ -3,6 +3,10 @@ 
 ccflags-y += -Iarch/x86/kvm
 ccflags-$(CONFIG_KVM_WERROR) += -Werror
 
+ifeq ($(CONFIG_FRAME_POINTER),y)
+OBJECT_FILES_NON_STANDARD_vmenter.o := y
+endif
+
 KVM := ../../../virt/kvm
 
 kvm-y			+= $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o \