Files
qemu/include/system/hw_accel.h
Alexander Graf 8155bca60d accel: Add Nitro Enclaves accelerator
Nitro Enclaves are a confidential compute technology which
allows a parent instance to carve out resources from itself
and spawn a confidential sibling VM next to itself. Similar
to other confidential compute solutions, this sibling is
controlled by an underlying vmm, but still has a higher level
vmm (QEMU) to implement some of its I/O functionality and
lifecycle.

Add an accelerator to drive this interface. In combination with
follow-on patches to enhance the Nitro Enclaves machine model, this
will allow users to run a Nitro Enclave using QEMU.

Signed-off-by: Alexander Graf <graf@amazon.com>

Link: https://lore.kernel.org/r/20260225220807.33092-5-graf@amazon.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-02-27 08:18:31 +01:00

58 lines
1.3 KiB
C

/*
* QEMU Hardware accelerators support
*
* Copyright 2016 Google, Inc.
*
* 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 QEMU_HW_ACCEL_H
#define QEMU_HW_ACCEL_H
#include "hw/core/cpu.h"
#include "system/kvm.h"
#include "system/hvf.h"
#include "system/mshv.h"
#include "system/whpx.h"
#include "system/nvmm.h"
#include "system/nitro-accel.h"
/**
* cpu_synchronize_state:
* cpu_synchronize_pre_loadvm:
* @cpu: The vCPU to synchronize.
*
* Request to synchronize QEMU vCPU registers from the hardware accelerator
* (the hardware accelerator is the reference).
*/
void cpu_synchronize_state(CPUState *cpu);
void cpu_synchronize_pre_loadvm(CPUState *cpu);
/**
* cpu_synchronize_post_reset:
* cpu_synchronize_post_init:
* @cpu: The vCPU to synchronize.
*
* Request to synchronize QEMU vCPU registers to the hardware accelerator
* (QEMU is the reference).
*/
void cpu_synchronize_post_reset(CPUState *cpu);
void cpu_synchronize_post_init(CPUState *cpu);
/**
* hwaccel_enabled:
*
* Returns: %true if a hardware accelerator is enabled, %false otherwise.
*/
static inline bool hwaccel_enabled(void)
{
return hvf_enabled()
|| kvm_enabled()
|| nvmm_enabled()
|| whpx_enabled();
}
#endif /* QEMU_HW_ACCEL_H */