@@ -20,6 +20,12 @@
typedef struct AccelOpsClass AccelOpsClass;
DECLARE_CLASS_CHECKERS(AccelOpsClass, ACCEL_OPS, TYPE_ACCEL_OPS)
+typedef enum {
+ CONFIDENTIAL_GUEST_SUPPORTED,
+ /* A confidential guest can share its private memory with host at runtime */
+ CONFIDENTIAL_GUEST_CAN_SHARE_MEM_WITH_HOST,
+} AccelCap;
+
/* cpus.c operations interface */
struct AccelOpsClass {
/*< private >*/
@@ -47,6 +53,8 @@ struct AccelOpsClass {
int64_t (*get_virtual_clock)(void);
int64_t (*get_elapsed_ticks)(void);
+ bool (*check_capability)(AccelCap capability);
+
/* gdbstub hooks */
bool (*supports_guest_debug)(void);
int (*update_guest_debug)(CPUState *cpu);
check_capability() offers a mechanism to discover accelerator capabilities. Two capabilities are introduced at this time to discover if confidential guest support exists and whether a confidential guest can share its private memory with host (using appropriate hypervisor APIs). Signed-off-by: Srivatsa Vaddagiri <quic_svaddagi@quicinc.com> --- include/sysemu/accel-ops.h | 8 ++++++++ 1 file changed, 8 insertions(+)