mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] KVM: VMX: Move bus lock handler from main.c => common.h
@ 2026-09-22  0:01 Sean Christopherson
  2026-09-22  2:35 ` Xiaoyao Li
  2026-09-22  3:29 ` Binbin Wu
  0 siblings, 2 replies; 4+ messages in thread
From: Sean Christopherson @ 2026-09-22  0:01 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini; +Cc: kvm, linux-kernel

Move the bus lock VM-Exit handler, which is basically a one-liner, from
main.c to vmx.h now that to_vt() is usable in common.h.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---

This applies on top of kvm-x86/next + Xiayao's series.  I.e. actually applying
it will be painful for anyone but me at this point, but I'm really just posting
for posterity.

 arch/x86/kvm/vmx/common.h | 11 ++++++++++-
 arch/x86/kvm/vmx/main.c   | 11 -----------
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/arch/x86/kvm/vmx/common.h b/arch/x86/kvm/vmx/common.h
index e22c159c3b84..b2905335a2d2 100644
--- a/arch/x86/kvm/vmx/common.h
+++ b/arch/x86/kvm/vmx/common.h
@@ -254,6 +254,15 @@ static inline int __vt_handle_notify(struct kvm_vcpu *vcpu,
 	return 1;
 }
 
-int vt_handle_bus_lock_vmexit(struct kvm_vcpu *vcpu);
+static inline int vt_handle_bus_lock_vmexit(struct kvm_vcpu *vcpu)
+{
+	/*
+	 * Hardware may or may not set the BUS_LOCK_DETECTED flag on BUS_LOCK
+	 * VM-Exits. Unconditionally set the flag here and leave the handling
+	 * to .handle_exit() callback.
+	 */
+	to_vt(vcpu)->exit_reason.bus_lock_detected = true;
+	return 1;
+}
 
 #endif /* __KVM_X86_VMX_COMMON_H */
