From: Andrew Donnellan <ajd@linux.ibm.com>
To: Daniel Axtens <dja@axtens.net>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2] powerpc: setup_64: set up PACA earlier to avoid kcov problems
Date: Fri, 6 Mar 2020 15:45:41 +1100 [thread overview]
Message-ID: <f9f212bb-66aa-ec99-2f04-c892c4572d2a@linux.ibm.com> (raw)
In-Reply-To: <87zhcup02u.fsf@dja-thinkpad.axtens.net>
On 6/3/20 3:40 pm, Daniel Axtens wrote:
>> 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.
That was my thinking too.
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited
prev parent reply other threads:[~2020-03-06 4:47 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
2020-03-06 4:45 ` Andrew Donnellan [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=f9f212bb-66aa-ec99-2f04-c892c4572d2a@linux.ibm.com \
--to=ajd@linux.ibm.com \
--cc=dja@axtens.net \
--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