RE: [PATCH] KVM: x86: handle wrap around 32-bit address space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: David Laight
> Sent: 29 April 2020 09:50
> From: Jim Mattson
> > Sent: 28 April 2020 01:29
> > On Mon, Apr 27, 2020 at 9:59 AM Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote:
> > >
> > > KVM is not handling the case where EIP wraps around the 32-bit address
> > > space (that is, outside long mode).  This is needed both in vmx.c
> > > and in emulate.c.  SVM with NRIPS is okay, but it can still print
> > > an error to dmesg due to integer overflow.
> ...
> > > +               if (unlikely(((rip ^ orig_rip) >> 31) == 3) && !is_64_bit_mode(vcpu))
> 
> Isn't the more obvious:
> 	if (((rip ^ orig_rip) & 1ull << 32) ...
> equivalent?

Actually not even being clever, how about:
	if (orig_rip < (1ull << 32) && unlikely(rip >= (1ull << 32)) && ...

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux