[PATCH 00/10 v4] KVM: introduce readonly memslot

From: Xiao Guangrong
Date: Tue Jul 17 2012 - 10:39:34 EST


In current code, if we map a readonly memory space from host to guest
and the page is not currently mapped in the host, we will get a fault-pfn
and async is not allowed, then the vm will crash.

As Avi's suggestion, We introduce readonly memory region to map ROM/ROMD
to the guest, read access is happy for readonly memslot, write access on
readonly memslot will cause KVM_EXIT_MMIO exit.

The test case attached is used to test this feather.

Changlog:
- fix memslot flag check
- fix caching the mmio info into spte which is caused by write on readonly
memslot
- extend mmio-exit info to indicate whether the mmio-exit is caused by
readonly fault

Attachment: migrate-perf.tar.bz2
Description: application/bzip