[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2f471fbc-99fb-1a85-8f9f-c276c897f518@redhat.com>
Date: Thu, 30 Apr 2020 14:45:19 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: David Laight <David.Laight@...LAB.COM>,
'Jim Mattson' <jmattson@...gle.com>
Cc: 'LKML' <linux-kernel@...r.kernel.org>,
'kvm list' <kvm@...r.kernel.org>,
'Sean Christopherson' <sean.j.christopherson@...el.com>,
'Joerg Roedel' <joro@...tes.org>,
"'everdox@...il.com'" <everdox@...il.com>
Subject: Re: [PATCH] KVM: x86: handle wrap around 32-bit address space
On 29/04/20 10:56, David Laight wrote:
>>>> + if (unlikely(((rip ^ orig_rip) >> 31) == 3) && !is_64_bit_mode(vcpu))
>> Isn't the more obvious:
>> if (((rip ^ orig_rip) & 1ull << 32) ...
>> equivalent?
This one would not (it would also detect carry on high memory addresses,
not just 0x7fffffff to 0x80000000)...
> Actually not even being clever, how about:
> if (orig_rip < (1ull << 32) && unlikely(rip >= (1ull << 32)) && ...
... but yes this one would be equivalent.
Paolo
Powered by blists - more mailing lists