From: Shannon Zhao Date: Wed, 30 Mar 2016 10:14:00 +0000 (+0200) Subject: arm/acpi: Fix event-channel interrupt when booting with ACPI X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~1452 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=076e922161059cee6eac52f4a614e0ea6029a42e;p=xen.git arm/acpi: Fix event-channel interrupt when booting with ACPI 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 Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index d9957ad44c..aba714ca6b 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -2050,6 +2050,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; /* @@ -2065,6 +2066,19 @@ 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_PPI << 56; + val |= (2 << 8); /* Active-low level-sensitive */ + val |= d->arch.evtchn_irq & 0xff; + d->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ] = val; + + /* + * When booting Dom0 using ACPI, Dom0 can only get the event channel + * interrupt via hypercall. + */ + if ( !acpi_disabled ) + return; + /* Fix up "interrupts" in /hypervisor node */ node = fdt_path_offset(kinfo->fdt, "/hypervisor"); if ( node < 0 )