From: Daniel Axtens <dja@axtens.net>
To: Andrew Donnellan <ajd@linux.ibm.com>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2] powerpc: setup_64: set up PACA earlier to avoid kcov problems
Date: Fri, 06 Mar 2020 15:40:57 +1100 [thread overview]
Message-ID: <87zhcup02u.fsf@dja-thinkpad.axtens.net> (raw)
In-Reply-To: <59e8a506-572a-f355-e0ca-9c75758a9b65@linux.ibm.com>
> There's some special handling for CPU_FTR_HVMODE in
> cpufeatures_setup_cpu() in kernel/dt_cpu_ftrs.c:
>
> /* Initialize the base environment -- clear FSCR/HFSCR. */
> hv_mode = !!(mfmsr() & MSR_HV);
> if (hv_mode) {
> /* CPU_FTR_HVMODE is used early in PACA setup */
> cur_cpu_spec->cpu_features |= CPU_FTR_HVMODE;
> mtspr(SPRN_HFSCR, 0);
> }
>
> With this patch, the comment about PACA setup I assume is no longer
> true. It looks like we still rely on hv_mode being set to deal with
> discrepancies between the device tree and the MSR.
This code confuses me. IIUC it sets the CPU feature if we're in HV mode,
which will catch the case where the HV bit is set in the MSR but for
some reason it's not listed in the DT. With my patch, we'll directly
test the MSR so we don't need the cpu feature set for that.
However, the CPU feature is tested elsewhere, so I think the correct
behaviour is to keep the code but drop the comment. Having said that
bootstrapping is hard so lmk if I've misunderstood.
Regards,
Daniel
>
> --
> Andrew Donnellan OzLabs, ADL Canberra
> ajd@linux.ibm.com IBM Australia Limited
next prev parent reply other threads:[~2020-03-06 4:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-13 5:23 [PATCH v2] powerpc: setup_64: set up PACA earlier to avoid kcov problems Daniel Axtens
2020-02-13 6:23 ` Christophe Leroy
2020-02-14 3:04 ` Andrew Donnellan
2020-03-06 4:40 ` Daniel Axtens [this message]
2020-03-06 4:45 ` Andrew Donnellan
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=87zhcup02u.fsf@dja-thinkpad.axtens.net \
--to=dja@axtens.net \
--cc=ajd@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.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