Displaying 20 results from an estimated 31 matches for "test_assert".
2020 Jul 21
0
[PATCH v9 40/84] KVM: introspection: add the read/dispatch message function
...;
#include "linux/kvmi.h"
#define VCPU_ID 5
@@ -116,10 +117,109 @@ static void unhook_introspection(struct kvm_vm *vm)
errno, strerror(errno));
}
+static void receive_data(void *dest, size_t size)
+{
+ ssize_t r;
+
+ r = recv(Userspace_socket, dest, size, MSG_WAITALL);
+ TEST_ASSERT(r == size,
+ "recv() failed, expected %zd, result %zd, errno %d (%s)\n",
+ size, r, errno, strerror(errno));
+}
+
+static int receive_cmd_reply(struct kvmi_msg_hdr *req, void *rpl,
+ size_t rpl_size)
+{
+ struct kvmi_msg_hdr hdr;
+ struct kvmi_error_code ec;
+
+ receive_data(&...
2020 Feb 07
0
[RFC PATCH v7 39/78] KVM: introspection: add the read/dispatch message function
....h"
+
#define VCPU_ID 5
static int socket_pair[2];
@@ -80,10 +83,107 @@ static void unhook_introspection(struct kvm_vm *vm)
errno, strerror(errno));
}
+static void receive_data(void *dest, size_t size)
+{
+ ssize_t r;
+
+ r = recv(Userspace_socket, dest, size, MSG_WAITALL);
+ TEST_ASSERT(r == size,
+ "recv() failed, expected %d, result %d, errno %d (%s)\n",
+ size, r, errno, strerror(errno));
+}
+
+static int receive_cmd_reply(struct kvmi_msg_hdr *req, void *rpl,
+ size_t rpl_size)
+{
+ struct kvmi_msg_hdr hdr;
+ struct kvmi_error_code ec;
+
+ receive_data(&h...
2020 Feb 07
0
[RFC PATCH v7 53/78] KVM: introspection: add KVMI_VCPU_CONTROL_EVENTS
...eq.cmd.event_id = event_id;
+ req.cmd.enable = enable ? 1 : 0;
+
+ return do_vcpu0_command(vm, KVMI_VCPU_CONTROL_EVENTS,
+ &req.hdr, sizeof(req), NULL, 0);
+}
+
+static void enable_vcpu_event(struct kvm_vm *vm, __u16 event_id)
+{
+ int r;
+
+ r = cmd_vcpu_control_event(vm, event_id, true);
+ TEST_ASSERT(r == 0,
+ "KVMI_VCPU_CONTROL_EVENTS failed to enable vCPU event %d, error %d(%s)\n",
+ event_id, -r, kvm_strerror(-r));
+}
+
+static void disable_vcpu_event(struct kvm_vm *vm, __u16 event_id)
+{
+ int r;
+
+ r = cmd_vcpu_control_event(vm, event_id, false);
+ TEST_ASSERT(r == 0,
+ "...
2020 Feb 07
0
[RFC PATCH v7 43/78] KVM: introspection: add KVMI_EVENT_UNHOOK
...sting/selftests/kvm/x86_64/kvmi_test.c
@@ -268,6 +268,47 @@ static void test_cmd_get_vm_info(void)
DEBUG("vcpu count: %u\n", rpl.vcpu_count);
}
+static void trigger_event_unhook_notification(struct kvm_vm *vm)
+{
+ int r;
+
+ r = ioctl(vm->fd, KVM_INTROSPECTION_PREUNHOOK, NULL);
+ TEST_ASSERT(r == 0,
+ "KVM_INTROSPECTION_PREUNHOOK failed, errno %d (%s)\n",
+ errno, strerror(errno));
+}
+
+static void receive_event(struct kvmi_msg_hdr *hdr, struct kvmi_event *ev,
+ size_t ev_size, int event_id)
+{
+ receive_data(hdr, sizeof(*hdr));
+
+ TEST_ASSERT(hdr->id == KVMI_EVENT,...
2020 Feb 07
0
[RFC PATCH v7 41/78] KVM: introspection: add KVMI_VM_CHECK_COMMAND and KVMI_VM_CHECK_EVENT
...mand cmd;
+ } req = {};
+
+ req.cmd.id = id;
+
+ return do_command(KVMI_VM_CHECK_COMMAND, &req.hdr, sizeof(req), NULL,
+ 0);
+}
+
+static void test_cmd_check_command(void)
+{
+ __u16 valid_id = KVMI_GET_VERSION;
+ __u16 invalid_id = 0xffff;
+ int r;
+
+ r = cmd_check_command(valid_id);
+ TEST_ASSERT(r == 0,
+ "KVMI_VM_CHECK_COMMAND failed, error %d (%s)\n",
+ -r, kvm_strerror(-r));
+
+ r = cmd_check_command(invalid_id);
+ TEST_ASSERT(r == -KVM_EINVAL,
+ "KVMI_VM_CHECK_COMMAND didn't failed with -KVM_EINVAL, error %d (%s)\n",
+ -r, kvm_strerror(-r));
+}
+
+static int...
2020 Jul 21
0
[PATCH v9 44/84] KVM: introspection: add KVMI_EVENT_UNHOOK
...atic void test_cmd_vm_get_info(void)
@@ -323,6 +335,52 @@ static void test_cmd_vm_get_info(void)
pr_info("vcpu count: %u\n", rpl.vcpu_count);
}
+static void trigger_event_unhook_notification(struct kvm_vm *vm)
+{
+ int r;
+
+ r = ioctl(vm->fd, KVM_INTROSPECTION_PREUNHOOK, NULL);
+ TEST_ASSERT(r == 0,
+ "KVM_INTROSPECTION_PREUNHOOK failed, errno %d (%s)\n",
+ errno, strerror(errno));
+}
+
+static void receive_event(struct kvmi_msg_hdr *hdr, struct kvmi_event *ev,
+ size_t ev_size, int event_id)
+{
+ size_t to_read = ev_size;
+
+ receive_data(hdr, sizeof(*hdr));
+
+ TEST_A...
2020 Feb 07
0
[RFC PATCH v7 38/78] KVM: introspection: add permission access ioctls
...void setup_socket(void)
errno, strerror(errno));
}
+static void toggle_event_permission(struct kvm_vm *vm, __s32 id, bool allow)
+{
+ struct kvm_introspection_feature feat = {
+ .allow = allow ? 1 : 0,
+ .id = id
+ };
+ int r;
+
+ r = ioctl(vm->fd, KVM_INTROSPECTION_EVENT, &feat);
+ TEST_ASSERT(r == 0,
+ "KVM_INTROSPECTION_EVENT failed, id %d, errno %d (%s)\n",
+ id, errno, strerror(errno));
+}
+
+static void allow_event(struct kvm_vm *vm, __s32 event_id)
+{
+ toggle_event_permission(vm, event_id, true);
+}
+
static void hook_introspection(struct kvm_vm *vm)
{
+ __s32 all_ID...
2020 Feb 07
0
[RFC PATCH v7 69/78] KVM: introspection: add KVMI_VCPU_CONTROL_MSR and KVMI_EVENT_MSR
...msr;
+ req.cmd.enable = enable ? 1 : 0;
+
+ return do_vcpu0_command(vm, KVMI_VCPU_CONTROL_MSR,
+ &req.hdr, sizeof(req), NULL, 0);
+}
+
+static void enable_msr_events(struct kvm_vm *vm, __u32 msr)
+{
+ int r;
+
+ enable_vcpu_event(vm, KVMI_EVENT_MSR);
+
+ r = cmd_control_msr(vm, msr, true);
+ TEST_ASSERT(r == 0,
+ "KVMI_EVENT_MSR failed, error %d(%s)\n",
+ -r, kvm_strerror(-r));
+}
+
+static void disable_msr_events(struct kvm_vm *vm, __u32 msr)
+{
+ int r;
+
+ r = cmd_control_msr(vm, msr, false);
+ TEST_ASSERT(r == 0,
+ "KVMI_EVENT_MSR failed, error %d(%s)\n",
+ -r, kvm_stre...
2019 Mar 05
2
Dovecot v2.3.5 released
Hi!
We are happy to release dovecot v2.3.5.
Please find sources at
https://dovecot.org/releases/2.3/dovecot-2.3.5.tar.gz
https://dovecot.org/releases/2.3/dovecot-2.3.5.tar.gz.sig
You can find precompiled binaries at
https://repo.dovecot.org/
NEWS:
+ Lua push notification driver: mail keywords and flags are provided in MessageNew and MessageAppend events.
+ submission: Implement support for
2019 Mar 05
2
Dovecot v2.3.5 released
Hi!
We are happy to release dovecot v2.3.5.
Please find sources at
https://dovecot.org/releases/2.3/dovecot-2.3.5.tar.gz
https://dovecot.org/releases/2.3/dovecot-2.3.5.tar.gz.sig
You can find precompiled binaries at
https://repo.dovecot.org/
NEWS:
+ Lua push notification driver: mail keywords and flags are provided in MessageNew and MessageAppend events.
+ submission: Implement support for
2020 Feb 07
0
[RFC PATCH v7 60/78] KVM: introspection: add KVMI_VCPU_CONTROL_CR and KVMI_EVENT_CR
...d.cr = cr;
+ req.cmd.enable = enable ? 1 : 0;
+
+ return do_vcpu0_command(vm, KVMI_VCPU_CONTROL_CR, &req.hdr, sizeof(req),
+ NULL, 0);
+}
+
+static void enable_cr_events(struct kvm_vm *vm, __u32 cr)
+{
+ int r;
+
+ enable_vcpu_event(vm, KVMI_EVENT_CR);
+
+ r = cmd_control_cr(vm, cr, true);
+ TEST_ASSERT(r == 0,
+ "KVMI_VCPU_CONTROL_CR failed, error %d(%s)\n",
+ -r, kvm_strerror(-r));
+}
+
+static void disable_cr_events(struct kvm_vm *vm, __u32 cr)
+{
+ int r;
+
+ r = cmd_control_cr(vm, cr, false);
+ TEST_ASSERT(r == 0,
+ "KVMI_VCPU_CONTROL_CR failed, error %d(%s)\n",
+ -r,...
2020 Feb 07
0
[RFC PATCH v7 40/78] KVM: introspection: add KVMI_GET_VERSION
.../x86_64/kvmi_test.c
@@ -177,12 +177,37 @@ static void test_cmd_invalid(void)
-r, kvm_strerror(-r));
}
+static void test_vm_command(int cmd_id, struct kvmi_msg_hdr *req,
+ size_t req_size, void *rpl, size_t rpl_size)
+{
+ int r;
+
+ r = do_command(cmd_id, req, req_size, rpl, rpl_size);
+ TEST_ASSERT(r == 0,
+ "Command %d failed, error %d (%s)\n",
+ cmd_id, -r, kvm_strerror(-r));
+}
+
+static void test_cmd_get_version(void)
+{
+ struct kvmi_get_version_reply rpl;
+ struct kvmi_msg_hdr req;
+
+ test_vm_command(KVMI_GET_VERSION, &req, sizeof(req), &rpl, sizeof(rpl));
+...
2020 Jul 21
0
[PATCH v9 71/84] KVM: introspection: add KVMI_VCPU_SET_XSAVE
...kvm_vm *vm, struct kvm_xsave *rpl)
{
struct {
struct kvmi_msg_hdr hdr;
struct kvmi_vcpu_hdr vcpu_hdr;
} req = {};
- struct kvm_xsave rpl;
int r;
r = do_vcpu0_command(vm, KVMI_VCPU_GET_XSAVE, &req.hdr, sizeof(req),
- &rpl, sizeof(rpl));
+ rpl, sizeof(*rpl));
TEST_ASSERT(r == 0,
"KVMI_VCPU_GET_XSAVE failed with error %d (%s)\n",
-r, kvm_strerror(-r));
}
-static void test_cmd_vcpu_get_xsave(struct kvm_vm *vm)
+static void cmd_vcpu_set_xsave(struct kvm_vm *vm, struct kvm_xsave *rpl)
+{
+ struct {
+ struct kvmi_msg_hdr hdr;
+ struct kvmi_v...
2020 Feb 07
78
[RFC PATCH v7 00/78] VM introspection
The KVM introspection subsystem provides a facility for applications
running on the host or in a separate VM, to control the execution of
other VMs (pause, resume, shutdown), query the state of the vCPUs (GPRs,
MSRs etc.), alter the page access bits in the shadow page tables (only
for the hardware backed ones, eg. Intel's EPT) and receive notifications
when events of interest have taken place
2020 Jul 21
0
[PATCH v9 42/84] KVM: introspection: add KVMI_VM_CHECK_COMMAND and KVMI_VM_CHECK_EVENT
...d, __u16 padding, int expected_err)
+{
+ struct {
+ struct kvmi_msg_hdr hdr;
+ struct kvmi_vm_check_command cmd;
+ } req = {};
+ int r;
+
+ req.cmd.id = id;
+ req.cmd.padding1 = padding;
+ req.cmd.padding2 = padding;
+
+ r = do_command(KVMI_VM_CHECK_COMMAND, &req.hdr, sizeof(req), NULL, 0);
+ TEST_ASSERT(r == expected_err,
+ "KVMI_VM_CHECK_COMMAND failed, error %d (%s), expected %d\n",
+ -r, kvm_strerror(-r), expected_err);
+}
+
+static void test_cmd_vm_check_command(void)
+{
+ __u16 valid_id = KVMI_GET_VERSION, invalid_id = 0xffff;
+ __u16 padding = 1, no_padding = 0;
+
+ cmd_vm_check_...
2020 Feb 07
0
[RFC PATCH v7 44/78] KVM: introspection: add KVMI_VM_CONTROL_EVENTS
...ol_events cmd;
+ } req = {};
+
+ req.cmd.event_id = event_id;
+ req.cmd.enable = enable ? 1 : 0;
+
+ return do_command(KVMI_VM_CONTROL_EVENTS, &req.hdr, sizeof(req),
+ NULL, 0);
+}
+
+static void enable_vm_event(__u16 event_id)
+{
+ int r;
+
+ r = cmd_vm_control_events(event_id, true);
+ TEST_ASSERT(r == 0,
+ "KVMI_VM_CONTROL_EVENTS failed to enable VM event %d, error %d (%s)\n",
+ event_id, -r, kvm_strerror(-r));
+}
+
+static void disable_vm_event(__u16 event_id)
+{
+ int r;
+
+ r = cmd_vm_control_events(event_id, false);
+ TEST_ASSERT(r == 0,
+ "KVMI_VM_CONTROL_EVENTS faile...
2020 Jul 21
0
[PATCH v9 75/84] KVM: introspection: add KVMI_VCPU_CONTROL_MSR and KVMI_EVENT_MSR
...truct kvmi_vcpu_hdr vcpu_hdr;
+ struct kvmi_vcpu_control_msr cmd;
+ } req = {};
+ int r;
+
+ req.cmd.msr = msr;
+ req.cmd.enable = enable;
+ req.cmd.padding1 = padding;
+ req.cmd.padding2 = padding;
+
+ r = do_vcpu0_command(vm, KVMI_VCPU_CONTROL_MSR, &req.hdr, sizeof(req),
+ NULL, 0);
+ TEST_ASSERT(r == expected_err,
+ "KVMI_VCPU_CONTROL_MSR failed, error %d(%s), expected error %d\n",
+ -r, kvm_strerror(-r), expected_err);
+}
+
+static void enable_msr_events(struct kvm_vm *vm, __u32 msr)
+{
+ enable_vcpu_event(vm, KVMI_EVENT_MSR);
+ cmd_control_msr(vm, msr, 1, 0, 0);
+}
+
+static...
2020 Jul 21
0
[PATCH v9 81/84] KVM: introspection: add KVMI_EVENT_SINGLESTEP
...p(bool enable)
+{
+ struct {
+ struct kvmi_msg_hdr hdr;
+ struct kvmi_vcpu_hdr vcpu_hdr;
+ struct kvmi_vcpu_control_singlestep cmd;
+ } req = {};
+ int r;
+
+ req.cmd.enable = enable ? 1 : 0;
+
+ r = __do_vcpu0_command(KVMI_VCPU_CONTROL_SINGLESTEP,
+ &req.hdr, sizeof(req), NULL, 0);
+ TEST_ASSERT(r == 0,
+ "KVMI_VCPU_CONTROL_SINGLESTEP failed, error %d(%s)\n",
+ -r, kvm_strerror(-r));
+}
+
+static void test_singlestep_event(__u16 event_id)
+{
+ struct {
+ struct kvmi_event common;
+ struct kvmi_event_singlestep singlestep;
+ } ev;
+ bool enable = true, disable = false;
+ struc...
2020 Jul 21
87
[PATCH v9 00/84] VM introspection
The KVM introspection subsystem provides a facility for applications
running on the host or in a separate VM, to control the execution of
other VMs (pause, resume, shutdown), query the state of the vCPUs (GPRs,
MSRs etc.), alter the page access bits in the shadow page tables (only
for the hardware backed ones, eg. Intel's EPT) and receive notifications
when events of interest have taken place
2019 Mar 07
0
Dovecot v2.3.5 released
....................................... : ok
invalid redirect: bad location ....................................... : ok
invalid redirect: too many ........................................... : ok
...
1 / 38 tests failed
looking at test-http-client-errors.c:2989, could this test ever pass?
test_assert(FALSE);
Andreas