Re: [Linux-nvdimm] [PATCH 04/21] nd: create an 'nd_bus' from an 'nfit_desc'

From: Toshi Kani
Date: Tue Apr 28 2015 - 13:06:28 EST


On Wed, 2015-04-22 at 13:00 -0700, Dan Williams wrote:
> On Wed, Apr 22, 2015 at 12:38 PM, Toshi Kani <toshi.kani@xxxxxx> wrote:
> > On Wed, 2015-04-22 at 12:28 -0700, Dan Williams wrote:
> >> On Wed, Apr 22, 2015 at 11:23 AM, Toshi Kani <toshi.kani@xxxxxx> wrote:
> >> > On Wed, 2015-04-22 at 11:20 -0700, Dan Williams wrote:
> >> >> On Wed, Apr 22, 2015 at 11:00 AM, Linda Knippers <linda.knippers@xxxxxx> wrote:
> >> >> Wait, point of clarification, DCRs (dimm-control-regions) have RFICs,
> >> >> not MEMDEVs (memory-device-to-spa-mapping). Toshi's original report
> >> >> was that an NFIT with a SPA+MEMDEV was failing to enable a PMEM
> >> >> device. That specific problem can be fixed by either deleting the
> >> >> MEMDEV, or adding a DCR.
> >> >
> >> > By a DCR, do you mean a DCR structure or SPA with Control Region GUID?
> >>
> >> Hmm, I meant a DCR as defined below. I agree you would not need a "SPA-DCR".
> >>
> >> > Adding a DCR structure does not solve this issue since it requires SPA
> >> > with Control Region GUID, which battery-backed DIMMs do not have.
> >>
> >> I would not go that far, half of a DCR entry is relevant for any
> >> NVDIMM, and half is only relevant if a DIMM offers BLK access:
> >>
> >> struct acpi_nfit_dcr {
> >> u16 type;
> >> u16 length;
> >> u16 dcr_index;
> >> u16 vendor_id;
> >> u16 device_id;
> >> u16 revision_id;
> >> u16 sub_vendor_id;
> >> u16 sub_device_id;
> >> u16 sub_revision_id;
> >> u8 reserved[6];
> >> u32 serial_number;
> >> u16 fic;
> >> <<<<< BLK relevant fields start here <<<<<
> >> u16 num_bcw;
> >> u64 bcw_size;
> >> u64 cmd_offset;
> >> u64 cmd_size;
> >> u64 status_offset;
> >> u64 status_size;
> >> u16 flags;
> >> u8 reserved2[6];
> >> };
> >
> > Yes, we do have a DCR entry. But we do not have a SPA-DCR.
>
> Got it. will fix.

Attached is an example implementation of the NFIT table with 2
battery-backed NVDIMM cards, which I have used for testing. I hope this
provides a good example of an NFIT table with SPA(PMEM), MEMDEV and DCR
entries, which allows optional _DSMs for battery-backed NVDIMMs as
necessary.

HP is also defining _DSM method for battery-backed NVDIMMs, and will
share the spec when it is ready.

Thanks,
-Toshi




Thanks,
-Toshi








ÿþ*****************************************************************************

* NVDIMM Firmware Interface Table *

*****************************************************************************

NFIT address ............................................. 0x000000007B7E7000

Table Header:

Signature ............................................ 'NFIT'

Length ............................................... 0x00000138

Revision ............................................. 0x01

Checksum ............................................. 0x4A

OEMID ................................................ 'HP '

OEM Table ID ......................................... 'ProLiant'

OEM Revision ......................................... 0x00000001

Creator ID ........................................... 'HP '

Creator Revision ..................................... 0x00000001

Table Contents:



*************************************************************************

* NFIT System Physical Address Range Structure *

*************************************************************************

Range Index ........................................ 0x0001

Flags .............................................. 0x0002

Hotplug Enabled ................................. 0x00

Proximity Domain Valid .......................... 0x02

Proximity Domain ................................... 0x00000000

Address Range Type ................................. 66F0D379-B4F3-4074-AC43-0D3318B78CDB

Address Range Base ................................. 0x0000000480000000

Address Range Length ............................... 0x0000000200000000

Address Range Attributes ........................... 0x000000000000800F

*************************************************************************



*************************************************************************

* NFIT Memory Device Address Range Map Structure *

*************************************************************************

Device Handle ...................................... 0x00000010

Device Physical ID ................................. 0x0014

Device Region ID ................................... 0x0000

Range Index ........................................ 0x0001

Control Region Index ............................... 0x0001

Region Size ........................................ 0x0000000200000000

Region Offset ...................................... 0x0000000000000000

Device Address Base ................................ 0x0000000480000000

Interleave Index ................................... 0x0000

Interleave Ways .................................... 0x0001

State Flags ........................................ 0x0000

Save Failed ..................................... 0x00

Restore Failed .................................. 0x00

Flush Failed .................................... 0x00

Not Armed ....................................... 0x00

Smart Events .................................... 0x00

Smart Notify .................................... 0x00

*************************************************************************



*************************************************************************

* NFIT NVDIMM Control Region Structure *

*************************************************************************

Structure Index .................................... 0x0001

Vendor ID .......................................... 0x2C00

Device ID .......................................... 0x8001

Revision ID ........................................ 0x0059

Subsystem Vendor ID ................................ 0x012C

Subsystem Device ID ................................ 0x0010

Subsystem Revision ID .............................. 0x0000

Serial Number ...................................... 0xA94500B3

Region Format ...................................... 0x0101

Control Window Count ............................... 0x0000

*************************************************************************



*************************************************************************

* NFIT System Physical Address Range Structure *

*************************************************************************

Range Index ........................................ 0x0002

Flags .............................................. 0x0002

Hotplug Enabled ................................. 0x00

Proximity Domain Valid .......................... 0x02

Proximity Domain ................................... 0x00000001

Address Range Type ................................. 66F0D379-B4F3-4074-AC43-0D3318B78CDB

Address Range Base ................................. 0x0000000A80000000

Address Range Length ............................... 0x0000000200000000

Address Range Attributes ........................... 0x000000000000800F

*************************************************************************



*************************************************************************

* NFIT Memory Device Address Range Map Structure *

*************************************************************************

Device Handle ...................................... 0x00020110

Device Physical ID ................................. 0x0020

Device Region ID ................................... 0x0001

Range Index ........................................ 0x0002

Control Region Index ............................... 0x0002

Region Size ........................................ 0x0000000200000000

Region Offset ...................................... 0x0000000000000000

Device Address Base ................................ 0x0000000A80000000

Interleave Index ................................... 0x0000

Interleave Ways .................................... 0x0001

State Flags ........................................ 0x0000

Save Failed ..................................... 0x00

Restore Failed .................................. 0x00

Flush Failed .................................... 0x00

Not Armed ....................................... 0x00

Smart Events .................................... 0x00

Smart Notify .................................... 0x00

*************************************************************************



*************************************************************************

* NFIT NVDIMM Control Region Structure *

*************************************************************************

Structure Index .................................... 0x0002

Vendor ID .......................................... 0x2C00

Device ID .......................................... 0x8001

Revision ID ........................................ 0x0059

Subsystem Vendor ID ................................ 0x012C

Subsystem Device ID ................................ 0x0010

Subsystem Revision ID .............................. 0x0000

Serial Number ...................................... 0xA04500B3

Region Format ...................................... 0x0101

Control Window Count ............................... 0x0000

*************************************************************************