KVM: MMU: fix direct sps access corrupted
commit31c6c80f10a4d09fba8ad8d4c57ac2eb2bd23335
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Thu, 28 Oct 2010 18:48:10 +0000 (28 16:48 -0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 22 Nov 2010 18:47:33 +0000 (22 10:47 -0800)
tree23fff37dbe20f19e8cdc5c79eb7ac85028ab750a
parent004ff730b84c2f35a69871fe3bcde07232ed8610
KVM: MMU: fix direct sps access corrupted

commit 9e7b0e7fba45ca3c6357aeb7091ebc281f1de365 upstream.

If the mapping is writable but the dirty flag is not set, we will find
the read-only direct sp and setup the mapping, then if the write #PF
occur, we will mark this mapping writable in the read-only direct sp,
now, other real read-only mapping will happily write it without #PF.

It may hurt guest's COW

Fixed by re-install the mapping when write #PF occur.

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kvm/paging_tmpl.h