Displaying 9 results from an estimated 9 matches for "kvmi_vcpu".
Did you mean:
kvm_vcpu
2019 Aug 09
0
[RFC PATCH v6 13/92] kvm: introspection: make the vCPU wait even when its jobs list is empty
...UX_SWAIT_H */
diff --git a/virt/kvm/kvmi.c b/virt/kvm/kvmi.c
index 07ebd1c629b0..3c884dc0e38c 100644
--- a/virt/kvm/kvmi.c
+++ b/virt/kvm/kvmi.c
@@ -135,6 +135,19 @@ static void kvmi_free_job(struct kvmi_job *job)
kmem_cache_free(job_cache, job);
}
+static struct kvmi_job *kvmi_pull_job(struct kvmi_vcpu *ivcpu)
+{
+ struct kvmi_job *job = NULL;
+
+ spin_lock(&ivcpu->job_lock);
+ job = list_first_entry_or_null(&ivcpu->job_list, typeof(*job), link);
+ if (job)
+ list_del(&job->link);
+ spin_unlock(&ivcpu->job_lock);
+
+ return job;
+}
+
static bool alloc_ivcpu(struct kv...
2019 Aug 13
1
[RFC PATCH v6 16/92] kvm: introspection: handle events and event replies
On 09/08/19 17:59, Adalbert Laz?r wrote:
>
> + reply->padding2);
> +
> + ivcpu->reply_waiting = false;
> + return expected->error;
> +}
> +
> /*
Is this missing a wakeup?
>
> +static bool need_to_wait(struct kvm_vcpu *vcpu)
> +{
> + struct kvmi_vcpu *ivcpu = IVCPU(vcpu);
> +
> + return ivcpu->reply_waiting;
> +}
> +
Do you actually need this function? It seems to me that everywhere you
call it you already have an ivcpu, so you can just access the field.
Also, "reply_waiting" means "there is a reply that is wait...
2019 Aug 09
0
[RFC PATCH v6 64/92] kvm: introspection: add single-stepping
...x/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -5384,6 +5384,7 @@ static int handle_invalid_op(struct kvm_vcpu *vcpu)
static int handle_monitor_trap(struct kvm_vcpu *vcpu)
{
+ kvmi_stop_ss(vcpu);
return 1;
}
@@ -5992,6 +5993,11 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu)
}
}
+ if (kvmi_vcpu_enabled_ss(vcpu)
+ && exit_reason != EXIT_REASON_EPT_VIOLATION
+ && exit_reason != EXIT_REASON_MONITOR_TRAP_FLAG)
+ kvmi_stop_ss(vcpu);
+
if (exit_reason < kvm_vmx_max_exit_handlers
&& kvm_vmx_exit_handlers[exit_reason])
return kvm_vmx_exit_handlers[exit_r...
2019 Aug 12
1
[RFC PATCH v6 64/92] kvm: introspection: add single-stepping
...tatic int handle_invalid_op(struct kvm_vcpu *vcpu)
>
> static int handle_monitor_trap(struct kvm_vcpu *vcpu)
> {
> + kvmi_stop_ss(vcpu);
> return 1;
> }
>
> @@ -5992,6 +5993,11 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu)
> }
> }
>
> + if (kvmi_vcpu_enabled_ss(vcpu)
> + && exit_reason != EXIT_REASON_EPT_VIOLATION
> + && exit_reason != EXIT_REASON_MONITOR_TRAP_FLAG)
Bad indentation. This is prevelant through the series.
> + kvmi_stop_ss(vcpu);
> +
> if (exit_reason < kvm_vmx_max_exit_handlers
>...
2019 Aug 09
0
[RFC PATCH v6 16/92] kvm: introspection: handle events and event replies
From: Mihai Don?u <mdontu at bitdefender.com>
All events are sent by the vCPU thread, which will handle any
introspection command while waiting for the reply.
The event reply messages contain a common strucure (kvmi_vcpu_hdr), as
any vCPU related command, which allows the receiving worker to dispatch
the reply as it does with any other introspection command sent for a
specific vCPU.
The kernel side will gracefully handle commands coming from an
introspection tool compiled with older or newer versions of KVMI API....
2019 Aug 09
0
[RFC PATCH v6 55/92] kvm: introspection: add KVMI_CONTROL_MSR and KVMI_EVENT_MSR
...i.rst
+++ b/Documentation/virtual/kvm/kvmi.rst
@@ -1042,6 +1042,45 @@ ID set.
* -KVM_EINVAL - padding is not zero
* -KVM_EAGAIN - the selected vCPU can't be introspected yet
+22. KVMI_CONTROL_MSR
+--------------------
+
+:Architectures: x86
+:Versions: >= 1
+:Parameters:
+
+::
+
+ struct kvmi_vcpu_hdr;
+ struct kvmi_control_msr {
+ __u8 enable;
+ __u8 padding1;
+ __u16 padding2;
+ __u32 msr;
+ };
+
+:Returns:
+
+::
+
+ struct kvmi_error_code
+
+Enables/disables introspection for a specific MSR and must be used
+in addition to *KVMI_CONTROL_EVENTS* with the *KVMI_EVENT_MSR* ID set.
+
+Cur...
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
2019 Aug 09
0
[RFC PATCH v6 27/92] kvm: introspection: use page track
....track_prewrite = kvmi_track_prewrite;
+ ikvm->kptn_node.track_preexec = kvmi_track_preexec;
+ ikvm->kptn_node.track_create_slot = kvmi_track_create_slot;
+ ikvm->kptn_node.track_flush_slot = kvmi_track_flush_slot;
+
ikvm->kvm = kvm;
kvm->kvmi = ikvm;
@@ -276,6 +376,179 @@ void kvmi_vcpu_uninit(struct kvm_vcpu *vcpu)
vcpu->kvmi = NULL;
}
+static bool is_pf_of_interest(struct kvm_vcpu *vcpu, gpa_t gpa, u8 access)
+{
+ struct kvm *kvm = vcpu->kvm;
+
+ if (kvm_mmu_nested_pagefault(vcpu))
+ return false;
+
+ /* Have we shown interest in this page? */
+ return kvmi_restricte...