]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s: Fix NULL AT_BASE_PLATFORM when using DT CPU features
authorMichael Ellerman <mpe@ellerman.id.au>
Tue, 13 Mar 2018 04:58:11 +0000 (15:58 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 14 Mar 2018 09:20:00 +0000 (20:20 +1100)
commit826529aba72f672d9d0ecca7144d7e4ec7d26bfe
treeef08e56100d10391df27d8e30b013bcb2a011f77
parent4797a7704cc01674de9d12531218d1b4f02ba5ba
powerpc/64s: Fix NULL AT_BASE_PLATFORM when using DT CPU features

When running virtualised the powerpc kernel is able to run the system
in "compat mode" - which means the kernel and hardware are pretending
to userspace that the CPU is an older version than it actually is.

AT_BASE_PLATFORM is an AUXV entry that we export to userspace for use
when we're running in that mode, which tells userspace the "platform"
string for the real CPU version, as opposed to the faked version.

Although we don't support compat mode when using DT CPU features, and
arguably don't need to set AT_BASE_PLATFORM, the existing cputable
based code always sets it even when we're running bare metal. That
means the lack of AT_BASE_PLATFORM is a user-visible artifact of the
fact that the kernel is using DT CPU features, which we don't want.

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

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
arch/powerpc/kernel/dt_cpu_ftrs.c