diff mbox

[v4,22/24] xen/acpi: Fix event-channel interrupt when booting with ACPI

Message ID 1456658360-16080-23-git-send-email-zhaoshenglong@huawei.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shannon Zhao Feb. 28, 2016, 11:19 a.m. UTC
From: Shannon Zhao <shannon.zhao@linaro.org>

Store the event-channel interrupt number and flag in HVM parameter
HVM_PARAM_CALLBACK_IRQ. Then Dom0 could get it through hypercall
HVMOP_get_param.

Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
v4: always set HVM_PARAM_CALLBACK_IRQ parameter
---
 xen/arch/arm/domain_build.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Stefano Stabellini Feb. 29, 2016, 5:08 p.m. UTC | #1
On Sun, 28 Feb 2016, Shannon Zhao wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
> 
> Store the event-channel interrupt number and flag in HVM parameter
> HVM_PARAM_CALLBACK_IRQ. Then Dom0 could get it through hypercall
> HVMOP_get_param.
> 
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>

Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


> v4: always set HVM_PARAM_CALLBACK_IRQ parameter
> ---
>  xen/arch/arm/domain_build.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 7750798..80c4230 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -2003,6 +2003,7 @@ static void initrd_load(struct kernel_info *kinfo)
>  static void evtchn_fixup(struct domain *d, struct kernel_info *kinfo)
>  {
>      int res, node;
> +    u64 val;
>      gic_interrupt_t intr;
>  
>      /*
> @@ -2018,6 +2019,15 @@ static void evtchn_fixup(struct domain *d, struct kernel_info *kinfo)
>      printk("Allocating PPI %u for event channel interrupt\n",
>             d->arch.evtchn_irq);
>  
> +    /* Set the value of domain param HVM_PARAM_CALLBACK_IRQ */
> +    val = (u64)HVM_PARAM_CALLBACK_TYPE_EVENT << 56;
> +    val |= (2 << 8); /* Active-low level-sensitive  */
> +    val |= d->arch.evtchn_irq & 0xff;
> +    d->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ] = val;
> +
> +    if ( !acpi_disabled )
> +        return;
> +
>      /* Fix up "interrupts" in /hypervisor node */
>      node = fdt_path_offset(kinfo->fdt, "/hypervisor");
>      if ( node < 0 )
> -- 
> 2.0.4
> 
>
diff mbox

Patch

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 7750798..80c4230 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2003,6 +2003,7 @@  static void initrd_load(struct kernel_info *kinfo)
 static void evtchn_fixup(struct domain *d, struct kernel_info *kinfo)
 {
     int res, node;
+    u64 val;
     gic_interrupt_t intr;
 
     /*
@@ -2018,6 +2019,15 @@  static void evtchn_fixup(struct domain *d, struct kernel_info *kinfo)
     printk("Allocating PPI %u for event channel interrupt\n",
            d->arch.evtchn_irq);
 
+    /* Set the value of domain param HVM_PARAM_CALLBACK_IRQ */
+    val = (u64)HVM_PARAM_CALLBACK_TYPE_EVENT << 56;
+    val |= (2 << 8); /* Active-low level-sensitive  */
+    val |= d->arch.evtchn_irq & 0xff;
+    d->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ] = val;
+
+    if ( !acpi_disabled )
+        return;
+
     /* Fix up "interrupts" in /hypervisor node */
     node = fdt_path_offset(kinfo->fdt, "/hypervisor");
     if ( node < 0 )