summaryrefslogtreecommitdiffstats
path: root/cachepc/event.h
blob: 8949dbd7cfb07f03c384163581014be8cd5b8500 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

#include "uapi.h"

#include <linux/kvm.h>
#include <linux/kvm_host.h>
#include <linux/types.h>

extern uint64_t cachepc_last_event_sent;
extern uint64_t cachepc_last_event_acked;
extern rwlock_t cachepc_event_lock;

extern struct cpc_event cachepc_event;
extern bool cachepc_event_avail;

extern bool cachepc_events_init;

void cachepc_events_reset(void);

int cachepc_send_guest_event(uint64_t type, uint64_t val);
int cachepc_send_track_step_event(struct list_head *list);
int cachepc_send_track_step_event_single(uint64_t gfn, uint32_t err, uint64_t retinst);
int cachepc_send_track_page_event(uint64_t gfn_prev, uint64_t gfn, uint64_t retinst);
bool cachepc_event_is_done(uint64_t id);

int cachepc_handle_poll_event_ioctl(struct cpc_event *user);
int cachepc_handle_ack_event_ioctl(uint64_t eventid);