From: "Maciej W. Rozycki" <macro@linux-mips.org>
To: Damien Le Moal <Damien.LeMoal@wdc.com>
Cc: "linux-riscv@lists.infradead.org"
<linux-riscv@lists.infradead.org>,
Alistair Francis <Alistair.Francis@wdc.com>,
"palmerdabbelt@google.com" <palmerdabbelt@google.com>,
Anup Patel <Anup.Patel@wdc.com>,
"paul.walmsley@sifive.com" <paul.walmsley@sifive.com>,
"aou@eecs.berkeley.edu" <aou@eecs.berkeley.edu>,
"palmer@dabbelt.com" <palmer@dabbelt.com>,
"anup@brainfault.org" <anup@brainfault.org>,
Atish Patra <Atish.Patra@wdc.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] RISC-V: Check clint_time_val before use
Date: Sat, 26 Sep 2020 11:52:25 +0100 (BST) [thread overview]
Message-ID: <alpine.LFD.2.21.2009261141060.3561363@eddie.linux-mips.org> (raw)
In-Reply-To: <8a99b16ae3037487b762fb1bbcd81b576d9e11ab.camel@wdc.com>
On Sat, 26 Sep 2020, Damien Le Moal wrote:
> > > With this applied in addition to your patch, it works.
> > >
> > > diff --git a/drivers/clocksource/timer-clint.c b/drivers/clocksource/timer-
> > > clint.c
> > > index d17367dee02c..8dbec85979fd 100644
> > > --- a/drivers/clocksource/timer-clint.c
> > > +++ b/drivers/clocksource/timer-clint.c
> > > @@ -37,7 +37,7 @@ static unsigned long clint_timer_freq;
> > > static unsigned int clint_timer_irq;
> > >
> > > #ifdef CONFIG_RISCV_M_MODE
> > > -u64 __iomem *clint_time_val;
> > > +u64 __iomem *clint_time_val = NULL;
> > > #endif
> >
> > Hmm, BSS initialisation issue?
>
> Not a static variable, so it is not in BSS, no ?
Maybe it has a weird declaration elsewhere which messes up things (I
haven't checked), but it looks to me like it does have static storage
(rather than automatic or thread one), so if uninitialised it goes to BSS,
and it is supposed to be all-zeros whether explicitly assigned a NULL
value or not. It does have external rather than internal linkage (as it
would if it had the `static' keyword), but it does not matter. Best check
with `objdump'/`readelf'.
Maciej
prev parent reply other threads:[~2020-09-26 10:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-26 7:27 Anup Patel
2020-09-26 9:25 ` Damien Le Moal
2020-09-26 9:31 ` Anup Patel
2020-09-26 9:46 ` Damien Le Moal
2020-09-26 9:57 ` Anup Patel
2020-09-26 10:01 ` Damien Le Moal
2020-09-26 10:09 ` Maciej W. Rozycki
2020-09-26 10:25 ` Damien Le Moal
2020-09-26 10:52 ` Maciej W. Rozycki [this message]
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=alpine.LFD.2.21.2009261141060.3561363@eddie.linux-mips.org \
--to=macro@linux-mips.org \
--cc=Alistair.Francis@wdc.com \
--cc=Anup.Patel@wdc.com \
--cc=Atish.Patra@wdc.com \
--cc=Damien.LeMoal@wdc.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=palmerdabbelt@google.com \
--cc=paul.walmsley@sifive.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
all inboxes | Powered by JetHome®