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:   Wed, 17 Feb 2021 17:29:26 +0100
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Sean Christopherson <seanjc@...gle.com>,
        Maxim Levitsky <mlevitsk@...hat.com>
Cc:     kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        Wanpeng Li <wanpengli@...cent.com>,
        Borislav Petkov <bp@...en8.de>, Joerg Roedel <joro@...tes.org>,
        Jim Mattson <jmattson@...gle.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH 1/7] KVM: VMX: read idt_vectoring_info a bit earlier

On 17/02/21 17:21, Sean Christopherson wrote:
> On Wed, Feb 17, 2021, Maxim Levitsky wrote:
>> On Wed, 2021-02-17 at 17:06 +0100, Paolo Bonzini wrote:
>>> On 17/02/21 15:57, Maxim Levitsky wrote:
>>>> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
>>>> index b3e36dc3f164..e428d69e21c0 100644
>>>> --- a/arch/x86/kvm/vmx/vmx.c
>>>> +++ b/arch/x86/kvm/vmx/vmx.c
>>>> @@ -6921,13 +6921,15 @@ static fastpath_t vmx_vcpu_run(struct kvm_vcpu *vcpu)
>>>>   	if (unlikely((u16)vmx->exit_reason.basic == EXIT_REASON_MCE_DURING_VMENTRY))
>>>>   		kvm_machine_check();
>>>>   
>>>> +	if (likely(!vmx->exit_reason.failed_vmentry))
>>>> +		vmx->idt_vectoring_info = vmcs_read32(IDT_VECTORING_INFO_FIELD);
>>>> +
>>>
>>> Any reason for the if?
>>
>> Sean Christopherson asked me to do this to avoid updating idt_vectoring_info on failed
>> VM entry, to keep things as they were logically before this patch.
> 
> Ya, specifically because the field isn't valid if VM-Enter fails.  I'm also ok
> with an unconditional VMREAD if we add a comment stating that it's unnecessary
> if VM-Enter failed, but faster in the common case.

It's okay, just good to know!

Thanks,

paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