xref: /qemu/qapi/tpm.json (revision 5a954e02)
1# -*- Mode: Python -*-
2# vim: filetype=python
3#
4
5##
6# = TPM (trusted platform module) devices
7##
8
9##
10# @TpmModel:
11#
12# An enumeration of TPM models
13#
14# @tpm-tis: TPM TIS model
15# @tpm-crb: TPM CRB model (since 2.12)
16# @tpm-spapr: TPM SPAPR model (since 5.0)
17#
18# Since: 1.5
19##
20{ 'enum': 'TpmModel', 'data': [ 'tpm-tis', 'tpm-crb', 'tpm-spapr' ],
21  'if': 'CONFIG_TPM' }
22
23##
24# @query-tpm-models:
25#
26# Return a list of supported TPM models
27#
28# Returns: a list of TpmModel
29#
30# Since: 1.5
31#
32# Example:
33#
34# -> { "execute": "query-tpm-models" }
35# <- { "return": [ "tpm-tis", "tpm-crb", "tpm-spapr" ] }
36#
37##
38{ 'command': 'query-tpm-models', 'returns': ['TpmModel'],
39  'if': 'CONFIG_TPM' }
40
41##
42# @TpmType:
43#
44# An enumeration of TPM types
45#
46# @passthrough: TPM passthrough type
47# @emulator: Software Emulator TPM type (since 2.11)
48#
49# Since: 1.5
50##
51{ 'enum': 'TpmType', 'data': [ 'passthrough', 'emulator' ],
52  'if': 'CONFIG_TPM' }
53
54##
55# @query-tpm-types:
56#
57# Return a list of supported TPM types
58#
59# Returns: a list of TpmType
60#
61# Since: 1.5
62#
63# Example:
64#
65# -> { "execute": "query-tpm-types" }
66# <- { "return": [ "passthrough", "emulator" ] }
67#
68##
69{ 'command': 'query-tpm-types', 'returns': ['TpmType'],
70  'if': 'CONFIG_TPM' }
71
72##
73# @TPMPassthroughOptions:
74#
75# Information about the TPM passthrough type
76#
77# @path: string describing the path used for accessing the TPM device
78#
79# @cancel-path: string showing the TPM's sysfs cancel file
80#               for cancellation of TPM commands while they are executing
81#
82# Since: 1.5
83##
84{ 'struct': 'TPMPassthroughOptions',
85  'data': { '*path': 'str',
86            '*cancel-path': 'str' },
87  'if': 'CONFIG_TPM' }
88
89##
90# @TPMEmulatorOptions:
91#
92# Information about the TPM emulator type
93#
94# @chardev: Name of a unix socket chardev
95#
96# Since: 2.11
97##
98{ 'struct': 'TPMEmulatorOptions', 'data': { 'chardev' : 'str' },
99  'if': 'CONFIG_TPM' }
100
101##
102# @TPMPassthroughOptionsWrapper:
103#
104# Since: 1.5
105##
106{ 'struct': 'TPMPassthroughOptionsWrapper',
107  'data': { 'data': 'TPMPassthroughOptions' },
108  'if': 'CONFIG_TPM' }
109
110##
111# @TPMEmulatorOptionsWrapper:
112#
113# Since: 2.11
114##
115{ 'struct': 'TPMEmulatorOptionsWrapper',
116  'data': { 'data': 'TPMEmulatorOptions' },
117  'if': 'CONFIG_TPM' }
118
119##
120# @TpmTypeOptions:
121#
122# A union referencing different TPM backend types' configuration options
123#
124# @type: - 'passthrough' The configuration options for the TPM passthrough type
125#        - 'emulator' The configuration options for TPM emulator backend type
126#
127# Since: 1.5
128##
129{ 'union': 'TpmTypeOptions',
130  'base': { 'type': 'TpmType' },
131  'discriminator': 'type',
132  'data': { 'passthrough' : 'TPMPassthroughOptionsWrapper',
133            'emulator': 'TPMEmulatorOptionsWrapper' },
134  'if': 'CONFIG_TPM' }
135
136##
137# @TPMInfo:
138#
139# Information about the TPM
140#
141# @id: The Id of the TPM
142#
143# @model: The TPM frontend model
144#
145# @options: The TPM (backend) type configuration options
146#
147# Since: 1.5
148##
149{ 'struct': 'TPMInfo',
150  'data': {'id': 'str',
151           'model': 'TpmModel',
152           'options': 'TpmTypeOptions' },
153  'if': 'CONFIG_TPM' }
154
155##
156# @query-tpm:
157#
158# Return information about the TPM device
159#
160# Returns: @TPMInfo on success
161#
162# Since: 1.5
163#
164# Example:
165#
166# -> { "execute": "query-tpm" }
167# <- { "return":
168#      [
169#        { "model": "tpm-tis",
170#          "options":
171#            { "type": "passthrough",
172#              "data":
173#                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
174#                  "path": "/dev/tpm0"
175#                }
176#            },
177#          "id": "tpm0"
178#        }
179#      ]
180#    }
181#
182##
183{ 'command': 'query-tpm', 'returns': ['TPMInfo'],
184  'if': 'CONFIG_TPM' }
185