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]
Date:   Tue, 22 Sep 2020 17:02:46 +0200
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Cathy Avery <cavery@...hat.com>, Wei Huang <wei.huang2@....com>
Cc:     linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        vkuznets@...hat.com
Subject: Re: [PATCH] KVM: SVM: Use a separate vmcb for the nested L2 guest

On 21/09/20 16:07, Cathy Avery wrote:
>>>   -    if (npt_enabled)
>>> -        svm->vmcb->save.cr3 = hsave->save.cr3;
>>> +    if (!npt_enabled)
>>> +        svm->vmcb01->save.cr3 = kvm_read_cr3(&svm->vcpu);
>> Does this mean the original code is missing the following?
>>
>>          else
>>         svm->vmcb01->save.cr3 = kvm_read_cr3(&svm->vcpu);
> No it means I made an assumption here. I'll look at this again.

This should not be needed, nested_svm_load_cr3's call to kvm_init_mmu
should write to svm->vmcb->save.cr3.

>>>
>>> +    unsigned long vmcb01_pa;
>> Any reason that vmcb01_pa can't be placed in "struct vcpu_svm" below, along
>> with vmcb01?
> I just grouped it with the other nesting components. I can move it.

Please do it, vmcb01 is not part of nesting.

>     static inline struct vmcb *get_host_vmcb(struct vcpu_svm *svm)
>   {
> -    if (is_guest_mode(&svm->vcpu))
> -        return svm->nested.hsave;
> -    else
> -        return svm->vmcb;
> +    return svm->vmcb01; 

You can remove the function altogether (in a second patch).

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