diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-07-10 16:44:18 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-07-10 16:44:18 -0400 |
commit | d86ef5851964521c4558e73e43187912718e6746 (patch) | |
tree | 87822ac233419190178e164eceec6a63cd5aa8bf | |
parent | a79c949573d8ee436cbee70c26aada8785329684 (diff) | |
download | kvm-unit-tests-d86ef5851964521c4558e73e43187912718e6746.tar.gz |
cstart: do not assume CR4 starts as zero
The BIOS might leave some bits set in CR4; for example, CR4.DE=1 would
cause the SVM test for the DR intercept to fail, because DR4/DR5
can only be written when CR4.DE is clear, and otherwise trigger
a #GP exception.
Reported-by: Nadav Amit <namit@vmware.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | x86/cstart.S | 3 | ||||
-rw-r--r-- | x86/cstart64.S | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/x86/cstart.S b/x86/cstart.S index 409cb00..e63e4e2 100644 --- a/x86/cstart.S +++ b/x86/cstart.S @@ -125,8 +125,7 @@ start: jmpl $8, $start32 prepare_32: - mov %cr4, %eax - bts $4, %eax // pse + mov %(1 << 4), %eax // pse mov %eax, %cr4 mov $pt, %eax diff --git a/x86/cstart64.S b/x86/cstart64.S index fabcdbf..3ae98d3 100644 --- a/x86/cstart64.S +++ b/x86/cstart64.S @@ -176,8 +176,7 @@ prepare_64: setup_segments enter_long_mode: - mov %cr4, %eax - bts $5, %eax // pae + mov $(1 << 5), %eax // pae mov %eax, %cr4 mov pt_root, %eax |