lkml.org 
[lkml]   [2021]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC 08/16] KVM: SVM: include CR3 in initial VMSA state for SEV-ES guests
From
On 06/10/21 22:37, Michael Roth wrote:
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index c1a2dd0024b2..d724fa185bef 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -10400,8 +10400,7 @@ static int __set_sregs_common(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs,
>
> vcpu->arch.cr2 = sregs->cr2;
> *mmu_reset_needed |= kvm_read_cr3(vcpu) != sregs->cr3;
> - vcpu->arch.cr3 = sregs->cr3;
> - kvm_register_mark_available(vcpu, VCPU_EXREG_CR3);
> + static_call(kvm_x86_set_cr3)(vcpu, sregs->cr3);
>
> kvm_set_cr8(vcpu, sregs->cr8);
>
>

Can you instead make the hook "post_set_sregs", and keep these two lines
in __set_sregs_common?

Thanks,

Paolo

\
 
 \ /
  Last update: 2021-10-21 18:43    [W:0.451 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site