Ampere CentOS Kernel wiki

khuong-dinh edited this page Oct 30, 2018 · 10 revisions

Ampere eMAG Linux Kernel Porting Guide

Introduction

This guide provides information regarding Linux kernel features and patches that apply to Ampere eMAG SoC. It provides a guideline regarding accepted, posting, and possible non-posted kernel patches that may assist developers in porting their kernels to have the same features as required to support Ampere eMAG SoC.

This document assumes a kernel version of 4.11 or 4.14. The stock kernel is located here https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/.

For any question, please contact Ampere eMAG support team at support@amperecomputing.com.

Ampere Kernel Features

Majority of Ampere eMAG SoC features are already part of 4.11 kernel or 4.14 kernel. There is no additional high level feature missing as of this writing.

Ampere SoC Kernel Repositories

The table below shows repositories for Ampere eMAG SoC kernel. Ampere eMAG SoC kernels are based on stock kernel from CentOS.

Repositories

Comment

https://github.com/AmpereComputing/ampere-centos-kernel

GIT repository for CentOS kernel for eMAG

- Branch amp-centos-7.4-kernel: CentOS kernel 4.11 for eMAG

- Branch amp-centos-7.5-kernel: CentOS kernel 4.14 for eMAG

https://github.com/AmpereComputing/ampere-centos-build

GIT repository for compiling CentOS kernel RPM’s for eMAG

- Branch amp-centos-7.4-build: CentOS kernel 4.11 RPM’s for eMAG

- Branch amp-centos-7.5-build: CentOS kernel 4.14 RPM’s for eMAG

Ampere Kernel Configuration

There is no Ampere eMAG SoC 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 below table.

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_GPIO_DWAPB

GPIO driver. Required for power off/reset.

CONFIG_SERIAL_AMBA_PL011

Serial console driver

CONFIG_SERIAL_AMBA_PL011_CONSOLE

Serial console driver

CONFIG_SATA_AHCI_PLATFORM

SATA driver

CONFIG_USB_DWC3

USB driver

CONFIG_USB_XHCI_HCD

USB driver

CONFIG_USB_XHCI_PCI

USB driver

CONFIG_USB_XHCI_PLATFORM

USB driver

CONFIG_ACPI_BUTTON

Require for power off support

CONFIG_ACPI_XXXX

General ACPI support configuration

CONFIG_XGENE_PMU

PMU driver

CONFIG_ARM64

General ARM64 support

CONFIG_PCI

General PCIe support

Ampere Patches

This section describes all patches related to Ampere eMAG SoC. In general, all patches are targeted for upstream. The only exception is patch marked with “NOUPSTREAM”. 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 but may be beneficial to a specific version of the kernel

        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

Patches are separate into three categories – required, optional, and obsolete. Required patches are minimum patch required to have a bootable, working, and 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.

Required Patches for Kernel 4.11

HWMon

These patches are required to support future BIOS change to support more efficient communication method with the boot processor.

Accepted Kernel

Hash Tag

Subject

4.14

eaff4e0

BACKPORT: i2c: xgene-slimpro: Support v2

4.14

a8c2dd7

BACKPORT: hwmon: (xgene) Minor clean up of ifdef and acpi_match_table reference

4.14

ddbd45e

BACKPORT: hwmon: (xgene) Support hwmon v2

USB

These patches are required to properly support USB on Ampere eMAG SoC. Please note that patch with hash tag 13963bb was an earlier version posted upstream. It is suggested that you pull in this version instead - https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=c6b8e79306f515b5483eb11076e0fbfc140434a8

Accepted Kernel

Hash Tag

Subject

N/A

13963bb

BACKPORT: usb:xhci: update condition to select bus->sysdev from parent device

4.12

85d0d54

BACKPORT: usb: ehci: fsl: use bus->sysdev for DMA configuration

4.12

c69309c

BACKPORT: usb: chipidea: use bus->sysdev for DMA configuration

4.12

ed2022a

BACKPORT: usb: xhci: use bus->sysdev for DMA configuration

4.12

6a66f53

BACKPORT: usb: separate out sysdev pointer from usb_bus

 

This patch is required to properly support USB on Ampere eMAG SoC. Without this patch, an USB device can enter low power state and may not function correctly upon resume to normal state.

Accepted Kernel

Hash Tag

Subject

4.15

c4c5a26

BACKPORT: usb: host: xhci support option to disable the xHCI USB2 HW LPM

 

