diff mbox

[v2,3/3] hw/arm/virt-acpi-build: Add PMU IRQ number in ACPI table

Message ID 1461405855-15576-4-git-send-email-zhaoshenglong@huawei.com
State Superseded
Headers show

Commit Message

Shannon Zhao April 23, 2016, 10:04 a.m. UTC
From: Shannon Zhao <shannon.zhao@linaro.org>


Add PMU IRQ number in ACPI table, then we can use PMU in guest through
ACPI.

Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>

---
 hw/arm/virt-acpi-build.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.0.4

Comments

Andrew Jones April 24, 2016, 5:29 p.m. UTC | #1
On Sat, Apr 23, 2016 at 06:04:15PM +0800, Shannon Zhao wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>

> 

> Add PMU IRQ number in ACPI table, then we can use PMU in guest through

> ACPI.

> 

> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>

> ---

>  hw/arm/virt-acpi-build.c | 3 +++

>  1 file changed, 3 insertions(+)


Reviewed-by: Andrew Jones <drjones@redhat.com>


> 

> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c

> index f51fe39..5031232 100644

> --- a/hw/arm/virt-acpi-build.c

> +++ b/hw/arm/virt-acpi-build.c

> @@ -491,6 +491,9 @@ build_madt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info)

>          gicc->arm_mpidr = armcpu->mp_affinity;

>          gicc->uid = i;

>          gicc->flags = cpu_to_le32(ACPI_GICC_ENABLED);

> +

> +        if (armcpu->has_pmu)

> +            gicc->performance_interrupt = cpu_to_le32(PPI(VIRTUAL_PMU_IRQ));

>      }

>  

>      if (guest_info->gic_version == 3) {

> -- 

> 2.0.4

> 

> 

>
diff mbox

Patch

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index f51fe39..5031232 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -491,6 +491,9 @@  build_madt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info)
         gicc->arm_mpidr = armcpu->mp_affinity;
         gicc->uid = i;
         gicc->flags = cpu_to_le32(ACPI_GICC_ENABLED);
+
+        if (armcpu->has_pmu)
+            gicc->performance_interrupt = cpu_to_le32(PPI(VIRTUAL_PMU_IRQ));
     }
 
     if (guest_info->gic_version == 3) {