lkml.org 
[lkml]   [2014]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/3] kvm: fix potentially corrupt mmio cache
On Tue, Sep 2, 2014 at 9:49 AM, Paolo Bonzini <pbonzini@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 MMIO_GEN_SHIFT 20
>> > +#define MMIO_GEN_LOW_SHIFT 10
>> > +#define MMIO_GEN_LOW_MASK ((1 << MMIO_GEN_LOW_SHIFT) - 2)
>> > #define MMIO_GEN_MASK ((1 << MMIO_GEN_SHIFT) - 1)
>> > #define MMIO_MAX_GEN ((1 << MMIO_GEN_SHIFT) - 1)
>> >
>> > @@ -4428,7 +4432,7 @@ void kvm_mmu_invalidate_mmio_sptes(struct kvm *kvm)
>> > * The very rare case: if the generation-number is round,
>> > * zap all shadow pages.
>> > */
>> > - if (unlikely(kvm_current_mmio_generation(kvm) >= MMIO_MAX_GEN)) {
>> > + if (unlikely(kvm_current_mmio_generation(kvm) == 0)) {
>>
>> This should be in patch 1/3.
>
> I don't think so. This change is not due to the removal of biasing in
> x86.c, but rather due to removing bit 0 from MMIO_GEN_LOW_MASK.
>
> I placed it here, because the previous test works just fine until bit 0
> is removed from MMIO_GEN_LOW_MASK.

Ah ok, you're right.

>
> Paolo


\
 
 \ /
  Last update: 2014-09-02 20:01    [W:0.081 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site