Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
tphan-ampere edited this page Jun 18, 2021 · 23 revisions

Ampere Computing

Ampere Altra™ Linux Kernel Porting Guide

Introduction

This guide provides information regarding Linux kernel features and patches that apply to the Ampere Altra™ SoC. It provides a guideline regarding accepted, posted, and pending but not yet posted kernel patches that may assist developers in porting their kernels to support SoC features.

This document assumes a stock Linux kernel version 4.18 base, which can be found here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ .

For any question, please contact the Ampere support team: support@amperecomputing.com

Note: the eMag kernel wiki has been moved here: https://github.com/AmpereComputing/ampere-centos-kernel/wiki/Ampere-CentOS-7.5-Kernel-wiki

Linux Kernel Features

The Linux 4.18 kernel contains many SoC features already; there is no high-level feature missing. Note that there is, however, platform functionality (i.e USB, etc.) that requires backporting to 4.18 listed below.

SoC Kernel Repositories

The table below shows the repositories for the Ampere Altra kernel, which are based on the stock CentOS Linux kernel.

Repositories Comment
https://github.com/AmpereComputing/ampere-altra-kernel

Ampere Altra kernel GIT repository- Branch amp-altra-8.0-kernel:

kernel 4.18 for Ampere Altra

https://github.com/AmpereComputing/ampere-altra-build Ampere Altra kernel RPM compiling GIT repository- Branch ampere-altra-8.0-build: kernel 4.18 RPM’s for Ampere Altra

Kernel Configuration

There is no Ampere Altra kernel specific configuration file, it relies on the default configuration. In general, the default will include all that is needed. You can confirm that all required drivers are included by cross checking with the table below.

Kernel Configuration Comment
CONFIG_SENSORS_XGENE SoC temperature/power sensors driver
CONFIG_I2C_XGENE_SLIMPRO I2C interface driver to boot processor
CONFIG_I2C_DESIGNWARE_PLATFORM I2C driver for bus directly expose to the OS
CONFIG_I2C_DESIGNWARE_CORE I2C driver for bus directly expose to the OS
CONFIG_SERIAL_AMBA_PL011 Serial console driver
CONFIG_SERIAL_AMBA_PL011_CONSOLE Serial console driver
CONFIG_ACPI_BUTTON Require for power off support
CONFIG_ACPI_XXXX General ACPI support configuration
CONFIG_ARM64 General ARM64 support
CONFIG_PCI General PCIe support

Ampere Altra Patches

This section describes all patches related to Altra. In general, all patches are targeted for upstream. The only exception is patch marked with “NOUPSTREAM" [MM1]. These patches - with no intention to upstream - may have one or more of the following reasons:

● Back ported patch and not applicable for upstream

● Patch will never be accepted upstream as there is another solution in-flight

● Patch applicable to a specific individual and have no overall benefit to all or to the maintainer

● Patch will never be accepted upstream but may be beneficial to a specific version of the kernel

Patches are separate into three categories – required, optional, and obsolete. Required patches are minimum patch required to have a bootable, working, and with reasonable system performance. Optional patches are patches that provide extra features but not required to have a basic working system. Obsolete patches are patches that are no longer relevant.

Linux Kernel 4.18 Required Patches

USB

These patches are required to properly support USB on Altra platforms. Without this patch set, pre-5.3 kernels will crash on boot:

Accepted Kernel Hash Tag Subject
5.3 2daaefd [MM2]  BACKPORT: lib/genalloc: add gen_pool_dma_zalloc() for zeroed DMA allocations
5.3 56ae2a91 BACKPORT: USB: use genalloc for USB HCs with local memory
5.3 920eeec8 BACKPORT: USB: drop HCD_LOCAL_MEM flag
5.3 391bde5 BACKPORT: usb: don't create dma pools for HCDs with a localmem_pool
5.3 cea1f46 BACKPORT: usb: add a hcd_uses_dma helper

PMU

These driver patches are required to support DMC-/b65054597872ce3aefbc6a666385eabdf9e288da, CMN-600, ARM DSU, SPE PMU:

Accepted Kernel Hash Tag Subject
    CMN-600
