All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: x86: Fix kvm/queue breakage on clang
@ 2023-03-15 19:11 Sean Christopherson
  2023-03-15 19:11 ` [PATCH 1/2] KVM: VMX: Drop unprotected-by-braces variable declaration in case-statement Sean Christopherson
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sean Christopherson @ 2023-03-15 19:11 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini
  Cc: kvm, linux-kernel, Emanuele Giuseppe Esposito

Fix clang build errors for patches sitting kvm/queue.  Ideally, these
fixes will be squashed before the buggy commits make their way to kvm/next.
If you do fixup kvm/queue, the VMX commit also has a bad SOB chain; Jim
either needs to be listed as the author or his SOB needs to be deleted.

Sean Christopherson (2):
  KVM: VMX: Drop unprotected-by-braces variable declaration in
    case-statement
  KVM: SVM: Drop unprotected-by-braces variable declaration in
    case-statement

 arch/x86/kvm/svm/svm.c | 5 ++---
 arch/x86/kvm/vmx/vmx.c | 4 +---
 2 files changed, 3 insertions(+), 6 deletions(-)


base-commit: 95b9779c1758f03cf494e8550d6249a40089ed1c
-- 
2.40.0.rc2.332.ga46443480c-goog


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

* [PATCH 1/2] KVM: VMX: Drop unprotected-by-braces variable declaration in case-statement
  2023-03-15 19:11 [PATCH 0/2] KVM: x86: Fix kvm/queue breakage on clang Sean Christopherson
@ 2023-03-15 19:11 ` Sean Christopherson
  2023-03-15 19:11 ` [PATCH 2/2] KVM: SVM: " Sean Christopherson
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sean Christopherson @ 2023-03-15 19:11 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini
  Cc: kvm, linux-kernel, Emanuele Giuseppe Esposito

Remove the intermediate "guest_flush_l1d" boolean to fix a build error on
clang due to the variable being declared inside a case-statement without
curly braces to create a proper code block.

Fixes: c7ed946b95cb ("kvm: vmx: Add IA32_FLUSH_CMD guest support")
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202303151912.oZ6SGd90-lkp@intel.com
Cc: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kvm/vmx/vmx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index c63f6c786eb1..d7bf14abdba1 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2325,10 +2325,8 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
 					   X86_FEATURE_IBPB);
 		break;
 	case MSR_IA32_FLUSH_CMD:
-		bool guest_flush_l1d = guest_cpuid_has(vcpu,
-						       X86_FEATURE_FLUSH_L1D);
 		ret = vmx_set_msr_ia32_cmd(vcpu, msr_info,
-					   guest_flush_l1d,
+					   guest_cpuid_has(vcpu, X86_FEATURE_FLUSH_L1D),
 					   L1D_FLUSH,
 					   X86_FEATURE_FLUSH_L1D);
 		break;
-- 
2.40.0.rc2.332.ga46443480c-goog


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

* [PATCH 2/2] KVM: SVM: Drop unprotected-by-braces variable declaration in case-statement
  2023-03-15 19:11 [PATCH 0/2] KVM: x86: Fix kvm/queue breakage on clang Sean Christopherson
  2023-03-15 19:11 ` [PATCH 1/2] KVM: VMX: Drop unprotected-by-braces variable declaration in case-statement Sean Christopherson
