Re: [PATCH 0/2] KVM: do not assume PTE is writable after follow_pfn

2021-02-09 Thread Joao Martins
On 2/9/21 8:19 AM, Christoph Hellwig wrote: > On Mon, Feb 08, 2021 at 07:26:25PM -0400, Jason Gunthorpe wrote: page_mkclean() has some technique to make the notifier have the right size without becoming entangled in the PTL locks.. >>> >>> Right. I guess it's because dax doesn't have "st

Re: [PATCH 0/2] KVM: do not assume PTE is writable after follow_pfn

2021-02-09 Thread Christoph Hellwig
On Mon, Feb 08, 2021 at 07:26:25PM -0400, Jason Gunthorpe wrote: > > > page_mkclean() has some technique to make the notifier have the right > > > size without becoming entangled in the PTL locks.. > > > > Right. I guess it's because dax doesn't have "struct page*" on the > > back, so it > > It

Re: [PATCH 0/2] KVM: do not assume PTE is writable after follow_pfn

2021-02-08 Thread Peter Xu
On Mon, Feb 08, 2021 at 07:26:25PM -0400, Jason Gunthorpe wrote: > On Mon, Feb 08, 2021 at 05:02:59PM -0500, Peter Xu wrote: > > On Mon, Feb 08, 2021 at 02:51:33PM -0400, Jason Gunthorpe wrote: > > > On Fri, Feb 05, 2021 at 01:14:11PM -0500, Peter Xu wrote: > > > > > > > But I do have a question o

Re: [PATCH 0/2] KVM: do not assume PTE is writable after follow_pfn

2021-02-08 Thread Jason Gunthorpe
On Mon, Feb 08, 2021 at 05:02:59PM -0500, Peter Xu wrote: > On Mon, Feb 08, 2021 at 02:51:33PM -0400, Jason Gunthorpe wrote: > > On Fri, Feb 05, 2021 at 01:14:11PM -0500, Peter Xu wrote: > > > > > But I do have a question on why dax as the only user needs to pass in the > > > notifier to follow_pt

Re: [PATCH 0/2] KVM: do not assume PTE is writable after follow_pfn

2021-02-08 Thread Peter Xu
On Mon, Feb 08, 2021 at 02:51:33PM -0400, Jason Gunthorpe wrote: > On Fri, Feb 05, 2021 at 01:14:11PM -0500, Peter Xu wrote: > > > But I do have a question on why dax as the only user needs to pass in the > > notifier to follow_pte() for initialization. > > Not sure either, why does DAX opencode

Re: [PATCH 0/2] KVM: do not assume PTE is writable after follow_pfn

2021-02-08 Thread Jason Gunthorpe
On Fri, Feb 05, 2021 at 01:14:11PM -0500, Peter Xu wrote: > But I do have a question on why dax as the only user needs to pass in the > notifier to follow_pte() for initialization. Not sure either, why does DAX opencode something very much like page_mkclean() with dax_entry_mkclean()? Also it lo

Re: [PATCH 0/2] KVM: do not assume PTE is writable after follow_pfn

2021-02-05 Thread Peter Xu
On Fri, Feb 05, 2021 at 05:32:57AM -0500, Paolo Bonzini wrote: > This series is the first step towards fixing KVM's usage of follow_pfn. > The immediate fix here is that KVM is not checking the writability of > the PFN, which actually dates back to way before the introduction of > follow_pfn in com

[PATCH 0/2] KVM: do not assume PTE is writable after follow_pfn

2021-02-05 Thread Paolo Bonzini
This series is the first step towards fixing KVM's usage of follow_pfn. The immediate fix here is that KVM is not checking the writability of the PFN, which actually dates back to way before the introduction of follow_pfn in commit add6a0cd1c5b ("KVM: MMU: try to fix up page faults before giving up