mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
spapr: initial implementation for H_TPM_COMM/spapr-tpm-proxy
This implements the H_TPM_COMM hypercall, which is used by an Ultravisor to pass TPM commands directly to the host's TPM device, or a TPM Resource Manager associated with the device. This also introduces a new virtual device, spapr-tpm-proxy, which is used to configure the host TPM path to be used to service requests sent by H_TPM_COMM hcalls, for example: -device spapr-tpm-proxy,id=tpmp0,host-path=/dev/tpmrm0 By default, no spapr-tpm-proxy will be created, and hcalls will return H_FUNCTION. The full specification for this hypercall can be found in docs/specs/ppc-spapr-uv-hcalls.txt Since SVM-related hcalls like H_TPM_COMM use a reserved range of 0xEF00-0xEF80, we introduce a separate hcall table here to handle them. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com Message-Id: <20190717205842.17827-3-mdroth@linux.vnet.ibm.com> [dwg: Corrected #include for upstream change] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
1daba4d1b2
commit
0fb6bd0732
7 changed files with 270 additions and 1 deletions
31
include/hw/ppc/spapr_tpm_proxy.h
Normal file
31
include/hw/ppc/spapr_tpm_proxy.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* SPAPR TPM Proxy/Hypercall
|
||||
*
|
||||
* Copyright IBM Corp. 2019
|
||||
*
|
||||
* Authors:
|
||||
* Michael Roth <mdroth@linux.vnet.ibm.com>
|
||||
*
|
||||
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
||||
* See the COPYING file in the top-level directory.
|
||||
*/
|
||||
|
||||
#ifndef HW_SPAPR_TPM_PROXY_H
|
||||
#define HW_SPAPR_TPM_PROXY_H
|
||||
|
||||
#include "qom/object.h"
|
||||
#include "hw/qdev-core.h"
|
||||
|
||||
#define TYPE_SPAPR_TPM_PROXY "spapr-tpm-proxy"
|
||||
#define SPAPR_TPM_PROXY(obj) OBJECT_CHECK(SpaprTpmProxy, (obj), \
|
||||
TYPE_SPAPR_TPM_PROXY)
|
||||
|
||||
typedef struct SpaprTpmProxy {
|
||||
/*< private >*/
|
||||
DeviceState parent;
|
||||
|
||||
char *host_path;
|
||||
int host_fd;
|
||||
} SpaprTpmProxy;
|
||||
|
||||
#endif /* HW_SPAPR_TPM_PROXY_H */
|
Loading…
Add table
Add a link
Reference in a new issue