Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_mem_event & slat_control functions added #95

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libvmi/events_cdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ struct vmi_event {
status_t vmi_register_event(
vmi_instance_t vmi,
vmi_event_t *event);

status_t vmi_set_mem_event(
vmi_instance_t vmi,
addr_t gfn,
vmi_mem_access_t access,
uint16_t slat_id);

status_t vmi_events_listen(
vmi_instance_t vmi,
Expand Down
9 changes: 9 additions & 0 deletions libvmi/libvmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,10 @@ def register_event(self, event):
status = lib.vmi_register_event(self.vmi, cffi_event)
check(status)

def set_mem_event(self, gfn, access, slatid):
status = lib.vmi_set_mem_event(self.vmi, gfn, access, slatid)
check(status)

def clear_event(self, event):
cffi_event = event.to_cffi()
status = lib.vmi_clear_event(self.vmi, cffi_event, ffi.NULL)
Expand Down Expand Up @@ -1017,6 +1021,11 @@ def get_va_pages(self, dtb):
return va_pages

# slat
def slat_control(self, state):
state = ffi.new("bool *")
status = lib.vmi_slat_control(self.vmi, state)
check(status)

def slat_get_domain_state(self):
state = ffi.new("bool *")
status = lib.vmi_slat_get_domain_state(self.vmi, state)
Expand Down
4 changes: 4 additions & 0 deletions libvmi/slat_cdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ status_t vmi_slat_change_gfn (
uint16_t slat_idx,
addr_t old_gfn,
addr_t new_gfn);

status_t vmi_slat_control (
vmi_instance_t vmi,
bool *state);
Loading