Skip to content

Commit ee3a4f6

Browse files
maciejsszmigierobonzini
authored andcommitted
KVM: x86: selftests: svm_int_ctl_test: fix intercept calculation
INTERCEPT_x are bit positions, but the code was using the raw value of INTERCEPT_VINTR (4) instead of BIT(INTERCEPT_VINTR). This resulted in masking of bit 2 - that is, SMI instead of VINTR. Signed-off-by: Maciej S. Szmigiero <[email protected]> Message-Id: <49b9571d25588870db5380b0be1a41df4bbaaf93.1638486479.git.maciej.szmigiero@oracle.com>
1 parent 250552b commit ee3a4f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/kvm/x86_64/svm_int_ctl_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static void l1_guest_code(struct svm_test_data *svm)
7575
vmcb->control.int_ctl &= ~V_INTR_MASKING_MASK;
7676

7777
/* No intercepts for real and virtual interrupts */
78-
vmcb->control.intercept &= ~(1ULL << INTERCEPT_INTR | INTERCEPT_VINTR);
78+
vmcb->control.intercept &= ~(BIT(INTERCEPT_INTR) | BIT(INTERCEPT_VINTR));
7979

8080
/* Make a virtual interrupt VINTR_IRQ_NUMBER pending */
8181
vmcb->control.int_ctl |= V_IRQ_MASK | (0x1 << V_INTR_PRIO_SHIFT);

0 commit comments

Comments
 (0)