Re: [PATCH] KVM: fix async page fault working for readonly mapping

2012-05-22 Thread Xiao Guangrong
On 05/22/2012 10:27 PM, Avi Kivity wrote: > On 05/22/2012 08:31 AM, Gleb Natapov wrote: >> On Mon, May 21, 2012 at 04:30:41PM -0300, Marcelo Tosatti wrote: >>> On Mon, May 21, 2012 at 04:15:50PM +0800, Xiao Guangrong wrote: On 05/21/2012 04:08 PM, Gleb Natapov wrote: > On Mon, May 21

Re: [PATCH] KVM: fix async page fault working for readonly mapping

2012-05-22 Thread Avi Kivity
On 05/22/2012 08:31 AM, Gleb Natapov wrote: > On Mon, May 21, 2012 at 04:30:41PM -0300, Marcelo Tosatti wrote: >> On Mon, May 21, 2012 at 04:15:50PM +0800, Xiao Guangrong wrote: >> > On 05/21/2012 04:08 PM, Gleb Natapov wrote: >> > >> > > On Mon, May 21, 2012 at 02:45:45PM +0800, Xiao Guangrong wr

Re: [PATCH] KVM: fix async page fault working for readonly mapping

2012-05-21 Thread Gleb Natapov
On Mon, May 21, 2012 at 04:30:41PM -0300, Marcelo Tosatti wrote: > On Mon, May 21, 2012 at 04:15:50PM +0800, Xiao Guangrong wrote: > > On 05/21/2012 04:08 PM, Gleb Natapov wrote: > > > > > On Mon, May 21, 2012 at 02:45:45PM +0800, Xiao Guangrong wrote: > > >> If we map a readonly memory space from

Re: [PATCH] KVM: fix async page fault working for readonly mapping

2012-05-21 Thread Marcelo Tosatti
On Mon, May 21, 2012 at 04:15:50PM +0800, Xiao Guangrong wrote: > On 05/21/2012 04:08 PM, Gleb Natapov wrote: > > > On Mon, May 21, 2012 at 02:45:45PM +0800, Xiao Guangrong wrote: > >> If we map a readonly memory space from host to guest and the page is > >> not currently mapped in the host, we wi

Re: [PATCH] KVM: fix async page fault working for readonly mapping

2012-05-21 Thread Xiao Guangrong
On 05/21/2012 04:08 PM, Gleb Natapov wrote: > On Mon, May 21, 2012 at 02:45:45PM +0800, Xiao Guangrong wrote: >> 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 >>

Re: [PATCH] KVM: fix async page fault working for readonly mapping

2012-05-21 Thread Gleb Natapov
On Mon, May 21, 2012 at 02:45:45PM +0800, Xiao Guangrong wrote: > 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 > Why would we want to map a readonly memory space f

[PATCH] KVM: fix async page fault working for readonly mapping

2012-05-20 Thread Xiao Guangrong
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 The reason is only writable vma can be allowed to be async in current code Signed-off-by: Xiao Guangrong --- virt/kvm/k