qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Auger Eric <eric.auger@redhat.com>
To: Andrew Jones <drjones@redhat.com>
Cc: eric.auger.pro@gmail.com, qemu-devel@nongnu.org,
	qemu-arm@nongnu.org, peter.maydell@linaro.org, wei@redhat.com,
	marc.zyngier@arm.com, cdall@kernel.org, zhaoshenglong@huawei.com
Subject: Re: [Qemu-devel] [RFC 7/8] hw/arm/virt-acpi-build: Handle multiple GICR structures
Date: Fri, 13 Apr 2018 15:55:27 +0200	[thread overview]
Message-ID: <ae74ebeb-b447-e640-2e48-926114b92823@redhat.com> (raw)
In-Reply-To: <20180413134734.ooeu36abnlafglwi@hawk.localdomain>

Hi Drew,

On 13/04/18 15:47, Andrew Jones wrote:
> On Tue, Mar 27, 2018 at 04:15:21PM +0200, Eric Auger wrote:
>> In case multiple redistributor regions were registered,
>> let's add the corresponding GICR structures in the MADT
>> ACPI table.
>>
>> Signed-off-by: Eric Auger <eric.auger@redhat.com>
>> ---
>>  hw/arm/virt-acpi-build.c | 21 +++++++++++++++------
>>  1 file changed, 15 insertions(+), 6 deletions(-)
>>
>> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
>> index c7c6a57..aefc1b4 100644
>> --- a/hw/arm/virt-acpi-build.c
>> +++ b/hw/arm/virt-acpi-build.c
>> @@ -43,6 +43,7 @@
>>  #include "hw/pci/pcie_host.h"
>>  #include "hw/pci/pci.h"
>>  #include "hw/arm/virt.h"
>> +#include "hw/intc/arm_gicv3.h"
>>  #include "sysemu/numa.h"
>>  #include "kvm_arm.h"
>>  
>> @@ -618,14 +619,22 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>>      }
>>  
>>      if (vms->gic_version == 3) {
>> +        GICv3State *s = (GICv3State *)vms->gic;
>> +        int r;
>> +
>>          AcpiMadtGenericTranslator *gic_its;
>> -        AcpiMadtGenericRedistributor *gicr = acpi_data_push(table_data,
>> -                                                         sizeof *gicr);
>>  
>> -        gicr->type = ACPI_APIC_GENERIC_REDISTRIBUTOR;
>> -        gicr->length = sizeof(*gicr);
>> -        gicr->base_address = cpu_to_le64(memmap[VIRT_GIC_REDIST].base);
>> -        gicr->range_length = cpu_to_le32(memmap[VIRT_GIC_REDIST].size);
>> +        for (r = 0; r <  s->nb_redist_regions; r++) {
>                            ^ extra space
>> +            AcpiMadtGenericRedistributor *gicr = acpi_data_push(table_data,
>> +                                                                sizeof *gicr);
>> +
>> +            gicr->type = ACPI_APIC_GENERIC_REDISTRIBUTOR;
>> +            gicr->length = sizeof(*gicr);
> 
> This file has inconsistent use of () with sizeof. If you want to start
> it on its path to using ()'s, like the majority of QEMU code, then you
> could add them to the acpi_data_push() above.
I will align with the rest of the code
> 
>> +            gicr->base_address = cpu_to_le64(s->redist_region[r].base);
>> +            /* count redistributors of 2 x 64kB pages */
>> +            gicr->range_length =
>> +                cpu_to_le64((uint64_t)s->redist_region[r].count << 17);
>                             ^^ range_length is only 4 bytes.
> 
> It might be nice to have a define of some sort for the 2*64K to avoid it
> getting scattered everywhere. 
sure

Thanks

Eric
> 
>> +        }
>>  
>>          if (its_class_name() && !vmc->no_its) {
>>              gic_its = acpi_data_push(table_data, sizeof *gic_its);
>> -- 
>> 2.5.5
>>
>>
> 
> Thanks,
> drew 
> 

  reply	other threads:[~2018-04-13 13:55 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-27 14:15 [Qemu-devel] [RFC 0/8] KVM/ARM: Relax the max 123 vcpus limitation along with KVM GICv3 Eric Auger
2018-03-27 14:15 ` [Qemu-devel] [RFC 1/8] linux-headers: Partial update for KVM/ARM multiple redistributor region registration Eric Auger
2018-03-27 14:15 ` [Qemu-devel] [RFC 2/8] hw/intc/arm_gicv3: Use an array of redistributor regions Eric Auger
2018-04-13 13:27   ` Peter Maydell
2018-04-13 13:36     ` Auger Eric
2018-03-27 14:15 ` [Qemu-devel] [RFC 3/8] kvm: Expose kvm_max_vcpus() Eric Auger
2018-03-27 14:15 ` [Qemu-devel] [RFC 4/8] hw/intc/arm_gicv3: Implement register_redist_region API Eric Auger
2018-04-13 13:34   ` Peter Maydell
2018-04-13 13:44     ` Auger Eric
2018-04-13 13:46       ` Peter Maydell
2018-04-13 13:56         ` Auger Eric
2018-03-27 14:15 ` [Qemu-devel] [RFC 5/8] hw/intc/arm_gicv3_kvm: Allow multiple redistributor regions Eric Auger
2018-03-27 14:15 ` [Qemu-devel] [RFC 6/8] hw/arm/virt: Allow GICv3 DT node with " Eric Auger
2018-04-13 13:36   ` Peter Maydell
2018-04-13 13:45     ` Auger Eric
2018-03-27 14:15 ` [Qemu-devel] [RFC 7/8] hw/arm/virt-acpi-build: Handle multiple GICR structures Eric Auger
2018-04-13 13:47   ` Andrew Jones
2018-04-13 13:55     ` Auger Eric [this message]
2018-03-27 14:15 ` [Qemu-devel] [RFC 8/8] hw/arm/virt: Allow up to 512 vcpus along with KVM VGICv3 Eric Auger
2018-03-28  4:02   ` Shannon Zhao
2018-03-28  6:47     ` Auger Eric
2018-04-13 13:41   ` Peter Maydell
2018-04-13 14:01     ` Auger Eric
2018-04-13 14:06       ` Peter Maydell
2018-04-13 14:11         ` Auger Eric
2018-04-16  9:19           ` Andrew Jones
2018-04-16 10:58             ` 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=ae74ebeb-b447-e640-2e48-926114b92823@redhat.com \
    --to=eric.auger@redhat.com \
    --cc=cdall@kernel.org \
    --cc=drjones@redhat.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=marc.zyngier@arm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wei@redhat.com \
    --cc=zhaoshenglong@huawei.com \
    /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).