Re: TTM huge page-faults WAS: Re: [RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit

2019-09-24 Thread Koenig, Christian
Am 11.09.19 um 17:08 schrieb Thomas Hellström (VMware): > On 9/11/19 4:06 PM, Koenig, Christian wrote: >> Am 11.09.19 um 12:10 schrieb Thomas Hellström (VMware): >> [SNIP] > The problem seen in TTM is that we want to be able to change the > vm_page_prot from the fault handler, but it's

Re: [RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit

2019-09-12 Thread VMware
On 9/11/19 8:03 PM, Andy Lutomirski wrote: That distinction is important because if it ever comes to a choice between adding a new lock to protect vm_page_prot (and consequently slow down the whole vm system) and using the WRITE_ONCE solution in TTM, we should know what the implications are.

Re: [RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit

2019-09-11 Thread Andy Lutomirski
On Wed, Sep 11, 2019 at 12:49 AM Thomas Hellström (VMware) wrote: > > Hi, Andy. > > On 9/11/19 6:18 AM, Andy Lutomirski wrote: > > > > As a for-real example, take a look at arch/x86/entry/vdso/vma.c. The > > "vvar" VMA contains multiple pages that are backed by different types > > of memory.

TTM huge page-faults WAS: Re: [RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit

2019-09-11 Thread VMware
removing people that are probably not interested from CC adding dri-devel On 9/11/19 11:08 AM, Koenig, Christian wrote: Am 10.09.19 um 21:26 schrieb Thomas Hellström (VMware): On 9/10/19 6:11 PM, Andy Lutomirski wrote: On Sep 5, 2019, at 8:24 AM, Christoph Hellwig wrote: On Thu, Sep 05,

Re: [RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit

2019-09-11 Thread Koenig, Christian
Am 10.09.19 um 21:26 schrieb Thomas Hellström (VMware): > On 9/10/19 6:11 PM, Andy Lutomirski wrote: >> >>> On Sep 5, 2019, at 8:24 AM, Christoph Hellwig >>> wrote: >>> On Thu, Sep 05, 2019 at 05:21:24PM +0200, Thomas Hellström (VMware) wrote: > On 9/5/19 4:15 PM, Dave Hansen

Re: [RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit

2019-09-11 Thread VMware
Hi, Andy. On 9/11/19 6:18 AM, Andy Lutomirski wrote: On Tue, Sep 10, 2019 at 12:26 PM Thomas Hellström (VMware) wrote: On 9/10/19 6:11 PM, Andy Lutomirski wrote: On Sep 5, 2019, at 8:24 AM, Christoph Hellwig wrote: On Thu, Sep 05, 2019 at 05:21:24PM +0200, Thomas Hellström (VMware) wrote:

Re: [RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit

2019-09-10 Thread Andy Lutomirski
On Tue, Sep 10, 2019 at 12:26 PM Thomas Hellström (VMware) wrote: > > On 9/10/19 6:11 PM, Andy Lutomirski wrote: > > > >> On Sep 5, 2019, at 8:24 AM, Christoph Hellwig wrote: > >> > >>> On Thu, Sep 05, 2019 at 05:21:24PM +0200, Thomas Hellström (VMware) wrote: > On 9/5/19 4:15 PM, Dave

Re: [RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit

2019-09-10 Thread VMware
On 9/10/19 6:11 PM, Andy Lutomirski wrote: On Sep 5, 2019, at 8:24 AM, Christoph Hellwig wrote: On Thu, Sep 05, 2019 at 05:21:24PM +0200, Thomas Hellström (VMware) wrote: On 9/5/19 4:15 PM, Dave Hansen wrote: Hi Thomas, Thanks for the second batch of patches! These look much improved on

Re: [RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit

2019-09-10 Thread Andy Lutomirski
> On Sep 5, 2019, at 8:24 AM, Christoph Hellwig wrote: > >> On Thu, Sep 05, 2019 at 05:21:24PM +0200, Thomas Hellström (VMware) wrote: >>> On 9/5/19 4:15 PM, Dave Hansen wrote: >>> Hi Thomas, >>> >>> Thanks for the second batch of patches! These look much improved on all >>> fronts. >> >>

Re: [RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit

2019-09-05 Thread VMware
On 9/5/19 5:24 PM, Christoph Hellwig wrote: On Thu, Sep 05, 2019 at 05:21:24PM +0200, Thomas Hellström (VMware) wrote: On 9/5/19 4:15 PM, Dave Hansen wrote: Hi Thomas, Thanks for the second batch of patches! These look much improved on all fronts. Yes, although the TTM functionality isn't

Re: [RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit

2019-09-05 Thread VMware
On 9/5/19 5:59 PM, Dave Hansen wrote: On 9/5/19 8:21 AM, Thomas Hellström (VMware) wrote:   #define pgprot_modify pgprot_modify   static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)   { -    pgprotval_t preservebits = pgprot_val(oldprot) & _PAGE_CHG_MASK; -   

Re: [RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit

2019-09-05 Thread Dave Hansen
On 9/5/19 8:21 AM, Thomas Hellström (VMware) wrote: >>>   #define pgprot_modify pgprot_modify >>>   static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t >>> newprot) >>>   { >>> -    pgprotval_t preservebits = pgprot_val(oldprot) & _PAGE_CHG_MASK; >>> -    pgprotval_t addbits =

Re: [RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit

2019-09-05 Thread Christoph Hellwig
On Thu, Sep 05, 2019 at 05:21:24PM +0200, Thomas Hellström (VMware) wrote: > On 9/5/19 4:15 PM, Dave Hansen wrote: > > Hi Thomas, > > > > Thanks for the second batch of patches! These look much improved on all > > fronts. > > Yes, although the TTM functionality isn't in yet. Hopefully we won't

Re: [RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit

2019-09-05 Thread VMware
On 9/5/19 4:15 PM, Dave Hansen wrote: Hi Thomas, Thanks for the second batch of patches! These look much improved on all fronts. Yes, although the TTM functionality isn't in yet. Hopefully we won't have to bother you with those though, since this assumes TTM will be using the dma API.

Re: [RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit

2019-09-05 Thread Dave Hansen
Hi Thomas, Thanks for the second batch of patches! These look much improved on all fronts. On 9/5/19 3:35 AM, Thomas Hellström (VMware) wrote: > -/* mprotect needs to preserve PAT bits when updating vm_page_prot */ > +/* > + * mprotect needs to preserve PAT and encryption bits when updating > +

[RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit

2019-09-05 Thread VMware
From: Thomas Hellstrom When SEV or SME is enabled and active, vm_get_page_prot() typically returns with the encryption bit set. This means that users of pgprot_modify(, vm_get_page_prot()) (mprotect_fixup, do_mmap) typically unintentionally sets encrypted page protection even on mmap'd coherent