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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 4 Apr 2018 19:43:19 +0200
From:   David Hildenbrand <david@...hat.com>
To:     Paolo Bonzini <pbonzini@...hat.com>,
        Wanpeng Li <kernellwp@...il.com>, linux-kernel@...r.kernel.org,
        kvm@...r.kernel.org
Cc:     Radim Krčmář <rkrcmar@...hat.com>,
        Andrew Cooper <andrew.cooper3@...rix.com>,
        Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
        Liran Alon <liran.alon@...cle.com>
Subject: Re: [PATCH v5 1/2] KVM: X86: Introduce handle_ud()

On 04.04.2018 19:12, Paolo Bonzini wrote:
> On 04/04/2018 13:54, David Hildenbrand wrote:
>>> +{
>>> +	enum emulation_result er;
>>> +
>>> +	er = emulate_instruction(vcpu, EMULTYPE_TRAP_UD);
>>> +	if (er == EMULATE_USER_EXIT)
>>> +		return 0;
>>> +	if (er != EMULATE_DONE)
>>> +		kvm_queue_exception(vcpu, UD_VECTOR);
>>> +	return 1;
>> I would now actually prefer
>>
>> if (er == EMULATE_DONE)
>> 	return 1 ...
> 
> Why?  The return statement would be duplicated.
> 
> Paolo
> 

I was talking about two equality checks vs. 1 equality and 1 inequality
check.

er = emulate_instruction(vcpu, EMULTYPE_TRAP_UD);
if (er == EMULATE_USER_EXIT)
	return 0;
else if (er == EMULATE_DONE)
	return 1;
return kvm_queue_exception(vcpu, UD_VECTOR);


-- 

Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