cxl.json 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555
  1. # -*- Mode: Python -*-
  2. # vim: filetype=python
  3. ##
  4. # = CXL devices
  5. ##
  6. ##
  7. # @CxlEventLog:
  8. #
  9. # CXL has a number of separate event logs for different types of
  10. # events. Each such event log is handled and signaled independently.
  11. #
  12. # @informational: Information Event Log
  13. #
  14. # @warning: Warning Event Log
  15. #
  16. # @failure: Failure Event Log
  17. #
  18. # @fatal: Fatal Event Log
  19. #
  20. # Since: 8.1
  21. ##
  22. { 'enum': 'CxlEventLog',
  23. 'data': ['informational',
  24. 'warning',
  25. 'failure',
  26. 'fatal']
  27. }
  28. ##
  29. # @cxl-inject-general-media-event:
  30. #
  31. # Inject an event record for a General Media Event (CXL r3.0
  32. # 8.2.9.2.1.1). This event type is reported via one of the event logs
  33. # specified via the log parameter.
  34. #
  35. # @path: CXL type 3 device canonical QOM path
  36. #
  37. # @log: event log to add the event to
  38. #
  39. # @flags: Event Record Flags. See CXL r3.0 Table 8-42 Common Event
  40. # Record Format, Event Record Flags for subfield definitions.
  41. #
  42. # @dpa: Device Physical Address (relative to @path device). Note
  43. # lower bits include some flags. See CXL r3.0 Table 8-43 General
  44. # Media Event Record, Physical Address.
  45. #
  46. # @descriptor: Memory Event Descriptor with additional memory event
  47. # information. See CXL r3.0 Table 8-43 General Media Event
  48. # Record, Memory Event Descriptor for bit definitions.
  49. #
  50. # @type: Type of memory event that occurred. See CXL r3.0 Table 8-43
  51. # General Media Event Record, Memory Event Type for possible
  52. # values.
  53. #
  54. # @transaction-type: Type of first transaction that caused the event
  55. # to occur. See CXL r3.0 Table 8-43 General Media Event Record,
  56. # Transaction Type for possible values.
  57. #
  58. # @channel: The channel of the memory event location. A channel is an
  59. # interface that can be independently accessed for a transaction.
  60. #
  61. # @rank: The rank of the memory event location. A rank is a set of
  62. # memory devices on a channel that together execute a transaction.
  63. #
  64. # @device: Bitmask that represents all devices in the rank associated
  65. # with the memory event location.
  66. #
  67. # @component-id: Device specific component identifier for the event.
  68. # May describe a field replaceable sub-component of the device.
  69. #
  70. # Since: 8.1
  71. ##
  72. { 'command': 'cxl-inject-general-media-event',
  73. 'data': { 'path': 'str', 'log': 'CxlEventLog', 'flags': 'uint8',
  74. 'dpa': 'uint64', 'descriptor': 'uint8',
  75. 'type': 'uint8', 'transaction-type': 'uint8',
  76. '*channel': 'uint8', '*rank': 'uint8',
  77. '*device': 'uint32', '*component-id': 'str' } }
  78. ##
  79. # @cxl-inject-dram-event:
  80. #
  81. # Inject an event record for a DRAM Event (CXL r3.0 8.2.9.2.1.2).
  82. # This event type is reported via one of the event logs specified via
  83. # the log parameter.
  84. #
  85. # @path: CXL type 3 device canonical QOM path
  86. #
  87. # @log: Event log to add the event to
  88. #
  89. # @flags: Event Record Flags. See CXL r3.0 Table 8-42 Common Event
  90. # Record Format, Event Record Flags for subfield definitions.
  91. #
  92. # @dpa: Device Physical Address (relative to @path device). Note
  93. # lower bits include some flags. See CXL r3.0 Table 8-44 DRAM
  94. # Event Record, Physical Address.
  95. #
  96. # @descriptor: Memory Event Descriptor with additional memory event
  97. # information. See CXL r3.0 Table 8-44 DRAM Event Record, Memory
  98. # Event Descriptor for bit definitions.
  99. #
  100. # @type: Type of memory event that occurred. See CXL r3.0 Table 8-44
  101. # DRAM Event Record, Memory Event Type for possible values.
  102. #
  103. # @transaction-type: Type of first transaction that caused the event
  104. # to occur. See CXL r3.0 Table 8-44 DRAM Event Record,
  105. # Transaction Type for possible values.
  106. #
  107. # @channel: The channel of the memory event location. A channel is an
  108. # interface that can be independently accessed for a transaction.
  109. #
  110. # @rank: The rank of the memory event location. A rank is a set of
  111. # memory devices on a channel that together execute a transaction.
  112. #
  113. # @nibble-mask: Identifies one or more nibbles that the error affects
  114. #
  115. # @bank-group: Bank group of the memory event location, incorporating
  116. # a number of Banks.
  117. #
  118. # @bank: Bank of the memory event location. A single bank is accessed
  119. # per read or write of the memory.
  120. #
  121. # @row: Row address within the DRAM.
  122. #
  123. # @column: Column address within the DRAM.
  124. #
  125. # @correction-mask: Bits within each nibble. Used in order of bits
  126. # set in the nibble-mask. Up to 4 nibbles may be covered.
  127. #
  128. # Since: 8.1
  129. ##
  130. { 'command': 'cxl-inject-dram-event',
  131. 'data': { 'path': 'str', 'log': 'CxlEventLog', 'flags': 'uint8',
  132. 'dpa': 'uint64', 'descriptor': 'uint8',
  133. 'type': 'uint8', 'transaction-type': 'uint8',
  134. '*channel': 'uint8', '*rank': 'uint8', '*nibble-mask': 'uint32',
  135. '*bank-group': 'uint8', '*bank': 'uint8', '*row': 'uint32',
  136. '*column': 'uint16', '*correction-mask': [ 'uint64' ]
  137. }}
  138. ##
  139. # @cxl-inject-memory-module-event:
  140. #
  141. # Inject an event record for a Memory Module Event (CXL r3.0
  142. # 8.2.9.2.1.3). This event includes a copy of the Device Health info
  143. # at the time of the event.
  144. #
  145. # @path: CXL type 3 device canonical QOM path
  146. #
  147. # @log: Event Log to add the event to
  148. #
  149. # @flags: Event Record Flags. See CXL r3.0 Table 8-42 Common Event
  150. # Record Format, Event Record Flags for subfield definitions.
  151. #
  152. # @type: Device Event Type. See CXL r3.0 Table 8-45 Memory Module
  153. # Event Record for bit definitions for bit definiions.
  154. #
  155. # @health-status: Overall health summary bitmap. See CXL r3.0 Table
  156. # 8-100 Get Health Info Output Payload, Health Status for bit
  157. # definitions.
  158. #
  159. # @media-status: Overall media health summary. See CXL r3.0 Table
  160. # 8-100 Get Health Info Output Payload, Media Status for bit
  161. # definitions.
  162. #
  163. # @additional-status: See CXL r3.0 Table 8-100 Get Health Info Output
  164. # Payload, Additional Status for subfield definitions.
  165. #
  166. # @life-used: Percentage (0-100) of factory expected life span.
  167. #
  168. # @temperature: Device temperature in degrees Celsius.
  169. #
  170. # @dirty-shutdown-count: Number of times the device has been unable to
  171. # determine whether data loss may have occurred.
  172. #
  173. # @corrected-volatile-error-count: Total number of correctable errors
  174. # in volatile memory.
  175. #
  176. # @corrected-persistent-error-count: Total number of correctable
  177. # errors in persistent memory
  178. #
  179. # Since: 8.1
  180. ##
  181. { 'command': 'cxl-inject-memory-module-event',
  182. 'data': { 'path': 'str', 'log': 'CxlEventLog', 'flags' : 'uint8',
  183. 'type': 'uint8', 'health-status': 'uint8',
  184. 'media-status': 'uint8', 'additional-status': 'uint8',
  185. 'life-used': 'uint8', 'temperature' : 'int16',
  186. 'dirty-shutdown-count': 'uint32',
  187. 'corrected-volatile-error-count': 'uint32',
  188. 'corrected-persistent-error-count': 'uint32'
  189. }}
  190. ##
  191. # @cxl-inject-poison:
  192. #
  193. # Poison records indicate that a CXL memory device knows that a
  194. # particular memory region may be corrupted. This may be because of
  195. # locally detected errors (e.g. ECC failure) or poisoned writes
  196. # received from other components in the system. This injection
  197. # mechanism enables testing of the OS handling of poison records which
  198. # may be queried via the CXL mailbox.
  199. #
  200. # @path: CXL type 3 device canonical QOM path
  201. #
  202. # @start: Start address; must be 64 byte aligned.
  203. #
  204. # @length: Length of poison to inject; must be a multiple of 64 bytes.
  205. #
  206. # Since: 8.1
  207. ##
  208. { 'command': 'cxl-inject-poison',
  209. 'data': { 'path': 'str', 'start': 'uint64', 'length': 'size' }}
  210. ##
  211. # @CxlUncorErrorType:
  212. #
  213. # Type of uncorrectable CXL error to inject. These errors are
  214. # reported via an AER uncorrectable internal error with additional
  215. # information logged at the CXL device.
  216. #
  217. # @cache-data-parity: Data error such as data parity or data ECC error
  218. # CXL.cache
  219. #
  220. # @cache-address-parity: Address parity or other errors associated
  221. # with the address field on CXL.cache
  222. #
  223. # @cache-be-parity: Byte enable parity or other byte enable errors on
  224. # CXL.cache
  225. #
  226. # @cache-data-ecc: ECC error on CXL.cache
  227. #
  228. # @mem-data-parity: Data error such as data parity or data ECC error
  229. # on CXL.mem
  230. #
  231. # @mem-address-parity: Address parity or other errors associated with
  232. # the address field on CXL.mem
  233. #
  234. # @mem-be-parity: Byte enable parity or other byte enable errors on
  235. # CXL.mem.
  236. #
  237. # @mem-data-ecc: Data ECC error on CXL.mem.
  238. #
  239. # @reinit-threshold: REINIT threshold hit.
  240. #
  241. # @rsvd-encoding: Received unrecognized encoding.
  242. #
  243. # @poison-received: Received poison from the peer.
  244. #
  245. # @receiver-overflow: Buffer overflows (first 3 bits of header log
  246. # indicate which)
  247. #
  248. # @internal: Component specific error
  249. #
  250. # @cxl-ide-tx: Integrity and data encryption tx error.
  251. #
  252. # @cxl-ide-rx: Integrity and data encryption rx error.
  253. #
  254. # Since: 8.0
  255. ##
  256. { 'enum': 'CxlUncorErrorType',
  257. 'data': ['cache-data-parity',
  258. 'cache-address-parity',
  259. 'cache-be-parity',
  260. 'cache-data-ecc',
  261. 'mem-data-parity',
  262. 'mem-address-parity',
  263. 'mem-be-parity',
  264. 'mem-data-ecc',
  265. 'reinit-threshold',
  266. 'rsvd-encoding',
  267. 'poison-received',
  268. 'receiver-overflow',
  269. 'internal',
  270. 'cxl-ide-tx',
  271. 'cxl-ide-rx'
  272. ]
  273. }
  274. ##
  275. # @CXLUncorErrorRecord:
  276. #
  277. # Record of a single error including header log.
  278. #
  279. # @type: Type of error
  280. #
  281. # @header: 16 DWORD of header.
  282. #
  283. # Since: 8.0
  284. ##
  285. { 'struct': 'CXLUncorErrorRecord',
  286. 'data': {
  287. 'type': 'CxlUncorErrorType',
  288. 'header': [ 'uint32' ]
  289. }
  290. }
  291. ##
  292. # @cxl-inject-uncorrectable-errors:
  293. #
  294. # Command to allow injection of multiple errors in one go. This
  295. # allows testing of multiple header log handling in the OS.
  296. #
  297. # @path: CXL Type 3 device canonical QOM path
  298. #
  299. # @errors: Errors to inject
  300. #
  301. # Since: 8.0
  302. ##
  303. { 'command': 'cxl-inject-uncorrectable-errors',
  304. 'data': { 'path': 'str',
  305. 'errors': [ 'CXLUncorErrorRecord' ] }}
  306. ##
  307. # @CxlCorErrorType:
  308. #
  309. # Type of CXL correctable error to inject
  310. #
  311. # @cache-data-ecc: Data ECC error on CXL.cache
  312. #
  313. # @mem-data-ecc: Data ECC error on CXL.mem
  314. #
  315. # @crc-threshold: Component specific and applicable to 68 byte Flit
  316. # mode only.
  317. #
  318. # @retry-threshold: Retry threshold hit in the Local Retry State
  319. # Machine, 68B Flits only.
  320. #
  321. # @cache-poison-received: Received poison from a peer on CXL.cache.
  322. #
  323. # @mem-poison-received: Received poison from a peer on CXL.mem
  324. #
  325. # @physical: Received error indication from the physical layer.
  326. #
  327. # Since: 8.0
  328. ##
  329. { 'enum': 'CxlCorErrorType',
  330. 'data': ['cache-data-ecc',
  331. 'mem-data-ecc',
  332. 'crc-threshold',
  333. 'retry-threshold',
  334. 'cache-poison-received',
  335. 'mem-poison-received',
  336. 'physical']
  337. }
  338. ##
  339. # @cxl-inject-correctable-error:
  340. #
  341. # Command to inject a single correctable error. Multiple error
  342. # injection of this error type is not interesting as there is no
  343. # associated header log. These errors are reported via AER as a
  344. # correctable internal error, with additional detail available from
  345. # the CXL device.
  346. #
  347. # @path: CXL Type 3 device canonical QOM path
  348. #
  349. # @type: Type of error.
  350. #
  351. # Since: 8.0
  352. ##
  353. {'command': 'cxl-inject-correctable-error',
  354. 'data': {'path': 'str', 'type': 'CxlCorErrorType'}}
  355. ##
  356. # @CxlDynamicCapacityExtent:
  357. #
  358. # A single dynamic capacity extent. This is a contiguous allocation
  359. # of memory by Device Physical Address within a single Dynamic
  360. # Capacity Region on a CXL Type 3 Device.
  361. #
  362. # @offset: The offset (in bytes) to the start of the region where the
  363. # extent belongs to.
  364. #
  365. # @len: The length of the extent in bytes.
  366. #
  367. # Since: 9.1
  368. ##
  369. { 'struct': 'CxlDynamicCapacityExtent',
  370. 'data': {
  371. 'offset':'uint64',
  372. 'len': 'uint64'
  373. }
  374. }
  375. ##
  376. # @CxlExtentSelectionPolicy:
  377. #
  378. # The policy to use for selecting which extents comprise the added
  379. # capacity, as defined in Compute Express Link (CXL) Specification,
  380. # Revision 3.1, Table 7-70.
  381. #
  382. # @free: Device is responsible for allocating the requested memory
  383. # capacity and is free to do this using any combination of
  384. # supported extents.
  385. #
  386. # @contiguous: Device is responsible for allocating the requested
  387. # memory capacity but must do so as a single contiguous
  388. # extent.
  389. #
  390. # @prescriptive: The precise set of extents to be allocated is
  391. # specified by the command. Thus allocation is being managed
  392. # by the issuer of the allocation command, not the device.
  393. #
  394. # @enable-shared-access: Capacity has already been allocated to a
  395. # different host using free, contiguous or prescriptive policy
  396. # with a known tag. This policy then instructs the device to make
  397. # the capacity with the specified tag available to an additional
  398. # host. Capacity is implicit as it matches that already
  399. # associated with the tag. Note that the extent list (and hence
  400. # Device Physical Addresses) used are per host, so a device may
  401. # use different representations on each host. The ordering of the
  402. # extents provided to each host is indicated to the host using per
  403. # extent sequence numbers generated by the device. Has a similar
  404. # meaning for temporal sharing, but in that case there may be only
  405. # one host involved.
  406. #
  407. # Since: 9.1
  408. ##
  409. { 'enum': 'CxlExtentSelectionPolicy',
  410. 'data': ['free',
  411. 'contiguous',
  412. 'prescriptive',
  413. 'enable-shared-access']
  414. }
  415. ##
  416. # @cxl-add-dynamic-capacity:
  417. #
  418. # Initiate adding dynamic capacity extents to a host. This simulates
  419. # operations defined in Compute Express Link (CXL) Specification,
  420. # Revision 3.1, Section 7.6.7.6.5. Note that, currently, establishing
  421. # success or failure of the full Add Dynamic Capacity flow requires
  422. # out of band communication with the OS of the CXL host.
  423. #
  424. # @path: path to the CXL Dynamic Capacity Device in the QOM tree.
  425. #
  426. # @host-id: The "Host ID" field as defined in Compute Express Link
  427. # (CXL) Specification, Revision 3.1, Table 7-70.
  428. #
  429. # @selection-policy: The "Selection Policy" bits as defined in
  430. # Compute Express Link (CXL) Specification, Revision 3.1,
  431. # Table 7-70. It specifies the policy to use for selecting
  432. # which extents comprise the added capacity.
  433. #
  434. # @region: The "Region Number" field as defined in Compute Express
  435. # Link (CXL) Specification, Revision 3.1, Table 7-70. Valid
  436. # range is from 0-7.
  437. #
  438. # @tag: The "Tag" field as defined in Compute Express Link (CXL)
  439. # Specification, Revision 3.1, Table 7-70.
  440. #
  441. # @extents: The "Extent List" field as defined in Compute Express Link
  442. # (CXL) Specification, Revision 3.1, Table 7-70.
  443. #
  444. # Features:
  445. #
  446. # @unstable: For now this command is subject to change.
  447. #
  448. # Since: 9.1
  449. ##
  450. { 'command': 'cxl-add-dynamic-capacity',
  451. 'data': { 'path': 'str',
  452. 'host-id': 'uint16',
  453. 'selection-policy': 'CxlExtentSelectionPolicy',
  454. 'region': 'uint8',
  455. '*tag': 'str',
  456. 'extents': [ 'CxlDynamicCapacityExtent' ]
  457. },
  458. 'features': [ 'unstable' ]
  459. }
  460. ##
  461. # @CxlExtentRemovalPolicy:
  462. #
  463. # The policy to use for selecting which extents comprise the released
  464. # capacity, defined in the "Flags" field in Compute Express Link (CXL)
  465. # Specification, Revision 3.1, Table 7-71.
  466. #
  467. # @tag-based: Extents are selected by the device based on tag, with
  468. # no requirement for contiguous extents.
  469. #
  470. # @prescriptive: Extent list of capacity to release is included in
  471. # the request payload.
  472. #
  473. # Since: 9.1
  474. ##
  475. { 'enum': 'CxlExtentRemovalPolicy',
  476. 'data': ['tag-based',
  477. 'prescriptive']
  478. }
  479. ##
  480. # @cxl-release-dynamic-capacity:
  481. #
  482. # Initiate release of dynamic capacity extents from a host. This
  483. # simulates operations defined in Compute Express Link (CXL)
  484. # Specification, Revision 3.1, Section 7.6.7.6.6. Note that,
  485. # currently, success or failure of the full Release Dynamic Capacity
  486. # flow requires out of band communication with the OS of the CXL host.
  487. #
  488. # @path: path to the CXL Dynamic Capacity Device in the QOM tree.
  489. #
  490. # @host-id: The "Host ID" field as defined in Compute Express Link
  491. # (CXL) Specification, Revision 3.1, Table 7-71.
  492. #
  493. # @removal-policy: Bit[3:0] of the "Flags" field as defined in
  494. # Compute Express Link (CXL) Specification, Revision 3.1,
  495. # Table 7-71.
  496. #
  497. # @forced-removal: Bit[4] of the "Flags" field in Compute Express
  498. # Link (CXL) Specification, Revision 3.1, Table 7-71. When set,
  499. # the device does not wait for a Release Dynamic Capacity command
  500. # from the host. Instead, the host immediately looses access to
  501. # the released capacity.
  502. #
  503. # @sanitize-on-release: Bit[5] of the "Flags" field in Compute Express
  504. # Link (CXL) Specification, Revision 3.1, Table 7-71. When set,
  505. # the device should sanitize all released capacity as a result of
  506. # this request. This ensures that all user data and metadata is
  507. # made permanently unavailable by whatever means is appropriate
  508. # for the media type. Note that changing encryption keys is not
  509. # sufficient.
  510. #
  511. # @region: The "Region Number" field as defined in Compute Express
  512. # Link Specification, Revision 3.1, Table 7-71. Valid range
  513. # is from 0-7.
  514. #
  515. # @tag: The "Tag" field as defined in Compute Express Link (CXL)
  516. # Specification, Revision 3.1, Table 7-71.
  517. #
  518. # @extents: The "Extent List" field as defined in Compute Express
  519. # Link (CXL) Specification, Revision 3.1, Table 7-71.
  520. #
  521. # Features:
  522. #
  523. # @unstable: For now this command is subject to change.
  524. #
  525. # Since: 9.1
  526. ##
  527. { 'command': 'cxl-release-dynamic-capacity',
  528. 'data': { 'path': 'str',
  529. 'host-id': 'uint16',
  530. 'removal-policy': 'CxlExtentRemovalPolicy',
  531. '*forced-removal': 'bool',
  532. '*sanitize-on-release': 'bool',
  533. 'region': 'uint8',
  534. '*tag': 'str',
  535. 'extents': [ 'CxlDynamicCapacityExtent' ]
  536. },
  537. 'features': [ 'unstable' ]
  538. }