aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/virtual
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>2012-08-20 23:02:51 -0400
committerAvi Kivity <avi@redhat.com>2012-08-22 08:09:03 -0400
commit4d8b81abc47b83a1939e59df2fdb0e98dfe0eedd (patch)
tree47ea77cb4f77a2884a0478ecf84f62e32e5661ee /Documentation/virtual
parent7068d0971524dd47a38f44f6020ba133432871ca (diff)
KVM: introduce readonly memslot
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 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 Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'Documentation/virtual')
-rw-r--r--Documentation/virtual/kvm/api.txt10
1 files changed, 7 insertions, 3 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index bf33aaa4c59f..b91bfd43f007 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -857,7 +857,8 @@ struct kvm_userspace_memory_region {
857}; 857};
858 858
859/* for kvm_memory_region::flags */ 859/* for kvm_memory_region::flags */
860#define KVM_MEM_LOG_DIRTY_PAGES 1UL 860#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)
861#define KVM_MEM_READONLY (1UL << 1)
861 862
862This ioctl allows the user to create or modify a guest physical memory 863This ioctl allows the user to create or modify a guest physical memory
863slot. When changing an existing slot, it may be moved in the guest 864slot. When changing an existing slot, it may be moved in the guest
@@ -873,9 +874,12 @@ It is recommended that the lower 21 bits of guest_phys_addr and userspace_addr
873be identical. This allows large pages in the guest to be backed by large 874be identical. This allows large pages in the guest to be backed by large
874pages in the host. 875pages in the host.
875 876
876The flags field supports just one flag, KVM_MEM_LOG_DIRTY_PAGES, which 877The flags field supports two flag, KVM_MEM_LOG_DIRTY_PAGES, which
877instructs kvm to keep track of writes to memory within the slot. See 878instructs kvm to keep track of writes to memory within the slot. See
878the KVM_GET_DIRTY_LOG ioctl. 879the KVM_GET_DIRTY_LOG ioctl. Another flag is KVM_MEM_READONLY when the
880KVM_CAP_READONLY_MEM capability, it indicates the guest memory is read-only,
881that means, guest is only allowed to read it. Writes will be posted to
882userspace as KVM_EXIT_MMIO exits.
879 883
880When the KVM_CAP_SYNC_MMU capability, changes in the backing of the memory 884When the KVM_CAP_SYNC_MMU capability, changes in the backing of the memory
881region are automatically reflected into the guest. For example, an mmap() 885region are automatically reflected into the guest. For example, an mmap()