search for: invalid_id

Displaying 8 results from an estimated 8 matches for "invalid_id".

2020 Jul 21
0
[PATCH v9 42/84] KVM: introspection: add KVMI_VM_CHECK_COMMAND and KVMI_VM_CHECK_EVENT
...d(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_command(valid_id, no_padding, 0); + cmd_vm_check_command(valid_id, padding, -KVM_EINVAL); + cmd_vm_check_command(invalid_id, no_padding, -KVM_ENOENT); +} + +static void cmd_vm_check_event(__u16 id, __u16 padding, int expected_err) +{ +...
2020 Feb 07
0
[RFC PATCH v7 41/78] KVM: introspection: add KVMI_VM_CHECK_COMMAND and KVMI_VM_CHECK_EVENT
...+{ + struct { + struct kvmi_msg_hdr hdr; + struct kvmi_vm_check_command 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_EIN...
2020 Jul 21
0
[PATCH v9 44/84] KVM: introspection: add KVMI_EVENT_UNHOOK
...ent_id) { set_event_perm(vm, event_id, 1, 0); @@ -300,13 +305,20 @@ static void cmd_vm_check_event(__u16 id, __u16 padding, int expected_err) -r, kvm_strerror(-r), expected_err); } -static void test_cmd_vm_check_event(void) +static void test_cmd_vm_check_event(struct kvm_vm *vm) { - __u16 invalid_id = 0xffff; + __u16 valid_id = KVMI_EVENT_UNHOOK, invalid_id = 0xffff; __u16 padding = 1, no_padding = 0; cmd_vm_check_event(invalid_id, padding, -KVM_EINVAL); cmd_vm_check_event(invalid_id, no_padding, -KVM_ENOENT); + + cmd_vm_check_event(valid_id, no_padding, 0); + cmd_vm_check_event(valid_...
2020 Jul 21
0
[PATCH v9 45/84] KVM: introspection: add KVMI_VM_CONTROL_EVENTS
...; struct kvmi_msg_hdr hdr; struct kvmi_event ev; + enable_vm_event(id); + trigger_event_unhook_notification(vm); receive_event(&hdr, &ev, sizeof(ev), id); + + disable_vm_event(id); +} + +static void test_cmd_vm_control_events(struct kvm_vm *vm) +{ + __u16 id = KVMI_EVENT_UNHOOK, invalid_id = 0xffff; + __u16 padding = 1, no_padding = 0; + __u8 enable = 1, enable_inval = 2; + + enable_vm_event(id); + disable_vm_event(id); + + cmd_vm_control_events(id, enable, padding, -KVM_EINVAL); + cmd_vm_control_events(id, enable_inval, no_padding, -KVM_EINVAL); + cmd_vm_control_events(invalid_id, e...
2020 Feb 07
0
[RFC PATCH v7 53/78] KVM: introspection: add KVMI_VCPU_CONTROL_EVENTS
...nt_id, enable); + TEST_ASSERT(r == -KVM_EINVAL, + "cmd_vcpu_control_event didn't failed with KVM_EINVAL, id %d, error %d (%s)\n", + event_id, -r, kvm_strerror(-r)); +} + +static void test_cmd_vcpu_control_events(struct kvm_vm *vm) +{ + __u16 valid_id = KVMI_EVENT_PAUSE_VCPU; + __u16 invalid_id = 0xffff; + + test_disallowed_vcpu_event(vm, valid_id); + + enable_vcpu_event(vm, valid_id); + + disable_vcpu_event(vm, valid_id); + + test_invalid_vcpu_event(vm, invalid_id); +} + static void test_introspection(struct kvm_vm *vm) { setup_socket(); @@ -737,6 +818,7 @@ static void test_introspec...
2020 Feb 07
0
[RFC PATCH v7 54/78] KVM: introspection: add KVMI_VCPU_GET_REGISTERS
...s/testing/selftests/kvm/x86_64/kvmi_test.c index 830b64cae20b..5d76d49bc277 100644 --- a/tools/testing/selftests/kvm/x86_64/kvmi_test.c +++ b/tools/testing/selftests/kvm/x86_64/kvmi_test.c @@ -803,6 +803,31 @@ static void test_cmd_vcpu_control_events(struct kvm_vm *vm) test_invalid_vcpu_event(vm, invalid_id); } +static void get_vcpu_registers(struct kvm_vm *vm, + struct kvm_regs *regs) +{ + struct { + struct kvmi_msg_hdr hdr; + struct kvmi_vcpu_hdr vcpu_hdr; + struct kvmi_vcpu_get_registers cmd; + } req = {}; + struct kvmi_vcpu_get_registers_reply rpl; + + test_vcpu0_command(vm, KVMI_VC...
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
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