linux/arch/x86/kvm/vmx
Michael Roth 405329fc9a KVM: SVM: include CR3 in initial VMSA state for SEV-ES guests
Normally guests will set up CR3 themselves, but some guests, such as
kselftests, and potentially CONFIG_PVH guests, rely on being booted
with paging enabled and CR3 initialized to a pre-allocated page table.

Currently CR3 updates via KVM_SET_SREGS* are not loaded into the guest
VMCB until just prior to entering the guest. For SEV-ES/SEV-SNP, this
is too late, since it will have switched over to using the VMSA page
prior to that point, with the VMSA CR3 copied from the VMCB initial
CR3 value: 0.

Address this by sync'ing the CR3 value into the VMCB save area
immediately when KVM_SET_SREGS* is issued so it will find it's way into
the initial VMSA.

Suggested-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
Message-Id: <20211216171358.61140-10-michael.roth@amd.com>
[Remove vmx_post_set_cr3; add a remark about kvm_set_cr3 not calling the
 new hook. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-01-07 10:44:46 -05:00
..
capabilities.h KVM: X86: Add parameter huge_page_level to kvm_init_shadow_ept_mmu() 2021-12-08 04:25:12 -05:00
evmcs.c KVM: nVMX: Filter out all unsupported controls when eVMCS was activated 2021-09-22 10:33:15 -04:00
evmcs.h x86/kvm: Always inline evmcs_write64() 2021-09-15 15:51:46 +02:00
nested.c KVM: x86: Update vPMCs when retiring branch instructions 2022-01-07 10:44:43 -05:00
nested.h KVM: nVMX: Introduce 'EVMPTR_MAP_PENDING' post-migration state 2021-06-17 13:09:49 -04:00
pmu_intel.c KVM: x86/pmu: Reuse pmc_perf_hw_id() and drop find_fixed_event() 2022-01-07 10:44:42 -05:00
posted_intr.c KVM: VMX: Clean up PI pre/post-block WARNs 2021-12-09 09:30:47 -05:00
posted_intr.h KVM: VMX: Use boolean returns for Posted Interrupt "test" helpers 2021-12-08 04:24:55 -05:00
sgx.c KVM: x86: SGX must obey the KVM_INTERNAL_ERROR_EMULATION protocol 2021-10-25 06:48:25 -04:00
sgx.h KVM: VMX: Enable SGX virtualization for SGX1, SGX2 and LC 2021-04-20 04:18:56 -04:00
vmcs12.c KVM: x86: Clean up redundant ROL16(val, n) macro definition 2021-08-13 03:35:16 -04:00
vmcs12.h KVM: x86: Clean up redundant ROL16(val, n) macro definition 2021-08-13 03:35:16 -04:00
vmcs_shadow_fields.h
vmcs.h KVM: x86: Clean up redundant ROL16(val, n) macro definition 2021-08-13 03:35:16 -04:00
vmenter.S KVM/nVMX: Use __vmx_vcpu_run in nested_vmx_check_vmentry_hw 2021-02-04 05:27:32 -05:00
vmx_ops.h KVM: VMX: Provide vmread version using asm-goto-with-outputs 2022-01-07 10:44:46 -05:00
vmx.c KVM: SVM: include CR3 in initial VMSA state for SEV-ES guests 2022-01-07 10:44:46 -05:00
vmx.h KVM: VMX: Save HOST_CR3 in vmx_set_host_fs_gs() 2022-01-07 10:44:39 -05:00