Re: [PATCH v19 5/8] mm: introduce memfd_secret system call to create "secret" memory areas

2021-05-19 Thread Mike Rapoport
On Tue, May 18, 2021 at 01:08:27PM +0200, Michal Hocko wrote: > On Tue 18-05-21 12:35:36, David Hildenbrand wrote: > > On 18.05.21 12:31, Michal Hocko wrote: > > > > > > Although I have to say openly that I am not a great fan of VM_FAULT_OOM > > > in general. It is usually a a wrong way to tell

Re: [PATCH v19 5/8] mm: introduce memfd_secret system call to create "secret" memory areas

2021-05-18 Thread Michal Hocko
On Tue 18-05-21 12:35:36, David Hildenbrand wrote: > On 18.05.21 12:31, Michal Hocko wrote: > > On Tue 18-05-21 12:06:42, David Hildenbrand wrote: > > > On 18.05.21 11:59, Michal Hocko wrote: > > > > On Sun 16-05-21 10:29:24, Mike Rapoport wrote: > > > > > On Fri, May 14, 2021 at 11:25:43AM +0200,

Re: [PATCH v19 5/8] mm: introduce memfd_secret system call to create "secret" memory areas

2021-05-18 Thread Michal Hocko
On Tue 18-05-21 12:06:42, David Hildenbrand wrote: > On 18.05.21 11:59, Michal Hocko wrote: > > On Sun 16-05-21 10:29:24, Mike Rapoport wrote: > > > On Fri, May 14, 2021 at 11:25:43AM +0200, David Hildenbrand wrote: > > [...] > > > > > + if (!page) > > > > > +

Re: [PATCH v19 5/8] mm: introduce memfd_secret system call to create "secret" memory areas

2021-05-18 Thread Michal Hocko
On Sun 16-05-21 10:29:24, Mike Rapoport wrote: > On Fri, May 14, 2021 at 11:25:43AM +0200, David Hildenbrand wrote: [...] > > > + if (!page) > > > + return VM_FAULT_OOM; > > > + > > > + err = set_direct_map_invalid_noflush(page, 1); > > > + if (err) { > > >

Re: [PATCH v19 5/8] mm: introduce memfd_secret system call to create "secret" memory areas

2021-05-18 Thread David Hildenbrand
On 18.05.21 12:31, Michal Hocko wrote: On Tue 18-05-21 12:06:42, David Hildenbrand wrote: On 18.05.21 11:59, Michal Hocko wrote: On Sun 16-05-21 10:29:24, Mike Rapoport wrote: On Fri, May 14, 2021 at 11:25:43AM +0200, David Hildenbrand wrote: [...] + if (!page) +

Re: [PATCH v19 5/8] mm: introduce memfd_secret system call to create "secret" memory areas

2021-05-18 Thread David Hildenbrand
On 18.05.21 11:59, Michal Hocko wrote: On Sun 16-05-21 10:29:24, Mike Rapoport wrote: On Fri, May 14, 2021 at 11:25:43AM +0200, David Hildenbrand wrote: [...] + if (!page) + return VM_FAULT_OOM; + + err = set_direct_map_invalid_noflush(page,

Re: [PATCH v19 5/8] mm: introduce memfd_secret system call to create "secret" memory areas

2021-05-17 Thread Mike Rapoport
On Fri, May 14, 2021 at 10:50:55AM +0200, David Hildenbrand wrote: > On 13.05.21 20:47, Mike Rapoport wrote: > > From: Mike Rapoport > > > > Removing of the pages from the direct map may cause its fragmentation > > on architectures that use large pages to map the physical memory > > which

Re: [PATCH v19 5/8] mm: introduce memfd_secret system call to create "secret" memory areas

2021-05-16 Thread Mike Rapoport
On Fri, May 14, 2021 at 11:25:43AM +0200, David Hildenbrand wrote: > > #ifdef CONFIG_IA64 > > # include > > @@ -64,6 +65,9 @@ static inline int valid_mmap_phys_addr_range(unsigned > > long pfn, size_t size) > > #ifdef CONFIG_STRICT_DEVMEM > > static inline int page_is_allowed(unsigned

Re: [PATCH v19 5/8] mm: introduce memfd_secret system call to create "secret" memory areas

2021-05-14 Thread David Hildenbrand
#ifdef CONFIG_IA64 # include @@ -64,6 +65,9 @@ static inline int valid_mmap_phys_addr_range(unsigned long pfn, size_t size) #ifdef CONFIG_STRICT_DEVMEM static inline int page_is_allowed(unsigned long pfn) { + if (pfn_valid(pfn) && page_is_secretmem(pfn_to_page(pfn))) +

Re: [PATCH v19 5/8] mm: introduce memfd_secret system call to create "secret" memory areas

2021-05-14 Thread David Hildenbrand
On 13.05.21 20:47, Mike Rapoport wrote: From: Mike Rapoport Introduce "memfd_secret" system call with the ability to create memory areas visible only in the context of the owning process and not mapped not only to other processes but in the kernel page tables as well. The secretmem feature is

[PATCH v19 5/8] mm: introduce memfd_secret system call to create "secret" memory areas

2021-05-13 Thread Mike Rapoport
From: Mike Rapoport Introduce "memfd_secret" system call with the ability to create memory areas visible only in the context of the owning process and not mapped not only to other processes but in the kernel page tables as well. The secretmem feature is off by default and the user must