diff mbox

[Xen-devel,v2,17/17] libxl/arm: Initialize domain param HVM_PARAM_CALLBACK_IRQ

Message ID 1466651824-6964-18-git-send-email-zhaoshenglong@huawei.com
State New
Headers show

Commit Message

Shannon Zhao June 23, 2016, 3:17 a.m. UTC
From: Shannon Zhao <shannon.zhao@linaro.org>

If Xen guest boots with ACPI, the guest kernel will get the event
channel interrupt information via domain param HVM_PARAM_CALLBACK_IRQ.
Initialize that domain param.

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

Comments

Julien Grall June 23, 2016, 6:48 p.m. UTC | #1
Hi Shannon,

On 23/06/2016 04:17, Shannon Zhao wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
>
> If Xen guest boots with ACPI, the guest kernel will get the event
> channel interrupt information via domain param HVM_PARAM_CALLBACK_IRQ.
> Initialize that domain param.
>
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
> ---
>  tools/libxl/libxl_arm_acpi.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/tools/libxl/libxl_arm_acpi.c b/tools/libxl/libxl_arm_acpi.c
> index 263b5de..8a42125 100644
> --- a/tools/libxl/libxl_arm_acpi.c
> +++ b/tools/libxl/libxl_arm_acpi.c
> @@ -348,6 +348,7 @@ int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info,
>  {
>      const libxl_version_info *vers;
>      int rc;
> +    uint64_t val;
>
>      /* convenience aliases */
>      xc_domain_configuration_t *xc_config = &state->config;
> @@ -373,7 +374,12 @@ int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info,
>      make_acpi_dsdt(gc, dom);
>      link_acpi_tables(gc, dom);
>
> -    return 0;
> +    /* Set the value of domain param HVM_PARAM_CALLBACK_IRQ. */
> +    val = (uint64_t)HVM_PARAM_CALLBACK_TYPE_PPI << 56;
> +    val |= (2 << 8); /* Active-low level-sensitive  */
> +    val |= GUEST_EVTCHN_PPI & 0xff;
> +    return xc_hvm_param_set(dom->xch, dom->guest_domid, HVM_PARAM_CALLBACK_IRQ,
> +                            val);

This is not ACPI specific. It could be done even if ACPI is not inuse. 
Actually it what we are doing for DOM0. So we need to keep consistent.

>  }
>
>  /*
>

Regards,
diff mbox

Patch

diff --git a/tools/libxl/libxl_arm_acpi.c b/tools/libxl/libxl_arm_acpi.c
index 263b5de..8a42125 100644
--- a/tools/libxl/libxl_arm_acpi.c
+++ b/tools/libxl/libxl_arm_acpi.c
@@ -348,6 +348,7 @@  int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info,
 {
     const libxl_version_info *vers;
     int rc;
+    uint64_t val;
 
     /* convenience aliases */
     xc_domain_configuration_t *xc_config = &state->config;
@@ -373,7 +374,12 @@  int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info,
     make_acpi_dsdt(gc, dom);
     link_acpi_tables(gc, dom);
 
-    return 0;
+    /* Set the value of domain param HVM_PARAM_CALLBACK_IRQ. */
+    val = (uint64_t)HVM_PARAM_CALLBACK_TYPE_PPI << 56;
+    val |= (2 << 8); /* Active-low level-sensitive  */
+    val |= GUEST_EVTCHN_PPI & 0xff;
+    return xc_hvm_param_set(dom->xch, dom->guest_domid, HVM_PARAM_CALLBACK_IRQ,
+                            val);
 }
 
 /*