diff options
| author | Tom Lendacky <thomas.lendacky@amd.com> | 2022-04-05 13:27:43 -0500 |
|---|---|---|
| committer | Borislav Petkov <bp@suse.de> | 2022-04-06 12:08:40 +0200 |
| commit | 3dd2775b74c9b1b01d19805877ab45bc47c4a5a5 (patch) | |
| tree | b085f2b250737cc0ac62bc1d03b1008a55c2306b /arch/x86/kvm/svm/svm.c | |
| parent | 046f773be106ec8eb92b13414c90f8e279deffe0 (diff) | |
| download | cachepc-linux-3dd2775b74c9b1b01d19805877ab45bc47c4a5a5.tar.gz cachepc-linux-3dd2775b74c9b1b01d19805877ab45bc47c4a5a5.zip | |
KVM: SVM: Create a separate mapping for the SEV-ES save area
The save area for SEV-ES/SEV-SNP guests, as used by the hardware, is
different from the save area of a non SEV-ES/SEV-SNP guest.
This is the first step in defining the multiple save areas to keep them
separate and ensuring proper operation amongst the different types of
guests. Create an SEV-ES/SEV-SNP save area and adjust usage to the new
save area definition where needed.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Venu Busireddy <venu.busireddy@oracle.com>
Link: https://lore.kernel.org/r/20220405182743.308853-1-brijesh.singh@amd.com
Diffstat (limited to 'arch/x86/kvm/svm/svm.c')
| -rw-r--r-- | arch/x86/kvm/svm/svm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 81cb518170a8..6ff595f74e3a 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -1270,8 +1270,8 @@ static void svm_prepare_switch_to_guest(struct kvm_vcpu *vcpu) */ vmsave(__sme_page_pa(sd->save_area)); if (sev_es_guest(vcpu->kvm)) { - struct vmcb_save_area *hostsa; - hostsa = (struct vmcb_save_area *)(page_address(sd->save_area) + 0x400); + struct sev_es_save_area *hostsa; + hostsa = (struct sev_es_save_area *)(page_address(sd->save_area) + 0x400); sev_es_prepare_switch_to_guest(hostsa); } |
