AArch64 EL2 hypervisor for QEMU virt that boots at EL2
1#ifndef HV_LOG_H
2#define HV_LOG_H
3
4#include "hv/types.h"
5
6enum log_kind {
7 LOG_BOOT = 1,
8 LOG_TRAP = 2,
9 LOG_POLICY = 3,
10 LOG_HVC = 4,
11 LOG_ABORT = 5,
12 LOG_MONITOR = 6,
13 LOG_PANIC = 7,
14 LOG_SELFTEST = 8,
15};
16
17enum log_action {
18 LOG_ACT_NONE = 0,
19 LOG_ACT_EMULATE_READ,
20 LOG_ACT_EMULATE_WRITE,
21 LOG_ACT_WRITE_MASK,
22 LOG_ACT_DENY_SKIP,
23 LOG_ACT_DENY_UNDEF,
24 LOG_ACT_PAUSE,
25 LOG_ACT_PANIC,
26};
27
28struct log_event {
29 uint64_t seq;
30 uint64_t cpu;
31 uint64_t vcpu;
32 uint64_t timestamp;
33 uint32_t kind;
34 uint32_t ec;
35 uint64_t iss;
36 uint64_t elr;
37 uint64_t far;
38 uint64_t hpfar;
39 uint64_t sysreg_key;
40 uint32_t is_read;
41 uint32_t rt;
42 uint64_t operand;
43 uint64_t result;
44 uint32_t action;
45 uint32_t reason;
46 uint64_t pstate;
47 const char *name;
48};
49
50void log_init(void);
51void log_event_commit(const struct log_event *event);
52void log_simple(enum log_kind kind, uint32_t reason, uint64_t a, uint64_t b);
53void log_dump(unsigned limit);
54void log_clear(void);
55bool log_selftest(void);
56
57#endif