]> git.proxmox.com Git - mirror_qemu.git/commit - target/i386/cpu.c
target-i386: Add NPT support
authorJan Kiszka <jan.kiszka@siemens.com>
Sat, 30 Jun 2018 06:08:23 +0000 (08:08 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 2 Jul 2018 13:41:18 +0000 (15:41 +0200)
commitfe441054bb3f0c75ff23335790342c0408e11c3a
tree4c33bcd58c69d2a1dc66ba3f10d98e3108976195
parent76b004d10da09bb77a4343edf7b98b2d662fb4f2
target-i386: Add NPT support

This implements NPT suport for SVM by hooking into
x86_cpu_handle_mmu_fault where it reads the stage-1 page table. Whether
we need to perform this 2nd stage translation, and how, is decided
during vmrun and stored in hflags2, along with nested_cr3 and
nested_pg_mode.

As get_hphys performs a direct cpu_vmexit in case of NPT faults, we need
retaddr in that function. To avoid changing the signature of
cpu_handle_mmu_fault, this passes the value from tlb_fill to get_hphys
via the CPU state.

This was tested successfully via the Jailhouse hypervisor.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Message-Id: <567473a0-6005-5843-4c73-951f476085ca@web.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/cpu.c
target/i386/cpu.h
target/i386/excp_helper.c
target/i386/machine.c
target/i386/mem_helper.c
target/i386/svm.h
target/i386/svm_helper.c