machine-target.json 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. # -*- Mode: Python -*-
  2. # vim: filetype=python
  3. #
  4. # This work is licensed under the terms of the GNU GPL, version 2 or later.
  5. # See the COPYING file in the top-level directory.
  6. { 'include': 'machine-common.json' }
  7. ##
  8. # @CpuModelInfo:
  9. #
  10. # Virtual CPU model.
  11. #
  12. # A CPU model consists of the name of a CPU definition, to which delta
  13. # changes are applied (e.g. features added/removed). Most magic
  14. # values that an architecture might require should be hidden behind
  15. # the name. However, if required, architectures can expose relevant
  16. # properties.
  17. #
  18. # @name: the name of the CPU definition the model is based on
  19. #
  20. # @props: a dictionary of QOM properties to be applied
  21. #
  22. # Since: 2.8
  23. ##
  24. { 'struct': 'CpuModelInfo',
  25. 'data': { 'name': 'str',
  26. '*props': 'any' } }
  27. ##
  28. # @CpuModelExpansionType:
  29. #
  30. # An enumeration of CPU model expansion types.
  31. #
  32. # @static: Expand to a static CPU model, a combination of a static
  33. # base model name and property delta changes. As the static base
  34. # model will never change, the expanded CPU model will be the
  35. # same, independent of QEMU version, machine type, machine
  36. # options, and accelerator options. Therefore, the resulting
  37. # model can be used by tooling without having to specify a
  38. # compatibility machine - e.g. when displaying the "host" model.
  39. # The @static CPU models are migration-safe.
  40. #
  41. # @full: Expand all properties. The produced model is not guaranteed
  42. # to be migration-safe, but allows tooling to get an insight and
  43. # work with model details.
  44. #
  45. # .. note:: When a non-migration-safe CPU model is expanded in static
  46. # mode, some features enabled by the CPU model may be omitted,
  47. # because they can't be implemented by a static CPU model
  48. # definition (e.g. cache info passthrough and PMU passthrough in
  49. # x86). If you need an accurate representation of the features
  50. # enabled by a non-migration-safe CPU model, use @full. If you
  51. # need a static representation that will keep ABI compatibility
  52. # even when changing QEMU version or machine-type, use @static (but
  53. # keep in mind that some features may be omitted).
  54. #
  55. # Since: 2.8
  56. ##
  57. { 'enum': 'CpuModelExpansionType',
  58. 'data': [ 'static', 'full' ] }
  59. ##
  60. # @CpuModelCompareResult:
  61. #
  62. # An enumeration of CPU model comparison results. The result is
  63. # usually calculated using e.g. CPU features or CPU generations.
  64. #
  65. # @incompatible: If model A is incompatible to model B, model A is not
  66. # guaranteed to run where model B runs and the other way around.
  67. #
  68. # @identical: If model A is identical to model B, model A is
  69. # guaranteed to run where model B runs and the other way around.
  70. #
  71. # @superset: If model A is a superset of model B, model B is
  72. # guaranteed to run where model A runs. There are no guarantees
  73. # about the other way.
  74. #
  75. # @subset: If model A is a subset of model B, model A is guaranteed to
  76. # run where model B runs. There are no guarantees about the other
  77. # way.
  78. #
  79. # Since: 2.8
  80. ##
  81. { 'enum': 'CpuModelCompareResult',
  82. 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
  83. ##
  84. # @CpuModelBaselineInfo:
  85. #
  86. # The result of a CPU model baseline.
  87. #
  88. # @model: the baselined CpuModelInfo.
  89. #
  90. # Since: 2.8
  91. ##
  92. { 'struct': 'CpuModelBaselineInfo',
  93. 'data': { 'model': 'CpuModelInfo' },
  94. 'if': 'TARGET_S390X' }
  95. ##
  96. # @CpuModelCompareInfo:
  97. #
  98. # The result of a CPU model comparison.
  99. #
  100. # @result: The result of the compare operation.
  101. #
  102. # @responsible-properties: List of properties that led to the
  103. # comparison result not being identical.
  104. #
  105. # @responsible-properties is a list of QOM property names that led to
  106. # both CPUs not being detected as identical. For identical models,
  107. # this list is empty. If a QOM property is read-only, that means
  108. # there's no known way to make the CPU models identical. If the
  109. # special property name "type" is included, the models are by
  110. # definition not identical and cannot be made identical.
  111. #
  112. # Since: 2.8
  113. ##
  114. { 'struct': 'CpuModelCompareInfo',
  115. 'data': { 'result': 'CpuModelCompareResult',
  116. 'responsible-properties': ['str'] },
  117. 'if': 'TARGET_S390X' }
  118. ##
  119. # @query-cpu-model-comparison:
  120. #
  121. # Compares two CPU models, @modela and @modelb, returning how they
  122. # compare in a specific configuration. The results indicates how
  123. # both models compare regarding runnability. This result can be
  124. # used by tooling to make decisions if a certain CPU model will
  125. # run in a certain configuration or if a compatible CPU model has
  126. # to be created by baselining.
  127. #
  128. # Usually, a CPU model is compared against the maximum possible CPU
  129. # model of a certain configuration (e.g. the "host" model for KVM).
  130. # If that CPU model is identical or a subset, it will run in that
  131. # configuration.
  132. #
  133. # The result returned by this command may be affected by:
  134. #
  135. # * QEMU version: CPU models may look different depending on the QEMU
  136. # version. (Except for CPU models reported as "static" in
  137. # query-cpu-definitions.)
  138. # * machine-type: CPU model may look different depending on the
  139. # machine-type. (Except for CPU models reported as "static" in
  140. # query-cpu-definitions.)
  141. # * machine options (including accelerator): in some architectures,
  142. # CPU models may look different depending on machine and accelerator
  143. # options. (Except for CPU models reported as "static" in
  144. # query-cpu-definitions.)
  145. # * "-cpu" arguments and global properties: arguments to the -cpu
  146. # option and global properties may affect expansion of CPU models.
  147. # Using query-cpu-model-expansion while using these is not advised.
  148. #
  149. # Some architectures may not support comparing CPU models. s390x
  150. # supports comparing CPU models.
  151. #
  152. # @modela: description of the first CPU model to compare, referred to
  153. # as "model A" in CpuModelCompareResult
  154. #
  155. # @modelb: description of the second CPU model to compare, referred to
  156. # as "model B" in CpuModelCompareResult
  157. #
  158. # Returns: a CpuModelCompareInfo describing how both CPU models
  159. # compare
  160. #
  161. # Errors:
  162. # - if comparing CPU models is not supported
  163. # - if a model cannot be used
  164. # - if a model contains an unknown cpu definition name, unknown
  165. # properties or properties with wrong types.
  166. #
  167. # .. note:: This command isn't specific to s390x, but is only
  168. # implemented on this architecture currently.
  169. #
  170. # Since: 2.8
  171. ##
  172. { 'command': 'query-cpu-model-comparison',
  173. 'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
  174. 'returns': 'CpuModelCompareInfo',
  175. 'if': 'TARGET_S390X' }
  176. ##
  177. # @query-cpu-model-baseline:
  178. #
  179. # Baseline two CPU models, @modela and @modelb, creating a compatible
  180. # third model. The created model will always be a static,
  181. # migration-safe CPU model (see "static" CPU model expansion for
  182. # details).
  183. #
  184. # This interface can be used by tooling to create a compatible CPU
  185. # model out two CPU models. The created CPU model will be identical
  186. # to or a subset of both CPU models when comparing them. Therefore,
  187. # the created CPU model is guaranteed to run where the given CPU
  188. # models run.
  189. #
  190. # The result returned by this command may be affected by:
  191. #
  192. # * QEMU version: CPU models may look different depending on the QEMU
  193. # version. (Except for CPU models reported as "static" in
  194. # query-cpu-definitions.)
  195. # * machine-type: CPU model may look different depending on the
  196. # machine-type. (Except for CPU models reported as "static" in
  197. # query-cpu-definitions.)
  198. # * machine options (including accelerator): in some architectures,
  199. # CPU models may look different depending on machine and accelerator
  200. # options. (Except for CPU models reported as "static" in
  201. # query-cpu-definitions.)
  202. # * "-cpu" arguments and global properties: arguments to the -cpu
  203. # option and global properties may affect expansion of CPU models.
  204. # Using query-cpu-model-expansion while using these is not advised.
  205. #
  206. # Some architectures may not support baselining CPU models. s390x
  207. # supports baselining CPU models.
  208. #
  209. # @modela: description of the first CPU model to baseline
  210. #
  211. # @modelb: description of the second CPU model to baseline
  212. #
  213. # Returns: a CpuModelBaselineInfo describing the baselined CPU model
  214. #
  215. # Errors:
  216. # - if baselining CPU models is not supported
  217. # - if a model cannot be used
  218. # - if a model contains an unknown cpu definition name, unknown
  219. # properties or properties with wrong types.
  220. #
  221. # .. note:: This command isn't specific to s390x, but is only
  222. # implemented on this architecture currently.
  223. #
  224. # Since: 2.8
  225. ##
  226. { 'command': 'query-cpu-model-baseline',
  227. 'data': { 'modela': 'CpuModelInfo',
  228. 'modelb': 'CpuModelInfo' },
  229. 'returns': 'CpuModelBaselineInfo',
  230. 'if': 'TARGET_S390X' }
  231. ##
  232. # @CpuModelExpansionInfo:
  233. #
  234. # The result of a cpu model expansion.
  235. #
  236. # @model: the expanded CpuModelInfo.
  237. #
  238. # @deprecated-props: a list of properties that are flagged as
  239. # deprecated by the CPU vendor. The list depends on the
  240. # CpuModelExpansionType: "static" properties are a subset of the
  241. # enabled-properties for the expanded model; "full" properties are
  242. # a set of properties that are deprecated across all models for
  243. # the architecture. (since: 9.1).
  244. #
  245. # Since: 2.8
  246. ##
  247. { 'struct': 'CpuModelExpansionInfo',
  248. 'data': { 'model': 'CpuModelInfo',
  249. 'deprecated-props' : { 'type': ['str'],
  250. 'if': 'TARGET_S390X' } },
  251. 'if': { 'any': [ 'TARGET_S390X',
  252. 'TARGET_I386',
  253. 'TARGET_ARM',
  254. 'TARGET_LOONGARCH64',
  255. 'TARGET_RISCV' ] } }
  256. ##
  257. # @query-cpu-model-expansion:
  258. #
  259. # Expands a given CPU model, @model, (or a combination of CPU model +
  260. # additional options) to different granularities, specified by @type,
  261. # allowing tooling to get an understanding what a specific CPU model
  262. # looks like in QEMU under a certain configuration.
  263. #
  264. # This interface can be used to query the "host" CPU model.
  265. #
  266. # The data returned by this command may be affected by:
  267. #
  268. # * QEMU version: CPU models may look different depending on the QEMU
  269. # version. (Except for CPU models reported as "static" in
  270. # query-cpu-definitions.)
  271. # * machine-type: CPU model may look different depending on the
  272. # machine-type. (Except for CPU models reported as "static" in
  273. # query-cpu-definitions.)
  274. # * machine options (including accelerator): in some architectures,
  275. # CPU models may look different depending on machine and accelerator
  276. # options. (Except for CPU models reported as "static" in
  277. # query-cpu-definitions.)
  278. # * "-cpu" arguments and global properties: arguments to the -cpu
  279. # option and global properties may affect expansion of CPU models.
  280. # Using query-cpu-model-expansion while using these is not advised.
  281. #
  282. # Some architectures may not support all expansion types. s390x
  283. # supports "full" and "static". Arm only supports "full".
  284. #
  285. # @model: description of the CPU model to expand
  286. #
  287. # @type: expansion type, specifying how to expand the CPU model
  288. #
  289. # Returns: a CpuModelExpansionInfo describing the expanded CPU model
  290. #
  291. # Errors:
  292. # - if expanding CPU models is not supported
  293. # - if the model cannot be expanded
  294. # - if the model contains an unknown CPU definition name, unknown
  295. # properties or properties with a wrong type
  296. # - if an expansion type is not supported
  297. #
  298. # Since: 2.8
  299. ##
  300. { 'command': 'query-cpu-model-expansion',
  301. 'data': { 'type': 'CpuModelExpansionType',
  302. 'model': 'CpuModelInfo' },
  303. 'returns': 'CpuModelExpansionInfo',
  304. 'if': { 'any': [ 'TARGET_S390X',
  305. 'TARGET_I386',
  306. 'TARGET_ARM',
  307. 'TARGET_LOONGARCH64',
  308. 'TARGET_RISCV' ] } }
  309. ##
  310. # @CpuDefinitionInfo:
  311. #
  312. # Virtual CPU definition.
  313. #
  314. # @name: the name of the CPU definition
  315. #
  316. # @migration-safe: whether a CPU definition can be safely used for
  317. # migration in combination with a QEMU compatibility machine when
  318. # migrating between different QEMU versions and between hosts with
  319. # different sets of (hardware or software) capabilities. If not
  320. # provided, information is not available and callers should not
  321. # assume the CPU definition to be migration-safe. (since 2.8)
  322. #
  323. # @static: whether a CPU definition is static and will not change
  324. # depending on QEMU version, machine type, machine options and
  325. # accelerator options. A static model is always migration-safe.
  326. # (since 2.8)
  327. #
  328. # @unavailable-features: List of properties that prevent the CPU model
  329. # from running in the current host. (since 2.8)
  330. #
  331. # @typename: Type name that can be used as argument to
  332. # @device-list-properties, to introspect properties configurable
  333. # using -cpu or -global. (since 2.9)
  334. #
  335. # @alias-of: Name of CPU model this model is an alias for. The target
  336. # of the CPU model alias may change depending on the machine type.
  337. # Management software is supposed to translate CPU model aliases
  338. # in the VM configuration, because aliases may stop being
  339. # migration-safe in the future (since 4.1)
  340. #
  341. # @deprecated: If true, this CPU model is deprecated and may be
  342. # removed in in some future version of QEMU according to the QEMU
  343. # deprecation policy. (since 5.2)
  344. #
  345. # @unavailable-features is a list of QOM property names that represent
  346. # CPU model attributes that prevent the CPU from running. If the QOM
  347. # property is read-only, that means there's no known way to make the
  348. # CPU model run in the current host. Implementations that choose not
  349. # to provide specific information return the property name "type". If
  350. # the property is read-write, it means that it MAY be possible to run
  351. # the CPU model in the current host if that property is changed.
  352. # Management software can use it as hints to suggest or choose an
  353. # alternative for the user, or just to generate meaningful error
  354. # messages explaining why the CPU model can't be used. If
  355. # @unavailable-features is an empty list, the CPU model is runnable
  356. # using the current host and machine-type. If @unavailable-features
  357. # is not present, runnability information for the CPU is not
  358. # available.
  359. #
  360. # Since: 1.2
  361. ##
  362. { 'struct': 'CpuDefinitionInfo',
  363. 'data': { 'name': 'str',
  364. '*migration-safe': 'bool',
  365. 'static': 'bool',
  366. '*unavailable-features': [ 'str' ],
  367. 'typename': 'str',
  368. '*alias-of' : 'str',
  369. 'deprecated' : 'bool' },
  370. 'if': { 'any': [ 'TARGET_PPC',
  371. 'TARGET_ARM',
  372. 'TARGET_I386',
  373. 'TARGET_S390X',
  374. 'TARGET_MIPS',
  375. 'TARGET_LOONGARCH64',
  376. 'TARGET_RISCV' ] } }
  377. ##
  378. # @query-cpu-definitions:
  379. #
  380. # Return a list of supported virtual CPU definitions
  381. #
  382. # Returns: a list of CpuDefinitionInfo
  383. #
  384. # Since: 1.2
  385. ##
  386. { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'],
  387. 'if': { 'any': [ 'TARGET_PPC',
  388. 'TARGET_ARM',
  389. 'TARGET_I386',
  390. 'TARGET_S390X',
  391. 'TARGET_MIPS',
  392. 'TARGET_LOONGARCH64',
  393. 'TARGET_RISCV' ] } }
  394. ##
  395. # @S390CpuPolarization:
  396. #
  397. # An enumeration of CPU polarization that can be assumed by a virtual
  398. # S390 CPU
  399. #
  400. # Since: 8.2
  401. ##
  402. { 'enum': 'S390CpuPolarization',
  403. 'data': [ 'horizontal', 'vertical' ],
  404. 'if': 'TARGET_S390X'
  405. }
  406. ##
  407. # @set-cpu-topology:
  408. #
  409. # Modify the topology by moving the CPU inside the topology tree, or
  410. # by changing a modifier attribute of a CPU. Absent values will not
  411. # be modified.
  412. #
  413. # @core-id: the vCPU ID to be moved
  414. #
  415. # @socket-id: destination socket to move the vCPU to
  416. #
  417. # @book-id: destination book to move the vCPU to
  418. #
  419. # @drawer-id: destination drawer to move the vCPU to
  420. #
  421. # @entitlement: entitlement to set
  422. #
  423. # @dedicated: whether the provisioning of real to virtual CPU is
  424. # dedicated
  425. #
  426. # Features:
  427. #
  428. # @unstable: This command is experimental.
  429. #
  430. # Since: 8.2
  431. ##
  432. { 'command': 'set-cpu-topology',
  433. 'data': {
  434. 'core-id': 'uint16',
  435. '*socket-id': 'uint16',
  436. '*book-id': 'uint16',
  437. '*drawer-id': 'uint16',
  438. '*entitlement': 'S390CpuEntitlement',
  439. '*dedicated': 'bool'
  440. },
  441. 'features': [ 'unstable' ],
  442. 'if': { 'all': [ 'TARGET_S390X' , 'CONFIG_KVM' ] }
  443. }
  444. ##
  445. # @CPU_POLARIZATION_CHANGE:
  446. #
  447. # Emitted when the guest asks to change the polarization.
  448. #
  449. # The guest can tell the host (via the PTF instruction) whether the
  450. # CPUs should be provisioned using horizontal or vertical
  451. # polarization.
  452. #
  453. # On horizontal polarization the host is expected to provision all
  454. # vCPUs equally.
  455. #
  456. # On vertical polarization the host can provision each vCPU
  457. # differently. The guest will get information on the details of the
  458. # provisioning the next time it uses the STSI(15) instruction.
  459. #
  460. # @polarization: polarization specified by the guest
  461. #
  462. # Features:
  463. #
  464. # @unstable: This event is experimental.
  465. #
  466. # Since: 8.2
  467. #
  468. # .. qmp-example::
  469. #
  470. # <- { "event": "CPU_POLARIZATION_CHANGE",
  471. # "data": { "polarization": "horizontal" },
  472. # "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
  473. ##
  474. { 'event': 'CPU_POLARIZATION_CHANGE',
  475. 'data': { 'polarization': 'S390CpuPolarization' },
  476. 'features': [ 'unstable' ],
  477. 'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] }
  478. }
  479. ##
  480. # @CpuPolarizationInfo:
  481. #
  482. # The result of a CPU polarization query.
  483. #
  484. # @polarization: the CPU polarization
  485. #
  486. # Since: 8.2
  487. ##
  488. { 'struct': 'CpuPolarizationInfo',
  489. 'data': { 'polarization': 'S390CpuPolarization' },
  490. 'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] }
  491. }
  492. ##
  493. # @query-s390x-cpu-polarization:
  494. #
  495. # Features:
  496. #
  497. # @unstable: This command is experimental.
  498. #
  499. # Returns: the machine's CPU polarization
  500. #
  501. # Since: 8.2
  502. ##
  503. { 'command': 'query-s390x-cpu-polarization', 'returns': 'CpuPolarizationInfo',
  504. 'features': [ 'unstable' ],
  505. 'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] }
  506. }