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] [day] [month] [year] [list]
Message-ID: <54497675-2b35-b351-4259-8eb819daca87@intel.com>
Date:   Fri, 29 May 2020 00:59:51 +0800
From:   Xiaoyao Li <xiaoyao.li@...el.com>
To:     Paolo Bonzini <pbonzini@...hat.com>,
        Sean Christopherson <sean.j.christopherson@...el.com>,
        kvm@...r.kernel.org
Cc:     Vitaly Kuznetsov <vkuznets@...hat.com>,
        Jim Mattson <jmattson@...gle.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: X86: Call kvm_x86_ops.cpuid_update() after CPUIDs
 fully updated

On 5/29/2020 12:15 AM, Paolo Bonzini wrote:
> On 28/05/20 17:40, Xiaoyao Li wrote:
>>>
>>>> kvm_x86_ops.cpuid_update() is used to update vmx/svm settings based on
>>>> updated CPUID settings. So it's supposed to be called after CPUIDs are
>>>> fully updated, not in the middle stage.
>>>>
>>>> Signed-off-by: Xiaoyao Li <xiaoyao.li@...el.com>
>>>
>>> Are you seeing anything bad happening from this?
>>
>> Not yet.
>>
>> IMO changing the order is more reasonable and less confusing.
> 
> Indeed, I just could not decide whether to include it in 5.7 or not.

Maybe for 5.8

I have a new idea to refactor a bit more that I find it does three 
things in kvm_update_cpuid():
- update cpuid;
- update vcpu states, e.g., apic->lapic_timer.timer_mode_mask, 
guest_supported_xcr0, maxphyaddr, ... etc,
- cpuid check, for vaddr_bits

I'm going to split it, and make the order as:
1. kvm_check_cpuid(), if invalid value return error;
2. kvm_update_cpuid();
3. kvm_update_state_based_on_cpuid();
    and kvm_x86_ops.kvm_x86_ops.cpuid_update() can be called inside it.

If you feel OK, I'll do it tomorrow.

-Xiaoyao


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