linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: David Laight <David.Laight@ACULAB.COM>,
	'Jim Mattson' <jmattson@google.com>
Cc: 'LKML' <linux-kernel@vger.kernel.org>,
	'kvm list' <kvm@vger.kernel.org>,
	'Sean Christopherson' <sean.j.christopherson@intel.com>,
	'Joerg Roedel' <joro@8bytes.org>,
	"'everdox@gmail.com'" <everdox@gmail.com>
Subject: Re: [PATCH] KVM: x86: handle wrap around 32-bit address space
Date: Thu, 30 Apr 2020 14:45:19 +0200	[thread overview]
Message-ID: <2f471fbc-99fb-1a85-8f9f-c276c897f518@redhat.com> (raw)
In-Reply-To: <91c76eb0edcd4f1a9d5bc541d35f8ade@AcuMS.aculab.com>

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


  reply	other threads:[~2020-04-30 12:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27 16:59 [PATCH] KVM: x86: handle wrap around 32-bit address space Paolo Bonzini
2020-04-28  0:28 ` Jim Mattson
2020-04-28  0:33   ` Sean Christopherson
2020-04-29  8:50   ` David Laight
2020-04-29  8:56     ` David Laight
2020-04-30 12:45       ` Paolo Bonzini [this message]
2020-04-30 13:18         ` David Laight

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f471fbc-99fb-1a85-8f9f-c276c897f518@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=everdox@gmail.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sean.j.christopherson@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).