kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: VMX: Avoid noinstr warning
@ 2023-07-07  8:43 Su Hui
  2023-07-13 21:22 ` Sean Christopherson
  0 siblings, 1 reply; 2+ messages in thread
From: Su Hui @ 2023-07-07  8:43 UTC (permalink / raw)
  To: seanjc, pbonzini, tglx, mingo, bp, dave.hansen, hpa, x86
  Cc: kvm, linux-kernel, kernel-janitors, Su Hui

vmlinux.o: warning: objtool: vmx_vcpu_enter_exit+0x2d8:
call to vmread_error_trampoline() leaves .noinstr.text section

Signed-off-by: Su Hui <suhui@nfschina.com>
---
 arch/x86/kvm/vmx/vmx_ops.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kvm/vmx/vmx_ops.h b/arch/x86/kvm/vmx/vmx_ops.h
index ce47dc265f89..54f86ce2ad60 100644
--- a/arch/x86/kvm/vmx/vmx_ops.h
+++ b/arch/x86/kvm/vmx/vmx_ops.h
@@ -112,6 +112,7 @@ static __always_inline unsigned long __vmcs_readl(unsigned long field)
 
 #else /* !CONFIG_CC_HAS_ASM_GOTO_OUTPUT */
 
+	instrumentation_begin();
 	asm volatile("1: vmread %2, %1\n\t"
 		     ".byte 0x3e\n\t" /* branch taken hint */
 		     "ja 3f\n\t"
@@ -139,6 +140,7 @@ static __always_inline unsigned long __vmcs_readl(unsigned long field)
 		     _ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_ONE_REG, %1)
 
 		     : ASM_CALL_CONSTRAINT, "=&r"(value) : "r"(field) : "cc");
+	instrumentation_end();
 	return value;
 
 #endif /* CONFIG_CC_HAS_ASM_GOTO_OUTPUT */
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-13 21:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-07  8:43 [PATCH] KVM: VMX: Avoid noinstr warning Su Hui
2023-07-13 21:22 ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).