From: Auger Eric <eric.auger@redhat.com>
To: Andrew Jones <drjones@redhat.com>,
qemu-devel@nongnu.org, qemu-arm@nongnu.org
Cc: peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCH 2/2] hw/arm/virt: no ITS on older machine types
Date: Mon, 10 Oct 2016 21:37:49 +0200 [thread overview]
Message-ID: <d0e927f3-25a7-7c30-e55f-d45b33ffd71f@redhat.com> (raw)
In-Reply-To: <1476117341-32690-3-git-send-email-drjones@redhat.com>
Hi Drew,
On 10/10/2016 18:35, Andrew Jones wrote:
> 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 <drjones@redhat.com>
> ---
>
> 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(-)
>
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index c31349561c95..48820f372830 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -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);
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 0f6305d3c7f6..e3734d47df81 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -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)
>
> diff --git a/include/hw/arm/virt-acpi-build.h b/include/hw/arm/virt-acpi-build.h
> index e43330ad659b..f5ec749b8fea 100644
> --- a/include/hw/arm/virt-acpi-build.h
> +++ b/include/hw/arm/virt-acpi-build.h
> @@ -33,6 +33,7 @@ typedef struct VirtGuestInfo {
> const int *irqmap;
> bool use_highmem;
> int gic_version;
> + bool no_its;
> } VirtGuestInfo;
>
>
>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Eric
next prev parent reply other threads:[~2016-10-10 19:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-10 16:35 [Qemu-devel] [PATCH 0/2] couple ITS support fixups Andrew Jones
2016-10-10 16:35 ` [Qemu-devel] [PATCH 1/2] hw/arm/virt-acpi-build: fix MADT generation Andrew Jones
2016-10-10 18:54 ` Auger Eric
2016-10-10 16:35 ` [Qemu-devel] [PATCH 2/2] hw/arm/virt: no ITS on older machine types Andrew Jones
2016-10-10 19:37 ` Auger Eric [this message]
2017-01-20 15:52 ` Peter Maydell
2017-01-26 7:58 ` Auger Eric
2017-01-26 10:41 ` Peter Maydell
2017-01-26 13:34 ` Auger Eric
2016-10-12 12:27 ` [Qemu-devel] [PATCH 0/2] couple ITS support fixups Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d0e927f3-25a7-7c30-e55f-d45b33ffd71f@redhat.com \
--to=eric.auger@redhat.com \
--cc=drjones@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).