Re: [RFC PATCH 12/15] kmap: Add stray write protection for device pages

2020-07-14 Thread Ira Weiny
On Tue, Jul 14, 2020 at 12:42:11PM -0700, Dave Hansen wrote: > On 7/14/20 12:29 PM, Peter Zijlstra wrote: > > On Tue, Jul 14, 2020 at 12:06:16PM -0700, Ira Weiny wrote: > >> On Tue, Jul 14, 2020 at 10:44:51AM +0200, Peter Zijlstra wrote: > >>> So, if I followed along correctly, you're proposing to

Re: [RFC PATCH 12/15] kmap: Add stray write protection for device pages

2020-07-14 Thread Peter Zijlstra
On Tue, Jul 14, 2020 at 12:42:11PM -0700, Dave Hansen wrote: > On 7/14/20 12:29 PM, Peter Zijlstra wrote: > > On Tue, Jul 14, 2020 at 12:06:16PM -0700, Ira Weiny wrote: > >> On Tue, Jul 14, 2020 at 10:44:51AM +0200, Peter Zijlstra wrote: > >>> So, if I followed along correctly, you're proposing to

Re: [RFC PATCH 12/15] kmap: Add stray write protection for device pages

2020-07-14 Thread Dave Hansen
On 7/14/20 12:29 PM, Peter Zijlstra wrote: > On Tue, Jul 14, 2020 at 12:06:16PM -0700, Ira Weiny wrote: >> On Tue, Jul 14, 2020 at 10:44:51AM +0200, Peter Zijlstra wrote: >>> So, if I followed along correctly, you're proposing to do a WRMSR per >>> k{,un}map{_atomic}(), sounds like excellent

Re: [RFC PATCH 12/15] kmap: Add stray write protection for device pages

2020-07-14 Thread Peter Zijlstra
On Tue, Jul 14, 2020 at 12:06:16PM -0700, Ira Weiny wrote: > On Tue, Jul 14, 2020 at 10:44:51AM +0200, Peter Zijlstra wrote: > > So, if I followed along correctly, you're proposing to do a WRMSR per > > k{,un}map{_atomic}(), sounds like excellent performance all-round :-( > > Only to pages which

Re: [RFC PATCH 12/15] kmap: Add stray write protection for device pages

2020-07-14 Thread Ira Weiny
On Tue, Jul 14, 2020 at 10:44:51AM +0200, Peter Zijlstra wrote: > On Tue, Jul 14, 2020 at 12:02:17AM -0700, ira.we...@intel.com wrote: > > From: Ira Weiny > > > > Device managed pages may have additional protections. These protections > > need to be removed prior to valid use by kernel users. >

Re: [RFC PATCH 12/15] kmap: Add stray write protection for device pages

2020-07-14 Thread Peter Zijlstra
On Tue, Jul 14, 2020 at 12:02:17AM -0700, ira.we...@intel.com wrote: > From: Ira Weiny > > Device managed pages may have additional protections. These protections > need to be removed prior to valid use by kernel users. > > Check for special treatment of device managed pages in kmap and take >

[RFC PATCH 12/15] kmap: Add stray write protection for device pages

2020-07-14 Thread ira . weiny
From: Ira Weiny Device managed pages may have additional protections. These protections need to be removed prior to valid use by kernel users. Check for special treatment of device managed pages in kmap and take action if needed. We use kmap as an interface for generic kernel code because