search for: kvmi_ioctl_unhook

Displaying 12 results from an estimated 12 matches for "kvmi_ioctl_unhook".

2020 Feb 07
0
[RFC PATCH v7 38/78] KVM: introspection: add permission access ioctls
...k; struct task_struct *recv; + + DECLARE_BITMAP(cmd_allow_mask, KVMI_NUM_COMMANDS); + DECLARE_BITMAP(event_allow_mask, KVMI_NUM_EVENTS); }; #ifdef CONFIG_KVM_INTROSPECTION @@ -27,6 +32,8 @@ void kvmi_destroy_vm(struct kvm *kvm); int kvmi_ioctl_hook(struct kvm *kvm, void __user *argp); int kvmi_ioctl_unhook(struct kvm *kvm); +int kvmi_ioctl_command(struct kvm *kvm, void __user *argp); +int kvmi_ioctl_event(struct kvm *kvm, void __user *argp); #else diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 09132d8dd3e5..e2de987b5d8f 100644 --- a/include/uapi/linux/kvm.h +++ b/include/...
2019 Aug 09
0
[RFC PATCH v6 02/92] kvm: introspection: add basic ioctls (hook/unhook)
..._init(void); void kvmi_uninit(void); void kvmi_create_vm(struct kvm *kvm); void kvmi_destroy_vm(struct kvm *kvm); +int kvmi_ioctl_hook(struct kvm *kvm, void __user *argp); +int kvmi_ioctl_command(struct kvm *kvm, void __user *argp); +int kvmi_ioctl_event(struct kvm *kvm, void __user *argp); +int kvmi_ioctl_unhook(struct kvm *kvm, bool force_reset); #else diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 6d4ea4b6c922..bae37bf37338 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -989,6 +989,8 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_MANUAL_DIRTY_LOG_PRO...
2019 Aug 13
0
[RFC PATCH v6 01/92] kvm: introduce KVMI (VM introspection subsystem)
...nhook are relatively rare events and not performance critical, >> so make those the restricted/slow flows, e.g. force userspace to quiesce >> the VM by making unhook() mutually exclusive with every vcpu ioctl() and >> maybe anything that takes kvm->lock. >> >> Then kvmi_ioctl_unhook() can use thread_stop() and kvmi_recv() just needs >> to check kthread_should_stop(). >> >> That way kvmi doesn't need to be refcounted since it's guaranteed to be >> alive if the pointer is non-null. Eliminating the refcounting will clean >> up a lot of the c...
2019 Aug 13
1
[RFC PATCH v6 01/92] kvm: introduce KVMI (VM introspection subsystem)
...events and not performance critical, > >> so make those the restricted/slow flows, e.g. force userspace to quiesce > >> the VM by making unhook() mutually exclusive with every vcpu ioctl() and > >> maybe anything that takes kvm->lock. > >> > >> Then kvmi_ioctl_unhook() can use thread_stop() and kvmi_recv() just needs > >> to check kthread_should_stop(). > >> > >> That way kvmi doesn't need to be refcounted since it's guaranteed to be > >> alive if the pointer is non-null. Eliminating the refcounting will clean > &...
2019 Aug 09
0
[RFC PATCH v6 14/92] kvm: introspection: handle introspection commands before returning to guest
...} if (kvm_check_request(KVM_REQ_EVENT, vcpu) || req_int_win) { diff --git a/include/linux/kvmi.h b/include/linux/kvmi.h index e8d25d7da751..ae5de1905b55 100644 --- a/include/linux/kvmi.h +++ b/include/linux/kvmi.h @@ -16,6 +16,7 @@ int kvmi_ioctl_event(struct kvm *kvm, void __user *argp); int kvmi_ioctl_unhook(struct kvm *kvm, bool force_reset); int kvmi_vcpu_init(struct kvm_vcpu *vcpu); void kvmi_vcpu_uninit(struct kvm_vcpu *vcpu); +void kvmi_handle_requests(struct kvm_vcpu *vcpu); #else @@ -25,6 +26,7 @@ static inline void kvmi_create_vm(struct kvm *kvm) { } static inline void kvmi_destroy_vm(s...
2019 Aug 12
2
[RFC PATCH v6 01/92] kvm: introduce KVMI (VM introspection subsystem)
...h also seems backwards. I assume hook and unhook are relatively rare events and not performance critical, so make those the restricted/slow flows, e.g. force userspace to quiesce the VM by making unhook() mutually exclusive with every vcpu ioctl() and maybe anything that takes kvm->lock. Then kvmi_ioctl_unhook() can use thread_stop() and kvmi_recv() just needs to check kthread_should_stop(). That way kvmi doesn't need to be refcounted since it's guaranteed to be alive if the pointer is non-null. Eliminating the refcounting will clean up a lot of the code by eliminating calls to kvmi_{get,put}()...
2020 Feb 07
0
[RFC PATCH v7 48/78] KVM: introspection: handle vCPU introspection requests
...ree_fct); + if (!err) + kvmi_make_request(vcpu); + return err; } @@ -217,6 +226,7 @@ static void __kvmi_unhook(struct kvm *kvm) { struct kvm_introspection *kvmi = KVMI(kvm); + wait_for_completion_killable(&kvm->kvmi_complete); kvmi_sock_put(kvmi); } @@ -242,8 +252,23 @@ int kvmi_ioctl_unhook(struct kvm *kvm) return 0; } +struct kvm_introspection * __must_check kvmi_get(struct kvm *kvm) +{ + if (refcount_inc_not_zero(&kvm->kvmi_ref)) + return kvm->kvmi; + + return NULL; +} + +void kvmi_put(struct kvm *kvm) +{ + if (refcount_dec_and_test(&kvm->kvmi_ref)) + complet...
2020 Feb 07
0
[RFC PATCH v7 43/78] KVM: introspection: add KVMI_EVENT_UNHOOK
...host.h @@ -21,6 +21,8 @@ struct kvm_introspection { DECLARE_BITMAP(cmd_allow_mask, KVMI_NUM_COMMANDS); DECLARE_BITMAP(event_allow_mask, KVMI_NUM_EVENTS); + + atomic_t ev_seq; }; #ifdef CONFIG_KVM_INTROSPECTION @@ -34,6 +36,7 @@ int kvmi_ioctl_hook(struct kvm *kvm, void __user *argp); int kvmi_ioctl_unhook(struct kvm *kvm); int kvmi_ioctl_command(struct kvm *kvm, void __user *argp); int kvmi_ioctl_event(struct kvm *kvm, void __user *argp); +int kvmi_ioctl_preunhook(struct kvm *kvm); #else diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index e2de987b5d8f..f745a3c60e02 100644 -...
2019 Aug 09
117
[RFC PATCH v6 00/92] 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 VM-s (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 Aug 09
117
[RFC PATCH v6 00/92] 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 VM-s (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
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