Linux CXL
 help / color / mirror / Atom feed
From: "Dan Williams" <djbw@kernel.org>
To: "Davidlohr Bueso" <dave@stgolabs.net>,
	"Dave Jiang" <dave.jiang@intel.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"Alison Schofield" <alison.schofield@intel.com>,
	ira.weiny@intel.com, dongjoo.seo1@samsung.com,
	anisa.su@samsung.com, linux-cxl@vger.kernel.org
Subject: Re: [PATCH v2] cxl/mbox: Support Media Operation
Date: Sat, 02 May 2026 15:53:30 -0700	[thread overview]
Message-ID: <9f73073f-09f0-4e08-b1d8-746be33fd674@app.fastmail.com> (raw)
In-Reply-To: <20260502193429.hztbijgv3bjwit5k@offworld>

K

On Sat, May 2, 2026, at 12:34 PM, Davidlohr Bueso wrote:
> On Tue, 28 Apr 2026, Dave Jiang wrote:
>>> +What:		/sys/bus/cxl/devices/memX/security/zero
>>> +Date:		April, 2026
>>> +KernelVersion:	v7.2
>>> +Contact:	linux-cxl@vger.kernel.org
>>> +Description:
>>> +		(WO) Write a DPA range as 'start length' in bytes to this
>>
>>Same comment about multiple input in a single attribute. Maybe introduce these:
>>
>>security/zero_start_dpa
>>security/zero_len
>>security/zero
>
> I had missed this feedback - this suggested interface is horrible. While the
> sysfs documentation mentions the one rule per file, this is not strict and
> (as Jonathan also agreed previously) we can do <start> <len> inputs. There
> are plenty of examples that do not follow this rule when it makes sense.
>
> So my follow up patches will do
>
> echo <start_dpa> <len> > /sys/bus/cxl/devices/mem0/security/sanitize_range
> echo <start_dpa> <len> > /sys/bus/cxl/devices/mem0/security/zero_range
>

Isn't a "start:len" tuple ABI a solved problem? It would be nice to share the same parsing as memmap=. For example, then you get features like "echo 1G:1G ..." to specify a range.

However does userspace really need to pick ranges? Would it be sufficient to start with a "sanitize / zero all unmapped" semantic to walk all not mapped DPA. Or perhaps a "sanitize / zero on unmap" flag to the decoder to make it similar to a storage "trim on delete" semantic. The nice thing about that, you can defer freeing the DPA until it's clean to avoid reallocation races. You actually know what you're zapping because it had some recent prior association.

Otherwise I do not trust the security properties of policy wanting to clean a DPA range but an unsuspecting thread can race to allocate between lock drops. Looks like a footgun.

What use case is missed with a per decoder automatic cleaning on unmap setting? Zero before map policy might be nice too...

  reply	other threads:[~2026-05-02 22:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28 20:04 [PATCH v2] cxl/mbox: Support Media Operation Davidlohr Bueso
2026-04-28 23:51 ` Dave Jiang
2026-04-29 19:06   ` Davidlohr Bueso
2026-04-29 19:13     ` Dave Jiang
2026-05-02 19:34   ` Davidlohr Bueso
2026-05-02 22:53     ` Dan Williams [this message]
2026-05-07 12:09       ` Davidlohr Bueso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f73073f-09f0-4e08-b1d8-746be33fd674@app.fastmail.com \
    --to=djbw@kernel.org \
    --cc=alison.schofield@intel.com \
    --cc=anisa.su@samsung.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=dongjoo.seo1@samsung.com \
    --cc=ira.weiny@intel.com \
    --cc=jic23@kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox