Skip to contentSkip to conversation

x86/svm: run cr3 read intercept emulate only on SMP

PATCH Applied [email protected] 3 participants 3 messages Apr 16, 2013 – Apr 17, 2013 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/svm: run cr3 read intercept emulate only on SMP

From: Prasad Joshi <[email protected]>

The SVM test 'cr3 read intercept emulate' when ran on uniprocessor system does not finish and blocks all the tests scheduled to be ran afterwords. Add check so that the test is only ran on the SMP VM.

---
 x86/svm.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
x86/svm.c +6 -1
index ed784c4..d51e7ec 100644
@@ -211,6 +211,11 @@ static bool test_run(struct test *test, struct vmcb *vmcb)
     return success;
 }
 
+static bool smp_supported(void)
+{
+	return cpu_count() > 1;
+}
+
 static bool default_supported(void)
 {
     return true;
@@ -749,7 +754,7 @@ static struct test tests[] = {
       test_cr3_intercept, default_finished, check_cr3_intercept },
     { "cr3 read nointercept", default_supported, default_prepare,
       test_cr3_intercept, default_finished, check_cr3_nointercept },
-    { "cr3 read intercept emulate", default_supported,
+    { "cr3 read intercept emulate", smp_supported,
       prepare_cr3_intercept_bypass, test_cr3_intercept_bypass,
       default_finished, check_cr3_intercept },
     { "next_rip", next_rip_supported, prepare_next_rip, test_next_rip,
Signature · 1 line
1.7.10.4
maintainer Reviewed-by on v1 1/1
#1 lore raw

Il 16/04/2013 07:08, [email protected] ha scritto:

Quoted 5 lines

From: Prasad Joshi <[email protected]>

The SVM test 'cr3 read intercept emulate' when ran on uniprocessor system does not finish and blocks all the tests scheduled to be ran afterwords. Add check so that the test is only ran on the SMP VM.

    test->scratch = 1;
    while (test->scratch != 2)
        barrier();

Indeed.

#2 lore raw
Quoted 7 lines · Paolo Bonzini

Il 16/04/2013 07:08, [email protected] ha scritto:

Quoted 5 lines

From: Prasad Joshi <[email protected]>

The SVM test 'cr3 read intercept emulate' when ran on uniprocessor system does not finish and blocks all the tests scheduled to be ran afterwords. Add check so that the test is only ran on the SMP VM.

Quoted 7 lines
    test->scratch = 1;
    while (test->scratch != 2)
        barrier();

Indeed.

Applied, thanks.