xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Manish Jaggi <mjaggi@caviumnetworks.com>, xen-devel@lists.xenproject.org
Cc: Andre.Przywara@arm.com, julien.grall@arm.com,
	sstabellini@kernel.org, Manish Jaggi <mjaggi@cavium.com>
Subject: Re: [PATCH v5 4/5] ARM: Update Formula to compute MADT size using new callbacks in gic_hw_operations
Date: Tue, 10 Oct 2017 11:42:15 +0100	[thread overview]
Message-ID: <51aea91b-3eea-eb2d-07a1-b8d2a23b7348@linaro.org> (raw)
In-Reply-To: <f61a2fb2-a69f-397a-fba0-84a481448bbf@caviumnetworks.com>

Hi,

On 10/10/17 11:33, Manish Jaggi wrote:
> 
> 
> On 10/10/2017 3:44 PM, Julien Grall wrote:
>> Hi Manish,
>>
>> On 10/10/17 07:16, mjaggi@caviumnetworks.com wrote:
>>> From: Manish Jaggi <mjaggi@cavium.com>
>>>
>>> estimate_acpi_efi_size needs to be updated to provide correct size of
>>> hardware domains MADT, which now adds ITS information as well.
>>>
>>> This patch updates the formula to compute extra MADT size, as per 
>>> GICv2/3
>>> by calling gic_get_hwdom_extra_madt_size
>>
>> Missing full stop.
> oh i missed it.
>>
>>>
>>> Signed-off-by: Manish Jaggi <mjaggi@cavium.com>
>>> ---
>>>   xen/arch/arm/domain_build.c |  7 +------
>>>   xen/arch/arm/gic-v2.c       |  6 ++++++
>>>   xen/arch/arm/gic-v3.c       | 19 +++++++++++++++++++
>>>   xen/arch/arm/gic.c          | 12 ++++++++++++
>>>   xen/include/asm-arm/gic.h   |  3 +++
>>>   5 files changed, 41 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>>> index d6f9585..f17fcf1 100644
>>> --- a/xen/arch/arm/domain_build.c
>>> +++ b/xen/arch/arm/domain_build.c
>>> @@ -1808,12 +1808,7 @@ static int estimate_acpi_efi_size(struct 
>>> domain *d, struct kernel_info *kinfo)
>>>       acpi_size = ROUNDUP(sizeof(struct acpi_table_fadt), 8);
>>>       acpi_size += ROUNDUP(sizeof(struct acpi_table_stao), 8);
>>>   -    madt_size = sizeof(struct acpi_table_madt)
>>> -                + sizeof(struct acpi_madt_generic_interrupt) * 
>>> d->max_vcpus
>>> -                + sizeof(struct acpi_madt_generic_distributor);
>>> -    if ( d->arch.vgic.version == GIC_V3 )
>>> -        madt_size += sizeof(struct acpi_madt_generic_redistributor)
>>> -                     * d->arch.vgic.nr_regions;
>>> +    madt_size = gic_get_hwdom_madt_size(d);
>>>       acpi_size += ROUNDUP(madt_size, 8);
>>>         addr = acpi_os_get_root_pointer();
>>> diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
>>> index cbe71a9..0123ea4 100644
>>> --- a/xen/arch/arm/gic-v2.c
>>> +++ b/xen/arch/arm/gic-v2.c
>>> @@ -1012,6 +1012,11 @@ static int gicv2_iomem_deny_access(const 
>>> struct domain *d)
>>>       return iomem_deny_access(d, mfn, mfn + nr);
>>>   }
>>>   +static unsigned long gicv2_get_hwdom_extra_madt_size(const struct 
>>> domain *d)
>>> +{
>>> +    return 0;
>>> +}
>>> +
>>>   #ifdef CONFIG_ACPI
>>>   static int gicv2_make_hwdom_madt(const struct domain *d, u32 offset)
>>>   {
>>> @@ -1248,6 +1253,7 @@ const static struct gic_hw_operations gicv2_ops 
>>> = {
>>>       .read_apr            = gicv2_read_apr,
>>>       .make_hwdom_dt_node  = gicv2_make_hwdom_dt_node,
>>>       .make_hwdom_madt     = gicv2_make_hwdom_madt,
>>> +    .get_hwdom_extra_madt_size = gicv2_get_hwdom_extra_madt_size,
>>>       .map_hwdom_extra_mappings = gicv2_map_hwdown_extra_mappings,
>>>       .iomem_deny_access   = gicv2_iomem_deny_access,
>>>       .do_LPI              = gicv2_do_LPI,
>>> diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
>>> index b3d605d..447998d 100644
>>> --- a/xen/arch/arm/gic-v3.c
>>> +++ b/xen/arch/arm/gic-v3.c
>>> @@ -1406,6 +1406,19 @@ static int gicv3_make_hwdom_madt(const struct 
>>> domain *d, u32 offset)
>>>       return table_len;
>>>   }
>>>   +static unsigned long gicv3_get_hwdom_extra_madt_size(const struct 
>>> domain *d)
>>> +{
>>> +    unsigned long size;
>>> +
>>> +    size  = sizeof(struct acpi_madt_generic_redistributor)
>>> +                    * d->arch.vgic.nr_regions;
>>
>> Here you align the * with struct. But below, you align with sizeof. 
>> Please stay consistent and always align with sizeof.
>>
>>> +
>>> +    size  += vgic_v3_its_count(d)
>>> +                    * sizeof(struct acpi_madt_generic_translator);
>>
>> Same here.
>>
> Could you please help with the specific section on coding style 
> guidelines on xen for indentation when line over 80 chars which I am not 
> following for this case.

The best guideline is the existing code around in the file, in doubt ask.

The code you copied was aligned with sizeof (see in domain_build.c) and 
now it does not have the same alignment.

Furthermore, you used double tab and not one tab (Xen is using 4 spaces).

Cheers

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-10-10 10:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10  6:16 [PATCH v5 0/5] ARM: ACPI: ITS: Add ITS Support for ACPI hardware domain mjaggi
2017-10-10  6:16 ` [PATCH v5 1/5] ARM: ITS: Introduce common function add_to_host_its_list mjaggi
2017-10-10  6:16 ` [PATCH v5 2/5] ARM: ITS: Populate host_its_list from ACPI MADT Table mjaggi
2017-10-10 10:04   ` Julien Grall
2017-10-10  6:16 ` [PATCH v5 3/5] ARM: ITS: Deny hardware domain access to ITS mjaggi
2017-10-10 10:11   ` Julien Grall
2017-10-10  6:16 ` [PATCH v5 4/5] ARM: Update Formula to compute MADT size using new callbacks in gic_hw_operations mjaggi
2017-10-10  9:10   ` Andre Przywara
2017-10-10 10:14   ` Julien Grall
2017-10-10 10:33     ` Manish Jaggi
2017-10-10 10:42       ` Julien Grall [this message]
2017-10-10  6:16 ` [PATCH v5 5/5] ARM: ITS: Expose ITS in the MADT table mjaggi
2017-10-10 10:17   ` Julien Grall

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=51aea91b-3eea-eb2d-07a1-b8d2a23b7348@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Andre.Przywara@arm.com \
    --cc=julien.grall@arm.com \
    --cc=mjaggi@cavium.com \
    --cc=mjaggi@caviumnetworks.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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).