kvm: support using KVM_MEM_READONLY flag for regions
For readonly memory regions and rom devices in romd_mode,
we make use of the KVM_MEM_READONLY. A slot that uses
KVM_MEM_READONLY can be read from and code can execute from the
region, but writes will exit to qemu.
For rom devices with !romd_mode, we force the slot to be
removed so reads or writes to the region will exit to qemu.
(Note that a memory region in this state is not executable
within kvm.)
v7:
* Update for readable => romd_mode rename (
5f9a5ea1)
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Xiao Guangrong <[email protected]> (v4)
Reviewed-by: Paolo Bonzini <[email protected]> (v5)
Message-id:
1369816047[email protected]
Signed-off-by: Anthony Liguori <[email protected]>