linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv4 0/5] arm64: handle heterogeneous system register values
Date: Wed, 16 Jul 2014 16:32:42 +0100	[thread overview]
Message-ID: <1405524767-30220-1-git-send-email-mark.rutland@arm.com> (raw)

Currently the arm64 kernel assumes CPUs are homogeneous, which is a source of
several potential problems as this is not always true. This series is an
attempt to ameliorate the situation. The first posting [1] was titled as
"arm64: extend/fix /proc/cpuinfo + runtime sanity checks", but with the
addition of the I-cache policy fix this title was either going to become
unwieldy or misleading.

The major addition is a couple of hooks to log system register values, and
sanity checking of our assumptions regarding the underlying hardware. If these
are violated it is made very clear to the user that things may be broken.

Due to rework between v2 an 3 I've dropped Acks from some patches. A once-over
from those who have reviewed this before would be much appreciated.

Due to some off-list comments I've restored the printing of features per-cpu
(which was also my initial preference). While this is still based on the global
hwcaps, this will be correct where the sanity checks don't fail. Hopefully
no-one is insane enough to build CPUs with different instruction set support
anyhow.

I'd like to see at least patches 1-4 go in shortly as they've been stable for a
while now, have received no major complaints, and will be of use immediately
for those involved in CPU bringup. I understand people might not like patch 5,
but that shouldn't delay the rest of the series.

Since v3 [5]:
* Minor cleanups suggested by Will.
* Print hwcaps per-cpu again.
* Clean up other issues in /proc/cpuinfo.
* Move the cpuinfo patch to the end.
Since v2 [4]:
* Print the hwcaps once in /proc/cpinfo, per Ard's comments.
* Apply fixupps per Will's comments.
* Sanity check additional registers: dczid id_aa64{isar,mmfr,pfr}1.
* We care about GICv3 support reporting, don't mask it out.
* Set TAINT_CPU_OUT_OF_SPEC upon sanity check failure.
* Store boot CPU values separately.
* Separate value stashing into new patch.
* Rebased the branch to v3.16-rc2.
Since v1 [1]:
* Add fix for differing I-cache policies
* Make read_cpuid_part_number and read_cpu_implementor return extracted fields.

This series adds infrastructure to record various system registers upon the
booting of each CPU into a new per-CPU struct cpuinfo_arm64. This data can then
be used to solve various problems:

* On arm64 /proc/cpuinfo only contains information regarding the current CPU
  (i.e. that which issued the read), due to use of read_cpuid_id() within
  c_show. This isn't fantastic as it doesn't match arm and x86 (which print
  information per-cpu), and on big.LITTLE AArch64 systems it will mean we can't
  discover what CPU implementations we have. Using the newly recorded
  information, we can print correct information per-CPU in /proc/cpuinfo.

* Level 1 instruction cache policy can differ across CPU micro-architectures in
  big.LITTLE configurations, which can lead to a subset of cores reporting
  aliasing I-caches in CTR_EL0.L1Ip. If any CPUs in the system have VIPT or
  AIVIVT I-caches, the appropriate maintenance must be performed even from those
  CPUs whose caches are non-aliasing. We can use the newly recorded information
  to detect when this is the case.

* Sometimes CPUs are erroneously configured differently by firmware such that a
  feature is only enabled on a subset of CPUs. Even in the presence of
  big.LITTLE systems we do not generally expect this, and such problems can be
  difficult to detect. To enable early detection of mismatched capabilities in
  SMP systems, we can use the newly recorded information to compare CPUs
  feature-wise and identify potential issues.

The series is based on v3.16-rc2, and can be found in my
arm64/heterogeneous-sysreg branch [2,3]. It should cleanly rebase to later
release candidates.

Cheers,
Mark.

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-May/255389.html
[2] http://linux-arm.org/git?p=linux-mr.git;a=shortlog;h=refs/heads/arm64/heterogeneous-sysreg
[3] git://linux-arm.org/linux-mr.git arm64/heterogeneous-sysreg
[4] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-June/264387.html
[5] lists.infradead.org/pipermail/linux-arm-kernel/2014-June/266973.html

Mark Rutland (5):
  arm64: add MIDR_EL1 field accessors
  arm64: cpuinfo: record cpu system register values
  arm64: cachetype: report weakest cache policy
  arm64: add runtime system sanity checks
  arm64: cpuinfo: print info for all CPUs

 arch/arm64/include/asm/cachetype.h |  16 ++--
 arch/arm64/include/asm/cpu.h       |  59 ++++++++++++
 arch/arm64/include/asm/cputype.h   |  33 +++++--
 arch/arm64/kernel/Makefile         |   3 +-
 arch/arm64/kernel/cpuinfo.c        | 192 +++++++++++++++++++++++++++++++++++++
 arch/arm64/kernel/setup.c          |  46 ++++-----
 arch/arm64/kernel/smp.c            |   6 ++
 7 files changed, 316 insertions(+), 39 deletions(-)
 create mode 100644 arch/arm64/include/asm/cpu.h
 create mode 100644 arch/arm64/kernel/cpuinfo.c

-- 
1.9.1

             reply	other threads:[~2014-07-16 15:32 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16 15:32 Mark Rutland [this message]
2014-07-16 15:32 ` [PATCHv4 1/5] arm64: add MIDR_EL1 field accessors Mark Rutland
2014-07-16 15:32 ` [PATCHv4 2/5] arm64: cpuinfo: record cpu system register values Mark Rutland
2014-07-16 15:32 ` [PATCHv4 3/5] arm64: cachetype: report weakest cache policy Mark Rutland
2014-07-16 15:32 ` [PATCHv4 4/5] arm64: add runtime system sanity checks Mark Rutland
2014-07-16 15:32 ` [PATCHv4 5/5] arm64: cpuinfo: print info for all CPUs Mark Rutland
2014-07-16 15:57   ` Will Deacon
2014-07-17 10:30     ` Catalin Marinas
2014-07-17 10:39     ` Peter Maydell
2014-07-17 10:46       ` Marcus Shawcroft
2014-07-17 10:54         ` Will Deacon
2014-07-17 11:09           ` Ard Biesheuvel
2014-07-17 11:12           ` Peter Maydell
2014-07-17 12:35             ` Will Deacon
2014-07-17 13:55               ` Peter Maydell
2014-07-17 17:10                 ` Catalin Marinas
2014-07-17 17:28                   ` Will Deacon
2014-07-18  9:27                     ` Catalin Marinas
2014-07-18  9:53                       ` Will Deacon
2014-07-18 13:57                         ` Mark Rutland
2014-07-18 15:52                           ` Peter Maydell
2014-07-18 15:58                             ` Mark Rutland
2014-07-18 16:18                               ` Peter Maydell
2014-07-18 16:41                                 ` Mark Rutland
2014-07-18 20:24                                   ` Christopher Covington
2014-07-16 15:55 ` [PATCHv4 0/5] arm64: handle heterogeneous system register values Will Deacon
2014-07-17 11:03 ` Catalin Marinas
2014-07-17 14:21   ` Mark Rutland
2014-07-17 14:28     ` Will Deacon

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=1405524767-30220-1-git-send-email-mark.rutland@arm.com \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).