From: Andre Przywara <andre.przywara@linaro.org>
To: "Julien Grall" <julien.grall@linaro.org>,
"Roger Pau Monné" <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org,
Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v3 8/8] ARM: make nr_irqs a constant
Date: Thu, 1 Feb 2018 14:41:29 +0000 [thread overview]
Message-ID: <32b90a7f-dc2b-aef7-37ff-7b3cbc9bc9c5@linaro.org> (raw)
In-Reply-To: <e3310a49-af90-a475-cb0a-0c2f78392df9@linaro.org>
Hi,
On 01/02/18 14:39, Julien Grall wrote:
>
>
> On 01/02/18 14:34, Andre Przywara wrote:
>> Hi,
>
> Hi,
>
>> On 01/02/18 13:47, Julien Grall wrote:
>>> Hi Andre,
>>>
>>> On 01/02/18 13:43, Andre Przywara wrote:
>>>> On 30/01/18 14:36, Roger Pau Monné wrote:
>>>>> On Wed, Jan 24, 2018 at 06:10:58PM +0000, Andre Przywara wrote:
>>>>>> On ARM the maximum number of IRQs is a constant, but we share it
>>>>>> being
>>>>>> a variable to match x86. Since we are not supposed to alter it, let's
>>>>>> mark it as "const" to avoid accidental change.
>>>>>>
>>>>>> Suggested-by: Julien Grall <julien.grall@linaro.org>
>>>>>> Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
>>>>>> ---
>>>>>> xen/arch/arm/irq.c | 2 +-
>>>>>> xen/include/asm-arm/irq.h | 2 +-
>>>>>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>>>>>
>>>>>> diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
>>>>>> index 62103a20e3..d229cb6871 100644
>>>>>> --- a/xen/arch/arm/irq.c
>>>>>> +++ b/xen/arch/arm/irq.c
>>>>>> @@ -27,7 +27,7 @@
>>>>>> #include <asm/gic.h>
>>>>>> #include <asm/vgic.h>
>>>>>> -unsigned int __read_mostly nr_irqs = NR_IRQS;
>>>>>> +const unsigned int __read_mostly nr_irqs = NR_IRQS;
>>>>>
>>>>> Shouldn't you remove the __read_mostly attribute, so the symbol it's
>>>>> placed at the .rodata section by the compiler?
>>>>
>>>> Yes, makes sense, thanks for pointing this out!
>>>> const ... __read_mostly sounds somewhat redundant.
>>>>
>>>> It looks like the compiler does the right thing anyway, as I can't find
>>>> nr_irqs in the ELF in any case. Both with and without __read_mostly it
>>>> results into the very same binary, actually even without the const.
>>>
>>> Really? I was expecting const data to be in the section.rodata. Are you
>>> suggesting this is landing in the section .data instead?
>>
>> Well, for the local case (arm/irq.c) the compiler just does the right
>> thing and eliminates the variable completely :
>>
>> 00000000000005dc <request_irq>:
>> 5dc: eb1f005f cmp x2, xzr
>> 5e0: 52807fe5 mov w5, #0x3ff // #1023
>> 5e4: 7a451002 ccmp w0, w5, #0x2, ne
>> 5e8: 540003e8 b.hi 664 <request_irq+0x88> // EINVAL
>>
>> For common/domain.o it is as you guessed: in .data.read_mostly, with or
>> without this (original) patch. So __read_mostly trumps const.
>> Removing __read_mostly indeed puts it in .rodata.
>>
>> Don't know why the resulting xen/xen.axf don't show any difference, but
>> the respective object files do.
> xen-syms is an ELF binary.
> xen is not an ELF.
> xen.axf is not built anymore since Xen 4.9.
Indeed, I missed that part. The date stayed always at "Jun 7 2017" ;-)
So on real surprise that it didn't change.
Cheers,
Andre.
> That might explain why you are not able to find it.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-02-01 14:41 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-24 18:10 [PATCH v3 0/8] ARM: VGIC/GIC separation cleanups Andre Przywara
2018-01-24 18:10 ` [PATCH v3 1/8] ARM: VGIC: drop unneeded gic_restore_pending_irqs() Andre Przywara
2018-01-30 11:48 ` Julien Grall
2018-01-30 17:26 ` Stefano Stabellini
2018-01-24 18:10 ` [PATCH v3 2/8] ARM: VGIC: split gic.c to observe hardware/virtual GIC separation Andre Przywara
2018-01-30 11:53 ` Julien Grall
2018-01-24 18:10 ` [PATCH v3 3/8] ARM: VGIC: split up gic_dump_info() to cover virtual part separately Andre Przywara
2018-01-24 18:10 ` [PATCH v3 4/8] ARM: VGIC: rework events_need_delivery() Andre Przywara
2018-01-24 18:10 ` [PATCH v3 5/8] ARM: VGIC: factor out vgic_connect_hw_irq() Andre Przywara
2018-01-30 13:19 ` Julien Grall
2018-01-31 15:54 ` Andre Przywara
2018-01-31 16:30 ` Julien Grall
2018-02-01 12:07 ` Andre Przywara
2018-01-24 18:10 ` [PATCH v3 6/8] ARM: VGIC: factor out vgic_get_hw_irq_desc() Andre Przywara
2018-01-31 16:16 ` Julien Grall
2018-01-31 16:24 ` Andre Przywara
2018-01-31 16:25 ` Julien Grall
2018-01-24 18:10 ` [PATCH v3 7/8] ARM: VGIC: rework gicv[23]_update_lr to not use pending_irq Andre Przywara
2018-01-24 18:10 ` [PATCH v3 8/8] ARM: make nr_irqs a constant Andre Przywara
2018-01-30 13:24 ` Julien Grall
2018-01-30 14:36 ` Roger Pau Monné
2018-02-01 13:43 ` Andre Przywara
2018-02-01 13:47 ` Julien Grall
2018-02-01 14:34 ` Andre Przywara
2018-02-01 14:39 ` Julien Grall
2018-02-01 14:41 ` Andre Przywara [this message]
2018-02-01 13:57 ` Roger Pau Monné
2018-02-01 14:39 ` Andre Przywara
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=32b90a7f-dc2b-aef7-37ff-7b3cbc9bc9c5@linaro.org \
--to=andre.przywara@linaro.org \
--cc=julien.grall@linaro.org \
--cc=roger.pau@citrix.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).