summary refs log tree commit diff stats
path: root/include
diff options
context:
space:
mode:
authorAlexander Boettcher <alexander.boettcher@genode-labs.com>2020-06-29 15:25:03 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-07-10 18:02:14 -0400
commita2d57703b3e735c700689b030c126fa8ba6793b9 (patch)
tree72ed9b0af2326eb2c77e7883c7c5e94f93c43972 /include
parent45db94cc90c286a9965a285ba19450f448760a09 (diff)
downloadfocaccia-qemu-a2d57703b3e735c700689b030c126fa8ba6793b9.tar.gz
focaccia-qemu-a2d57703b3e735c700689b030c126fa8ba6793b9.zip
tcg/svm: use host cr4 during NPT page table walk
During a page table walk of TCG+SVM the code in target/i386/excp_helper.c
get_hphys() uses the cr4 register of the guest instead of the hypervisor
to check for the PSE bit. In the test case we have, the guest have not
enabled (yet) the PSE bit and so the page table walk results in a wrong
host physical address resolution and wrong content read by the guest.

Attached patch is against 4.2.1, but works also on 3.1.0. It fixes the
issue for our automated testcase, which is a 32bit hypervisor w/o PAE
support running a guest VM with tcg+svm.

The test worked beforehand up to qemu 2.12, started to fail with qemu 3.0
and later. The added TCG/SVM NPT commit seems to introduce the regression.

In case someone want to try to reproduce it, the iso is at [0], the good
case is [1] and the failing case is [2]. The used commandline is:

qemu-system-i386 -no-kvm -nographic -cpu phenom -m 512 -machine q35 -cdrom seoul-vmm-test.iso

[0] https://depot.genode.org/alex-ab/images/seoul-vmm-test.iso
[1] https://depot.genode.org/alex-ab/images/seoul-vmm-good.txt
[2] https://depot.genode.org/alex-ab/images/seoul-vmm-bad.txt

Signed-off-by: Alexander Boettcher <alexander.boettcher@genode-labs.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions