Re: [PATCH 2/3] kvm: fix potentially corrupt mmio cache

2014-09-02 Thread David Matlack
On Tue, Sep 2, 2014 at 9:49 AM, Paolo Bonzini wrote: > Il 02/09/2014 18:44, David Matlack ha scritto: >> > >> > -#define MMIO_GEN_SHIFT 19 >> > -#define MMIO_GEN_LOW_SHIFT 9 >> > -#define MMIO_GEN_LOW_MASK ((1 << MMIO_GEN_LOW_SHIFT) - 1) >> > +#define

Re: [PATCH 2/3] kvm: fix potentially corrupt mmio cache

2014-09-02 Thread Paolo Bonzini
Il 02/09/2014 18:44, David Matlack ha scritto: > > > > -#define MMIO_GEN_SHIFT 19 > > -#define MMIO_GEN_LOW_SHIFT 9 > > -#define MMIO_GEN_LOW_MASK ((1 << MMIO_GEN_LOW_SHIFT) - 1) > > +#define MMIO_GEN_SHIFT 20 > > +#define MMIO_GEN_LOW_SHIFT

Re: [PATCH 2/3] kvm: fix potentially corrupt mmio cache

2014-09-02 Thread David Matlack
On Fri, Aug 29, 2014 at 3:31 AM, Paolo Bonzini wrote: > From: David Matlack > > vcpu exits and memslot mutations can run concurrently as long as the > vcpu does not aquire the slots mutex. Thus it is theoretically possible > for memslots to change underneath a vcpu that is handling an exit. > >

Re: [PATCH 2/3] kvm: fix potentially corrupt mmio cache

2014-09-02 Thread David Matlack
On Fri, Aug 29, 2014 at 3:31 AM, Paolo Bonzini pbonz...@redhat.com wrote: From: David Matlack dmatl...@google.com vcpu exits and memslot mutations can run concurrently as long as the vcpu does not aquire the slots mutex. Thus it is theoretically possible for memslots to change underneath a

Re: [PATCH 2/3] kvm: fix potentially corrupt mmio cache

2014-09-02 Thread Paolo Bonzini
Il 02/09/2014 18:44, David Matlack ha scritto: -#define MMIO_GEN_SHIFT 19 -#define MMIO_GEN_LOW_SHIFT 9 -#define MMIO_GEN_LOW_MASK ((1 MMIO_GEN_LOW_SHIFT) - 1) +#define MMIO_GEN_SHIFT 20 +#define MMIO_GEN_LOW_SHIFT

Re: [PATCH 2/3] kvm: fix potentially corrupt mmio cache

2014-09-02 Thread David Matlack
On Tue, Sep 2, 2014 at 9:49 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 02/09/2014 18:44, David Matlack ha scritto: -#define MMIO_GEN_SHIFT 19 -#define MMIO_GEN_LOW_SHIFT 9 -#define MMIO_GEN_LOW_MASK ((1 MMIO_GEN_LOW_SHIFT) - 1) +#define

[PATCH 2/3] kvm: fix potentially corrupt mmio cache

2014-08-29 Thread Paolo Bonzini
From: David Matlack vcpu exits and memslot mutations can run concurrently as long as the vcpu does not aquire the slots mutex. Thus it is theoretically possible for memslots to change underneath a vcpu that is handling an exit. If we increment the memslot generation number again after

[PATCH 2/3] kvm: fix potentially corrupt mmio cache

2014-08-29 Thread Paolo Bonzini
From: David Matlack dmatl...@google.com vcpu exits and memslot mutations can run concurrently as long as the vcpu does not aquire the slots mutex. Thus it is theoretically possible for memslots to change underneath a vcpu that is handling an exit. If we increment the memslot generation number