Skip to contentSkip to conversation

KVM: SVM: Fix a misplaced paranthesis in APICV inhibit mask generation

PATCH In review Sean Christopherson 2 participants 2 messages Jun 10, 2022 – Jun 11, 2022

Subsystems (3)
lore
Share & tools
lore

Sean Christopherson

author maintainer
#0 lore raw

PATCH 1/1 KVM: SVM: Fix a misplaced paranthesis in APICV inhibit mask generation

Relocate a ")" to its proper place at the end of a BIT usage, the intent is most definitely not to have a feedback loop of BITs in the mask.

arch/x86/kvm/svm/avic.c: In function ‘avic_check_apicv_inhibit_reasons’:
include/vdso/bits.h:7:40: error: left shift count >= width of type [-Werror=shift-count-overflow]

    7 | #define BIT(nr)                 (UL(1) << (nr))
      |                                        ^~
arch/x86/kvm/svm/avic.c:911:27: note: in expansion of macro ‘BIT’
  911 |                           BIT(APICV_INHIBIT_REASON_SEV      |
      |                           ^~~
Fixes 3743c2f02517 ("KVM: x86: inhibit APICv/AVIC on changes to APIC ID or APIC base")
Cc Maxim Levitsky <[email protected]>
---
 arch/x86/kvm/svm/avic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/svm/avic.c +2 -2
index 5542d8959e11..d1bc5820ea46 100644
@@ -908,9 +908,9 @@ bool avic_check_apicv_inhibit_reasons(enum kvm_apicv_inhibit reason)
 			  BIT(APICV_INHIBIT_REASON_PIT_REINJ) |
 			  BIT(APICV_INHIBIT_REASON_X2APIC) |
 			  BIT(APICV_INHIBIT_REASON_BLOCKIRQ) |
-			  BIT(APICV_INHIBIT_REASON_SEV      |
+			  BIT(APICV_INHIBIT_REASON_SEV)      |
 			  BIT(APICV_INHIBIT_REASON_APIC_ID_MODIFIED) |
-			  BIT(APICV_INHIBIT_REASON_APIC_BASE_MODIFIED));
+			  BIT(APICV_INHIBIT_REASON_APIC_BASE_MODIFIED);
 
 	return supported & BIT(reason);
 }

base-commit: b23f8810c46978bc05252db03055a61fcadc07d5

Signature · 1 line
2.36.1.476.g0c4daa206d-goog
#1 lore raw
Quoted 35 lines · Sean Christopherson

Relocate a ")" to its proper place at the end of a BIT usage, the intent is most definitely not to have a feedback loop of BITs in the mask.

arch/x86/kvm/svm/avic.c: In function ‘avic_check_apicv_inhibit_reasons’:
include/vdso/bits.h:7:40: error: left shift count >= width of type [-Werror=shift-count-overflow]

    7 | #define BIT(nr)                 (UL(1) << (nr))
      |                                        ^~
arch/x86/kvm/svm/avic.c:911:27: note: in expansion of macro ‘BIT’
  911 |                           BIT(APICV_INHIBIT_REASON_SEV      |
      |                           ^~~
Fixes 3743c2f02517 ("KVM: x86: inhibit APICv/AVIC on changes to APIC ID or APIC base")
Cc Maxim Levitsky <[email protected]>
---
 arch/x86/kvm/svm/avic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/svm/avic.c +2 -2
index 5542d8959e11..d1bc5820ea46 100644
@@ -908,9 +908,9 @@ bool avic_check_apicv_inhibit_reasons(enum kvm_apicv_inhibit reason)
 			  BIT(APICV_INHIBIT_REASON_PIT_REINJ) |
 			  BIT(APICV_INHIBIT_REASON_X2APIC) |
 			  BIT(APICV_INHIBIT_REASON_BLOCKIRQ) |
-			  BIT(APICV_INHIBIT_REASON_SEV      |
+			  BIT(APICV_INHIBIT_REASON_SEV)      |
 			  BIT(APICV_INHIBIT_REASON_APIC_ID_MODIFIED) |
-			  BIT(APICV_INHIBIT_REASON_APIC_BASE_MODIFIED));
+			  BIT(APICV_INHIBIT_REASON_APIC_BASE_MODIFIED);
 
 	return supported & BIT(reason);
 }
Quoted 1 line

base-commit: b23f8810c46978bc05252db03055a61fcadc07d5

Sorry about it!

Best regards,
Maxim Levitsky