1/* @title: KVM Guest */
2#pragma once
3#include <err.h>
4#include <stdbool.h>
5#include <stdint.h>
6#include <virt/kvm_para.h>
7
8bool kvm_detect(void);
9
10bool kvm_has_feature(uint32_t feature);
11
12/* Uses vmcall or vmmcall as the
13 * CPU vendor requires. ERR_NO_DEV when not running on KVM,
14 * returning other errors too.
15 *
16 * TODO: Consider error facility*/
17err_checked kvm_hypercall4(uint64_t nr, uint64_t a0, uint64_t a1, uint64_t a2,
18 uint64_t a3, uint64_t *out);
19