diff mbox

[Xen-devel,v5,15/16] libxl/arm: Initialize domain param HVM_PARAM_CALLBACK_IRQ

Message ID 1472784939-14404-16-git-send-email-zhaoshenglong@huawei.com
State New
Headers show

Commit Message

Shannon Zhao Sept. 2, 2016, 2:55 a.m. UTC
From: Shannon Zhao <shannon.zhao@linaro.org>

The guest kernel will get the event channel interrupt information via
domain param HVM_PARAM_CALLBACK_IRQ. Initialize it here.

Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 tools/libxl/libxl_arm.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Julien Grall Sept. 12, 2016, 3:14 p.m. UTC | #1
Hi Shannon,

On 02/09/16 03:55, Shannon Zhao wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
>
> The guest kernel will get the event channel interrupt information via
> domain param HVM_PARAM_CALLBACK_IRQ. Initialize it here.
>
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>

Acked-by: Julien Grall <julien.grall@arm.com>

Regards,

> ---
>  tools/libxl/libxl_arm.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
> index 6f0bc70..e73d65e 100644
> --- a/tools/libxl/libxl_arm.c
> +++ b/tools/libxl/libxl_arm.c
> @@ -900,8 +900,21 @@ int libxl__arch_domain_init_hw_description(libxl__gc *gc,
>                                             struct xc_dom_image *dom)
>  {
>      int rc;
> +    uint64_t val;
>
>      assert(info->type == LIBXL_DOMAIN_TYPE_PV);
> +
> +    /* Set the value of domain param HVM_PARAM_CALLBACK_IRQ. */
> +    val = (uint64_t)HVM_PARAM_CALLBACK_TYPE_PPI << HVM_PARAM_CALLBACK_IRQ_TYPE_SHIFT;
> +    /* Active-low level-sensitive  */
> +    val |= (HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_LOW_LEVEL <<
> +            HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_SHIFT);
> +    val |= GUEST_EVTCHN_PPI;
> +    rc = xc_hvm_param_set(dom->xch, dom->guest_domid, HVM_PARAM_CALLBACK_IRQ,
> +                          val);
> +    if (rc)
> +        return rc;
> +
>      rc = libxl__prepare_dtb(gc, info, state, dom);
>      if (rc) goto out;
>
>
diff mbox

Patch

diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index 6f0bc70..e73d65e 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -900,8 +900,21 @@  int libxl__arch_domain_init_hw_description(libxl__gc *gc,
                                            struct xc_dom_image *dom)
 {
     int rc;
+    uint64_t val;
 
     assert(info->type == LIBXL_DOMAIN_TYPE_PV);
+
+    /* Set the value of domain param HVM_PARAM_CALLBACK_IRQ. */
+    val = (uint64_t)HVM_PARAM_CALLBACK_TYPE_PPI << HVM_PARAM_CALLBACK_IRQ_TYPE_SHIFT;
+    /* Active-low level-sensitive  */
+    val |= (HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_LOW_LEVEL <<
+            HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_SHIFT);
+    val |= GUEST_EVTCHN_PPI;
+    rc = xc_hvm_param_set(dom->xch, dom->guest_domid, HVM_PARAM_CALLBACK_IRQ,
+                          val);
+    if (rc)
+        return rc;
+
     rc = libxl__prepare_dtb(gc, info, state, dom);
     if (rc) goto out;