]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - include/xen/hvm.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Simple wrappers around HVM functions */
6 #include <xen/interface/hvm/params.h>
7 #include <asm/xen/hypercall.h>
9 static const char *param_name(int op
)
11 #define PARAM(x) [HVM_PARAM_##x] = #x
12 static const char *const names
[] = {
27 PARAM(CONSOLE_EVTCHN
),
31 if (op
>= ARRAY_SIZE(names
))
39 static inline int hvm_get_parameter(int idx
, uint64_t *value
)
41 struct xen_hvm_param xhv
;
44 xhv
.domid
= DOMID_SELF
;
46 r
= HYPERVISOR_hvm_op(HVMOP_get_param
, &xhv
);
48 pr_err("Cannot get hvm parameter %s (%d): %d!\n",
49 param_name(idx
), idx
, r
);
56 #define HVM_CALLBACK_VIA_TYPE_VECTOR 0x2
57 #define HVM_CALLBACK_VIA_TYPE_SHIFT 56
58 #define HVM_CALLBACK_VECTOR(x) (((uint64_t)HVM_CALLBACK_VIA_TYPE_VECTOR)<<\
59 HVM_CALLBACK_VIA_TYPE_SHIFT | (x))
61 #endif /* XEN_HVM_H__ */