Controller register는 2장 내용중 PCI header 부분에서 나온 MLBAR/MUBAR (PCI BAR0, BAR1) register들을 통해 Host PC의 main memory 영역에 할당되어 있다. Host는 locked access를 할수 없다. 아래의 그림은 SSD controller에서 사용될 register들에 대한 정의이다. 

nvme-cli가 설치되어 있다는 전제하에 실행
#nvme show-regs /dev/nvme0
또는
#nvme show-regs /dev/nvme0 -H

2장에서처럼 마찬가지로 이번에는 controller의 register 값들을 보기 위해 nvme-cli 툴을 사용한다. nvme-cli는 nvme 디바이스에 대해 편리하게 사용하기 위한 commnad line 기반의 management tool이다.

# nvme show-regs --help 결과

nvme show-regs /dev/nvme0만 사용했을 경우엔 hex 값으로 값이 전부 보이며 -H 옵션을 주게 되면 human-readable 옵션으로 보기 좋게 바뀐다. 

# nvme show-regs /dev/nvme0 결과
# nvme show-regs /dev/nvme0 -H 결과

cap     : 200a010fff
	Controller Memory Buffer Supported (CMBS): The Controller Memory Buffer is Not Supported
	Persistent Memory Region Supported (PMRS): The Persistent Memory Region is Not Supported
	Memory Page Size Maximum	   (MPSMAX): 4096 bytes
	Memory Page Size Minimum         (MPSMIN): 4096 bytes
	Boot Partition Support              (BPS): No
	Command Sets Supported              (CSS): NVM command set is supported
	NVM Subsystem Reset Supported     (NSSRS): No
	Doorbell Stride                   (DSTRD): 4 bytes
	Timeout                              (TO): 5000 ms
	Arbitration Mechanism Supported     (AMS): Weighted Round Robin with Urgent Priority Class is not supported
	Contiguous Queues Required	      (CQR): Yes
	Maximum Queue Entries Supported    (MQES): 4096

version : 10200
	NVMe specification 1.2

cc      : 460001
	I/O Completion Queue Entry Size (IOCQES): 16 bytes
	I/O Submission Queue Entry Size (IOSQES): 64 bytes
	Shutdown Notification              (SHN): No notification; no effect
	Arbitration Mechanism Selected     (AMS): Round Robin
	Memory Page Size                   (MPS): 4096 bytes
	I/O Command Sets Selected          (CSS): NVM Command Set
	Enable                              (EN): Yes

csts    : 1
	Processing Paused               (PP): No
	NVM Subsystem Reset Occurred (NSSRO): No
	Shutdown Status               (SHST): Normal operation (no shutdown has been requested)
	Controller Fatal Status        (CFS): False
	Ready                          (RDY): Yes

nssr    : 0
	NVM Subsystem Reset Control (NSSRC): 0

intms   : 0
	Interrupt Vector Mask Set (IVMS): 0

intmc   : 0
	Interrupt Vector Mask Clear (IVMC): 0

aqa     : 1f001f
	Admin Completion Queue Size (ACQS): 32
	Admin Submission Queue Size (ASQS): 32

asq     : 303d9000
	Admin Submission Queue Base (ASQB): 303d9000

acq     : 34580000
	Admin Completion Queue Base (ACQB): 34580000

cmbloc  : 3
	Offset                                                        (OFST): 0x0 (See cmbsz.szu for granularity)
	CMB Queue Dword Alignment                                     (CQDA): 0
	CMB Data Metadata Mixed Memory Support                      (CDMMMS): Enforced
	CMB Data Pointer and Command Independent Locations Support (CDPCILS): Enforced
	CMB Data Pointer Mixed Locations Support                    (CDPMLS): Enforced
	CMB Queue Physically Discontiguous Support                   (CQPDS): Enforced
	CMB Queue Mixed Memory Support                               (CQMMS): Enforced
	Base Indicator Register                                        (BIR): 0x3

cmbsz   : 500003
	Size                      (SZ): 1280
	Size Units               (SZU): 4 KB
	Write Data Support       (WDS): Write Data and metadata transfer in Controller Memory Buffer is Not supported
	Read Data Support        (RDS): Read Data and metadata transfer in Controller Memory Buffer is Not supported
	PRP SGL List Support   (LISTS): PRP/SG Lists in Controller Memory Buffer is Not supported
	Completion Queue Support (CQS): Admin and I/O Completion Queues in Controller Memory Buffer is Supported
	Submission Queue Support (SQS): Admin and I/O Submission Queues in Controller Memory Buffer is Supported

bpinfo  : ffffffff
	Active Boot Partition ID      (ABPID): 1
	Boot Read Status                (BRS): Error completing Boot Partition read
	Boot Partition Size            (BPSZ): 32767
bprsel  : ffffffff
	Boot Partition Identifier      (BPID): 1
	Boot Partition Read Offset    (BPROF): fffff
	Boot Partition Read Size      (BPRSZ): 3ff
bpmbl   : ffffffffffffffff
	Boot Partition Memory Buffer Base Address (BMBBA): ffffffffffffffff
cmbmsc	: ffffffffffffffff
	Controller Base Address (CBA)	     : fffffffffffff
	Controller Memory Space Enable (CMSE): 1
	Capabilities Registers Enabled (CRE) : CMBLOC and CMBSZ registers are enabled

cmbsts	: ffffffff
	Controller Base Address Invalid (CBAI): 1

pmrcap  : ffffffff
	Controller Memory Space Supported (CMSS)		   : Referencing PMR with host supplied addresses is Supported
	Persistent Memory Region Timeout		    (PMRTO): ff
	Persistent Memory Region Write Barrier Mechanisms(PMRWBM): f
	Persistent Memory Region Time Units		    (PMRTU): PMR time unit is minutes
	Base Indicator Register			      (BIR): 7
	Write Data Support				      (WDS): Write data to the PMR is supported
	Read Data Support				      (RDS): Read data from the PMR is supported
pmrctl  : ffffffff
	Enable (EN): PMR is READY
pmrsts  : ffffffff
	Controller Base Address Invalid (CBAI): 1
	Health Status			  (HSTS): Reserved
	Not Ready			  (NRDY): The Persistent Memory Region is Not Ready to process PCI Express memory read and write requests
	Error				  (ERR) : ff
pmrebs  : ffffffff
	PMR Elasticity Buffer Size Base  (PMRWBZ): ffffff
	Read Bypass Behavior			   : memory reads not conflicting with memory writes in the PMR Elasticity Buffer SHALL bypass those memory writes
	PMR Elasticity Buffer Size Units (PMRSZU): Reserved
pmrswtp : ffffffff
	PMR Sustained Write Throughput       (PMRSWTV): ffffff
	PMR Sustained Write Throughput Units (PMRSWTU): Reserved/second
