public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] x86: msr: Remove the loop for testing reserved bits in MSR_IA32_FLUSH_CMD
@ 2024-04-15 17:25 Mingwei Zhang
  2024-04-16 16:21 ` Sean Christopherson
  0 siblings, 1 reply; 3+ messages in thread
From: Mingwei Zhang @ 2024-04-15 17:25 UTC (permalink / raw)
  To: Paolo Bonzini, Sean Christopherson; +Cc: kvm, Mingwei Zhang

Avoid testing reserved bits in MSR_IA32_FLUSH_CMD. Since KVM passes through
the MSR at runtime, testing reserved bits directly touches the HW and
should generate #GP. However, some older CPU models like skylake with
certain FMS do not generate #GP.

Ideally, it could be fixed by enumerating all such CPU models. The value
added is would be low. So just remove the testing loop and allow the test
pass.

Signed-off-by: Mingwei Zhang <mizhang@google.com>
---
 x86/msr.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/x86/msr.c b/x86/msr.c
index 3a041fab..76c80d29 100644
--- a/x86/msr.c
+++ b/x86/msr.c
@@ -302,8 +302,6 @@ static void test_cmd_msrs(void)
 		test_wrmsr_fault(MSR_IA32_FLUSH_CMD, "FLUSH_CMD", 0);
 		test_wrmsr_fault(MSR_IA32_FLUSH_CMD, "FLUSH_CMD", L1D_FLUSH);
 	}
-	for (i = 1; i < 64; i++)
-		test_wrmsr_fault(MSR_IA32_FLUSH_CMD, "FLUSH_CMD", BIT_ULL(i));
 }
 
 int main(int ac, char **av)

base-commit: 7b0147ea57dc29ba844f5b60393a0639e55e88af
-- 
2.44.0.683.g7961c838ac-goog


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

end of thread, other threads:[~2024-04-17 23:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-15 17:25 [kvm-unit-tests PATCH] x86: msr: Remove the loop for testing reserved bits in MSR_IA32_FLUSH_CMD Mingwei Zhang
2024-04-16 16:21 ` Sean Christopherson
2024-04-17 23:11   ` Mingwei Zhang

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