@ 2023-03-15 19:11 ` Sean Christopherson
  2023-03-16 12:07 ` [PATCH 0/2] KVM: x86: Fix kvm/queue breakage on clang Emanuele Giuseppe Esposito
  2023-03-16 14:26 ` Paolo Bonzini
  3 siblings, 0 replies; 5+ messages in thread
From: Sean Christopherson @ 2023-03-15 19:11 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini
  Cc: kvm, linux-kernel, Emanuele Giuseppe Esposito

Remove the intermediate "guest_flush_l1d" boolean to fix a build error on
clang due to the variable being declared inside a case-statement without
curly braces to create a proper code block.

Fixes: cfc1f129df06 ("kvm: svm: Add IA32_FLUSH_CMD guest support")
Cc: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kvm/svm/svm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 2780254d4362..70183d2271b5 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -2970,9 +2970,8 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)
 					 PRED_CMD_IBPB, X86_FEATURE_IBPB);
 		break;
 	case MSR_IA32_FLUSH_CMD:
-		bool guest_flush_l1d = guest_cpuid_has(vcpu,
-						       X86_FEATURE_FLUSH_L1D);
-		r = svm_set_msr_ia32_cmd(vcpu, msr, guest_flush_l1d,
+		r = svm_set_msr_ia32_cmd(vcpu, msr,
+					 guest_cpuid_has(vcpu, X86_FEATURE_FLUSH_L1D),
 					 L1D_FLUSH, X86_FEATURE_FLUSH_L1D);
 		break;
 	case MSR_AMD64_VIRT_SPEC_CTRL:
-- 
2.40.0.rc2.332.ga46443480c-goog


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

* Re: [PATCH 0/2] KVM: x86: Fix kvm/queue breakage on clang
  2023-03-15 19:11 [PATCH 0/2] KVM: x86: Fix kvm/queue breakage on clang Sean Christopherson
  2023-03-15 19:11 ` [PATCH 1/2] KVM: VMX: Drop unprotected-by-braces variable declaration in case-statement Sean Christopherson
  2023-03-15 19:11 ` [PATCH 2/2] KVM: SVM: " Sean Christopherson
@ 2023-03-16 12:07 ` Emanuele Giuseppe Esposito
  2023-03-16 14:26 ` Paolo Bonzini
  3 siblings, 0 replies; 5+ messages in thread
From: Emanuele Giuseppe Esposito @ 2023-03-16 12:07 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini; +Cc: kvm, linux-kernel



Am 15/03/2023 um 20:11 schrieb Sean Christopherson:
> Fix clang build errors for patches sitting kvm/queue.  Ideally, these
> fixes will be squashed before the buggy commits make their way to kvm/next.
> If you do fixup kvm/queue, the VMX commit also has a bad SOB chain; Jim
> either needs to be listed as the author or his SOB needs to be deleted.
> 
> Sean Christopherson (2):
>   KVM: VMX: Drop unprotected-by-braces variable declaration in
>     case-statement
>   KVM: SVM: Drop unprotected-by-braces variable declaration in
>     case-statement
> 
>  arch/x86/kvm/svm/svm.c | 5 ++---
>  arch/x86/kvm/vmx/vmx.c | 4 +---
>  2 files changed, 3 insertions(+), 6 deletions(-)
> 
> 
> base-commit: 95b9779c1758f03cf494e8550d6249a40089ed1c

Note to self: compile patches also with clang, since gcc didn't complain
about missing brackets in a switch case.

Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>


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

* Re: [PATCH 0/2] KVM: x86: Fix kvm/queue breakage on clang
  2023-03-15 19:11 [PATCH 0/2] KVM: x86: Fix kvm/queue breakage on clang Sean Christopherson
                   ` (2 preceding siblings ...)
  2023-03-16 12:07 ` [PATCH 0/2] KVM: x86: Fix kvm/queue breakage on clang Emanuele Giuseppe Esposito
@ 2023-03-16 14:26 ` Paolo Bonzini
  3 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2023-03-16 14:26 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: kvm, linux-kernel, Emanuele Giuseppe Esposito

On 3/15/23 20:11, Sean Christopherson wrote:
> Fix clang build errors for patches sitting kvm/queue.  Ideally, these
> fixes will be squashed before the buggy commits make their way to kvm/next.
> If you do fixup kvm/queue, the VMX commit also has a bad SOB chain; Jim
> either needs to be listed as the author or his SOB needs to be deleted.

I added it as Co-developed-by and squashed the patches.

Paolo


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

end of thread, other threads:[~2023-03-16 14:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15 19:11 [PATCH 0/2] KVM: x86: Fix kvm/queue breakage on clang Sean Christopherson
2023-03-15 19:11 ` [PATCH 1/2] KVM: VMX: Drop unprotected-by-braces variable declaration in case-statement Sean Christopherson
2023-03-15 19:11 ` [PATCH 2/2] KVM: SVM: " Sean Christopherson
2023-03-16 12:07 ` [PATCH 0/2] KVM: x86: Fix kvm/queue breakage on clang Emanuele Giuseppe Esposito
2023-03-16 14:26 ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.