diff --git a/arch/x86/kvm/vmx/main.c b/arch/x86/kvm/vmx/main.c
index c11732cfadf0..2985742e20f1 100644
--- a/arch/x86/kvm/vmx/main.c
+++ b/arch/x86/kvm/vmx/main.c
@@ -872,17 +872,6 @@ static int vt_gmem_max_mapping_level(struct kvm *kvm, kvm_pfn_t pfn,
 #define vt_op_tdx_only(name) NULL
 #endif /* CONFIG_KVM_INTEL_TDX */
 
-int vt_handle_bus_lock_vmexit(struct kvm_vcpu *vcpu)
-{
-	/*
-	 * Hardware may or may not set the BUS_LOCK_DETECTED flag on BUS_LOCK
-	 * VM-Exits. Unconditionally set the flag here and leave the handling
-	 * to .handle_exit() callback.
-	 */
-	to_vt(vcpu)->exit_reason.bus_lock_detected = true;
-	return 1;
-}
-
 noinstr void vt_handle_nmi(struct kvm_vcpu *vcpu)
 {
 	if ((u16)vt_get_exit_reason(vcpu).basic != EXIT_REASON_EXCEPTION_NMI ||

base-commit: e1d8e13452eea815042f79244bb649536e3689f5
-- 
2.55.0.1082.g2b9226bbc0-goog


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

* Re: [PATCH] KVM: VMX: Move bus lock handler from main.c => common.h
  2026-09-22  0:01 [PATCH] KVM: VMX: Move bus lock handler from main.c => common.h Sean Christopherson
@ 2026-09-22  2:35 ` Xiaoyao Li
  2026-09-22 13:36   ` Sean Christopherson
  2026-09-22  3:29 ` Binbin Wu
  1 sibling, 1 reply; 4+ messages in thread
From: Xiaoyao Li @ 2026-09-22  2:35 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini; +Cc: kvm, linux-kernel

On 9/22/2026 8:01 AM, Sean Christopherson wrote:
> Move the bus lock VM-Exit handler, which is basically a one-liner, from
> main.c to vmx.h now that to_vt() is usable in common.h.
> 
> No functional change intended.
> 
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> 
> This applies on top of kvm-x86/next + Xiayao's series.  I.e. actually applying
> it will be painful for anyone but me at this point, but I'm really just posting
> for posterity.

It seems like squashing it into patch 7 of my series would be OK as well. I
guess you intended to avoid changing my series since it might require a new
version.

Anyway,

Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
>  arch/x86/kvm/vmx/common.h | 11 ++++++++++-
>  arch/x86/kvm/vmx/main.c   | 11 -----------
>  2 files changed, 10 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/x86/kvm/vmx/common.h b/arch/x86/kvm/vmx/common.h
> index e22c159c3b84..b2905335a2d2 100644
> --- a/arch/x86/kvm/vmx/common.h
> +++ b/arch/x86/kvm/vmx/common.h
> @@ -254,6 +254,15 @@ static inline int __vt_handle_notify(struct kvm_vcpu *vcpu,
>  	return 1;
>  }
>  
> -int vt_handle_bus_lock_vmexit(struct kvm_vcpu *vcpu);
> +static inline int vt_handle_bus_lock_vmexit(struct kvm_vcpu *vcpu)
> +{
> +	/*
> +	 * Hardware may or may not set the BUS_LOCK_DETECTED flag on BUS_LOCK
> +	 * VM-Exits. Unconditionally set the flag here and leave the handling
> +	 * to .handle_exit() callback.
> +	 */
> +	to_vt(vcpu)->exit_reason.bus_lock_detected = true;
> +	return 1;
> +}
>  
>  #endif /* __KVM_X86_VMX_COMMON_H */
> diff --git a/arch/x86/kvm/vmx/main.c b/arch/x86/kvm/vmx/main.c
> index c11732cfadf0..2985742e20f1 100644
> --- a/arch/x86/kvm/vmx/main.c
> +++ b/arch/x86/kvm/vmx/main.c
> @@ -872,17 +872,6 @@ static int vt_gmem_max_mapping_level(struct kvm *kvm, kvm_pfn_t pfn,
>  #define vt_op_tdx_only(name) NULL
>  #endif /* CONFIG_KVM_INTEL_TDX */
>  
> -int vt_handle_bus_lock_vmexit(struct kvm_vcpu *vcpu)
> -{
> -	/*
> -	 * Hardware may or may not set the BUS_LOCK_DETECTED flag on BUS_LOCK
> -	 * VM-Exits. Unconditionally set the flag here and leave the handling
> -	 * to .handle_exit() callback.
> -	 */
> -	to_vt(vcpu)->exit_reason.bus_lock_detected = true;
> -	return 1;
> -}
> -
>  noinstr void vt_handle_nmi(struct kvm_vcpu *vcpu)
>  {
>  	if ((u16)vt_get_exit_reason(vcpu).basic != EXIT_REASON_EXCEPTION_NMI ||
> 
> base-commit: e1d8e13452eea815042f79244bb649536e3689f5


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

* Re: [PATCH] KVM: VMX: Move bus lock handler from main.c => common.h
  2026-09-22  0:01 [PATCH] KVM: VMX: Move bus lock handler from main.c => common.h Sean Christopherson
  2026-09-22  2:35 ` Xiaoyao Li
@ 2026-09-22  3:29 ` Binbin Wu
  1 sibling, 0 replies; 4+ messages in thread
From: Binbin Wu @ 2026-09-22  3:29 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: Paolo Bonzini, kvm, linux-kernel

On 9/22/2026 8:01 AM, Sean Christopherson wrote:
> Move the bus lock VM-Exit handler, which is basically a one-liner, from
> main.c to vmx.h now that to_vt() is usable in common.h.
> 
> No functional change intended.
> 
> Signed-off-by: Sean Christopherson <seanjc@google.com>

Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com>

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

* Re: [PATCH] KVM: VMX: Move bus lock handler from main.c => common.h
  2026-09-22  2:35 ` Xiaoyao Li
@ 2026-09-22 13:36   ` Sean Christopherson
  0 siblings, 0 replies; 4+ messages in thread
From: Sean Christopherson @ 2026-09-22 13:36 UTC (permalink / raw)
  To: Xiaoyao Li; +Cc: Paolo Bonzini, kvm, linux-kernel

On Tue, Sep 22, 2026, Xiaoyao Li wrote:
> On 9/22/2026 8:01 AM, Sean Christopherson wrote:
> > Move the bus lock VM-Exit handler, which is basically a one-liner, from
> > main.c to vmx.h now that to_vt() is usable in common.h.
> > 
> > No functional change intended.
> > 
> > Signed-off-by: Sean Christopherson <seanjc@google.com>
> > ---
> > 
> > This applies on top of kvm-x86/next + Xiayao's series.  I.e. actually applying
> > it will be painful for anyone but me at this point, but I'm really just posting
> > for posterity.
> 
> It seems like squashing it into patch 7 of my series would be OK as well. I
> guess you intended to avoid changing my series since it might require a new
> version.

Heh, I would have happily squashed, and tried to.  The problem is that I want to
land your series before "Move common VT getters/converters to common.h".

https://lore.kernel.org/all/20260904010353.3175819-8-seanjc@google.com

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

end of thread, other threads:[~2026-09-22 13:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-22  0:01 [PATCH] KVM: VMX: Move bus lock handler from main.c => common.h Sean Christopherson
2026-09-22  2:35 ` Xiaoyao Li
2026-09-22 13:36   ` Sean Christopherson
2026-09-22  3:29 ` Binbin Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®