Re: [PATCH v17 07/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-02-11 Thread Mike Rapoport
On Thu, Feb 11, 2021 at 01:07:10PM +0100, David Hildenbrand wrote: > On 11.02.21 12:27, Mike Rapoport wrote: > > On Thu, Feb 11, 2021 at 10:01:32AM +0100, David Hildenbrand wrote: > > So let's talk about the main user-visible differences to other memfd files > (especially, other purely virtual

Re: [PATCH v17 07/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-02-11 Thread Mike Rapoport
On Thu, Feb 11, 2021 at 01:30:42PM +0100, Michal Hocko wrote: > On Thu 11-02-21 13:20:08, Mike Rapoport wrote: > [...] > > Sealing is anyway controlled via fcntl() and I don't think > > MFD_ALLOW_SEALING makes much sense for the secretmem because it is there to > > prevent rogue file sealing in

Re: [PATCH v2 3/8] cxl/mem: Register CXL memX devices

2021-02-11 Thread Dan Williams
On Thu, Feb 11, 2021 at 2:19 AM Jonathan Cameron wrote: > > On Wed, 10 Feb 2021 18:17:25 + > Jonathan Cameron wrote: > > > On Tue, 9 Feb 2021 16:02:54 -0800 > > Ben Widawsky wrote: > > > > > From: Dan Williams > > > > > > Create the /sys/bus/cxl hierarchy to enumerate: > > > > > > * Memory

Re: [PATCH v2 6/8] cxl/mem: Enable commands via CEL

2021-02-11 Thread Dan Williams
On Thu, Feb 11, 2021 at 9:45 AM Ben Widawsky wrote: [..] > > > + if (mbox_cmd.size_out > sizeof(gsl)) { > > > + dev_warn(dev, "%zu excess logs\n", > > > +(mbox_cmd.size_out - sizeof(gsl)) / > > > +sizeof(struct gsl_entry)); > > > > This

Re: [PATCH v2 2/8] cxl/mem: Find device capabilities

2021-02-11 Thread Ben Widawsky
On 21-02-11 09:55:48, Jonathan Cameron wrote: > On Wed, 10 Feb 2021 10:16:05 -0800 > Ben Widawsky wrote: > > > On 21-02-10 08:55:57, Ben Widawsky wrote: > > > On 21-02-10 15:07:59, Jonathan Cameron wrote: > > > > On Wed, 10 Feb 2021 13:32:52 + > > > > Jonathan Cameron wrote: > > > > >

Re: [PATCH v2 6/8] cxl/mem: Enable commands via CEL

2021-02-11 Thread Ben Widawsky
On 21-02-11 12:02:15, Jonathan Cameron wrote: > On Tue, 9 Feb 2021 16:02:57 -0800 > Ben Widawsky wrote: > > > CXL devices identified by the memory-device class code must implement > > the Device Command Interface (described in 8.2.9 of the CXL 2.0 spec). > > While the driver already maintains a

Re: [PATCH v2 4/8] cxl/mem: Add basic IOCTL interface

2021-02-11 Thread Ben Widawsky
On 21-02-11 10:06:46, Jonathan Cameron wrote: > On Wed, 10 Feb 2021 20:40:52 -0800 > Dan Williams wrote: > > > On Wed, Feb 10, 2021 at 10:47 AM Jonathan Cameron > > wrote: > > [..] > > > > +#define CXL_CMDS > > > >\ > > > > +

Re: [PATCH v2 5/8] cxl/mem: Add a "RAW" send command

2021-02-11 Thread Dan Williams
On Wed, Feb 10, 2021 at 7:27 AM wrote: > > > diff --git a/drivers/cxl/Kconfig b/drivers/cxl/Kconfig > > index c4ba3aa0a05d..08eaa8e52083 100644 > > --- a/drivers/cxl/Kconfig > > +++ b/drivers/cxl/Kconfig > > @@ -33,6 +33,24 @@ config CXL_MEM > > > > If unsure say 'm'. > > > > +config

Re: [PATCH v17 07/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-02-11 Thread Michal Hocko
On Thu 11-02-21 13:20:08, Mike Rapoport wrote: [...] > Sealing is anyway controlled via fcntl() and I don't think > MFD_ALLOW_SEALING makes much sense for the secretmem because it is there to > prevent rogue file sealing in tmpfs/hugetlbfs. This doesn't really match my understanding. The primary

Re: [PATCH v2 2/8] cxl/mem: Find device capabilities

2021-02-11 Thread Ben Widawsky
On 21-02-11 10:01:52, Jonathan Cameron wrote: > On Wed, 10 Feb 2021 11:54:29 -0800 > Dan Williams wrote: > > > > > ... > > > > > > > > > +static void cxl_mem_mbox_timeout(struct cxl_mem *cxlm, > > > > > +struct mbox_cmd *mbox_cmd) > > > > > +{ > > > > > + struct

Re: [PATCH v2 5/8] cxl/mem: Add a "RAW" send command

2021-02-11 Thread Ben Widawsky
On 21-02-11 11:19:24, Jonathan Cameron wrote: > On Tue, 9 Feb 2021 16:02:56 -0800 > Ben Widawsky wrote: > > > The CXL memory device send interface will have a number of supported > > commands. The raw command is not such a command. Raw commands allow > > userspace to send a specified opcode to

Re: [PATCH v2 2/8] cxl/mem: Find device capabilities

2021-02-11 Thread Ben Widawsky
On 21-02-11 09:55:48, Jonathan Cameron wrote: > On Wed, 10 Feb 2021 10:16:05 -0800 > Ben Widawsky wrote: > > > On 21-02-10 08:55:57, Ben Widawsky wrote: > > > On 21-02-10 15:07:59, Jonathan Cameron wrote: > > > > On Wed, 10 Feb 2021 13:32:52 + > > > > Jonathan Cameron wrote: > > > > >

Re: [PATCH v17 07/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-02-11 Thread Michal Hocko
On Thu 11-02-21 10:01:32, David Hildenbrand wrote: [...] > AFAIKS, we would need MFD_SECRET and disallow > MFD_ALLOW_SEALING and MFD_HUGETLB. Yes for an initial version. But I do expect a request to support both features is just a matter of time. > In addition, we could add MFD_SECRET_NEVER_MAP,

Re: [PATCH v17 07/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-02-11 Thread Michal Hocko
On Thu 11-02-21 09:13:19, Mike Rapoport wrote: > On Tue, Feb 09, 2021 at 02:17:11PM +0100, Michal Hocko wrote: > > On Tue 09-02-21 11:09:38, Mike Rapoport wrote: [...] > > > Citing my older email: > > > > > > I've hesitated whether to continue to use new flags to memfd_create() > > > or to >

Re: [PATCH v2 7/8] cxl/mem: Add set of informational commands

2021-02-11 Thread Jonathan Cameron
On Tue, 9 Feb 2021 16:02:58 -0800 Ben Widawsky wrote: > Add initial set of formal commands beyond basic identify and command > enumeration. > > Of special note is the Get Log Command which is only specified to return > 2 log types, CEL and VENDOR_DEBUG. Given that VENDOR_DEBUG is already a >

Re: [PATCH v17 07/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-02-11 Thread David Hildenbrand
On 11.02.21 12:27, Mike Rapoport wrote: On Thu, Feb 11, 2021 at 10:01:32AM +0100, David Hildenbrand wrote: On 11.02.21 09:39, Michal Hocko wrote: On Thu 11-02-21 09:13:19, Mike Rapoport wrote: On Tue, Feb 09, 2021 at 02:17:11PM +0100, Michal Hocko wrote: On Tue 09-02-21 11:09:38, Mike

Re: [PATCH v2 6/8] cxl/mem: Enable commands via CEL

2021-02-11 Thread Jonathan Cameron
On Tue, 9 Feb 2021 16:02:57 -0800 Ben Widawsky wrote: > CXL devices identified by the memory-device class code must implement > the Device Command Interface (described in 8.2.9 of the CXL 2.0 spec). > While the driver already maintains a list of commands it supports, there > is still a need to

Re: [PATCH v17 07/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-02-11 Thread Mike Rapoport
On Thu, Feb 11, 2021 at 11:02:07AM +0100, David Hildenbrand wrote: > > Another thought regarding "doesn't have _any_ backing storage" > > What are the right semantics when it comes to memory accounting/commit? > > As secretmem does not have > a) any backing storage > b) cannot go to swap > >

Re: [PATCH v17 07/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-02-11 Thread Mike Rapoport
On Thu, Feb 11, 2021 at 10:01:32AM +0100, David Hildenbrand wrote: > On 11.02.21 09:39, Michal Hocko wrote: > > On Thu 11-02-21 09:13:19, Mike Rapoport wrote: > > > On Tue, Feb 09, 2021 at 02:17:11PM +0100, Michal Hocko wrote: > > > > On Tue 09-02-21 11:09:38, Mike Rapoport wrote: > > [...] > > >

Re: [PATCH v2 5/8] cxl/mem: Add a "RAW" send command

2021-02-11 Thread Jonathan Cameron
On Tue, 9 Feb 2021 16:02:56 -0800 Ben Widawsky wrote: > The CXL memory device send interface will have a number of supported > commands. The raw command is not such a command. Raw commands allow > userspace to send a specified opcode to the underlying hardware and > bypass all driver checks on

Re: [PATCH v17 07/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-02-11 Thread Mike Rapoport
On Thu, Feb 11, 2021 at 09:39:38AM +0100, Michal Hocko wrote: > On Thu 11-02-21 09:13:19, Mike Rapoport wrote: > > On Tue, Feb 09, 2021 at 02:17:11PM +0100, Michal Hocko wrote: > > > On Tue 09-02-21 11:09:38, Mike Rapoport wrote: > [...] > > > > Citing my older email: > > > > > > > > I've

Re: [PATCH v2 3/8] cxl/mem: Register CXL memX devices

2021-02-11 Thread Jonathan Cameron
On Wed, 10 Feb 2021 18:17:25 + Jonathan Cameron wrote: > On Tue, 9 Feb 2021 16:02:54 -0800 > Ben Widawsky wrote: > > > From: Dan Williams > > > > Create the /sys/bus/cxl hierarchy to enumerate: > > > > * Memory Devices (per-endpoint control devices) > > > > * Memory Address Space

Re: [PATCH v2 4/8] cxl/mem: Add basic IOCTL interface

2021-02-11 Thread Jonathan Cameron
On Wed, 10 Feb 2021 20:40:52 -0800 Dan Williams wrote: > On Wed, Feb 10, 2021 at 10:47 AM Jonathan Cameron > wrote: > [..] > > > +#define CXL_CMDS > > > \ > > > + ___C(INVALID, "Invalid Command"), \ >

Re: [PATCH v2 2/8] cxl/mem: Find device capabilities

2021-02-11 Thread Jonathan Cameron
On Wed, 10 Feb 2021 11:54:29 -0800 Dan Williams wrote: > > > ... > > > > > > > +static void cxl_mem_mbox_timeout(struct cxl_mem *cxlm, > > > > +struct mbox_cmd *mbox_cmd) > > > > +{ > > > > + struct device *dev = >pdev->dev; > > > > + > > > > + dev_dbg(dev,

Re: [PATCH v17 07/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-02-11 Thread David Hildenbrand
On 11.02.21 10:38, Michal Hocko wrote: On Thu 11-02-21 10:01:32, David Hildenbrand wrote: [...] AFAIKS, we would need MFD_SECRET and disallow MFD_ALLOW_SEALING and MFD_HUGETLB. Yes for an initial version. But I do expect a request to support both features is just a matter of time. In

Re: [PATCH v2 2/8] cxl/mem: Find device capabilities

2021-02-11 Thread Jonathan Cameron
On Wed, 10 Feb 2021 10:16:05 -0800 Ben Widawsky wrote: > On 21-02-10 08:55:57, Ben Widawsky wrote: > > On 21-02-10 15:07:59, Jonathan Cameron wrote: > > > On Wed, 10 Feb 2021 13:32:52 + > > > Jonathan Cameron wrote: > > > > > > > On Tue, 9 Feb 2021 16:02:53 -0800 > > > > Ben Widawsky

Re: [PATCH v17 07/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-02-11 Thread David Hildenbrand
Some random thoughts regarding files. What is the page size of secretmem memory? Sometimes we use huge pages, sometimes we fallback to 4k pages. So I assume huge pages in general? Unless there is an explicit request for hugetlb I would say the page size is not really important like for any

Re: [PATCH v17 07/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-02-11 Thread David Hildenbrand
On 11.02.21 09:39, Michal Hocko wrote: On Thu 11-02-21 09:13:19, Mike Rapoport wrote: On Tue, Feb 09, 2021 at 02:17:11PM +0100, Michal Hocko wrote: On Tue 09-02-21 11:09:38, Mike Rapoport wrote: [...] Citing my older email: I've hesitated whether to continue to use new flags to