1415442a1SJonathan Cameron# -*- Mode: Python -*- 2415442a1SJonathan Cameron# vim: filetype=python 3415442a1SJonathan Cameron 4415442a1SJonathan Cameron## 5415442a1SJonathan Cameron# = CXL devices 6415442a1SJonathan Cameron## 7415442a1SJonathan Cameron 8415442a1SJonathan Cameron## 9ea9b6d64SIra Weiny# @CxlEventLog: 10ea9b6d64SIra Weiny# 11ea9b6d64SIra Weiny# CXL has a number of separate event logs for different types of 12ea9b6d64SIra Weiny# events. Each such event log is handled and signaled independently. 13ea9b6d64SIra Weiny# 14ea9b6d64SIra Weiny# @informational: Information Event Log 15ea9b6d64SIra Weiny# 16ea9b6d64SIra Weiny# @warning: Warning Event Log 17ea9b6d64SIra Weiny# 18ea9b6d64SIra Weiny# @failure: Failure Event Log 19ea9b6d64SIra Weiny# 20ea9b6d64SIra Weiny# @fatal: Fatal Event Log 21ea9b6d64SIra Weiny# 22ea9b6d64SIra Weiny# Since: 8.1 23ea9b6d64SIra Weiny## 24ea9b6d64SIra Weiny{ 'enum': 'CxlEventLog', 25ea9b6d64SIra Weiny 'data': ['informational', 26ea9b6d64SIra Weiny 'warning', 27ea9b6d64SIra Weiny 'failure', 28ea9b6d64SIra Weiny 'fatal'] 29ea9b6d64SIra Weiny } 30ea9b6d64SIra Weiny 31ea9b6d64SIra Weiny## 32ea9b6d64SIra Weiny# @cxl-inject-general-media-event: 33ea9b6d64SIra Weiny# 34ea9b6d64SIra Weiny# Inject an event record for a General Media Event (CXL r3.0 35ea9b6d64SIra Weiny# 8.2.9.2.1.1). This event type is reported via one of the event logs 36ea9b6d64SIra Weiny# specified via the log parameter. 37ea9b6d64SIra Weiny# 38ea9b6d64SIra Weiny# @path: CXL type 3 device canonical QOM path 39ea9b6d64SIra Weiny# 40ea9b6d64SIra Weiny# @log: event log to add the event to 41ea9b6d64SIra Weiny# 42ea9b6d64SIra Weiny# @flags: Event Record Flags. See CXL r3.0 Table 8-42 Common Event 43ea9b6d64SIra Weiny# Record Format, Event Record Flags for subfield definitions. 44ea9b6d64SIra Weiny# 45ea9b6d64SIra Weiny# @dpa: Device Physical Address (relative to @path device). Note 46ea9b6d64SIra Weiny# lower bits include some flags. See CXL r3.0 Table 8-43 General 47ea9b6d64SIra Weiny# Media Event Record, Physical Address. 48ea9b6d64SIra Weiny# 49ea9b6d64SIra Weiny# @descriptor: Memory Event Descriptor with additional memory event 50ea9b6d64SIra Weiny# information. See CXL r3.0 Table 8-43 General Media Event 51ea9b6d64SIra Weiny# Record, Memory Event Descriptor for bit definitions. 52ea9b6d64SIra Weiny# 53ea9b6d64SIra Weiny# @type: Type of memory event that occurred. See CXL r3.0 Table 8-43 54ea9b6d64SIra Weiny# General Media Event Record, Memory Event Type for possible 55ea9b6d64SIra Weiny# values. 56ea9b6d64SIra Weiny# 57ea9b6d64SIra Weiny# @transaction-type: Type of first transaction that caused the event 58ea9b6d64SIra Weiny# to occur. See CXL r3.0 Table 8-43 General Media Event Record, 59ea9b6d64SIra Weiny# Transaction Type for possible values. 60ea9b6d64SIra Weiny# 61ea9b6d64SIra Weiny# @channel: The channel of the memory event location. A channel is an 62ea9b6d64SIra Weiny# interface that can be independently accessed for a transaction. 63ea9b6d64SIra Weiny# 64ea9b6d64SIra Weiny# @rank: The rank of the memory event location. A rank is a set of 65ea9b6d64SIra Weiny# memory devices on a channel that together execute a transaction. 66ea9b6d64SIra Weiny# 67ea9b6d64SIra Weiny# @device: Bitmask that represents all devices in the rank associated 68ea9b6d64SIra Weiny# with the memory event location. 69ea9b6d64SIra Weiny# 70ea9b6d64SIra Weiny# @component-id: Device specific component identifier for the event. 71ea9b6d64SIra Weiny# May describe a field replaceable sub-component of the device. 72ea9b6d64SIra Weiny# 73ea9b6d64SIra Weiny# Since: 8.1 74ea9b6d64SIra Weiny## 75ea9b6d64SIra Weiny{ 'command': 'cxl-inject-general-media-event', 76ea9b6d64SIra Weiny 'data': { 'path': 'str', 'log': 'CxlEventLog', 'flags': 'uint8', 77ea9b6d64SIra Weiny 'dpa': 'uint64', 'descriptor': 'uint8', 78ea9b6d64SIra Weiny 'type': 'uint8', 'transaction-type': 'uint8', 79ea9b6d64SIra Weiny '*channel': 'uint8', '*rank': 'uint8', 80ea9b6d64SIra Weiny '*device': 'uint32', '*component-id': 'str' } } 81ea9b6d64SIra Weiny 82ea9b6d64SIra Weiny## 83b90a324eSJonathan Cameron# @cxl-inject-dram-event: 84b90a324eSJonathan Cameron# 85b90a324eSJonathan Cameron# Inject an event record for a DRAM Event (CXL r3.0 8.2.9.2.1.2). 86b90a324eSJonathan Cameron# This event type is reported via one of the event logs specified via 87b90a324eSJonathan Cameron# the log parameter. 88b90a324eSJonathan Cameron# 89b90a324eSJonathan Cameron# @path: CXL type 3 device canonical QOM path 90b90a324eSJonathan Cameron# 91b90a324eSJonathan Cameron# @log: Event log to add the event to 92b90a324eSJonathan Cameron# 93b90a324eSJonathan Cameron# @flags: Event Record Flags. See CXL r3.0 Table 8-42 Common Event 94b90a324eSJonathan Cameron# Record Format, Event Record Flags for subfield definitions. 95b90a324eSJonathan Cameron# 96b90a324eSJonathan Cameron# @dpa: Device Physical Address (relative to @path device). Note 97b90a324eSJonathan Cameron# lower bits include some flags. See CXL r3.0 Table 8-44 DRAM 98b90a324eSJonathan Cameron# Event Record, Physical Address. 99b90a324eSJonathan Cameron# 100b90a324eSJonathan Cameron# @descriptor: Memory Event Descriptor with additional memory event 101b90a324eSJonathan Cameron# information. See CXL r3.0 Table 8-44 DRAM Event Record, Memory 102b90a324eSJonathan Cameron# Event Descriptor for bit definitions. 103b90a324eSJonathan Cameron# 104b90a324eSJonathan Cameron# @type: Type of memory event that occurred. See CXL r3.0 Table 8-44 105b90a324eSJonathan Cameron# DRAM Event Record, Memory Event Type for possible values. 106b90a324eSJonathan Cameron# 107b90a324eSJonathan Cameron# @transaction-type: Type of first transaction that caused the event 108b90a324eSJonathan Cameron# to occur. See CXL r3.0 Table 8-44 DRAM Event Record, 109b90a324eSJonathan Cameron# Transaction Type for possible values. 110b90a324eSJonathan Cameron# 111b90a324eSJonathan Cameron# @channel: The channel of the memory event location. A channel is an 112b90a324eSJonathan Cameron# interface that can be independently accessed for a transaction. 113b90a324eSJonathan Cameron# 114b90a324eSJonathan Cameron# @rank: The rank of the memory event location. A rank is a set of 115b90a324eSJonathan Cameron# memory devices on a channel that together execute a transaction. 116b90a324eSJonathan Cameron# 117b90a324eSJonathan Cameron# @nibble-mask: Identifies one or more nibbles that the error affects 118b90a324eSJonathan Cameron# 119b90a324eSJonathan Cameron# @bank-group: Bank group of the memory event location, incorporating 120b90a324eSJonathan Cameron# a number of Banks. 121b90a324eSJonathan Cameron# 122b90a324eSJonathan Cameron# @bank: Bank of the memory event location. A single bank is accessed 123b90a324eSJonathan Cameron# per read or write of the memory. 124b90a324eSJonathan Cameron# 125b90a324eSJonathan Cameron# @row: Row address within the DRAM. 126b90a324eSJonathan Cameron# 127b90a324eSJonathan Cameron# @column: Column address within the DRAM. 128b90a324eSJonathan Cameron# 129b90a324eSJonathan Cameron# @correction-mask: Bits within each nibble. Used in order of bits 130b90a324eSJonathan Cameron# set in the nibble-mask. Up to 4 nibbles may be covered. 131b90a324eSJonathan Cameron# 132b90a324eSJonathan Cameron# Since: 8.1 133b90a324eSJonathan Cameron## 134b90a324eSJonathan Cameron{ 'command': 'cxl-inject-dram-event', 135b90a324eSJonathan Cameron 'data': { 'path': 'str', 'log': 'CxlEventLog', 'flags': 'uint8', 136b90a324eSJonathan Cameron 'dpa': 'uint64', 'descriptor': 'uint8', 137b90a324eSJonathan Cameron 'type': 'uint8', 'transaction-type': 'uint8', 138b90a324eSJonathan Cameron '*channel': 'uint8', '*rank': 'uint8', '*nibble-mask': 'uint32', 139b90a324eSJonathan Cameron '*bank-group': 'uint8', '*bank': 'uint8', '*row': 'uint32', 140b90a324eSJonathan Cameron '*column': 'uint16', '*correction-mask': [ 'uint64' ] 141b90a324eSJonathan Cameron }} 142b90a324eSJonathan Cameron 143b90a324eSJonathan Cameron## 144bafe0308SJonathan Cameron# @cxl-inject-memory-module-event: 145bafe0308SJonathan Cameron# 146bafe0308SJonathan Cameron# Inject an event record for a Memory Module Event (CXL r3.0 147209e64d9SMarkus Armbruster# 8.2.9.2.1.3). This event includes a copy of the Device Health info 148209e64d9SMarkus Armbruster# at the time of the event. 149bafe0308SJonathan Cameron# 150bafe0308SJonathan Cameron# @path: CXL type 3 device canonical QOM path 151bafe0308SJonathan Cameron# 152bafe0308SJonathan Cameron# @log: Event Log to add the event to 153bafe0308SJonathan Cameron# 154bafe0308SJonathan Cameron# @flags: Event Record Flags. See CXL r3.0 Table 8-42 Common Event 155bafe0308SJonathan Cameron# Record Format, Event Record Flags for subfield definitions. 156bafe0308SJonathan Cameron# 157bafe0308SJonathan Cameron# @type: Device Event Type. See CXL r3.0 Table 8-45 Memory Module 158bafe0308SJonathan Cameron# Event Record for bit definitions for bit definiions. 159bafe0308SJonathan Cameron# 160bafe0308SJonathan Cameron# @health-status: Overall health summary bitmap. See CXL r3.0 Table 161bafe0308SJonathan Cameron# 8-100 Get Health Info Output Payload, Health Status for bit 162bafe0308SJonathan Cameron# definitions. 163bafe0308SJonathan Cameron# 164bafe0308SJonathan Cameron# @media-status: Overall media health summary. See CXL r3.0 Table 165bafe0308SJonathan Cameron# 8-100 Get Health Info Output Payload, Media Status for bit 166bafe0308SJonathan Cameron# definitions. 167bafe0308SJonathan Cameron# 168bafe0308SJonathan Cameron# @additional-status: See CXL r3.0 Table 8-100 Get Health Info Output 169bafe0308SJonathan Cameron# Payload, Additional Status for subfield definitions. 170bafe0308SJonathan Cameron# 171bafe0308SJonathan Cameron# @life-used: Percentage (0-100) of factory expected life span. 172bafe0308SJonathan Cameron# 173bafe0308SJonathan Cameron# @temperature: Device temperature in degrees Celsius. 174bafe0308SJonathan Cameron# 1759e272073SMarkus Armbruster# @dirty-shutdown-count: Number of times the device has been unable to 1769e272073SMarkus Armbruster# determine whether data loss may have occurred. 177bafe0308SJonathan Cameron# 178bafe0308SJonathan Cameron# @corrected-volatile-error-count: Total number of correctable errors 179bafe0308SJonathan Cameron# in volatile memory. 180bafe0308SJonathan Cameron# 181bafe0308SJonathan Cameron# @corrected-persistent-error-count: Total number of correctable 182bafe0308SJonathan Cameron# errors in persistent memory 183bafe0308SJonathan Cameron# 184bafe0308SJonathan Cameron# Since: 8.1 185bafe0308SJonathan Cameron## 186bafe0308SJonathan Cameron{ 'command': 'cxl-inject-memory-module-event', 187bafe0308SJonathan Cameron 'data': { 'path': 'str', 'log': 'CxlEventLog', 'flags' : 'uint8', 188bafe0308SJonathan Cameron 'type': 'uint8', 'health-status': 'uint8', 189bafe0308SJonathan Cameron 'media-status': 'uint8', 'additional-status': 'uint8', 190bafe0308SJonathan Cameron 'life-used': 'uint8', 'temperature' : 'int16', 191bafe0308SJonathan Cameron 'dirty-shutdown-count': 'uint32', 192bafe0308SJonathan Cameron 'corrected-volatile-error-count': 'uint32', 193bafe0308SJonathan Cameron 'corrected-persistent-error-count': 'uint32' 194bafe0308SJonathan Cameron }} 195bafe0308SJonathan Cameron 196bafe0308SJonathan Cameron## 1979547754fSJonathan Cameron# @cxl-inject-poison: 1989547754fSJonathan Cameron# 1999547754fSJonathan Cameron# Poison records indicate that a CXL memory device knows that a 2009547754fSJonathan Cameron# particular memory region may be corrupted. This may be because of 2019547754fSJonathan Cameron# locally detected errors (e.g. ECC failure) or poisoned writes 2029547754fSJonathan Cameron# received from other components in the system. This injection 2039547754fSJonathan Cameron# mechanism enables testing of the OS handling of poison records which 2049547754fSJonathan Cameron# may be queried via the CXL mailbox. 2059547754fSJonathan Cameron# 2069547754fSJonathan Cameron# @path: CXL type 3 device canonical QOM path 2079547754fSJonathan Cameron# 2089547754fSJonathan Cameron# @start: Start address; must be 64 byte aligned. 2099547754fSJonathan Cameron# 2109547754fSJonathan Cameron# @length: Length of poison to inject; must be a multiple of 64 bytes. 2119547754fSJonathan Cameron# 2129547754fSJonathan Cameron# Since: 8.1 2139547754fSJonathan Cameron## 2149547754fSJonathan Cameron{ 'command': 'cxl-inject-poison', 2159547754fSJonathan Cameron 'data': { 'path': 'str', 'start': 'uint64', 'length': 'size' }} 2169547754fSJonathan Cameron 2179547754fSJonathan Cameron## 218415442a1SJonathan Cameron# @CxlUncorErrorType: 219415442a1SJonathan Cameron# 220a937b6aaSMarkus Armbruster# Type of uncorrectable CXL error to inject. These errors are 221a937b6aaSMarkus Armbruster# reported via an AER uncorrectable internal error with additional 222a937b6aaSMarkus Armbruster# information logged at the CXL device. 223415442a1SJonathan Cameron# 224a937b6aaSMarkus Armbruster# @cache-data-parity: Data error such as data parity or data ECC error 225a937b6aaSMarkus Armbruster# CXL.cache 226a937b6aaSMarkus Armbruster# 227a937b6aaSMarkus Armbruster# @cache-address-parity: Address parity or other errors associated 228a937b6aaSMarkus Armbruster# with the address field on CXL.cache 229a937b6aaSMarkus Armbruster# 230a937b6aaSMarkus Armbruster# @cache-be-parity: Byte enable parity or other byte enable errors on 231a937b6aaSMarkus Armbruster# CXL.cache 232a937b6aaSMarkus Armbruster# 233415442a1SJonathan Cameron# @cache-data-ecc: ECC error on CXL.cache 234a937b6aaSMarkus Armbruster# 235a937b6aaSMarkus Armbruster# @mem-data-parity: Data error such as data parity or data ECC error 236a937b6aaSMarkus Armbruster# on CXL.mem 237a937b6aaSMarkus Armbruster# 238a937b6aaSMarkus Armbruster# @mem-address-parity: Address parity or other errors associated with 239a937b6aaSMarkus Armbruster# the address field on CXL.mem 240a937b6aaSMarkus Armbruster# 241a937b6aaSMarkus Armbruster# @mem-be-parity: Byte enable parity or other byte enable errors on 242a937b6aaSMarkus Armbruster# CXL.mem. 243a937b6aaSMarkus Armbruster# 244415442a1SJonathan Cameron# @mem-data-ecc: Data ECC error on CXL.mem. 245a937b6aaSMarkus Armbruster# 246415442a1SJonathan Cameron# @reinit-threshold: REINIT threshold hit. 247a937b6aaSMarkus Armbruster# 248415442a1SJonathan Cameron# @rsvd-encoding: Received unrecognized encoding. 249a937b6aaSMarkus Armbruster# 250415442a1SJonathan Cameron# @poison-received: Received poison from the peer. 251a937b6aaSMarkus Armbruster# 252a937b6aaSMarkus Armbruster# @receiver-overflow: Buffer overflows (first 3 bits of header log 253a937b6aaSMarkus Armbruster# indicate which) 254a937b6aaSMarkus Armbruster# 255415442a1SJonathan Cameron# @internal: Component specific error 256a937b6aaSMarkus Armbruster# 257415442a1SJonathan Cameron# @cxl-ide-tx: Integrity and data encryption tx error. 258a937b6aaSMarkus Armbruster# 259415442a1SJonathan Cameron# @cxl-ide-rx: Integrity and data encryption rx error. 260415442a1SJonathan Cameron# 261415442a1SJonathan Cameron# Since: 8.0 262415442a1SJonathan Cameron## 263415442a1SJonathan Cameron 264415442a1SJonathan Cameron{ 'enum': 'CxlUncorErrorType', 265415442a1SJonathan Cameron 'data': ['cache-data-parity', 266415442a1SJonathan Cameron 'cache-address-parity', 267415442a1SJonathan Cameron 'cache-be-parity', 268415442a1SJonathan Cameron 'cache-data-ecc', 269415442a1SJonathan Cameron 'mem-data-parity', 270415442a1SJonathan Cameron 'mem-address-parity', 271415442a1SJonathan Cameron 'mem-be-parity', 272415442a1SJonathan Cameron 'mem-data-ecc', 273415442a1SJonathan Cameron 'reinit-threshold', 274415442a1SJonathan Cameron 'rsvd-encoding', 275415442a1SJonathan Cameron 'poison-received', 276415442a1SJonathan Cameron 'receiver-overflow', 277415442a1SJonathan Cameron 'internal', 278415442a1SJonathan Cameron 'cxl-ide-tx', 279415442a1SJonathan Cameron 'cxl-ide-rx' 280415442a1SJonathan Cameron ] 281415442a1SJonathan Cameron } 282415442a1SJonathan Cameron 283415442a1SJonathan Cameron## 284415442a1SJonathan Cameron# @CXLUncorErrorRecord: 285415442a1SJonathan Cameron# 286415442a1SJonathan Cameron# Record of a single error including header log. 287415442a1SJonathan Cameron# 288415442a1SJonathan Cameron# @type: Type of error 289a937b6aaSMarkus Armbruster# 290415442a1SJonathan Cameron# @header: 16 DWORD of header. 291415442a1SJonathan Cameron# 292415442a1SJonathan Cameron# Since: 8.0 293415442a1SJonathan Cameron## 294415442a1SJonathan Cameron{ 'struct': 'CXLUncorErrorRecord', 295415442a1SJonathan Cameron 'data': { 296415442a1SJonathan Cameron 'type': 'CxlUncorErrorType', 297415442a1SJonathan Cameron 'header': [ 'uint32' ] 298415442a1SJonathan Cameron } 299415442a1SJonathan Cameron} 300415442a1SJonathan Cameron 301415442a1SJonathan Cameron## 302415442a1SJonathan Cameron# @cxl-inject-uncorrectable-errors: 303415442a1SJonathan Cameron# 304a937b6aaSMarkus Armbruster# Command to allow injection of multiple errors in one go. This 305a937b6aaSMarkus Armbruster# allows testing of multiple header log handling in the OS. 306415442a1SJonathan Cameron# 307415442a1SJonathan Cameron# @path: CXL Type 3 device canonical QOM path 308a937b6aaSMarkus Armbruster# 309415442a1SJonathan Cameron# @errors: Errors to inject 310415442a1SJonathan Cameron# 311415442a1SJonathan Cameron# Since: 8.0 312415442a1SJonathan Cameron## 313415442a1SJonathan Cameron{ 'command': 'cxl-inject-uncorrectable-errors', 314415442a1SJonathan Cameron 'data': { 'path': 'str', 315415442a1SJonathan Cameron 'errors': [ 'CXLUncorErrorRecord' ] }} 316415442a1SJonathan Cameron 317415442a1SJonathan Cameron## 318415442a1SJonathan Cameron# @CxlCorErrorType: 319415442a1SJonathan Cameron# 320415442a1SJonathan Cameron# Type of CXL correctable error to inject 321415442a1SJonathan Cameron# 322415442a1SJonathan Cameron# @cache-data-ecc: Data ECC error on CXL.cache 323a937b6aaSMarkus Armbruster# 324415442a1SJonathan Cameron# @mem-data-ecc: Data ECC error on CXL.mem 325a937b6aaSMarkus Armbruster# 326a937b6aaSMarkus Armbruster# @crc-threshold: Component specific and applicable to 68 byte Flit 327a937b6aaSMarkus Armbruster# mode only. 328a937b6aaSMarkus Armbruster# 329*923b9687SMarkus Armbruster# @retry-threshold: Retry threshold hit in the Local Retry State 330*923b9687SMarkus Armbruster# Machine, 68B Flits only. 331*923b9687SMarkus Armbruster# 332415442a1SJonathan Cameron# @cache-poison-received: Received poison from a peer on CXL.cache. 333a937b6aaSMarkus Armbruster# 334415442a1SJonathan Cameron# @mem-poison-received: Received poison from a peer on CXL.mem 335a937b6aaSMarkus Armbruster# 336415442a1SJonathan Cameron# @physical: Received error indication from the physical layer. 337415442a1SJonathan Cameron# 338415442a1SJonathan Cameron# Since: 8.0 339415442a1SJonathan Cameron## 340415442a1SJonathan Cameron{ 'enum': 'CxlCorErrorType', 341415442a1SJonathan Cameron 'data': ['cache-data-ecc', 342415442a1SJonathan Cameron 'mem-data-ecc', 343415442a1SJonathan Cameron 'crc-threshold', 344415442a1SJonathan Cameron 'retry-threshold', 345415442a1SJonathan Cameron 'cache-poison-received', 346415442a1SJonathan Cameron 'mem-poison-received', 347415442a1SJonathan Cameron 'physical'] 348415442a1SJonathan Cameron} 349415442a1SJonathan Cameron 350415442a1SJonathan Cameron## 351415442a1SJonathan Cameron# @cxl-inject-correctable-error: 352415442a1SJonathan Cameron# 353a937b6aaSMarkus Armbruster# Command to inject a single correctable error. Multiple error 354a937b6aaSMarkus Armbruster# injection of this error type is not interesting as there is no 355a937b6aaSMarkus Armbruster# associated header log. These errors are reported via AER as a 356a937b6aaSMarkus Armbruster# correctable internal error, with additional detail available from 357a937b6aaSMarkus Armbruster# the CXL device. 358415442a1SJonathan Cameron# 359415442a1SJonathan Cameron# @path: CXL Type 3 device canonical QOM path 360a937b6aaSMarkus Armbruster# 361415442a1SJonathan Cameron# @type: Type of error. 362415442a1SJonathan Cameron# 363415442a1SJonathan Cameron# Since: 8.0 364415442a1SJonathan Cameron## 365415442a1SJonathan Cameron{'command': 'cxl-inject-correctable-error', 366a937b6aaSMarkus Armbruster 'data': {'path': 'str', 'type': 'CxlCorErrorType'}} 367d0b9b28aSFan Ni 368d0b9b28aSFan Ni## 369efc4ad6fSJonathan Cameron# @CxlDynamicCapacityExtent: 370d0b9b28aSFan Ni# 371efc4ad6fSJonathan Cameron# A single dynamic capacity extent. This is a contiguous allocation 372efc4ad6fSJonathan Cameron# of memory by Device Physical Address within a single Dynamic 373efc4ad6fSJonathan Cameron# Capacity Region on a CXL Type 3 Device. 374d0b9b28aSFan Ni# 37501bed0ffSMarkus Armbruster# @offset: The offset (in bytes) to the start of the region where the 37601bed0ffSMarkus Armbruster# extent belongs to. 377d0b9b28aSFan Ni# 378d0b9b28aSFan Ni# @len: The length of the extent in bytes. 379d0b9b28aSFan Ni# 380d0b9b28aSFan Ni# Since: 9.1 381d0b9b28aSFan Ni## 382efc4ad6fSJonathan Cameron{ 'struct': 'CxlDynamicCapacityExtent', 383d0b9b28aSFan Ni 'data': { 384d0b9b28aSFan Ni 'offset':'uint64', 385d0b9b28aSFan Ni 'len': 'uint64' 386d0b9b28aSFan Ni } 387d0b9b28aSFan Ni} 388d0b9b28aSFan Ni 389d0b9b28aSFan Ni## 390efc4ad6fSJonathan Cameron# @CxlExtentSelectionPolicy: 391d0b9b28aSFan Ni# 392d0b9b28aSFan Ni# The policy to use for selecting which extents comprise the added 393efc4ad6fSJonathan Cameron# capacity, as defined in Compute Express Link (CXL) Specification, 394efc4ad6fSJonathan Cameron# Revision 3.1, Table 7-70. 395d0b9b28aSFan Ni# 396efc4ad6fSJonathan Cameron# @free: Device is responsible for allocating the requested memory 397efc4ad6fSJonathan Cameron# capacity and is free to do this using any combination of 398efc4ad6fSJonathan Cameron# supported extents. 399d0b9b28aSFan Ni# 400efc4ad6fSJonathan Cameron# @contiguous: Device is responsible for allocating the requested 401efc4ad6fSJonathan Cameron# memory capacity but must do so as a single contiguous 402efc4ad6fSJonathan Cameron# extent. 403d0b9b28aSFan Ni# 404efc4ad6fSJonathan Cameron# @prescriptive: The precise set of extents to be allocated is 405efc4ad6fSJonathan Cameron# specified by the command. Thus allocation is being managed 406efc4ad6fSJonathan Cameron# by the issuer of the allocation command, not the device. 407d0b9b28aSFan Ni# 408efc4ad6fSJonathan Cameron# @enable-shared-access: Capacity has already been allocated to a 409efc4ad6fSJonathan Cameron# different host using free, contiguous or prescriptive policy 41001bed0ffSMarkus Armbruster# with a known tag. This policy then instructs the device to make 41101bed0ffSMarkus Armbruster# the capacity with the specified tag available to an additional 41201bed0ffSMarkus Armbruster# host. Capacity is implicit as it matches that already 41301bed0ffSMarkus Armbruster# associated with the tag. Note that the extent list (and hence 41401bed0ffSMarkus Armbruster# Device Physical Addresses) used are per host, so a device may 41501bed0ffSMarkus Armbruster# use different representations on each host. The ordering of the 41601bed0ffSMarkus Armbruster# extents provided to each host is indicated to the host using per 41701bed0ffSMarkus Armbruster# extent sequence numbers generated by the device. Has a similar 41801bed0ffSMarkus Armbruster# meaning for temporal sharing, but in that case there may be only 41901bed0ffSMarkus Armbruster# one host involved. 420d0b9b28aSFan Ni# 421d0b9b28aSFan Ni# Since: 9.1 422d0b9b28aSFan Ni## 423efc4ad6fSJonathan Cameron{ 'enum': 'CxlExtentSelectionPolicy', 424d0b9b28aSFan Ni 'data': ['free', 425d0b9b28aSFan Ni 'contiguous', 426d0b9b28aSFan Ni 'prescriptive', 427d0b9b28aSFan Ni 'enable-shared-access'] 428d0b9b28aSFan Ni} 429d0b9b28aSFan Ni 430d0b9b28aSFan Ni## 431d0b9b28aSFan Ni# @cxl-add-dynamic-capacity: 432d0b9b28aSFan Ni# 433efc4ad6fSJonathan Cameron# Initiate adding dynamic capacity extents to a host. This simulates 434efc4ad6fSJonathan Cameron# operations defined in Compute Express Link (CXL) Specification, 435efc4ad6fSJonathan Cameron# Revision 3.1, Section 7.6.7.6.5. Note that, currently, establishing 436efc4ad6fSJonathan Cameron# success or failure of the full Add Dynamic Capacity flow requires 437efc4ad6fSJonathan Cameron# out of band communication with the OS of the CXL host. 438d0b9b28aSFan Ni# 439efc4ad6fSJonathan Cameron# @path: path to the CXL Dynamic Capacity Device in the QOM tree. 440d0b9b28aSFan Ni# 441efc4ad6fSJonathan Cameron# @host-id: The "Host ID" field as defined in Compute Express Link 442efc4ad6fSJonathan Cameron# (CXL) Specification, Revision 3.1, Table 7-70. 443d0b9b28aSFan Ni# 444d0b9b28aSFan Ni# @selection-policy: The "Selection Policy" bits as defined in 445efc4ad6fSJonathan Cameron# Compute Express Link (CXL) Specification, Revision 3.1, 446efc4ad6fSJonathan Cameron# Table 7-70. It specifies the policy to use for selecting 447efc4ad6fSJonathan Cameron# which extents comprise the added capacity. 448d0b9b28aSFan Ni# 449efc4ad6fSJonathan Cameron# @region: The "Region Number" field as defined in Compute Express 450efc4ad6fSJonathan Cameron# Link (CXL) Specification, Revision 3.1, Table 7-70. Valid 451efc4ad6fSJonathan Cameron# range is from 0-7. 452d0b9b28aSFan Ni# 453efc4ad6fSJonathan Cameron# @tag: The "Tag" field as defined in Compute Express Link (CXL) 454efc4ad6fSJonathan Cameron# Specification, Revision 3.1, Table 7-70. 455d0b9b28aSFan Ni# 456efc4ad6fSJonathan Cameron# @extents: The "Extent List" field as defined in Compute Express Link 457efc4ad6fSJonathan Cameron# (CXL) Specification, Revision 3.1, Table 7-70. 458d0b9b28aSFan Ni# 4595e3cd0a2SJonathan Cameron# Features: 4605e3cd0a2SJonathan Cameron# 4615e3cd0a2SJonathan Cameron# @unstable: For now this command is subject to change. 4625e3cd0a2SJonathan Cameron# 463d0b9b28aSFan Ni# Since : 9.1 464d0b9b28aSFan Ni## 465d0b9b28aSFan Ni{ 'command': 'cxl-add-dynamic-capacity', 466d0b9b28aSFan Ni 'data': { 'path': 'str', 467d0b9b28aSFan Ni 'host-id': 'uint16', 468efc4ad6fSJonathan Cameron 'selection-policy': 'CxlExtentSelectionPolicy', 469d0b9b28aSFan Ni 'region': 'uint8', 470d0b9b28aSFan Ni '*tag': 'str', 471efc4ad6fSJonathan Cameron 'extents': [ 'CxlDynamicCapacityExtent' ] 4725e3cd0a2SJonathan Cameron }, 4735e3cd0a2SJonathan Cameron 'features': [ 'unstable' ] 474d0b9b28aSFan Ni} 475d0b9b28aSFan Ni 476d0b9b28aSFan Ni## 477efc4ad6fSJonathan Cameron# @CxlExtentRemovalPolicy: 478d0b9b28aSFan Ni# 479d0b9b28aSFan Ni# The policy to use for selecting which extents comprise the released 480efc4ad6fSJonathan Cameron# capacity, defined in the "Flags" field in Compute Express Link (CXL) 481efc4ad6fSJonathan Cameron# Specification, Revision 3.1, Table 7-71. 482d0b9b28aSFan Ni# 483efc4ad6fSJonathan Cameron# @tag-based: Extents are selected by the device based on tag, with 484efc4ad6fSJonathan Cameron# no requirement for contiguous extents. 485d0b9b28aSFan Ni# 486efc4ad6fSJonathan Cameron# @prescriptive: Extent list of capacity to release is included in 487efc4ad6fSJonathan Cameron# the request payload. 488d0b9b28aSFan Ni# 489d0b9b28aSFan Ni# Since: 9.1 490d0b9b28aSFan Ni## 491efc4ad6fSJonathan Cameron{ 'enum': 'CxlExtentRemovalPolicy', 492d0b9b28aSFan Ni 'data': ['tag-based', 493d0b9b28aSFan Ni 'prescriptive'] 494d0b9b28aSFan Ni} 495d0b9b28aSFan Ni 496d0b9b28aSFan Ni## 497d0b9b28aSFan Ni# @cxl-release-dynamic-capacity: 498d0b9b28aSFan Ni# 499efc4ad6fSJonathan Cameron# Initiate release of dynamic capacity extents from a host. This 500efc4ad6fSJonathan Cameron# simulates operations defined in Compute Express Link (CXL) 501efc4ad6fSJonathan Cameron# Specification, Revision 3.1, Section 7.6.7.6.6. Note that, 502efc4ad6fSJonathan Cameron# currently, success or failure of the full Release Dynamic Capacity 503efc4ad6fSJonathan Cameron# flow requires out of band communication with the OS of the CXL host. 504d0b9b28aSFan Ni# 505efc4ad6fSJonathan Cameron# @path: path to the CXL Dynamic Capacity Device in the QOM tree. 506d0b9b28aSFan Ni# 507efc4ad6fSJonathan Cameron# @host-id: The "Host ID" field as defined in Compute Express Link 508efc4ad6fSJonathan Cameron# (CXL) Specification, Revision 3.1, Table 7-71. 509efc4ad6fSJonathan Cameron# 510efc4ad6fSJonathan Cameron# @removal-policy: Bit[3:0] of the "Flags" field as defined in 511efc4ad6fSJonathan Cameron# Compute Express Link (CXL) Specification, Revision 3.1, 512d0b9b28aSFan Ni# Table 7-71. 513d0b9b28aSFan Ni# 514efc4ad6fSJonathan Cameron# @forced-removal: Bit[4] of the "Flags" field in Compute Express 515efc4ad6fSJonathan Cameron# Link (CXL) Specification, Revision 3.1, Table 7-71. When set, 516efc4ad6fSJonathan Cameron# the device does not wait for a Release Dynamic Capacity command 517efc4ad6fSJonathan Cameron# from the host. Instead, the host immediately looses access to 518efc4ad6fSJonathan Cameron# the released capacity. 519d0b9b28aSFan Ni# 52001bed0ffSMarkus Armbruster# @sanitize-on-release: Bit[5] of the "Flags" field in Compute Express 52101bed0ffSMarkus Armbruster# Link (CXL) Specification, Revision 3.1, Table 7-71. When set, 52201bed0ffSMarkus Armbruster# the device should sanitize all released capacity as a result of 52301bed0ffSMarkus Armbruster# this request. This ensures that all user data and metadata is 52401bed0ffSMarkus Armbruster# made permanently unavailable by whatever means is appropriate 52501bed0ffSMarkus Armbruster# for the media type. Note that changing encryption keys is not 52601bed0ffSMarkus Armbruster# sufficient. 527d0b9b28aSFan Ni# 528efc4ad6fSJonathan Cameron# @region: The "Region Number" field as defined in Compute Express 529efc4ad6fSJonathan Cameron# Link Specification, Revision 3.1, Table 7-71. Valid range 530efc4ad6fSJonathan Cameron# is from 0-7. 531d0b9b28aSFan Ni# 532efc4ad6fSJonathan Cameron# @tag: The "Tag" field as defined in Compute Express Link (CXL) 533efc4ad6fSJonathan Cameron# Specification, Revision 3.1, Table 7-71. 534d0b9b28aSFan Ni# 535efc4ad6fSJonathan Cameron# @extents: The "Extent List" field as defined in Compute Express 536efc4ad6fSJonathan Cameron# Link (CXL) Specification, Revision 3.1, Table 7-71. 537d0b9b28aSFan Ni# 5385e3cd0a2SJonathan Cameron# Features: 5395e3cd0a2SJonathan Cameron# 5405e3cd0a2SJonathan Cameron# @unstable: For now this command is subject to change. 5415e3cd0a2SJonathan Cameron# 542d0b9b28aSFan Ni# Since : 9.1 543d0b9b28aSFan Ni## 544d0b9b28aSFan Ni{ 'command': 'cxl-release-dynamic-capacity', 545d0b9b28aSFan Ni 'data': { 'path': 'str', 546d0b9b28aSFan Ni 'host-id': 'uint16', 547efc4ad6fSJonathan Cameron 'removal-policy': 'CxlExtentRemovalPolicy', 548d0b9b28aSFan Ni '*forced-removal': 'bool', 549d0b9b28aSFan Ni '*sanitize-on-release': 'bool', 550d0b9b28aSFan Ni 'region': 'uint8', 551d0b9b28aSFan Ni '*tag': 'str', 552efc4ad6fSJonathan Cameron 'extents': [ 'CxlDynamicCapacityExtent' ] 5535e3cd0a2SJonathan Cameron }, 5545e3cd0a2SJonathan Cameron 'features': [ 'unstable' ] 555d0b9b28aSFan Ni} 556