5.xx 5384c1c perf/arm-cmn: Fix invalid pointer when access dtc object sharing the same IRQ number
5.10 283833f BACKPORT: perf: Add Arm CMN-600 DT binding
5.10 283833f BACKPORT: perf: Add Arm CMN-600 PMU driver
5.10 63fbb8b BACKPORT: perf/arm-cmn: Add ACPI support
N/A 55e935b NOUPSTREAM [MM3] : centos: defconfig: Add CMN-600 PMU support
TBD - 5.10? 19a1b38 Perf: arm-cmn: Allow irq to be shared.
TBD - 5.10? c6f079f perf: arm_cmn: improve and make it work on 2P.
    ARM SPE
5.0 2f798e1 BACKPORT: crypto: authenc - fix parsing key with misaligned rta_len
5.3 44e81d2 BACKPORT: ACPI/PPTT: Modify node flag detection to find last IDENTICAL
5.3 2c70ac1 BACKPORT: ACPI/PPTT: Add function to return ACPI 6.3 Identical tokens
5.3 fb577aa BACKPORT: arm_pmu: acpi: spe: Add initial MADT/SPE probing
5.3 068ff4a BACKPORT: perf: arm_spe: Enable ACPI/Platform automatic module loading
5.3 51df9ae BACKPORT: ACPICA: ACPI 6.3: PPTT add additional fields in Processor S…
5.1 537f45c BACKPORT: ACPICA: ACPI 6.3: MADT: add support for statistical profili…
N/A 44fb326 NOUPSTREAM: [MM4]  centos: defconfig: Add ARM SPE PMU support
    ARM DSU
TBD - 5.11? c015bb2 perf: arm_dsu: Allow IRQ to be shared among devices.
5.10 d5b4ea2 perf: arm_dsu: Support DSU ACPI devices (perf: arm_dsu: Support ACPI mode.)
N/A 63fbb8b NOUPSTREAM: centos: defconfig: Enable ARM_DSU_PMU support
    ARM DMC-620
5.11 e287be8 perf: Add ARM DMC-620 PMU driver.
N/A 2f21c8a NOUPSTREAM: centos: defconfig: Add DMC-620 PMU support
N/A 871759d NOUPSTREAM: perf: arm_dmc620: Update ACPI ID. (DMC-620 Driver will include this)
    ARM SMMUv3 PMU (PMCG)
5.1 0a24ea6 perf/core: Add function to test for event exclusion flags.
5.1 23353f8 BACKPORT: perf/core: Add PERF_PMU_CAP_NO_EXCLUDE for exclusion incapable PMUs.
5.2 90314cd BACKPORT: ACPI/IORT: Add support for PMCG.
5.2 1fa69b2 BACKPORT: perf/smmuv3: Add arm64 smmuv3 pmu driver.
5.2 6f3efbe BACKPORT: perf/smmuv3: Add MSI irq support.
5.4 236a28b BACKPORT: perf/smmuv3: Validate group size.
5.4 9482e6e BACKPORT: perf/smmuv3: Validate groups for global filtering.
5.5 43046fc BACKPORT: perf/smmuv3: Remove the leftover put_cpu() in error path In…
5.8 1164351 Allow sharing MMIO registers with the SMMU driver.
5.8 4964038 ACPI/IORT: Fix PMCG node always look for a single ID mapping.
N/A 283833f NOUPSTREAM: perf: arm_cmn: add new code drop off from ARM.
N/A cb4b1ac NOUPSTREAM: centos: defconfig: Enable ARM_SMMU_V3_PMU config

NUMA

These patches provide multi-socket optimization:

Accepted Kernel Hash Tag Subject
5.8 or see below N/A [PATCH v2 00/20] mm: rework free_area_init*() funcitons
5.10 2a13c13 arm64: NUMA: Kconfig: Increase NODES_SHIFT to 4
N/A 9db4e45 NOUPSTREAM: arm64: Kconfig: Enable NODES_SPAN_OTHER_NODES config for NUMA

COMPILER

