> -----Original Message----- > From: Dave Jiang <[email protected]> > Sent: Wednesday, July 18, 2018 12:41 PM > To: Elliott, Robert (Persistent Memory) <[email protected]>; Williams, > Dan J <[email protected]> > Cc: [email protected]; Schofield, Alison > <[email protected]>; [email protected]; > [email protected]; [email protected] > Subject: Re: [PATCH v5 09/12] nfit/libnvdimm: add support for issue > secure erase DSM to Intel nvdimm > > > > On 07/18/2018 10:27 AM, Elliott, Robert (Persistent Memory) wrote: > > > > > >> -----Original Message----- > >> From: Linux-nvdimm [mailto:[email protected]] On > Behalf Of Dave Jiang > >> Sent: Tuesday, July 17, 2018 3:55 PM > >> Subject: [PATCH v5 09/12] nfit/libnvdimm: add support for issue > secure erase DSM to Intel nvdimm > > ... > > +static int intel_dimm_security_erase(struct nvdimm_bus > *nvdimm_bus, > >> +struct nvdimm *nvdimm, struct nvdimm_key_data *nkey) > > ... > >> +/* DIMM unlocked, invalidate all CPU caches before we read it */ > >> +wbinvd_on_all_cpus(); > > > > For this function, that comment should use "erased" rather than > > "unlocked". > > > > For both this function and intel_dimm_security_unlock() in patch > 04/12, > > could the driver do a loop of clflushopts on one CPU via > > clflush_cache_range() rather than run wbinvd on all CPUs? > > The loop should work, but wbinvd is going to be less overall impact > to the performance for really huge ranges. Also, unlock should happen > only once and during NVDIMM initialization. So wbinvd should be ok. Unlike unlock, secure erase could be requested at any time. wbinvd must run on every physical core on every physical CPU, while clflushopt flushes everything from just one CPU core. wbinvd adds huge interrupt latencies, generating complaints like these: https://patchwork.kernel.org/patch/37090/ https://lists.xenproject.org/archives/html/xen-devel/2011-09/msg00675.html Also, there's no need to disrupt cache content for other addresses; only the data at the addresses just erased or unlocked is a concern. clflushopt avoids disrupting other threads. Related topic: a flush is also necessary before sending the secure erase or unlock command. Otherwise, there could be dirty write data that gets written by the concluding flush (overwriting the now-unlocked or just-erased data). For unlock during boot, you might assume that no writes having occurred yet, but that isn't true for secure erase on demand. Flushing before both commands is safest. --- Robert Elliott, HPE Persistent Memory _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
RE: [PATCH v5 09/12] nfit/libnvdimm: add support for issue secure erase DSM to Intel nvdimm
Elliott, Robert (Persistent Memory) Wed, 18 Jul 2018 18:44:54 -0700
- Re: [PATCH v5 04/12] nfit/libnvdi... Eric Biggers
- [PATCH v5 03/12] nfit/libnvdimm: store... Dave Jiang
- RE: [PATCH v5 03/12] nfit/libnvdi... Elliott, Robert (Persistent Memory)
- Re: [PATCH v5 03/12] nfit/lib... Dave Jiang
- [PATCH v5 02/12] libnvdimm: create key... Dave Jiang
- Re: [PATCH v5 02/12] libnvdimm: c... Eric Biggers
- [PATCH v5 08/12] nfit/libnvdimm: add f... Dave Jiang
- [PATCH v5 09/12] nfit/libnvdimm: add s... Dave Jiang
- RE: [PATCH v5 09/12] nfit/libnvdi... Elliott, Robert (Persistent Memory)
- Re: [PATCH v5 09/12] nfit/lib... Dave Jiang
- RE: [PATCH v5 09/12] nfit... Elliott, Robert (Persistent Memory)
- RE: [PATCH v5 09/12] ... Li, Juston
- Re: [PATCH v5 09/12] ... Dave Jiang
- [PATCH v5 06/12] nfit/libnvdimm: add s... Dave Jiang
- [PATCH v5 10/12] nfit_test: add contex... Dave Jiang
- [PATCH v5 05/12] keys: add call key_pu... Dave Jiang
- Re: [PATCH v5 05/12] keys: add ca... Eric Biggers
- Re: [PATCH v5 05/12] keys: ad... Dave Jiang
- [PATCH v5 07/12] nfit/libnvdimm: add d... Dave Jiang
- [PATCH v5 11/12] nfit_test: add test s... Dave Jiang
- [PATCH v5 12/12] libnvdimm: add docume... Dave Jiang
