From: Gustavo Romero <gromero@linux.vnet.ibm.com>
To: "Li Yi (Adam)" <liyiadam@gmail.com>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/64s: Fix NULL AT_BASE_PLATFORM when using DT CPU features
Date: Fri, 23 Mar 2018 15:39:09 -0300 [thread overview]
Message-ID: <20ef5811-6fbf-19ca-a083-395deb84fd5e@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAN7W-Tbai=VjA6HBVM-2tQwdgk1ebiSZ_d-D2o42Yhz=bJOo-Q@mail.gmail.com>
Hi Yi,
On 03/14/2018 05:34 AM, Li Yi (Adam) wrote:
>> So set it in the DT CPU features code also.
>>
>> This results in eg:
>> $ LD_SHOW_AUXV=1 /bin/true | grep "AT_.*PLATFORM"
>> AT_PLATFORM: power9
>> AT_BASE_PLATFORM:power9
>>
>
> Is this issue related with DD2.2 CPU?
> I tested on a Boston system with DD2.1 CPU, with kernel 4.14.23,
> AT_BASE_PLATFORM value is correct:
>
> [root@boston-sh-04 ~]# LD_SHOW_AUXV=1 /bin/true | grep "AT_.*PLATFORM"
> AT_PLATFORM: power9
> AT_BASE_PLATFORM:power9
> [root@boston-sh-04 ~]# uname -a
> Linux boston-sh-04 4.14.23 #1 SMP Sat Mar 3 12:14:56 CST 2018 ppc64le
> ppc64le ppc64le GNU/Linux
It's not related to the processor version, rather it's related to if you
are under a VM or running on baremetal. The issue happens on baremetal
when you are using DT to get the CPU features. So I guess the test you
performed above is on a VM? On DD2.1 baremetal AT_BASE_PLATFORM is
missing as on a DD2.2 baremetal (if mpe's patch is not applied):
root@r222l:~# LD_SHOW_AUXV=1 /bin/true | grep "AT_.*PLATFORM"
AT_PLATFORM: power9
root@r222l:~# lscpu | fgrep Model
Model: 2.1 (pvr 004e 1201)
Model name: POWER9, altivec supported
root@r222l:~# uname -a
Linux r222l 4.13.0-32-generic #35-Ubuntu SMP Thu Jan 25 09:05:20 UTC 2018 ppc64le ppc64le ppc64le GNU/Linux
Regards,
Gustavo
>
> Thanks,
> -Yi
>
>> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>> ---
>> arch/powerpc/kernel/dt_cpu_ftrs.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c b/arch/powerpc/kernel/dt_cpu_ftrs.c
>> index 945e2c29ad2d..0bcfb0f256e1 100644
>> --- a/arch/powerpc/kernel/dt_cpu_ftrs.c
>> +++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
>> @@ -720,6 +720,9 @@ static void __init cpufeatures_setup_finished(void)
>> cur_cpu_spec->cpu_features |= CPU_FTR_HVMODE;
>> }
>>
>> + /* Make sure powerpc_base_platform is non-NULL */
>> + powerpc_base_platform = cur_cpu_spec->platform;
>> +
>> system_registers.lpcr = mfspr(SPRN_LPCR);
>> system_registers.hfscr = mfspr(SPRN_HFSCR);
>> system_registers.fscr = mfspr(SPRN_FSCR);
>> --
>> 2.14.1
>
next prev parent reply other threads:[~2018-03-23 18:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-14 8:34 [PATCH] powerpc/64s: Fix NULL AT_BASE_PLATFORM when using DT CPU features Li Yi (Adam)
2018-03-23 18:39 ` Gustavo Romero [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-03-13 23:14 Michael Ellerman
2018-03-13 23:36 ` Nicholas Piggin
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=20ef5811-6fbf-19ca-a083-395deb84fd5e@linux.vnet.ibm.com \
--to=gromero@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=liyiadam@gmail.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;
as well as URLs for NNTP newsgroup(s).