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# 329415442a1SJonathan Cameron# @cache-poison-received: Received poison from a peer on CXL.cache. 330a937b6aaSMarkus Armbruster# 331415442a1SJonathan Cameron# @mem-poison-received: Received poison from a peer on CXL.mem 332a937b6aaSMarkus Armbruster# 333415442a1SJonathan Cameron# @physical: Received error indication from the physical layer. 334415442a1SJonathan Cameron# 335415442a1SJonathan Cameron# Since: 8.0 336415442a1SJonathan Cameron## 337415442a1SJonathan Cameron{ 'enum': 'CxlCorErrorType', 338415442a1SJonathan Cameron 'data': ['cache-data-ecc', 339415442a1SJonathan Cameron 'mem-data-ecc', 340415442a1SJonathan Cameron 'crc-threshold', 341415442a1SJonathan Cameron 'retry-threshold', 342415442a1SJonathan Cameron 'cache-poison-received', 343415442a1SJonathan Cameron 'mem-poison-received', 344415442a1SJonathan Cameron 'physical'] 345415442a1SJonathan Cameron} 346415442a1SJonathan Cameron 347415442a1SJonathan Cameron## 348415442a1SJonathan Cameron# @cxl-inject-correctable-error: 349415442a1SJonathan Cameron# 350a937b6aaSMarkus Armbruster# Command to inject a single correctable error. Multiple error 351a937b6aaSMarkus Armbruster# injection of this error type is not interesting as there is no 352a937b6aaSMarkus Armbruster# associated header log. These errors are reported via AER as a 353a937b6aaSMarkus Armbruster# correctable internal error, with additional detail available from 354a937b6aaSMarkus Armbruster# the CXL device. 355415442a1SJonathan Cameron# 356415442a1SJonathan Cameron# @path: CXL Type 3 device canonical QOM path 357a937b6aaSMarkus Armbruster# 358415442a1SJonathan Cameron# @type: Type of error. 359415442a1SJonathan Cameron# 360415442a1SJonathan Cameron# Since: 8.0 361415442a1SJonathan Cameron## 362415442a1SJonathan Cameron{'command': 'cxl-inject-correctable-error', 363a937b6aaSMarkus Armbruster 'data': {'path': 'str', 'type': 'CxlCorErrorType'}} 364d0b9b28aSFan Ni 365d0b9b28aSFan Ni## 366*efc4ad6fSJonathan Cameron# @CxlDynamicCapacityExtent: 367d0b9b28aSFan Ni# 368*efc4ad6fSJonathan Cameron# A single dynamic capacity extent. This is a contiguous allocation 369*efc4ad6fSJonathan Cameron# of memory by Device Physical Address within a single Dynamic 370*efc4ad6fSJonathan Cameron# Capacity Region on a CXL Type 3 Device. 371d0b9b28aSFan Ni# 372d0b9b28aSFan Ni# @offset: The offset (in bytes) to the start of the region 373d0b9b28aSFan Ni# where the extent belongs to. 374d0b9b28aSFan Ni# 375d0b9b28aSFan Ni# @len: The length of the extent in bytes. 376d0b9b28aSFan Ni# 377d0b9b28aSFan Ni# Since: 9.1 378d0b9b28aSFan Ni## 379*efc4ad6fSJonathan Cameron{ 'struct': 'CxlDynamicCapacityExtent', 380d0b9b28aSFan Ni 'data': { 381d0b9b28aSFan Ni 'offset':'uint64', 382d0b9b28aSFan Ni 'len': 'uint64' 383d0b9b28aSFan Ni } 384d0b9b28aSFan Ni} 385d0b9b28aSFan Ni 386d0b9b28aSFan Ni## 387*efc4ad6fSJonathan Cameron# @CxlExtentSelectionPolicy: 388d0b9b28aSFan Ni# 389d0b9b28aSFan Ni# The policy to use for selecting which extents comprise the added 390*efc4ad6fSJonathan Cameron# capacity, as defined in Compute Express Link (CXL) Specification, 391*efc4ad6fSJonathan Cameron# Revision 3.1, Table 7-70. 392d0b9b28aSFan Ni# 393*efc4ad6fSJonathan Cameron# @free: Device is responsible for allocating the requested memory 394*efc4ad6fSJonathan Cameron# capacity and is free to do this using any combination of 395*efc4ad6fSJonathan Cameron# supported extents. 396d0b9b28aSFan Ni# 397*efc4ad6fSJonathan Cameron# @contiguous: Device is responsible for allocating the requested 398*efc4ad6fSJonathan Cameron# memory capacity but must do so as a single contiguous 399*efc4ad6fSJonathan Cameron# extent. 400d0b9b28aSFan Ni# 401*efc4ad6fSJonathan Cameron# @prescriptive: The precise set of extents to be allocated is 402*efc4ad6fSJonathan Cameron# specified by the command. Thus allocation is being managed 403*efc4ad6fSJonathan Cameron# by the issuer of the allocation command, not the device. 404d0b9b28aSFan Ni# 405*efc4ad6fSJonathan Cameron# @enable-shared-access: Capacity has already been allocated to a 406*efc4ad6fSJonathan Cameron# different host using free, contiguous or prescriptive policy 407*efc4ad6fSJonathan Cameron# with a known tag. This policy then instructs the device to 408*efc4ad6fSJonathan Cameron# make the capacity with the specified tag available to an 409*efc4ad6fSJonathan Cameron# additional host. Capacity is implicit as it matches that 410*efc4ad6fSJonathan Cameron# already associated with the tag. Note that the extent list 411*efc4ad6fSJonathan Cameron# (and hence Device Physical Addresses) used are per host, so 412*efc4ad6fSJonathan Cameron# a device may use different representations on each host. 413*efc4ad6fSJonathan Cameron# The ordering of the extents provided to each host is indicated 414*efc4ad6fSJonathan Cameron# to the host using per extent sequence numbers generated by 415*efc4ad6fSJonathan Cameron# the device. Has a similar meaning for temporal sharing, but 416*efc4ad6fSJonathan Cameron# in that case there may be only one host involved. 417d0b9b28aSFan Ni# 418d0b9b28aSFan Ni# Since: 9.1 419d0b9b28aSFan Ni## 420*efc4ad6fSJonathan Cameron{ 'enum': 'CxlExtentSelectionPolicy', 421d0b9b28aSFan Ni 'data': ['free', 422d0b9b28aSFan Ni 'contiguous', 423d0b9b28aSFan Ni 'prescriptive', 424d0b9b28aSFan Ni 'enable-shared-access'] 425d0b9b28aSFan Ni} 426d0b9b28aSFan Ni 427d0b9b28aSFan Ni## 428d0b9b28aSFan Ni# @cxl-add-dynamic-capacity: 429d0b9b28aSFan Ni# 430*efc4ad6fSJonathan Cameron# Initiate adding dynamic capacity extents to a host. This simulates 431*efc4ad6fSJonathan Cameron# operations defined in Compute Express Link (CXL) Specification, 432*efc4ad6fSJonathan Cameron# Revision 3.1, Section 7.6.7.6.5. Note that, currently, establishing 433*efc4ad6fSJonathan Cameron# success or failure of the full Add Dynamic Capacity flow requires 434*efc4ad6fSJonathan Cameron# out of band communication with the OS of the CXL host. 435d0b9b28aSFan Ni# 436*efc4ad6fSJonathan Cameron# @path: path to the CXL Dynamic Capacity Device in the QOM tree. 437d0b9b28aSFan Ni# 438*efc4ad6fSJonathan Cameron# @host-id: The "Host ID" field as defined in Compute Express Link 439*efc4ad6fSJonathan Cameron# (CXL) Specification, Revision 3.1, Table 7-70. 440d0b9b28aSFan Ni# 441d0b9b28aSFan Ni# @selection-policy: The "Selection Policy" bits as defined in 442*efc4ad6fSJonathan Cameron# Compute Express Link (CXL) Specification, Revision 3.1, 443*efc4ad6fSJonathan Cameron# Table 7-70. It specifies the policy to use for selecting 444*efc4ad6fSJonathan Cameron# which extents comprise the added capacity. 445d0b9b28aSFan Ni# 446*efc4ad6fSJonathan Cameron# @region: The "Region Number" field as defined in Compute Express 447*efc4ad6fSJonathan Cameron# Link (CXL) Specification, Revision 3.1, Table 7-70. Valid 448*efc4ad6fSJonathan Cameron# range is from 0-7. 449d0b9b28aSFan Ni# 450*efc4ad6fSJonathan Cameron# @tag: The "Tag" field as defined in Compute Express Link (CXL) 451*efc4ad6fSJonathan Cameron# Specification, Revision 3.1, Table 7-70. 452d0b9b28aSFan Ni# 453*efc4ad6fSJonathan Cameron# @extents: The "Extent List" field as defined in Compute Express Link 454*efc4ad6fSJonathan Cameron# (CXL) Specification, Revision 3.1, Table 7-70. 455d0b9b28aSFan Ni# 456d0b9b28aSFan Ni# Since : 9.1 457d0b9b28aSFan Ni## 458d0b9b28aSFan Ni{ 'command': 'cxl-add-dynamic-capacity', 459d0b9b28aSFan Ni 'data': { 'path': 'str', 460d0b9b28aSFan Ni 'host-id': 'uint16', 461*efc4ad6fSJonathan Cameron 'selection-policy': 'CxlExtentSelectionPolicy', 462d0b9b28aSFan Ni 'region': 'uint8', 463d0b9b28aSFan Ni '*tag': 'str', 464*efc4ad6fSJonathan Cameron 'extents': [ 'CxlDynamicCapacityExtent' ] 465d0b9b28aSFan Ni } 466d0b9b28aSFan Ni} 467d0b9b28aSFan Ni 468d0b9b28aSFan Ni## 469*efc4ad6fSJonathan Cameron# @CxlExtentRemovalPolicy: 470d0b9b28aSFan Ni# 471d0b9b28aSFan Ni# The policy to use for selecting which extents comprise the released 472*efc4ad6fSJonathan Cameron# capacity, defined in the "Flags" field in Compute Express Link (CXL) 473*efc4ad6fSJonathan Cameron# Specification, Revision 3.1, Table 7-71. 474d0b9b28aSFan Ni# 475*efc4ad6fSJonathan Cameron# @tag-based: Extents are selected by the device based on tag, with 476*efc4ad6fSJonathan Cameron# no requirement for contiguous extents. 477d0b9b28aSFan Ni# 478*efc4ad6fSJonathan Cameron# @prescriptive: Extent list of capacity to release is included in 479*efc4ad6fSJonathan Cameron# the request payload. 480d0b9b28aSFan Ni# 481d0b9b28aSFan Ni# Since: 9.1 482d0b9b28aSFan Ni## 483*efc4ad6fSJonathan Cameron{ 'enum': 'CxlExtentRemovalPolicy', 484d0b9b28aSFan Ni 'data': ['tag-based', 485d0b9b28aSFan Ni 'prescriptive'] 486d0b9b28aSFan Ni} 487d0b9b28aSFan Ni 488d0b9b28aSFan Ni## 489d0b9b28aSFan Ni# @cxl-release-dynamic-capacity: 490d0b9b28aSFan Ni# 491*efc4ad6fSJonathan Cameron# Initiate release of dynamic capacity extents from a host. This 492*efc4ad6fSJonathan Cameron# simulates operations defined in Compute Express Link (CXL) 493*efc4ad6fSJonathan Cameron# Specification, Revision 3.1, Section 7.6.7.6.6. Note that, 494*efc4ad6fSJonathan Cameron# currently, success or failure of the full Release Dynamic Capacity 495*efc4ad6fSJonathan Cameron# flow requires out of band communication with the OS of the CXL host. 496d0b9b28aSFan Ni# 497*efc4ad6fSJonathan Cameron# @path: path to the CXL Dynamic Capacity Device in the QOM tree. 498d0b9b28aSFan Ni# 499*efc4ad6fSJonathan Cameron# @host-id: The "Host ID" field as defined in Compute Express Link 500*efc4ad6fSJonathan Cameron# (CXL) Specification, Revision 3.1, Table 7-71. 501*efc4ad6fSJonathan Cameron# 502*efc4ad6fSJonathan Cameron# @removal-policy: Bit[3:0] of the "Flags" field as defined in 503*efc4ad6fSJonathan Cameron# Compute Express Link (CXL) Specification, Revision 3.1, 504d0b9b28aSFan Ni# Table 7-71. 505d0b9b28aSFan Ni# 506*efc4ad6fSJonathan Cameron# @forced-removal: Bit[4] of the "Flags" field in Compute Express 507*efc4ad6fSJonathan Cameron# Link (CXL) Specification, Revision 3.1, Table 7-71. When set, 508*efc4ad6fSJonathan Cameron# the device does not wait for a Release Dynamic Capacity command 509*efc4ad6fSJonathan Cameron# from the host. Instead, the host immediately looses access to 510*efc4ad6fSJonathan Cameron# the released capacity. 511d0b9b28aSFan Ni# 512*efc4ad6fSJonathan Cameron# @sanitize-on-release: Bit[5] of the "Flags" field in Compute 513*efc4ad6fSJonathan Cameron# Express Link (CXL) Specification, Revision 3.1, Table 7-71. 514*efc4ad6fSJonathan Cameron# When set, the device should sanitize all released capacity as 515*efc4ad6fSJonathan Cameron# a result of this request. This ensures that all user data 516*efc4ad6fSJonathan Cameron# and metadata is made permanently unavailable by whatever 517*efc4ad6fSJonathan Cameron# means is appropriate for the media type. Note that changing 518*efc4ad6fSJonathan Cameron# encryption keys is not sufficient. 519d0b9b28aSFan Ni# 520*efc4ad6fSJonathan Cameron# @region: The "Region Number" field as defined in Compute Express 521*efc4ad6fSJonathan Cameron# Link Specification, Revision 3.1, Table 7-71. Valid range 522*efc4ad6fSJonathan Cameron# is from 0-7. 523d0b9b28aSFan Ni# 524*efc4ad6fSJonathan Cameron# @tag: The "Tag" field as defined in Compute Express Link (CXL) 525*efc4ad6fSJonathan Cameron# Specification, Revision 3.1, Table 7-71. 526d0b9b28aSFan Ni# 527*efc4ad6fSJonathan Cameron# @extents: The "Extent List" field as defined in Compute Express 528*efc4ad6fSJonathan Cameron# Link (CXL) Specification, Revision 3.1, Table 7-71. 529d0b9b28aSFan Ni# 530d0b9b28aSFan Ni# Since : 9.1 531d0b9b28aSFan Ni## 532d0b9b28aSFan Ni{ 'command': 'cxl-release-dynamic-capacity', 533d0b9b28aSFan Ni 'data': { 'path': 'str', 534d0b9b28aSFan Ni 'host-id': 'uint16', 535*efc4ad6fSJonathan Cameron 'removal-policy': 'CxlExtentRemovalPolicy', 536d0b9b28aSFan Ni '*forced-removal': 'bool', 537d0b9b28aSFan Ni '*sanitize-on-release': 'bool', 538d0b9b28aSFan Ni 'region': 'uint8', 539d0b9b28aSFan Ni '*tag': 'str', 540*efc4ad6fSJonathan Cameron 'extents': [ 'CxlDynamicCapacityExtent' ] 541d0b9b28aSFan Ni } 542d0b9b28aSFan Ni} 543