These patches are required to support hotplug for USB. Without this patch, USB hotplug will cause kernel crash.

Accepted Kernel

Hash Tag

Subject

4.13

54d8f60

BACKPORT: scsi: Avoid that scsi_exit_rq() triggers a use-after-free

4.12

064dfcf

BACKPORT: blk-mq: update ->init_request and ->exit_request prototypes

GPIO

These patches are required to properly support Ampere eMAG SoC to power off the system.

Accepted Kernel

Hash Tag

Subject

4.14

0fdbd9f

BACKPORT: gpio: dwapb: Add wakeup source support

PCIe

This patch is required to properly support PCIe in Ampere eMAG SoC.

Accepted Kernel

Hash Tag

Subject

4.13

44068b5

BACKPORT: PCI: Add ACS quirk for APM X-Gene devices

4.17

b07b307

BACKPORT: PCI: Add ACS quirk for Ampere root ports

N/A

280bb22

BACKPORT: PM / core: fix deferred probe breaking suspend resume order

 

These patches are required to properly support PCIe subsystem which has more than 42 bit addressing.

Accepted Kernel

Hash Tag

Subject

4.14

c1544e5

BACKPORT: ACPICA: Resources: Allow _DMA method in walk resources

4.14

f29b352

BACKPORT: ACPI: Make acpi_dev_get_resources() method agnostic

4.14

b84e7ce

BACKPORT: ACPI: Introduce DMA ranges parsing

4.14

fe35b79

BACKPORT: ACPI: Make acpi_dma_configure() DMA regions aware

4.14

acc17a2

BACKPORT: ACPI/IORT: Add IORT named component memory address limits

 

These patches are required to properly support PCIe in virtual environment for Ampere eMAG SoC.

Accepted Kernel

Hash Tag

Subject

N/A

cace14c

BACKPORT: iommu: use the smallest DMA aperture to set dma_limit

4.14

6fac577

BACKPORT: iommu/iova: Fix underflow bug in __alloc_and_insert_iova_range

4.15

464fa0e

BACKPORT: vfio/pci: Virtualize Maximum Payload Size

4.14

6869670

BACKPORT: iommu: enable bypass transaction caching for ARM SMMU 500

 

This patch is required to support multiple PCIe cards that require lot of contiguous memory. Otherwise, one or more PCIe driver will fail to load. This patch is only applicable to this version of the kernel. More recent version of the kernel does not have this issue.

Accepted Kernel

Hash Tag

Subject

N/A

dd94235

NOUPSTREAM: centos: defconfig: Change CMA_SIZE to 0

APEI

This patch is required to support APEI (RAS) properly on Ampere eMAG SoC.

Accepted Kernel

Hash Tag

Subject

4.13

7696900

BACKPORT: ACPI/APEI: Handle GSIV and GPIO notification types

4.13

cf4ef63

BACKPORT: acpi: apei: Enable APEI multiple GHES source to share an single external IRQ

4.13

a380357

BACKPORT: ACPI / irq: Fix return code of acpi_gsi_to_irq()

I2C

This patch is required to support open IPMI interface. Without this patch, open IPMI interface will not enumerate correctly.

Accepted Kernel

Hash Tag

Subject

4.12

0bee676

BACKPORT: ACPI / scan: Apply default enumeration to devices with ACPI drivers

4.12

a4053a5

BACKPORT: ACPI / scan: Fix enumeration for special SPI and I2C devices

UART

This patch is required for Ampere eMAG SoC to ensure no console characters drop.

Accepted Kernel

Hash Tag

Subject

4.12

2f3d7c4

BACKPORT: tty: amba-pl011: Fix spurious TX interrupts

 

PMU

This patch is only applicable for Ampere Computing SoC’s.

Accepted Kernel

Hash Tag

Subject

N/A

eee1a94

BACKPORT: perf: xgene: Fix IOB SLOW PMU parser error

SATA

This patch is only applicable for Ampere Computing SoC’s.

Accepted Kernel

Hash Tag

Subject

N/A

cb08c6a

NOUPSTREAM: Disable AHCI ALPM feature for eMAG SATA

ILP32

These patches are required to improve CPU performance. Please be aware that ILP32 support is targeted in future version of the kernel by the open source community. This is a port to support this version of the kernel.

Accepted Kernel

Hash Tag

Subject

N/A

830969a

NOUPSTREAM: arm64:configs: workaround for kexec crashes with ILP32

