]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: Fix race in reading change bit when removing HPTE
authorPaul Mackerras <paulus@samba.org>
Wed, 24 Jun 2015 11:18:05 +0000 (21:18 +1000)
committerAlexander Graf <agraf@suse.de>
Sat, 22 Aug 2015 09:16:18 +0000 (11:16 +0200)
commit0574e882b89e870721c1465688984601839655c3
tree06e2668ccf5a62c069a94147f8c08debf36d50fc
parent1c4639b64d5d89ea97d6022c9a6d8088109ddc9d
KVM: PPC: Book3S HV: Fix race in reading change bit when removing HPTE

The reference (R) and change (C) bits in a HPT entry can be set by
hardware at any time up until the HPTE is invalidated and the TLB
invalidation sequence has completed.  This means that when removing
a HPTE, we need to read the HPTE after the invalidation sequence has
completed in order to obtain reliable values of R and C.  The code
in kvmppc_do_h_remove() used to do this.  However, commit c957e29ca56d
("KVM: PPC: Book3S HV: Make HTAB code LE host aware") removed the
read after invalidation as a side effect of other changes.  This
restores the read of the HPTE after invalidation.

The user-visible effect of this bug would be that when migrating a
guest, there is a small probability that a page modified by the guest
and then unmapped by the guest might not get re-transmitted and thus
the destination might end up with a stale copy of the page.

Fixes: c957e29ca56d
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/kvm/book3s_hv_rm_mmu.c