Displaying 16 results from an estimated 16 matches for "job_lock".
2020 Feb 07
0
[RFC PATCH v7 47/78] KVM: introspection: add a jobs list to every introspected vCPU
...VMI_NUM_COMMANDS KVMI_NUM_MESSAGES
+struct kvmi_job {
+ struct list_head link;
+ void *ctx;
+ void (*fct)(struct kvm_vcpu *vcpu, void *ctx);
+ void (*free_fct)(void *ctx);
+};
+
struct kvm_vcpu_introspection {
struct kvm_vcpu_arch_introspection arch;
+
+ struct list_head job_list;
+ spinlock_t job_lock;
};
struct kvm_introspection {
diff --git a/virt/kvm/introspection/kvmi.c b/virt/kvm/introspection/kvmi.c
index 655170ffb574..5149f8e06131 100644
--- a/virt/kvm/introspection/kvmi.c
+++ b/virt/kvm/introspection/kvmi.c
@@ -10,6 +10,7 @@
#include <linux/kthread.h>
static struct kmem_cac...
2019 Aug 09
0
[RFC PATCH v6 13/92] kvm: introspection: make the vCPU wait even when its jobs list is empty
...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 kvm_vcpu *vcpu)
{
struct kvmi_vcpu *ivcpu;
@@ -496,6 +509,73 @@ void kvmi_destr...
2020 Feb 07
0
[RFC PATCH v7 48/78] KVM: introspection: handle vCPU introspection requests
...kvmi_put(kvm);
goto unhook;
}
@@ -616,3 +651,40 @@ int kvmi_cmd_write_physical(struct kvm *kvm, u64 gpa, u64 size, const void *buf)
return 0;
}
+
+static struct kvmi_job *kvmi_pull_job(struct kvm_vcpu_introspection *vcpui)
+{
+ struct kvmi_job *job = NULL;
+
+ spin_lock(&vcpui->job_lock);
+ job = list_first_entry_or_null(&vcpui->job_list, typeof(*job), link);
+ if (job)
+ list_del(&job->link);
+ spin_unlock(&vcpui->job_lock);
+
+ return job;
+}
+
+void kvmi_run_jobs(struct kvm_vcpu *vcpu)
+{
+ struct kvm_vcpu_introspection *vcpui = VCPUI(vcpu);
+ struct kvmi_...
2019 Aug 12
1
[RFC PATCH v6 64/92] kvm: introspection: add single-stepping
...@@ struct kvmi_vcpu {
> DECLARE_BITMAP(high, KVMI_NUM_MSR);
> } msr_mask;
>
> + bool ss_owner;
Why is single-stepping mutually exclusive across all vCPUs? Does that
always have to be the case?
> + bool ss_requested;
> +
> struct list_head job_list;
> spinlock_t job_lock;
>
> @@ -151,6 +154,15 @@ struct kvmi {
> DECLARE_BITMAP(event_allow_mask, KVMI_NUM_EVENTS);
> DECLARE_BITMAP(vm_ev_mask, KVMI_NUM_EVENTS);
>
> +#define SINGLE_STEP_MAX_DEPTH 8
> + struct {
> + gfn_t gfn;
> + u8 old_access;
> + u32 old_write_bitmap;
> + }...
2019 Aug 09
0
[RFC PATCH v6 55/92] kvm: introspection: add KVMI_CONTROL_MSR and KVMI_EVENT_MSR
...i_msg_hdr) + KVMI_MSG_SIZE)
@@ -120,6 +120,10 @@ struct kvmi_vcpu {
DECLARE_BITMAP(ev_mask, KVMI_NUM_EVENTS);
DECLARE_BITMAP(cr_mask, KVMI_NUM_CR);
+ struct {
+ DECLARE_BITMAP(low, KVMI_NUM_MSR);
+ DECLARE_BITMAP(high, KVMI_NUM_MSR);
+ } msr_mask;
struct list_head job_list;
spinlock_t job_lock;
@@ -258,5 +262,7 @@ int kvmi_arch_cmd_inject_exception(struct kvm_vcpu *vcpu, u8 vector,
u64 address);
int kvmi_arch_cmd_control_cr(struct kvm_vcpu *vcpu,
const struct kvmi_control_cr *req);
+int kvmi_arch_cmd_control_msr(struct kvm_vcpu *vcpu,
+ const struct kvmi_control...
2019 Aug 09
0
[RFC PATCH v6 64/92] kvm: introspection: add single-stepping
...vmi_int.h b/virt/kvm/kvmi_int.h
index d7f9858d3e97..1550fe33ed48 100644
--- a/virt/kvm/kvmi_int.h
+++ b/virt/kvm/kvmi_int.h
@@ -126,6 +126,9 @@ struct kvmi_vcpu {
DECLARE_BITMAP(high, KVMI_NUM_MSR);
} msr_mask;
+ bool ss_owner;
+ bool ss_requested;
+
struct list_head job_list;
spinlock_t job_lock;
@@ -151,6 +154,15 @@ struct kvmi {
DECLARE_BITMAP(event_allow_mask, KVMI_NUM_EVENTS);
DECLARE_BITMAP(vm_ev_mask, KVMI_NUM_EVENTS);
+#define SINGLE_STEP_MAX_DEPTH 8
+ struct {
+ gfn_t gfn;
+ u8 old_access;
+ u32 old_write_bitmap;
+ } ss_context[SINGLE_STEP_MAX_DEPTH];
+ u8 ss_level;
+ at...
2020 Feb 07
0
[RFC PATCH v7 52/78] KVM: introspection: add KVMI_EVENT_PAUSE_VCPU
...11,6 +11,14 @@ struct kvm_vcpu;
#define KVMI_NUM_COMMANDS KVMI_NUM_MESSAGES
+struct kvmi_vcpu_reply {
+ int error;
+ int action;
+ u32 seq;
+ void *data;
+ size_t size;
+};
+
struct kvmi_job {
struct list_head link;
void *ctx;
@@ -25,6 +33,9 @@ struct kvm_vcpu_introspection {
spinlock_t job_lock;
atomic_t pause_requests;
+
+ struct kvmi_vcpu_reply reply;
+ bool waiting_for_reply;
};
struct kvm_introspection {
diff --git a/include/uapi/linux/kvmi.h b/include/uapi/linux/kvmi.h
index 54a788c1c204..2eb1e5b20d53 100644
--- a/include/uapi/linux/kvmi.h
+++ b/include/uapi/linux/kvmi.h
@@ -...
2019 Aug 09
0
[RFC PATCH v6 16/92] kvm: introspection: handle events and event replies
...mi_int.h
@@ -82,7 +82,18 @@ struct kvmi_job {
void (*free_fct)(void *ctx);
};
+struct kvmi_vcpu_reply {
+ int error;
+ int action;
+ u32 seq;
+ void *data;
+ size_t size;
+};
+
struct kvmi_vcpu {
+ bool reply_waiting;
+ struct kvmi_vcpu_reply reply;
+
struct list_head job_list;
spinlock_t job_lock;
@@ -96,6 +107,7 @@ struct kvmi {
struct socket *sock;
struct task_struct *recv;
+ atomic_t ev_seq;
uuid_t uuid;
@@ -118,8 +130,12 @@ void *kvmi_msg_alloc_check(size_t size);
void kvmi_msg_free(void *addr);
int kvmi_cmd_control_vm_events(struct kvmi *ikvm, unsigned int event_id,...
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
2020 Mar 05
55
[PATCH 00/22] drm: Convert drivers to drm_simple_encoder_init()
A call to drm_simple_encoder_init() initializes an encoder without
further functionality. It only provides the destroy callback to
cleanup the encoder's state. Only few drivers implement more
sophisticated encoders than that. Most drivers implement such a
simple encoder and can use drm_simple_encoder_init() instead.
The patchset converts drivers where the encoder's instance is
embedded in
2020 Mar 05
55
[PATCH 00/22] drm: Convert drivers to drm_simple_encoder_init()
A call to drm_simple_encoder_init() initializes an encoder without
further functionality. It only provides the destroy callback to
cleanup the encoder's state. Only few drivers implement more
sophisticated encoders than that. Most drivers implement such a
simple encoder and can use drm_simple_encoder_init() instead.
The patchset converts drivers where the encoder's instance is
embedded in
2012 Apr 20
1
[PATCH] multiqueue: a hodge podge of things
...ost->host_no,
vport->channel, stat);
}
/*
* BSG support
*/
/**
* fc_destroy_bsgjob - routine to teardown/delete a fc bsg job
* @job: fc_bsg_job that is to be torn down
*/
static void
fc_destroy_bsgjob(struct fc_bsg_job *job)
{
unsigned long flags;
spin_lock_irqsave(&job->job_lock, flags);
if (job->ref_cnt) {
spin_unlock_irqrestore(&job->job_lock, flags);
return;
}
spin_unlock_irqrestore(&job->job_lock, flags);
put_device(job->dev); /* release reference for the request */
kfree(job->request_payload.sg_list);
kfree(job->reply_payload.sg_l...
2012 Apr 20
1
[PATCH] multiqueue: a hodge podge of things
...ost->host_no,
vport->channel, stat);
}
/*
* BSG support
*/
/**
* fc_destroy_bsgjob - routine to teardown/delete a fc bsg job
* @job: fc_bsg_job that is to be torn down
*/
static void
fc_destroy_bsgjob(struct fc_bsg_job *job)
{
unsigned long flags;
spin_lock_irqsave(&job->job_lock, flags);
if (job->ref_cnt) {
spin_unlock_irqrestore(&job->job_lock, flags);
return;
}
spin_unlock_irqrestore(&job->job_lock, flags);
put_device(job->dev); /* release reference for the request */
kfree(job->request_payload.sg_list);
kfree(job->reply_payload.sg_l...