N/A

1c373d3

NOUPSTREAM: arm64:configs: enable ILP32 support

N/A

b31d29a

NOUPSTREAM: arm64: fixing init process crash on ilp32 root file system

N/A

b0deda8

NOUPSTREAM: arm64:ilp32: add ARM64_ILP32 to Kconfig

N/A

1caffae

NOUPSTREAM: aarch64: ilp32: msgrcv, msgsnd handlers

N/A

f29074b

NOUPSTREAM: arm64:ilp32: change COMPAT_ELF_PLATFORM to report a a subplatform for ILP32

N/A

d619f21

NOUPSTREAM: arm64:ilp32: use the native siginfo instead of the compat siginfo

N/A

7293198

NOUPSTREAM: arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

N/A

b188a06

NOUPSTREAM: ptrace: Allow compat to use the native siginfo

N/A

f981410

NOUPSTREAM: arm64:ilp32: add vdso-ilp32 and use for signal return

N/A

5895ebc

NOUPSTREAM: arm64: add support for starting ILP32 (ELFCLASS32) binaries

N/A

dfbf452

NOUPSTREAM: arm64:ilp32: support core dump generation for ILP32

N/A

bd64f0b

NOUPSTREAM: arm64:ilp32 use the native LP64 'start_thread' for ILP32 threads

N/A

edbb494

NOUPSTREAM: arm64:ilp32: share HWCAP between LP64 and ILP32

N/A

7e3af54

NOUPSTREAM: arm64:ilp32: COMPAT_USE_64BIT_TIME is true for ILP32 tasks

N/A

c73d202

NOUPSTREAM: arm64:ilp32: add is_ilp32_compat_{task, thread} and TIF_32BIT_AARCH64

N/A

c3c4f23

NOUPSTREAM: arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat)

N/A

5b29a15

NOUPSTREAM: arm64:ilp32: use non-compat syscall names for ILP32 as for LP64

N/A

68ecb14

NOUPSTREAM: arm64:ilp32: use 64bit syscall-names for ILP32 when passing 64bit registers

N/A

3df4133

NOUPSTREAM: arm64:ilp32: share signal structures between ILP32 and LP64 ABIs

N/A

db7f8a7

NOUPSTREAM: arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64

N/A

f62ec67

NOUPSTREAM: arm64:ilp32: expose 'kernel_long' as 'long long' for ILP32

N/A

eaf378a

NOUPSTREAM: arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead

N/A

bc4335f

NOUPSTREAM: arm64: rename COMPAT to AARCH32_EL0 in Kconfig

N/A

6b9b7a0

NOUPSTREAM: arm64: ensure the kernel is compiled for LP64

N/A

156a414

NOUPSTREAM: arm64:ilp32: add documentation on the ILP32 ABI for ARM64

Configuration

These patches are required to support Ampere eMAG SoC. These are configuration changes to support Ampere processors. These patches provide optimization for Ampere processors.

Accepted Kernel

Hash Tag

Subject

N/A

4ae2a43

NOUPSTREAM: centos: optimization defconfig: Disable NETFILTER

N/A

766aec1

NOUPSTREAM: arm64:configs: add xgene debug defconfig's

N/A

bb28796

NOUPSTREAM: configs: add initial X-Gene optimization config

N/A

9a52b94

NOUPSTREAM: configs: enable X-Gene-specific configuration

N/A

baa65b8

NOUPSTREAM: Add initial xgene_defconfig and xgene_optimized_defconfig

 

These patches are required for compilation with Ampere GCC compiler.

Accepted Kernel

Hash Tag

Subject

N/A

686c6da

NOUPSTREAM: Workaround APM gcc issue with loop-optimization when building perf

N/A

8afb6a8

NOUPSTREAM: scripts: Fix compilation error when using APM native toolchain

Optional Patches

SATA

This patch is optional if you want to enable SATA trace events. Without this patch, the kernel will panic if SATA trace events are enabled.

Accepted Kernel

Hash Tag

Subject

4.14

f0fcf86

BACKPORT: ata: fixes kernel crash while tracing ata_eh_link_autopsy event

OP-TEE

These patches are optional and enable support for OP-TEE.

Accepted Kernel

Hash Tag

Subject

N/A

ed1dc8a

NOUPSTREAM: Use smc to communicate with ATF/Secure OS

N/A

97573f4

NOUPSTREAM: optee: optee driver ACPI support

N/A