These patches are required for compilation with the Ampere compiler (based on GCC: https://www.gnu.org/software/gcc/ ): https://developer.amperecomputing.com/resources/ :

Accepted Kernel Hash Tag Subject
N/A a201de4 NOUPSTREAM: scripts: Fix compilation error when using Ampere native toolchain
N/A 0b31158 NOUPSTREAM: Workaround Ampere gcc issue with loop-optimization when building perf

ARM64

This patch is required to fix a kernel crash:

Accepted Kernel Hash Tag Subject
5.0 5db43ff BACKPORT: efi/arm: Revert "Defer persistent reservations until after paging_init()"

These patches are required to expose side channel vulnerability mitigation visibility to sysfs:

Accepted Kernel Hash Tag Subject
5.2 b6f5d5c BACKPORT: arm64: add sysfs vulnerability show for meltdown
5.2 be1dbd0 BACKPORT: arm64: Add sysfs vulnerability show for spectre-v1
N/A (5.2) 9d345e4 NOUPSTREAM: VARIANT 2: arm64: add vulnerability show for retpoline spectre-v2 [MM5] 

This patch is required to fix PCI ECAM reading:

Accepted Kernel Hash Tag Subject
5.10 0d8dd94 drivers/pci: Add ecam quirk for Ampere Altra SOC.

This patch is required to fix soft lockup during heavy stress test:

Accepted Kernel Hash Tag Subject
5.8 d6f5dfc BACKPORT: Split the old READ_IMPLIES_EXEC workaround from executable.

Crypto[MM6]

These patches are required to fix kernel crashes during LTP testing:

Accepted Kernel Hash Tag Subject
5.0 2f798e1 BACKPORT: crypto: authenc - fix parsing key with misaligned rta_len
5.2 a9b2432 BACKPORT: crypto: user - prevent operating on larval algorithms

APEI

These patches are required to support APEI/RAS features:

Accepted Kernel Hash Tag Subject
5.1 d2e5e81 BACKPORT: ACPI / APEI: Don't wait to serialise with oops messages when panic()ing
5.1 460f959 BACKPORT: ACPI / APEI: Remove silent flag from ghes_read_estatus()
5.1 a33b383 BACKPORT: ACPI / APEI: Switch estatus pool to use vmalloc memory
5.1 9778f65 BACKPORT: ACPI / APEI: Make hest.c manage the estatus memory pool
5.1 2888525 BACKPORT: ACPI / APEI: Make estatus pool allocation a static size
5.1 9ae38f2 BACKPORT: ACPI / APEI: Don't store CPER records physical address in struct ghes
5.1 ab202ee BACKPORT: ACPI / APEI: Remove spurious GHES_TO_CLEAR check
5.1 f36998d BACKPORT: ACPI / APEI: Don't update struct ghes' flags in read/clear estatus
5.1 fb2bfdc BACKPORT: ACPI / APEI: Generalise the estatus queue's notify code
5.1 6c070ab BACKPORT: ACPI / APEI: Don't allow ghes_ack_error() to mask earlier errors
5.1 2dae32f BACKPORT: ACPI / APEI: Move NOTIFY_SEA between the estatus-queue and NOTIFY_NMI
5.1 7e0c9ae BACKPORT: ACPI / APEI: Switch NOTIFY_SEA to use the estatus queue
5.1 f78e808 BACKPORT: KVM: arm/arm64: Add kvm_ras.h to collect kvm specific RAS plumbing
5.1 ab77d4b BACKPORT: arm64: KVM/mm: Move SEA handling behind a single 'claim' interface
5.1 2ff3da1 BACKPORT: ACPI / APEI: Move locking to the notification helper
5.1 71b03af BACKPORT: ACPI / APEI: Let the notification helper specify the fixmap slot
5.1 15304bd BACKPORT: ACPI / APEI: Pass ghes and estatus separately to avoid a later copy
5.1 4c66fd1 BACKPORT: ACPI / APEI: Make GHES estatus header validation more user friendly
5.1 a90df19 BACKPORT: ACPI / APEI: Split ghes_read_estatus() to allow a peek at the CPER length
5.1 de8192e BACKPORT: ACPI / APEI: Only use queued estatus entry during in_nmi_queue_one_entry()
5.1 073712f BACKPORT: ACPI / APEI: Use separate fixmap pages for arm64 NMI-like notifications
5.8 f845034 BACKPORT: mm/memory-failure: Add memory_failure_queue_kick()
5.8 ac5d13a BACKPORT: ACPI / APEI: Kick the memory_failure() queue for synchronous err
5.8 76f72cb BACKPORT: arm64: acpi: Make apei_claim_sea() synchronise with APEI's irq work
5.1 535e7eb BACKPORT: firmware: arm_sdei: Add ACPI GHES registration helper
5.1 e2b0f47 BACKPORT: ACPI / APEI: Add support for the SDEI GHES Notification type

HW Monitor

These patches are required to support HW monitor:

Accepted Kernel Hash Tag Subject
TBD - 5.11? f2e6dee hwmon: Add Ampere Altra HW monitor driver
Clone this wiki locally