couple ITS support fixups
cover couple ITS support fixups
Andrew Jones (2):
hw/arm/virt-acpi-build: fix MADT generation
hw/arm/virt: no ITS on older machine types
hw/arm/virt-acpi-build.c | 14 ++++++-------- hw/arm/virt.c | 15 +++++++++++---- include/hw/arm/virt-acpi-build.h | 1 + 3 files changed, 18 insertions(+), 12 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/2 hw/arm/virt-acpi-build: fix MADT generation
We can't return early from build_* functions, as build_header is only called at the end.
--- hw/arm/virt-acpi-build.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
hw/arm/virt-acpi-build.c +6 -8
@@ -556,15 +556,13 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtGuestInfo *guest_info) gicr->base_address =cpu_to_le64 (memmap[VIRT_GIC_REDIST ].base); gicr->range_length =cpu_to_le32 (memmap[VIRT_GIC_REDIST ].size); -if (!its_class_name ()) { -return ; +if (its_class_name ()) { + gic_its =acpi_data_push (table_data,sizeof *gic_its); + gic_its->type =ACPI_APIC_GENERIC_TRANSLATOR ; + gic_its->length =sizeof (*gic_its); + gic_its->translation_id =0 ; + gic_its->base_address =cpu_to_le64 (memmap[VIRT_GIC_ITS ].base); } - - gic_its =acpi_data_push (table_data,sizeof *gic_its); - gic_its->type =ACPI_APIC_GENERIC_TRANSLATOR ; - gic_its->length =sizeof (*gic_its); - gic_its->translation_id =0 ; - gic_its->base_address =cpu_to_le64 (memmap[VIRT_GIC_ITS ].base); }else { gic_msi =acpi_data_push (table_data,sizeof *gic_msi); gic_msi->type =ACPI_APIC_GENERIC_MSI_FRAME ;
Signature · 1 line
2.7.4
PATCH 2/2 hw/arm/virt: no ITS on older machine types
In reply to Andrew JonesWe should avoid exposing new hardware (through DT and ACPI) on older machine types. This patch keeps 2.7 and older from changing, despite the introduction of ITS support for 2.8.
---
As Eduardo pointed out long ago for a different reason, we should probably replace VirtGuestInfo with direct use of VirtMachineClass, like x86 has done to replace PcGuestInfo with direct use of PCMachineClass. I'll work on that, but wanted to get this ITS fixup in sooner than later, so I'm posting this patch now, which requires 'no_its' to be duplicated.
Also, this patch will have a trivial conflict with Wei's PMU property series.
hw/arm/virt-acpi-build.c | 2 +- hw/arm/virt.c | 15 +++++++++++---- include/hw/arm/virt-acpi-build.h | 1 + 3 files changed, 13 insertions(+), 5 deletions(-)
hw/arm/virt-acpi-build.c +1 -1
@@ -556,7 +556,7 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtGuestInfo *guest_info) gicr->base_address =cpu_to_le64 (memmap[VIRT_GIC_REDIST ].base); gicr->range_length =cpu_to_le32 (memmap[VIRT_GIC_REDIST ].size); -if (its_class_name ()) { +if (its_class_name () && !guest_info->no_its) { gic_its =acpi_data_push (table_data,sizeof *gic_its); gic_its->type =ACPI_APIC_GENERIC_TRANSLATOR ; gic_its->length =sizeof (*gic_its);
hw/arm/virt.c +11 -4
@@ -84,6 +84,7 @@ typedef struct {MachineClass parent;VirtBoardInfo *daughterboard;bool disallow_affinity_adjustment; +bool no_its; } VirtMachineClass; typedef struct {
@@ -552,7 +553,8 @@ static void create_v2m(VirtBoardInfo *vbi, qemu_irq *pic)fdt_add_v2m_gic_node (vbi); } -static void create_gic (VirtBoardInfo *vbi,qemu_irq *pic,int type,bool secure) +static void create_gic (VirtBoardInfo *vbi,qemu_irq *pic,int type, +bool secure,bool no_its) {/* We create a standalone GIC */ DeviceState *gicdev;
@@ -616,9 +618,9 @@ static void create_gic(VirtBoardInfo *vbi, qemu_irq *pic, int type, bool secure)fdt_add_gic_node (vbi, type); -if (type ==3 ) { +if (type ==3 && !no_its) {create_its (vbi, gicdev); - }else { + }else if (type ==2 ) {create_v2m (vbi, pic); } }
@@ -1376,7 +1378,7 @@ static void machvirt_init(MachineState *machine)create_flash (vbi, sysmem, secure_sysmem ? secure_sysmem : sysmem); -create_gic (vbi, pic, gic_version, vms->secure); +create_gic (vbi, pic, gic_version, vms->secure, vmc->no_its);fdt_add_pmu_nodes (vbi, gic_version);
@@ -1408,6 +1410,7 @@ static void machvirt_init(MachineState *machine) guest_info->irqmap = vbi->irqmap; guest_info->use_highmem = vms->highmem; guest_info->gic_version = gic_version; + guest_info->no_its = vmc->no_its; guest_info_state->machine_done.notify = virt_guest_info_machine_done;qemu_add_machine_init_done_notifier (&guest_info_state->machine_done);
@@ -1562,8 +1565,12 @@ static void virt_2_7_instance_init(Object *obj)static void virt_machine_2_7_options (MachineClass *mc) { +VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc)); +virt_machine_2_8_options (mc);SET_MACHINE_COMPAT (mc,VIRT_COMPAT_2_7 ); +/* ITS was introduced with 2.8 */ + vmc->no_its = true; }DEFINE_VIRT_MACHINE (2 ,7 )
include/hw/arm/virt-acpi-build.h +1 -0
@@ -33,6 +33,7 @@ typedef struct VirtGuestInfo {const int *irqmap;bool use_highmem;int gic_version; +bool no_its; } VirtGuestInfo;
Signature · 1 line
2.7.4
Re: [Qemu-arm] [Qemu-devel] [PATCH 1/2] hw/arm/virt-acpi-build: fix MADT generation
In reply to Andrew JonesHi Drew,
Quoted 25 lines · Andrew Jones
We can't return early from build_* functions, as
build_headeris only called at the end.Signed-off-by Andrew Jones <[email protected]>--- hw/arm/virt-acpi-build.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)hw/arm/virt-acpi-build.c +6
-2@@ -556,15 +556,13 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtGuestInfo *guest_info) gicr->base_address =cpu_to_le64 (memmap[VIRT_GIC_REDIST ].base); gicr->range_length =cpu_to_le32 (memmap[VIRT_GIC_REDIST ].size); -if (!its_class_name ()) { -return ; +if (its_class_name ()) { + gic_its =acpi_data_push (table_data,sizeof *gic_its); + gic_its->type =ACPI_APIC_GENERIC_TRANSLATOR ; + gic_its->length =sizeof (*gic_its); + gic_its->translation_id =0 ; + gic_its->base_address =cpu_to_le64 (memmap[VIRT_GIC_ITS ].base);
hw/arm/virt-acpi-build.c build_madt(GArray *table_data, BIOSLinker *linker, VirtGuestInfo *guest_info) · line 568
Quoted 10 lines
hw/arm/virt-acpi-build.c +0
-6} - - gic_its =acpi_data_push (table_data,sizeof *gic_its); - gic_its->type =ACPI_APIC_GENERIC_TRANSLATOR ; - gic_its->length =sizeof (*gic_its); - gic_its->translation_id =0 ; - gic_its->base_address =cpu_to_le64 (memmap[VIRT_GIC_ITS ].base); }else { gic_msi =acpi_data_push (table_data,sizeof *gic_msi); gic_msi->type =ACPI_APIC_GENERIC_MSI_FRAME ;
Thanks for spotting the issue
Eric
Re: [Qemu-arm] [Qemu-devel] [PATCH 2/2] hw/arm/virt: no ITS on older machine types
In reply to Andrew JonesHi Drew,
Quoted 106 lines · Andrew Jones
We should avoid exposing new hardware (through DT and ACPI) on older machine types. This patch keeps 2.7 and older from changing, despite the introduction of ITS support for 2.8.
Signed-off-by Andrew Jones <[email protected]>---
As Eduardo pointed out long ago for a different reason, we should probably replace VirtGuestInfo with direct use of VirtMachineClass, like x86 has done to replace PcGuestInfo with direct use of PCMachineClass. I'll work on that, but wanted to get this ITS fixup in sooner than later, so I'm posting this patch now, which requires '
no_its' to be duplicated.Also, this patch will have a trivial conflict with Wei's PMU property series.
hw/arm/virt-acpi-build.c | 2 +- hw/arm/virt.c | 15 +++++++++++---- include/hw/arm/virt-acpi-build.h | 1 + 3 files changed, 13 insertions(+), 5 deletions(-)hw/arm/virt-acpi-build.c +1
-1@@ -556,7 +556,7 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtGuestInfo *guest_info) gicr->base_address =cpu_to_le64 (memmap[VIRT_GIC_REDIST ].base); gicr->range_length =cpu_to_le32 (memmap[VIRT_GIC_REDIST ].size); -if (its_class_name ()) { +if (its_class_name () && !guest_info->no_its) { gic_its =acpi_data_push (table_data,sizeof *gic_its); gic_its->type =ACPI_APIC_GENERIC_TRANSLATOR ; gic_its->length =sizeof (*gic_its);hw/arm/virt.c +11
-4@@ -84,6 +84,7 @@ typedef struct {MachineClass parent;VirtBoardInfo *daughterboard;bool disallow_affinity_adjustment; +bool no_its; } VirtMachineClass; typedef struct {@@ -552,7 +553,8 @@ static void create_v2m(VirtBoardInfo *vbi, qemu_irq *pic)fdt_add_v2m_gic_node (vbi); } -static void create_gic (VirtBoardInfo *vbi,qemu_irq *pic,int type,bool secure) +static void create_gic (VirtBoardInfo *vbi,qemu_irq *pic,int type, +bool secure,bool no_its) {/* We create a standalone GIC */ DeviceState *gicdev;@@ -616,9 +618,9 @@ static void create_gic(VirtBoardInfo *vbi, qemu_irq *pic, int type, bool secure)fdt_add_gic_node (vbi, type); -if (type ==3 ) { +if (type ==3 && !no_its) {create_its (vbi, gicdev); - }else { + }else if (type ==2 ) {create_v2m (vbi, pic); } }@@ -1376,7 +1378,7 @@ static void machvirt_init(MachineState *machine)create_flash (vbi, sysmem, secure_sysmem ? secure_sysmem : sysmem); -create_gic (vbi, pic, gic_version, vms->secure); +create_gic (vbi, pic, gic_version, vms->secure, vmc->no_its);fdt_add_pmu_nodes (vbi, gic_version);@@ -1408,6 +1410,7 @@ static void machvirt_init(MachineState *machine) guest_info->irqmap = vbi->irqmap; guest_info->use_highmem = vms->highmem; guest_info->gic_version = gic_version; + guest_info->no_its = vmc->no_its; guest_info_state->machine_done.notify = virt_guest_info_machine_done;qemu_add_machine_init_done_notifier (&guest_info_state->machine_done);@@ -1562,8 +1565,12 @@ static void virt_2_7_instance_init(Object *obj)static void virt_machine_2_7_options (MachineClass *mc) { +VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc)); +virt_machine_2_8_options (mc);SET_MACHINE_COMPAT (mc,VIRT_COMPAT_2_7 ); +/* ITS was introduced with 2.8 */ + vmc->no_its = true; }DEFINE_VIRT_MACHINE (2 ,7 )include/hw/arm/virt-acpi-build.h +0
-0
include/hw/arm/virt-acpi-build.h typedef struct VirtGuestInfo { · line 39
Quoted 7 lines
include/hw/arm/virt-acpi-build.h +1
-0@@ -33,6 +33,7 @@ typedef struct VirtGuestInfo {const int *irqmap;bool use_highmem;int gic_version; +bool no_its; } VirtGuestInfo;
Eric
Peter Maydell
AppliedQuoted 9 lines · Andrew Jones
Andrew Jones (2):
hw/arm/virt-acpi-build: fix MADT generation
hw/arm/virt: no ITS on older machine typeshw/arm/virt-acpi-build.c | 14 ++++++-------- hw/arm/virt.c | 15 +++++++++++---- include/hw/arm/virt-acpi-build.h | 1 + 3 files changed, 18 insertions(+), 12 deletions(-)
Applied to target-arm.next, thanks.
-- PMM
Re: [Qemu-arm] [PATCH 2/2] hw/arm/virt: no ITS on older machine types
In reply to Andrew JonesQuoted 5 lines · Andrew Jones
We should avoid exposing new hardware (through DT and ACPI) on older machine types. This patch keeps 2.7 and older from changing, despite the introduction of ITS support for 2.8.
Signed-off-by Andrew Jones <[email protected]>
Quoted 8 lines
---
As Eduardo pointed out long ago for a different reason, we should probably replace VirtGuestInfo with direct use of VirtMachineClass, like x86 has done to replace PcGuestInfo with direct use of PCMachineClass. I'll work on that, but wanted to get this ITS fixup in sooner than later, so I'm posting this patch now, which requires '
no_its' to be duplicated.
So this patch added a no_its flag which gets set for virt-2.7 and earlier, but there's no user-facing way to say "I'd like a virt-2.8 board with no ITS", right? That's a bit unfortunate because the ITS can't be migrated, which means there's no way to ask for a post-2.7 virt board which can be migrated...
thanks
-- PMM
Re: [Qemu-arm] [PATCH 2/2] hw/arm/virt: no ITS on older machine types
Hi Peter,
Quoted 15 lines · Peter Maydell
Quoted 5 lines · Andrew Jones
We should avoid exposing new hardware (through DT and ACPI) on older machine types. This patch keeps 2.7 and older from changing, despite the introduction of ITS support for 2.8.
Signed-off-by Andrew Jones <[email protected]>Quoted 8 lines
---
As Eduardo pointed out long ago for a different reason, we should probably replace VirtGuestInfo with direct use of VirtMachineClass, like x86 has done to replace PcGuestInfo with direct use of PCMachineClass. I'll work on that, but wanted to get this ITS fixup in sooner than later, so I'm posting this patch now, which requires '
no_its' to be duplicated.
Quoted 5 lines
So this patch added a
no_itsflag which gets set for virt-2.7 and earlier, but there's no user-facing way to say "I'd like a virt-2.8 board with no ITS", right? That's a bit unfortunate because the ITS can't be migrated, which means there's no way to ask for a post-2.7 virt board which can be migrated...
Sorry for the delay.
For 2.9 machine I can add a new property that would allow the user to deselect the ITS. Would that make sense?
Thanks
Eric
Quoted 3 lines
thanks
-- PMM
Re: [Qemu-arm] [PATCH 2/2] hw/arm/virt: no ITS on older machine types
Quoted 11 lines · Auger Eric
Quoted 5 lines · Peter Maydell
So this patch added a
no_itsflag which gets set for virt-2.7 and earlier, but there's no user-facing way to say "I'd like a virt-2.8 board with no ITS", right? That's a bit unfortunate because the ITS can't be migrated, which means there's no way to ask for a post-2.7 virt board which can be migrated...Sorry for the delay.
For 2.9 machine I can add a new property that would allow the user to deselect the ITS. Would that make sense?
Maybe, but Christoffer pointed out to me that we can't do migration of the GICv3 yet anyway, so I was getting a bit ahead of myself -- non-migratable ITS doesn't break something that worked previously. So perhaps we're OK the way we are?
thanks
-- PMM
Re: [Qemu-arm] [Qemu-devel] [PATCH 2/2] hw/arm/virt: no ITS on older machine types
Hi Peter,
Quoted 10 lines · Peter Maydell
Quoted 9 lines · Auger Eric
Quoted 5 lines · Peter Maydell
So this patch added a
no_itsflag which gets set for virt-2.7 and earlier, but there's no user-facing way to say "I'd like a virt-2.8 board with no ITS", right? That's a bit unfortunate because the ITS can't be migrated, which means there's no way to ask for a post-2.7 virt board which can be migrated...Sorry for the delay.
Quoted 7 lines
Quoted 2 lines
For 2.9 machine I can add a new property that would allow the user to deselect the ITS. Would that make sense?
Maybe, but Christoffer pointed out to me that we can't do migration of the GICv3 yet anyway, so I was getting a bit ahead of myself -- non-migratable ITS doesn't break something that worked previously. So perhaps we're OK the way we are?
Yes indeed GICv3 migration is not yet upstreamed although under way. For 2.9 your concern still is relevant if ITS migration functionality does not get supported in 2.9 along with GICv3 one. I will pay attention to this.
Thanks
Eric
Quoted 4 lines
thanks
-- PMM