Linux CXL
 help / color / mirror / Atom feed
From: "Zhijian Li (Fujitsu)" <lizhijian@fujitsu.com>
To: Davidlohr Bueso <dave@stgolabs.net>,
	"alison.schofield@intel.com" <alison.schofield@intel.com>
Cc: "Yasunori Gotou (Fujitsu)" <y-goto@fujitsu.com>,
	"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>,
	"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>
Subject: Re: [PATCH v4 -ndctl] cxl/memdev: Introduce sanitize-memdev functionality
Date: Tue, 20 May 2025 03:00:22 +0000	[thread overview]
Message-ID: <e2defa61-8a12-4b5d-87b2-1271222edf28@fujitsu.com> (raw)
In-Reply-To: <20250318234543.562359-1-dave@stgolabs.net>


(Resend it again, my previous reply didn't appear in the lore.kernel.org)


On 19/03/2025 07:45, Davidlohr Bueso wrote:
> Add a new cxl_memdev_sanitize() to libcxl to support triggering memory
> device sanitation, in either Sanitize and/or Secure Erase, per the
> CXL 3.0 spec.
> 
> This is analogous to 'ndctl sanitize-dimm'.
> 
> Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
> ---

snip...

> +static int action_sanitize_memdev(struct cxl_memdev *memdev,
> +				  struct action_context *actx)
> +{
> +	int rc;
> +
> +	if (param.secure_erase)
> +		rc = cxl_memdev_sanitize(memdev, "erase");
> +        else
> +		rc = cxl_memdev_sanitize(memdev, "sanitize");
> +
> +	return rc;
> +}
> +

cxl_memdev_sanitize could fail for some reasons(lack of hardware support, device busy etc)

I'd like to log more details for the failure, something like:

+       if (rc) {
+               log_err(&ml, "one or more failures, last failure: %s\n",
+                       strerror(-rc));
+       }


Otherwise,
I tested it with QEMU and CXL_TEST, it worked

Tested-by: Li Zhijian <lizhijian@fujitsu.com>

  parent reply	other threads:[~2025-05-20  3:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18 23:45 [PATCH v4 -ndctl] cxl/memdev: Introduce sanitize-memdev functionality Davidlohr Bueso
2025-04-23 18:17 ` Alison Schofield
2025-05-13 19:42   ` Davidlohr Bueso
2025-05-15  9:04     ` Yasunori Gotou (Fujitsu)
2025-05-16  8:33       ` Yasunori Gotou (Fujitsu)
2025-05-20  3:00 ` Zhijian Li (Fujitsu) [this message]
2025-05-20  9:37   ` Yasunori Gotou (Fujitsu)

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=e2defa61-8a12-4b5d-87b2-1271222edf28@fujitsu.com \
    --to=lizhijian@fujitsu.com \
    --cc=alison.schofield@intel.com \
    --cc=dave@stgolabs.net \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=y-goto@fujitsu.com \
    /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