]> git.ipfire.org Git - thirdparty/qemu.git/commit
i386/tdx: handle TDG.VP.VMCALL<GetQuote>
authorIsaku Yamahata <isaku.yamahata@intel.com>
Mon, 28 Nov 2022 09:43:52 +0000 (17:43 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 20 Jun 2025 11:25:59 +0000 (13:25 +0200)
commit40da501d8989913935660dc24953ece02c9e98b8
treeb76674a018d27d6a45e6e9a69770a0cf9d2ae5e7
parent427b8cf47a6959cd8b0db12bcf66e9009afa2c07
i386/tdx: handle TDG.VP.VMCALL<GetQuote>

Add property "quote-generation-socket" to tdx-guest, which is a property
of type SocketAddress to specify Quote Generation Service(QGS).

On request of GetQuote, it connects to the QGS socket, read request
data from shared guest memory, send the request data to the QGS,
and store the response into shared guest memory, at last notify
TD guest by interrupt.

command line example:
  qemu-system-x86_64 \
    -object '{"qom-type":"tdx-guest","id":"tdx0","quote-generation-socket":{"type":"unix", "path":"/var/run/tdx-qgs/qgs.socket"}}' \
    -machine confidential-guest-support=tdx0

Note, above example uses the unix socket. It can be other types, like vsock,
which depends on the implementation of QGS.

To avoid no response from QGS server, setup a timer for the transaction.
If timeout, make it an error and interrupt guest. Define the threshold of
time to 30s at present, maybe change to other value if not appropriate.

Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
Co-developed-by: Chenyi Qiang <chenyi.qiang@intel.com>
Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
Co-developed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Tested-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qapi/qom.json
target/i386/kvm/kvm.c
target/i386/kvm/meson.build
target/i386/kvm/tdx-quote-generator.c [new file with mode: 0644]
target/i386/kvm/tdx-quote-generator.h [new file with mode: 0644]
target/i386/kvm/tdx-stub.c
target/i386/kvm/tdx.c
target/i386/kvm/tdx.h