linux/drivers/virt/acrn/hypercall.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * ACRN HSM: hypercalls of ACRN Hypervisor
 */
#ifndef __ACRN_HSM_HYPERCALL_H
#define __ACRN_HSM_HYPERCALL_H
#include <asm/acrn.h>

/*
 * Hypercall IDs of the ACRN Hypervisor
 */
#define _HC_ID(x, y)

#define HC_ID

#define HC_ID_GEN_BASE
#define HC_SOS_REMOVE_CPU

#define HC_ID_VM_BASE
#define HC_CREATE_VM
#define HC_DESTROY_VM
#define HC_START_VM
#define HC_PAUSE_VM
#define HC_RESET_VM
#define HC_SET_VCPU_REGS

#define HC_ID_IRQ_BASE
#define HC_INJECT_MSI
#define HC_VM_INTR_MONITOR
#define HC_SET_IRQLINE

#define HC_ID_IOREQ_BASE
#define HC_SET_IOREQ_BUFFER
#define HC_NOTIFY_REQUEST_FINISH

#define HC_ID_MEM_BASE
#define HC_VM_SET_MEMORY_REGIONS

#define HC_ID_PCI_BASE
#define HC_SET_PTDEV_INTR
#define HC_RESET_PTDEV_INTR
#define HC_ASSIGN_PCIDEV
#define HC_DEASSIGN_PCIDEV
#define HC_ASSIGN_MMIODEV
#define HC_DEASSIGN_MMIODEV
#define HC_CREATE_VDEV
#define HC_DESTROY_VDEV

#define HC_ID_PM_BASE
#define HC_PM_GET_CPU_STATE

/**
 * hcall_sos_remove_cpu() - Remove a vCPU of Service VM
 * @cpu: The vCPU to be removed
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_sos_remove_cpu(u64 cpu)
{}

/**
 * hcall_create_vm() - Create a User VM
 * @vminfo:	Service VM GPA of info of User VM creation
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_create_vm(u64 vminfo)
{}

/**
 * hcall_start_vm() - Start a User VM
 * @vmid:	User VM ID
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_start_vm(u64 vmid)
{}

/**
 * hcall_pause_vm() - Pause a User VM
 * @vmid:	User VM ID
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_pause_vm(u64 vmid)
{}

/**
 * hcall_destroy_vm() - Destroy a User VM
 * @vmid:	User VM ID
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_destroy_vm(u64 vmid)
{}

/**
 * hcall_reset_vm() - Reset a User VM
 * @vmid:	User VM ID
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_reset_vm(u64 vmid)
{}

/**
 * hcall_set_vcpu_regs() - Set up registers of virtual CPU of a User VM
 * @vmid:	User VM ID
 * @regs_state:	Service VM GPA of registers state
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_set_vcpu_regs(u64 vmid, u64 regs_state)
{}

/**
 * hcall_inject_msi() - Deliver a MSI interrupt to a User VM
 * @vmid:	User VM ID
 * @msi:	Service VM GPA of MSI message
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_inject_msi(u64 vmid, u64 msi)
{}

/**
 * hcall_vm_intr_monitor() - Set a shared page for User VM interrupt statistics
 * @vmid:	User VM ID
 * @addr:	Service VM GPA of the shared page
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_vm_intr_monitor(u64 vmid, u64 addr)
{}

/**
 * hcall_set_irqline() - Set or clear an interrupt line
 * @vmid:	User VM ID
 * @op:		Service VM GPA of interrupt line operations
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_set_irqline(u64 vmid, u64 op)
{}

/**
 * hcall_set_ioreq_buffer() - Set up the shared buffer for I/O Requests.
 * @vmid:	User VM ID
 * @buffer:	Service VM GPA of the shared buffer
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_set_ioreq_buffer(u64 vmid, u64 buffer)
{}

/**
 * hcall_notify_req_finish() - Notify ACRN Hypervisor of I/O request completion.
 * @vmid:	User VM ID
 * @vcpu:	The vCPU which initiated the I/O request
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_notify_req_finish(u64 vmid, u64 vcpu)
{}

/**
 * hcall_set_memory_regions() - Inform the hypervisor to set up EPT mappings
 * @regions_pa:	Service VM GPA of &struct vm_memory_region_batch
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_set_memory_regions(u64 regions_pa)
{}

/**
 * hcall_create_vdev() - Create a virtual device for a User VM
 * @vmid:	User VM ID
 * @addr:	Service VM GPA of the &struct acrn_vdev
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_create_vdev(u64 vmid, u64 addr)
{}

/**
 * hcall_destroy_vdev() - Destroy a virtual device of a User VM
 * @vmid:	User VM ID
 * @addr:	Service VM GPA of the &struct acrn_vdev
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_destroy_vdev(u64 vmid, u64 addr)
{}

/**
 * hcall_assign_mmiodev() - Assign a MMIO device to a User VM
 * @vmid:	User VM ID
 * @addr:	Service VM GPA of the &struct acrn_mmiodev
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_assign_mmiodev(u64 vmid, u64 addr)
{}

/**
 * hcall_deassign_mmiodev() - De-assign a PCI device from a User VM
 * @vmid:	User VM ID
 * @addr:	Service VM GPA of the &struct acrn_mmiodev
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_deassign_mmiodev(u64 vmid, u64 addr)
{}

/**
 * hcall_assign_pcidev() - Assign a PCI device to a User VM
 * @vmid:	User VM ID
 * @addr:	Service VM GPA of the &struct acrn_pcidev
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_assign_pcidev(u64 vmid, u64 addr)
{}

/**
 * hcall_deassign_pcidev() - De-assign a PCI device from a User VM
 * @vmid:	User VM ID
 * @addr:	Service VM GPA of the &struct acrn_pcidev
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_deassign_pcidev(u64 vmid, u64 addr)
{}

/**
 * hcall_set_ptdev_intr() - Configure an interrupt for an assigned PCI device.
 * @vmid:	User VM ID
 * @irq:	Service VM GPA of the &struct acrn_ptdev_irq
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_set_ptdev_intr(u64 vmid, u64 irq)
{}

/**
 * hcall_reset_ptdev_intr() - Reset an interrupt for an assigned PCI device.
 * @vmid:	User VM ID
 * @irq:	Service VM GPA of the &struct acrn_ptdev_irq
 *
 * Return: 0 on success, <0 on failure
 */
static inline long hcall_reset_ptdev_intr(u64 vmid, u64 irq)
{}

/*
 * hcall_get_cpu_state() - Get P-states and C-states info from the hypervisor
 * @state:	Service VM GPA of buffer of P-states and C-states
 */
static inline long hcall_get_cpu_state(u64 cmd, u64 state)
{}

#endif /* __ACRN_HSM_HYPERCALL_H */