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

Update libkvmi #1

Open
wants to merge 8 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
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
os: [ubuntu-20.04, ubuntu-22.04]

steps:
- name: Install required packages
run: sudo apt-get install uuid-dev
- uses: actions/checkout@v1
- name: Bootstrap
run: ./bootstrap
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![Build](https://github.com/bitdefender/libkvmi/workflows/Build/badge.svg)

(c) 2017-2021 Bitdefender SRL
(c) 2017-2023 Bitdefender SRL

## Usage

Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ AS_CASE([$host_cpu],
)
AC_SUBST([ARCH])

AC_CHECK_HEADERS([uuid/uuid.h], [], [AC_MSG_ERROR([please install the uuid development package])])

AC_OUTPUT(Makefile src/Makefile include/Makefile examples/Makefile libkvmi.pc)
2 changes: 1 addition & 1 deletion include/libkvmi.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2021 Bitdefender S.R.L.
* Copyright (C) 2017-2023 Bitdefender S.R.L.
*
* The KVMI Library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down
95 changes: 54 additions & 41 deletions include/linux/kvmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,47 @@
#define KVMI_VERSION 0x00000001

enum {
KVMI_EVENT_REPLY = 0,
KVMI_EVENT = 1,

KVMI_GET_VERSION = 2,
KVMI_CHECK_COMMAND = 3,
KVMI_CHECK_EVENT = 4,
KVMI_GET_GUEST_INFO = 5,
KVMI_GET_VCPU_INFO = 6,
KVMI_PAUSE_VCPU = 7,
KVMI_CONTROL_VM_EVENTS = 8,
KVMI_CONTROL_EVENTS = 9,
KVMI_CONTROL_CR = 10,
KVMI_CONTROL_MSR = 11,
KVMI_CONTROL_VE = 12,
KVMI_GET_REGISTERS = 13,
KVMI_SET_REGISTERS = 14,
KVMI_GET_CPUID = 15,
KVMI_GET_XSAVE = 16,
KVMI_READ_PHYSICAL = 17,
KVMI_WRITE_PHYSICAL = 18,
KVMI_INJECT_EXCEPTION = 19,
KVMI_GET_PAGE_ACCESS = 20,
KVMI_SET_PAGE_ACCESS = 21,
KVMI_GET_MAP_TOKEN = 22,
KVMI_GET_MTRR_TYPE = 23,
KVMI_CONTROL_SPP = 24,
KVMI_GET_PAGE_WRITE_BITMAP = 25,
KVMI_SET_PAGE_WRITE_BITMAP = 26,
KVMI_CONTROL_CMD_RESPONSE = 27,
KVMI_SET_VE_INFO_PAGE = 28,
KVMI_GET_MAX_GFN = 29,
KVMI_SET_EPT_PAGE_CONV = 30,
KVMI_GET_EPT_PAGE_CONV = 31,
KVMI_SWITCH_EPT_VIEW = 32,
KVMI_DISABLE_VE = 33,
KVMI_GET_EPT_VIEW = 34,
KVMI_VCPU_TRANSLATE_GVA = 35,
KVMI_CONTROL_EPT_VIEW = 36,
KVMI_VCPU_GET_XCR = 37,
KVMI_VCPU_SET_XSAVE = 38,
KVMI_VCPU_CHANGE_GFN = 60,
KVMI_EVENT_REPLY = 0,
KVMI_EVENT = 1,

KVMI_GET_VERSION = 2,
KVMI_CHECK_COMMAND = 3,
KVMI_CHECK_EVENT = 4,
KVMI_GET_GUEST_INFO = 5,
KVMI_GET_VCPU_INFO = 6,
KVMI_PAUSE_VCPU = 7,
KVMI_CONTROL_VM_EVENTS = 8,
KVMI_CONTROL_EVENTS = 9,
KVMI_CONTROL_CR = 10,
KVMI_CONTROL_MSR = 11,
KVMI_CONTROL_VE = 12,
KVMI_GET_REGISTERS = 13,
KVMI_SET_REGISTERS = 14,
KVMI_GET_CPUID = 15,
KVMI_GET_XSAVE = 16,
KVMI_READ_PHYSICAL = 17,
KVMI_WRITE_PHYSICAL = 18,
KVMI_INJECT_EXCEPTION = 19,
KVMI_GET_PAGE_ACCESS = 20,
KVMI_SET_PAGE_ACCESS = 21,
KVMI_GET_MAP_TOKEN = 22,
KVMI_GET_MTRR_TYPE = 23,
KVMI_CONTROL_SPP = 24,
KVMI_GET_PAGE_WRITE_BITMAP = 25,
KVMI_SET_PAGE_WRITE_BITMAP = 26,
KVMI_CONTROL_CMD_RESPONSE = 27,
KVMI_SET_VE_INFO_PAGE = 28,
KVMI_GET_MAX_GFN = 29,
KVMI_GET_NEXT_AVAILABLE_GFN = 31,
KVMI_SWITCH_EPT_VIEW = 32,
KVMI_DISABLE_VE = 33,
KVMI_GET_EPT_VIEW = 34,
KVMI_VCPU_TRANSLATE_GVA = 35,
KVMI_CONTROL_EPT_VIEW = 36,
KVMI_VCPU_GET_XCR = 37,
KVMI_VCPU_SET_XSAVE = 38,
KVMI_QUERY_PHYSICAL = 39,
KVMI_VCPU_CHANGE_GFN = 60,

KVMI_VCPU_CONTROL_SINGLESTEP = 63,

Expand Down Expand Up @@ -201,6 +201,15 @@ struct kvmi_write_physical {
__u8 data[0];
};

struct kvmi_query_physical {
__u64 gfn;
};

struct kvmi_query_physical_reply {
__u64 gfn;
__u64 size;
};

struct kvmi_vcpu_hdr {
__u16 vcpu;
__u16 padding1;
Expand Down Expand Up @@ -262,6 +271,10 @@ struct kvmi_get_max_gfn_reply {
__u64 gfn;
};

struct kvmi_get_next_available_gfn_reply {
__u64 gfn;
};

struct kvmi_set_ve_info_page {
__u64 gpa;
__u8 trigger_vmexit;
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/linux/$(ARCH)
lib_LTLIBRARIES = libkvmi.la

libkvmi_la_SOURCES = kvmi.c
libkvmi_la_LDFLAGS = -pthread -version-number 1:1 \
libkvmi_la_LDFLAGS = -luuid -pthread -version-number 1:1 \
-Wl,--version-script,$(srcdir)/version.ld
Loading