[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH V3] x86/HVM: Introduce struct hvm_pi_ops



Jan,

I would like to updated the following to be more correct.

On 1/12/17 19:37, Jan Beulich wrote:
On 12.01.17 at 05:47, <suravee.suthikulpanit@xxxxxxx> wrote:
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -72,6 +72,38 @@ struct hvm_ioreq_server {
     bool_t                 bufioreq_atomic;
 };

+/*
+ * This structure defines function hooks to support hardware-assisted
+ * virtual interrupt delivery to guest. (e.g. VMX PI and SVM AVIC).
+ *
+ * The way we implement this now is by looking at what needs to happen on
+ * the following runstate transitions:
+ *
+ * A: runnable -> running  : switch_to
+ * B: running  -> runnable : switch_from

I don't think this is accurate - switch_from may be used when
transitioning to states other than runnable.
Both hooks really are context switch rather than run state related afaict.

+ * C: running  -> blocked  : vcpu_block
+ * D: blocked  -> runnable : do_resume

This one is, I think, similarly not so much run state related, but
instead used when a vCPU is about to enter guest context again.

So, what if I generalize and simplify as following:

+/*
+ * This structure defines function hooks to support hardware-assisted
+ * virtual interrupt delivery to guest. (e.g. VMX PI and SVM AVIC).
+ *
+ * These hooks are defined by the underlying arch-specific code
+ * as needed. For example:
+ *   - When the domain is enabled with virtual IPI delivery
+ *   - When the domain is enabled with virtual I/O int delivery
+ *     and actually has a physical device assigned .
+ */
+struct hvm_pi_ops {
+    /* We add hooks into ctx_switch_from. */
+    void (*switch_from) (struct vcpu *v);
+
+    /* We add hooks into ctx_switch_to */
+    void (*switch_to) (struct vcpu *v);
+
+    /*
+     * We add a new arch hook, arch_vcpu_block(),
+     * which is called from vcpu_block() and vcpu_do_poll().
+     */
+    void (*vcpu_block) (struct vcpu *);
+
+    /* We add a hook on the vmentry path. */
+    void (*do_resume) (struct vcpu *v);
+};

Thanks,
Suravee

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.