Re: [PATCH v5 27/34] KVM: SVM: Add support for booting APs for an SEV-ES guest

2021-01-04 Thread Paolo Bonzini
On 04/01/21 18:38, Tom Lendacky wrote: Paolo, is this something along the lines of what you were thinking, or am I off base? I created kvm_emulate_ap_reset_hold() to keep the code consolidated and remove the duplication, but can easily make those changes local to sev.c. I'd also like to

Re: [PATCH v5 27/34] KVM: SVM: Add support for booting APs for an SEV-ES guest

2021-01-04 Thread Tom Lendacky
On 12/15/20 2:25 PM, Tom Lendacky wrote: On 12/14/20 1:46 PM, Tom Lendacky wrote: On 12/14/20 10:03 AM, Paolo Bonzini wrote: On 10/12/20 18:10, Tom Lendacky wrote: From: Tom Lendacky +case SVM_VMGEXIT_AP_HLT_LOOP: +svm->ap_hlt_loop = true; This value needs to be communicated

Re: [PATCH v5 27/34] KVM: SVM: Add support for booting APs for an SEV-ES guest

2020-12-15 Thread Tom Lendacky
On 12/14/20 1:46 PM, Tom Lendacky wrote: > On 12/14/20 10:03 AM, Paolo Bonzini wrote: >> On 10/12/20 18:10, Tom Lendacky wrote: >>> From: Tom Lendacky >>> >>> +case SVM_VMGEXIT_AP_HLT_LOOP: >>> +svm->ap_hlt_loop = true; >> >> This value needs to be communicated to userspace. Let's

Re: [PATCH v5 27/34] KVM: SVM: Add support for booting APs for an SEV-ES guest

2020-12-14 Thread Tom Lendacky
On 12/14/20 10:03 AM, Paolo Bonzini wrote: > On 10/12/20 18:10, Tom Lendacky wrote: >> From: Tom Lendacky >> >> Typically under KVM, an AP is booted using the INIT-SIPI-SIPI sequence, >> where the guest vCPU register state is updated and then the vCPU is VMRUN >> to begin execution of the AP. For

Re: [PATCH v5 27/34] KVM: SVM: Add support for booting APs for an SEV-ES guest

2020-12-14 Thread Paolo Bonzini
On 10/12/20 18:10, Tom Lendacky wrote: @@ -10144,6 +10144,15 @@ void kvm_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector) { struct kvm_segment cs; + /* +* Guests with protected state can't have their state altered by KVM, +* call the

Re: [PATCH v5 27/34] KVM: SVM: Add support for booting APs for an SEV-ES guest

2020-12-14 Thread Paolo Bonzini
On 10/12/20 18:10, Tom Lendacky wrote: From: Tom Lendacky Typically under KVM, an AP is booted using the INIT-SIPI-SIPI sequence, where the guest vCPU register state is updated and then the vCPU is VMRUN to begin execution of the AP. For an SEV-ES guest, this won't work because the guest

[PATCH v5 27/34] KVM: SVM: Add support for booting APs for an SEV-ES guest

2020-12-10 Thread Tom Lendacky
From: Tom Lendacky Typically under KVM, an AP is booted using the INIT-SIPI-SIPI sequence, where the guest vCPU register state is updated and then the vCPU is VMRUN to begin execution of the AP. For an SEV-ES guest, this won't work because the guest register state is encrypted. Following the