Re: [PATCH v3 6/6] KVM: introduce readonly memslot

2012-06-19 Thread Gleb Natapov
On Mon, Jun 18, 2012 at 05:25:05PM -0300, Marcelo Tosatti wrote: On Mon, Jun 18, 2012 at 12:50:10PM +0300, Avi Kivity wrote: On 06/16/2012 05:11 AM, Marcelo Tosatti wrote: Can you introduce a separate exit reason, say KVM_EXIT_READ_FAULT, with information about the fault? I think

Re: [PATCH v3 6/6] KVM: introduce readonly memslot

2012-06-19 Thread Avi Kivity
On 06/18/2012 11:25 PM, Marcelo Tosatti wrote: On Mon, Jun 18, 2012 at 12:50:10PM +0300, Avi Kivity wrote: On 06/16/2012 05:11 AM, Marcelo Tosatti wrote: Can you introduce a separate exit reason, say KVM_EXIT_READ_FAULT, with information about the fault? I think you mean WRITE_FAULT.

Re: [PATCH v3 6/6] KVM: introduce readonly memslot

2012-06-18 Thread Avi Kivity
On 06/16/2012 05:11 AM, Marcelo Tosatti wrote: Can you introduce a separate exit reason, say KVM_EXIT_READ_FAULT, with information about the fault? I think you mean WRITE_FAULT. But what's wrong with the normal mmio exit? Then perform this exit only if userspace allows it by explicit

Re: [PATCH v3 6/6] KVM: introduce readonly memslot

2012-06-18 Thread Marcelo Tosatti
On Mon, Jun 18, 2012 at 12:50:10PM +0300, Avi Kivity wrote: On 06/16/2012 05:11 AM, Marcelo Tosatti wrote: Can you introduce a separate exit reason, say KVM_EXIT_READ_FAULT, with information about the fault? I think you mean WRITE_FAULT. Yes. But what's wrong with the normal mmio

Re: [PATCH v3 6/6] KVM: introduce readonly memslot

2012-06-18 Thread Xiao Guangrong
On 06/18/2012 06:11 PM, Avi Kivity wrote: static int check_memory_region_flags(struct kvm_userspace_memory_region *mem) { -if (mem-flags ~KVM_MEM_LOG_DIRTY_PAGES) +if (mem-flags ~(KVM_MEM_LOG_DIRTY_PAGES | KVM_MEM_READONLY)) return -EINVAL; Only x86 supports

Re: [PATCH v3 6/6] KVM: introduce readonly memslot

2012-06-17 Thread Xiao Guangrong
On 06/16/2012 10:11 AM, Marcelo Tosatti wrote: On Tue, Jun 12, 2012 at 10:49:31AM +0800, Xiao Guangrong wrote: 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

Re: [PATCH v3 6/6] KVM: introduce readonly memslot

2012-06-15 Thread Marcelo Tosatti
On Tue, Jun 12, 2012 at 10:49:31AM +0800, Xiao Guangrong wrote: 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 Address Avi's idea, we introduce

[PATCH v3 6/6] KVM: introduce readonly memslot

2012-06-11 Thread Xiao Guangrong
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 Address Avi's idea, we introduce readonly memory region to map ROM/ROMD to the guest Signed-off-by: