lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211025035901.r3yxumcygvj22skp@amd.com>
Date:   Sun, 24 Oct 2021 22:59:01 -0500
From:   Michael Roth <michael.roth@....com>
To:     Paolo Bonzini <pbonzini@...hat.com>
CC:     <linux-kselftest@...r.kernel.org>, <kvm@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <x86@...nel.org>,
        Nathan Tempelman <natet@...gle.com>,
        Marc Orr <marcorr@...gle.com>,
        Steve Rutherford <srutherford@...gle.com>,
        Sean Christopherson <seanjc@...gle.com>,
        "Mingwei Zhang" <mizhang@...gle.com>,
        Brijesh Singh <brijesh.singh@....com>,
        "Tom Lendacky" <thomas.lendacky@....com>,
        Varad Gautam <varad.gautam@...e.com>,
        Shuah Khan <shuah@...nel.org>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        "David Woodhouse" <dwmw@...zon.co.uk>,
        Ricardo Koller <ricarkol@...gle.com>,
        "Jim Mattson" <jmattson@...gle.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        "Joerg Roedel" <joro@...tes.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H . Peter Anvin" <hpa@...or.com>
Subject: Re: [RFC 08/16] KVM: SVM: include CR3 in initial VMSA state for
 SEV-ES guests

On Thu, Oct 21, 2021 at 06:43:34PM +0200, Paolo Bonzini wrote:
> 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?

Makes sense. Will do.

> 
> Thanks,
> 
> Paolo
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