212cc46

BACKPORT: tee: add OP-TEE driver

N/A

ebf5bc9

BACKPORT: tee: generic TEE subsystem

 

Required Patches for Kernel 4.14

PCIe

This patch is required to properly support PCIe in Ampere eMAG SoC.

Accepted Kernel

Hash Tag

Subject

N/A

45ce023

BACKPORT: PM / core: fix deferred probe breaking suspend resume order

 

These patches are required to properly support PCIe in virtual environment for Ampere eMAG SoC.

Accepted Kernel

Hash Tag

Subject

4.14

07ff323

BACKPORT: iommu: enable bypass transaction caching for ARM SMMU 500

N/A

4afdc85

NOUPSTREAM: iommu: force IOMMU passthrough mode for Ampere eMAG system

 

PMU

This patch is only applicable for Ampere Computing SoC’s.

Accepted Kernel

Hash Tag

Subject

N/A

10960a0

BACKPORT: perf: xgene: Fix IOB SLOW PMU parser error

N/A

4c2479c

arm64: Add recommended IMPLEMENTATION DEFINED eMAG PMU event codes

N/A

3e66c54

BACKPORT: perf: xgene: Add CPU hotplug support

 

The supported ARMv8 recommended IMPLEMENTATION DEFINED events for the Ampere Computing eMAG core PMU are listed in this table - https://github.com/AmpereComputing/ampere-centos-kernel/blob/amp-centos-7.5-kernel/Documentation/arm64/eMAG-ARM-CoreImpDefined.pdf

 

SATA

This patch is only applicable for Ampere Computing SoC’s.

Accepted Kernel

Hash Tag

Subject

4.18

10018bc

BACKPORT: ahci: Disable LPM on Lenovo 50 series laptops with a too old BIOS

4.16

fbfbcba

BACKPORT: ACPI / bus: Introduce acpi_get_match_data() function

4.16

aa41191

BACKPORT: ACPI / bus: Remove checks in acpi_get_match_data()

4.16

788f520

BACKPORT: ACPI / bus: Rename acpi_get_match_data() to acpi_device_get_match_data()

4.19

f37c437

BACKPORT ata: Disable AHCI ALPM feature for Ampere Computing eMAG SATA

 

Ethernet

This patch is only applicable for Ampere Computing SoC’s. It addresses CVS-2018-5803 as reported by open source community. Without this patch, LTP will fail.

Accepted Kernel

Hash Tag

Subject

4.16

9ccb2dd

BACKPORT: sctp: verify size of a new chunk in _sctp_make_chunk()

 

Arm64

These patches are required to fix kernel soft lock up with read/write lock for Ampere eMAG SoC.

Accepted Kernel

Hash Tag

Subject

4.18

a5eb379

BACKPORT: arm64: cmpwait: Clear event register before arming exclusive monitor

4.19-rc1

505eec7

BACKPORT: arm64: barrier: Implement smp_cond_load_relaxed

4.19-rc1

ed5d5a8

BACKPORT: arm64: locking: Replace ticket lock implementation with qspinlock

4.19-rc1

d5fadca

BACKPORT: arm64: kconfig: Ensure spinlock fastpaths are inlined if !PREEMPT

4.16

f8f830f

BACKPORT: arm64: cpufeature: __this_cpu_has_cap() shouldn't stop early

 

These patches are required to fix eMAG Spectre variant 2 for Ampere eMAG SoC.

Accepted Kernel

Hash Tag

Subject

N/A

04cd507

BACKPORT: VARIANT 2: arm64: Add initial retpoline support.

N/A

de819a8

BACKPORT: VARIANT 2: arm64: asm: Use *_nospec variants for blr and br.

N/A

54a096b

BACKPORT: VARIANT 2: arm64: Add MIDR_APM_POTENZA.

N/A

04426ea

BACKPORT: VARIANT 2: arm64: insn: Add offset getter/setter for adr.

N/A

a4b9657

BACKPORT: VARIANT 2: arm64: alternatives: Add support for adr/adrp with offset in alt block.

N/A

2a47f70

BACKPORT: VARIANT 2: arm64: Use alternative framework for retpoline.

N/A

88b8ae7

BACKPORT: VARIANT 2: arm64: Provide spectre v2 status via generic CPU vulnerability folder.

N/A

b208120

BACKPORT: VARIANT 2: arm64: retpoline: Only compile retpolines if CONFIG_RETPOLINE is set.

N/A

