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: <563890B3.2090704@redhat.com>
Date:	Tue, 3 Nov 2015 11:47:15 +0100
From:	Paolo Bonzini <pbonzini@...hat.com>
To:	Nadav Amit <nadav.amit@...il.com>,
	Wanpeng Li <wanpeng.li@...mail.com>
Cc:	kvm list <kvm@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] KVM: x86: fix eflags state following processor init/reset



On 28/10/2015 09:10, Nadav Amit wrote:
> Here are my 5 cents. Note that vmx_vcpu_reset calls:
> 
> 	vmcs_writel(GUEST_RFLAGS, 0x02);
> 
> (And the RFLAGS value is not cached by KVM, so no consistency problem should
> occur.)
> 
> You may want to change the value into constant or call a wrapper function
> for setting RFLAGS, but I don’t see something broken in the functionality.

I agree.  Wanpeng, if this is just a cleanup, can you send v2 that
removes or modifies the existing call to vmcs_writel?  If there is a
bug, can you write a unit test for it?  It should be possible to test
for the problem using INIT+SIPI on an AP.

Thanks,

Paolo

> Regards,
> Nadav
> 
> Wanpeng Li <wanpeng.li@...mail.com> wrote:
> 
>> Ping, :-)
>> On 10/21/15 2:28 PM, Wanpeng Li wrote:
>>> Reference SDM 3.4.3:
>>>
>>> Following initialization of the processor (either by asserting the
>>> RESET pin or the INIT pin), the state of the EFLAGS register is
>>> 00000002H.
>>>
>>> However, the eflags fixed bit is not set and other bits are also not
>>> cleared during the init/reset in kvm.
>>>
>>> This patch fix it by set eflags register to 00000002H following
>>> initialization of the processor.
>>>
>>> Signed-off-by: Wanpeng Li <wanpeng.li@...mail.com>
>>> ---
>>>  arch/x86/kvm/vmx.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>>> index b680c2e..326f6ea 100644
>>> --- a/arch/x86/kvm/vmx.c
>>> +++ b/arch/x86/kvm/vmx.c
>>> @@ -4935,6 +4935,7 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
>>>  	vmx_set_efer(vcpu, 0);
>>>  	vmx_fpu_activate(vcpu);
>>>  	update_exception_bitmap(vcpu);
>>> +	vmx_set_rflags(vcpu, X86_EFLAGS_FIXED);
>>>    	vpid_sync_context(vmx->vpid);
>>>  }
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>> the body of a message to majordomo@...r.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