pmrmsc	: ffffffffffffffff
	Controller Base Address (CBA)		: fffffffffffff
	Controller Memory Space Enable (CMSE	: 0

 위 결과는 -H 옵션을 주고 실행했을때의 결과이다. 

  • CAP -controller capabilities
    • 8B의 크기를 가지고 있다.
    • 값: 0x200a010fff
    • controller의 특성을 host software에게 알려준다. 
    • nvme-cli에서는 admin passthru command를 통해 register 값을 읽어 온다.
    • Controller Memory Buffer Supported (CMBS): The Controller Memory Buffer is Not Supported 
    • Persistent Memory Region Supported (PMRS): The Persistent Memory Region is Not Supported 
    • Memory Page Size Maximum    (MPSMAX): 4096 bytes
    • Memory Page Size Minimum         (MPSMIN): 4096 bytes
    • Boot Partition Support              (BPS): No
    • Command Sets Supported              (CSS): NVM command set is supported
    • NVM Subsystem Reset Supported     (NSSRS): No
    • Doorbell Stride                   (DSTRD): 4 bytes
    • Timeout                              (TO): 5000 ms
    • Arbitration Mechanism Supported     (AMS): Weighted Round Robin with Urgent Priority Class is not supported
    • Contiguous Queues Required       (CQR): Yes
    • Maximum Queue Entries Supported    (MQES): 4096 

nvme-cli show-regs의 마지막 전달 과정

  • VS - version에 대한 것을 나타냄. 1.0 ~ 1.4까지 존재함. 
    • 4B를 가진다.
    • 값: 0x10200
    • NVMe specification 1.2

  • intms - interrupt mask set  
    • 4B를 가진다.
    • 값: 0 Interrupt Vector Mask Set (IVMS): 0 

  • intmc - interrupt mask clear
    • 4B를 가진다.
    • 값: 0 Interrupt Vector Mask Clear (IVMC): 0

  • CC - controller configuration
    • 해당 register는 controller를 위한 셋팅을 변경한다.
    • Host가 가능한 부분
      • Arbitraction mechanism (CC.AMS)
      • Memory page size (CC.MPS)
      • Command set (CC.CSS)
    • cc      : 460001
    • I/O Completion Queue Entry Size (IOCQES): 16 bytes
    • I/O Submission Queue Entry Size (IOSQES): 64 bytes
    • Shutdown Notification              (SHN): No notification; no effect
    • Arbitration Mechanism Selected     (AMS): Round Robin
    • Memory Page Size                   (MPS): 4096 bytes
    • I/O Command Sets Selected          (CSS): NVM Command Set
      • controller가 diable되었을대 (CC.EN == 0) 설정을 변경할 수 있다.
    • Enable                              (EN): Yes 

  • NSSR - NVM subsystem reset
    • NVM Subsystem Reset Control (NSSRC): 0
    • CAP.NSSRS와 관련

  • AQA - admin queue attributes
    • 값: 1f001f 
    • Admin Completion Queue Size (ACQS): 32
    • Admin Submission Queue Size (ASQS): 32 

  • asq     : 303d9000
    • Admin Submission Queue Base (ASQB): 303d9000
  • acq     : 34580000
    • Admin Completion Queue Base (ACQB): 34580000

cmbloc  : 3
Offset                                                        (OFST): 0x0
CMB Queue Dword Alignment                                     (CQDA): 0
CMB Data Metadata Mixed Memory Support                      (CDMMMS): Enforced
CMB Data Pointer and Command Independent Locations Support (CDPCILS): Enforced
CMB Data Pointer Mixed Locations Support                    (CDPMLS): Enforced
CMB Queue Physically Discontiguous Support                   (CQPDS): Enforced
CMB Queue Mixed Memory Support                               (CQMMS): Enforced
Base Indicator Register                                        (BIR): 0x3

cmbsz   : 500003
Size                      (SZ): 1280
Size Units               (SZU): 4 KB
Write Data Support       (WDS): Write Data and metadata transfer in Controller Memory Buffer is Not supported
Read Data Support        (RDS): Read Data and metadata transfer in Controller Memory Buffer is Not supported
PRP SGL List Support   (LISTS): PRP/SG Lists in Controller Memory Buffer is Not supported
Completion Queue Support (CQS): Admin and I/O Completion Queues in Controller Memory Buffer is Supported
Submission Queue Support (SQS): Admin and I/O Submission Queues in Controller Memory Buffer is Supported

bpinfo  : ffffffff
Active Boot Partition ID      (ABPID): 1
Boot Read Status                (BRS): Error completing Boot Partition read
Boot Partition Size            (BPSZ): 32767

bprsel  : ffffffff
Boot Partition Identifier      (BPID): 1
Boot Partition Read Offset    (BPROF): fffff
Boot Partition Read Size      (BPRSZ): 3ff

bpmbl   : ffffffffffffffff
Boot Partition Memory Buffer Base Address (BMBBA): ffffffffffffffff

cmbmsc : ffffffffffffffff
Controller Base Address (CBA)      : fffffffffffff
Controller Memory Space Enable (CMSE): 1
Capabilities Registers Enabled (CRE) : CMBLOC and CMBSZ registers are enabled

cmbsts : ffffffff
Controller Base Address Invalid (CBAI): 1

pmrcap  : ffffffff
Controller Memory Space Supported (CMSS)    : Referencing PMR with host supplied addresses is Supported
Persistent Memory Region Timeout     (PMRTO): ff
Persistent Memory Region Write Barrier Mechanisms(PMRWBM): f
Persistent Memory Region Time Units     (PMRTU): PMR time unit is minutes
Base Indicator Register       (BIR): 7
Write Data Support       (WDS): Write data to the PMR is supported
Read Data Support       (RDS): Read data from the PMR is supported

pmrctl  : ffffffff
Enable (EN): PMR is READY

pmrsts  : ffffffff
Controller Base Address Invalid (CBAI): 1
Health Status   (HSTS): Reserved
Not Ready   (NRDY): The Persistent Memory Region is Not Ready to process PCI Express memory read and write requests

pmrebs  : ffffffff
PMR Elasticity Buffer Size Base  (PMRWBZ): ffffff
Read Bypass Behavior    : memory reads not conflicting with memory writes in the PMR Elasticity Buffer SHALL bypass those memory writes
PMR Elasticity Buffer Size Units (PMRSZU): Reserved

pmrswtp : ffffffff
PMR Sustained Write Throughput       (PMRSWTV): ffffff
PMR Sustained Write Throughput Units (PMRSWTU): Reserved/second

pmrmsc : ffffffffffffffff
Controller Base Address (CBA) : fffffffffffff
Controller Memory Space Enable (CMSE : 0

+ Recent posts