bfb2bc7

BACKPORT: VARIANT 2: arm64: retpoline: Don't use retpoline in KVM's HYP part.

 

 

ILP32

These patches are required to improve CPU performance. Please be aware that ILP32 support is targeted in future version of the kernel by the open source community. This is a port to support this version of the kernel.

Accepted Kernel

Hash Tag

Subject

N/A

94c89f1

NOUPSTREAM: ILP32: arm64: config: disable ilp32 for emag_defconfig

N/A

78e0998

BACKPORT: ILP32: arm64: ilp32: Make the Kconfig option default y

N/A

7075ec3

BACKPORT: ILP32: arm64: ilp32: add ARM64_ILP32 to Kconfig

N/A

5a6c38c

BACKPORT: ILP32: arm64: ilp32: add vdso-ilp32 and use for signal return

N/A

99d0420

BACKPORT: ILP32: arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32

N/A

7b3241a

BACKPORT: ILP32: arm64: ilp32: introduce ilp32-specific handlers for sigframe and ucontext

N/A

360ed1d

BACKPORT: ILP32: arm64: signal32: move ilp32 and aarch32 common code to separated file

N/A

e3988e9

BACKPORT: ILP32: arm64: signal: share lp64 signal structures and routines to ilp32

N/A

d818544

BACKPORT: ILP32: arm64: ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

N/A

1a166a3

BACKPORT: ILP32: arm64: ilp32: share aarch32 syscall handlers

N/A

9f1ed8f

BACKPORT: ILP32: arm64: ilp32: introduce binfmt_ilp32.c

N/A

6949d3d

BACKPORT: ILP32: arm64: change compat_elf_hwcap and compat_elf_hwcap2 prefix to a32

N/A

6bd38d4

BACKPORT: ILP32: arm64: introduce binfmt_elf32.c

N/A

3fa1831

BACKPORT: ILP32: arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64

N/A

a8f2bc6

BACKPORT: ILP32: arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat)

N/A

01d5793

BACKPORT: ILP32: arm64: uapi: set __BITS_PER_LONG correctly for ILP32 and LP64

N/A

fdf446c

BACKPORT: ILP32: arm64: rename functions that reference compat term

N/A

80eaafd

BACKPORT: ILP32: arm64: rename COMPAT to AARCH32_EL0 in Kconfig

N/A

dead8cb

BACKPORT: ILP32: arm64: ilp32: add documentation on the ILP32 ABI for ARM64

N/A

1f276a7

BACKPORT: ILP32: arm64: thread: move thread bits accessors to separated file

N/A

7b4909b

BACKPORT: ILP32: arm64: asm-generic: Drop getrlimit and setrlimit syscalls from default list

N/A

9ac753f

BACKPORT: ILP32: arm64: 32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option

N/A

42d7c6f

BACKPORT: ILP32: arm64: compat ABI: use non-compat openat and open_by_handle_at variants

N/A

b960a3d

BACKPORT: ILP32: arm64: ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers

N/A

1e3d492

BACKPORT: ILP32: arm64: signal: Make parse_user_sigframe() independent of rt_sigframe layout

N/A

d6d76a2

BACKPORT: ILP32: arm64: move TASK_* definitions to <asm/processor.h>

 

Configuration

These patches are required to support Ampere eMAG SoC. These are configuration changes to support Ampere processors. These patches provide optimization for Ampere processors.

Accepted Kernel

Hash Tag

Subject

N/A

fa736eb

NOUPSTREAM: centos: optimization defconfig: Disable NETFILTER

N/A

1895e47

NOUPSTREAM: configs: add initial eMAG optimization config

N/A

3288dc1

NOUPSTREAM: configs: enable eMAG specific configuration

N/A

07edd50

NOUPSTREAM: Add initial emag_defconfig and emag_optimized_defconfig

 

These patches are required for compilation with Ampere GCC compiler.

Accepted Kernel

Hash Tag

Subject

N/A

789a9a5

NOUPSTREAM: Workaround Ampere gcc issue with loop-optimization when building perf

N/A

472a1b6

NOUPSTREAM: scripts: Fix compilation error when using Ampere native toolchain

N/A

039d737

NOUPSTREAM: scripts: Update Ampere native toolchain

N/A

61f9663

NOUPSTREAM: scripts: Update Ampere native toolchain

N/A

d38707b

NOUPSTREAM: scripts: Update Ampere native toolchain

 

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.