projects/linux·commit ab182e67

Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

ab182e67 · Linus Torvalds <[email protected]> · 2017-05-05 12:11:37 -07:00

Pull arm64 updates from Catalin Marinas:

 - kdump support, including two necessary memblock additions:
   memblock_clear_nomap() and memblock_cap_memory_range()

 - ARMv8.3 HWCAP bits for JavaScript conversion instructions, complex
   numbers and weaker release consistency

 - arm64 ACPI platform MSI support

 - arm perf updates: ACPI PMU support, L3 cache PMU in some Qualcomm
   SoCs, Cortex-A53 L2 cache events and DTLB refills, MAINTAINERS update
   for DT perf bindings

 - architected timer errata framework (the arch/arm64 changes only)

 - support for DMA_ATTR_FORCE_CONTIGUOUS in the arm64 iommu DMA API

 - arm64 KVM refactoring to use common system register definitions

 - remove support for ASID-tagged VIVT I-cache (no ARMv8 implementation
   using it and deprecated in the architecture) together with some
   I-cache handling clean-up

 - PE/COFF EFI header clean-up/hardening

 - define BUG() instruction without CONFIG_BUG

* tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (92 commits)
  arm64: Fix the DMA mmap and get_sgtable API with DMA_ATTR_FORCE_CONTIGUOUS
  arm64: Print DT machine model in setup_machine_fdt()
  arm64: pmu: Wire-up Cortex A53 L2 cache events and DTLB refills
  arm64: module: split core and init PLT sections
  arm64: pmuv3: handle pmuv3+
  arm64: Add CNTFRQ_EL0 trap handler
  arm64: Silence spurious kbuild warning on menuconfig
  arm64: pmuv3: use arm_pmu ACPI framework
  arm64: pmuv3: handle !PMUv3 when probing
  drivers/perf: arm_pmu: add ACPI framework
  arm64: add function to get a cpu's MADT GICC table
  drivers/perf: arm_pmu: split out platform device probe logic
  drivers/perf: arm_pmu: move irq request/free into probe
  drivers/perf: arm_pmu: split cpu-local irq request/free
  drivers/perf: arm_pmu: rename irq request/free functions
  drivers/perf: arm_pmu: handle no platform_device
  drivers/perf: arm_pmu: simplify cpu_pmu_request_irqs()
  drivers/perf: arm_pmu: factor out pmu registration
  drivers/perf: arm_pmu: fold init into alloc
  drivers/perf: arm_pmu: define armpmu_init_fn
  ...
Commit
ab182e67ec99ea0c8d7435a32a4a1ed9bb02559a
Parents
7246f600 · 92f66f84

Merge commit. Changes below are compared with the first parent: 7246f600.

Changes

77 files changed · +3754 −1256

FileStatusAddDelContent
Documentation/arm64/cpu-feature-registers.txtmodified+12−0View file
Documentation/devicetree/bindings/chosen.txtmodified+45−0View file
Documentation/kdump/kdump.txtmodified+15−1View file
Documentation/perf/qcom_l3_pmu.txtadded+25−0View file
MAINTAINERSmodified+1−0View file
arch/arm64/Kconfigmodified+11−0View file
arch/arm64/Kconfig.debugmodified+4−0View file
arch/arm64/Makefilemodified+3−1View file
arch/arm64/configs/defconfigmodified+1−0View file
arch/arm64/include/asm/acpi.hmodified+2−0View file
arch/arm64/include/asm/arch_gicv3.hmodified+13−68View file
arch/arm64/include/asm/bug.hmodified+18−14View file
arch/arm64/include/asm/cache.hmodified+37−1View file
arch/arm64/include/asm/cacheflush.hmodified+1−0View file
arch/arm64/include/asm/cachetype.hdeleted+0−100View before deletion
arch/arm64/include/asm/cpufeature.hmodified+2−2View file
arch/arm64/include/asm/esr.hmodified+4−0View file
arch/arm64/include/asm/hardirq.hmodified+1−1View file
arch/arm64/include/asm/hw_breakpoint.hmodified+2−2View file
arch/arm64/include/asm/kexec.hmodified+51−1View file
arch/arm64/include/asm/kvm_mmu.hmodified+7−6View file
arch/arm64/include/asm/mmu.hmodified+1−0View file
arch/arm64/include/asm/module.hmodified+7−7View file
arch/arm64/include/asm/pgtable.hmodified+10−0View file
arch/arm64/include/asm/processor.hmodified+2−0View file
arch/arm64/include/asm/sections.hmodified+2−0View file
arch/arm64/include/asm/smp.hmodified+3−0View file
arch/arm64/include/asm/sysreg.hmodified+160−7View file
arch/arm64/include/uapi/asm/hwcap.hmodified+3−0View file
arch/arm64/kernel/Makefilemodified+3−0View file
arch/arm64/kernel/alternative.cmodified+6−5View file
arch/arm64/kernel/cacheinfo.cmodified+0−38View file
arch/arm64/kernel/cpufeature.cmodified+20−10View file
arch/arm64/kernel/cpuinfo.cmodified+19−18View file
arch/arm64/kernel/crash_dump.cadded+71−0View file
arch/arm64/kernel/debug-monitors.cmodified+1−1View file
arch/arm64/kernel/efi-header.Sadded+155−0View file
arch/arm64/kernel/head.Smodified+34−188View file
arch/arm64/kernel/hibernate.cmodified+9−1View file
arch/arm64/kernel/machine_kexec.cmodified+161−9View file
arch/arm64/kernel/module-plts.cmodified+63−45View file
arch/arm64/kernel/module.cmodified+1−1View file
arch/arm64/kernel/module.ldsmodified+1−0View file
arch/arm64/kernel/perf_event.cmodified+87−33View file
arch/arm64/kernel/process.cmodified+0−2View file
arch/arm64/kernel/reloc_test_core.cadded+81−0View file
arch/arm64/kernel/reloc_test_syms.Sadded+83−0View file
arch/arm64/kernel/setup.cmodified+10−2View file
arch/arm64/kernel/smp.cmodified+79−0View file
arch/arm64/kernel/traps.cmodified+14−0View file
arch/arm64/kernel/vmlinux.lds.Smodified+18−9View file
arch/arm64/kvm/hyp/tlb.cmodified+22−0View file
arch/arm64/kvm/reset.cmodified+1−1View file
arch/arm64/kvm/sys_regs.cmodified+2−2View file
arch/arm64/mm/context.cmodified+0−3View file
arch/arm64/mm/dma-mapping.cmodified+97−31View file
arch/arm64/mm/fault.cmodified+36−19View file
arch/arm64/mm/flush.cmodified+1−3View file
arch/arm64/mm/init.cmodified+181−0View file
arch/arm64/mm/mmu.cmodified+204−107View file
arch/arm64/mm/pageattr.cmodified+9−6View file
drivers/acpi/arm64/iort.cmodified+127−31View file
drivers/acpi/glue.cmodified+6−0View file
drivers/firmware/efi/libstub/fdt.cmodified+26−2View file
drivers/perf/Kconfigmodified+14−0View file
drivers/perf/Makefilemodified+3−1View file
drivers/perf/arm_pmu.cmodified+160−370View file
drivers/perf/arm_pmu_acpi.cadded+256−0View file
drivers/perf/arm_pmu_platform.cadded+235−0View file
drivers/perf/qcom_l3_pmu.cadded+849−0View file
include/linux/acpi_iort.hmodified+3−0View file
include/linux/cpuhotplug.hmodified+2−0View file
include/linux/memblock.hmodified+2−0View file
include/linux/pe.hmodified+92−85View file
include/linux/perf/arm_pmu.hmodified+23−6View file
mm/memblock.cmodified+41−15View file
virt/kvm/arm/vgic/vgic.cmodified+3−1View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/arm64/cpu-feature-registers.txt

View file
diff --git a/Documentation/arm64/cpu-feature-registers.txt b/Documentation/arm64/cpu-feature-registers.txt
index 61ca21e..d1c97f9 100644
--- a/Documentation/arm64/cpu-feature-registers.txt
+++ b/Documentation/arm64/cpu-feature-registers.txt
@@ -169,6 +169,18 @@ infrastructure:
as available on the CPU where it is fetched and is not a system
wide safe value.
+ 4) ID_AA64ISAR1_EL1 - Instruction set attribute register 1
+
+ x--------------------------------------------------x
+ | Name | bits | visible |
+ |--------------------------------------------------|
+ | LRCPC | [23-20] | y |
+ |--------------------------------------------------|
+ | FCMA | [19-16] | y |
+ |--------------------------------------------------|
+ | JSCVT | [15-12] | y |
+ x--------------------------------------------------x
+
Appendix I: Example
---------------------------

Documentation/devicetree/bindings/chosen.txt

View file
diff --git a/Documentation/devicetree/bindings/chosen.txt b/Documentation/devicetree/bindings/chosen.txt
index 6ae9d82..b5e39af 100644
--- a/Documentation/devicetree/bindings/chosen.txt
+++ b/Documentation/devicetree/bindings/chosen.txt
@@ -52,3 +52,48 @@ This property is set (currently only on PowerPC, and only needed on
book3e) by some versions of kexec-tools to tell the new kernel that it
is being booted by kexec, as the booting environment may differ (e.g.
a different secondary CPU release mechanism)
+
+linux,usable-memory-range
+-------------------------
+
+This property (arm64 only) holds a base address and size, describing a
+limited region in which memory may be considered available for use by
+the kernel. Memory outside of this range is not available for use.
+
+This property describes a limitation: memory within this range is only
+valid when also described through another mechanism that the kernel
+would otherwise use to determine available memory (e.g. memory nodes
+or the EFI memory map). Valid memory may be sparse within the range.
+e.g.
+
+/ {
+ chosen {
+ linux,usable-memory-range = <0x9 0xf0000000 0x0 0x10000000>;
+ };
+};
+
+The main usage is for crash dump kernel to identify its own usable
+memory and exclude, at its boot time, any other memory areas that are
+part of the panicked kernel's memory.
+
+While this property does not represent a real hardware, the address
+and the size are expressed in #address-cells and #size-cells,
+respectively, of the root node.
+
+linux,elfcorehdr
+----------------
+
+This property (currently used only on arm64) holds the memory range,
+the address and the size, of the elf core header which mainly describes
+the panicked kernel's memory layout as PT_LOAD segments of elf format.
+e.g.
+
+/ {
+ chosen {
+ linux,elfcorehdr = <0x9 0xfffff000 0x0 0x800>;
+ };
+};
+
+While this property does not represent a real hardware, the address
+and the size are expressed in #address-cells and #size-cells,
+respectively, of the root node.

Documentation/kdump/kdump.txt

View file
diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt
index b0eb27b..615434d 100644
--- a/Documentation/kdump/kdump.txt
+++ b/Documentation/kdump/kdump.txt
@@ -18,7 +18,7 @@ memory image to a dump file on the local disk, or across the network to
a remote system.
Kdump and kexec are currently supported on the x86, x86_64, ppc64, ia64,
-s390x and arm architectures.
+s390x, arm and arm64 architectures.
When the system kernel boots, it reserves a small section of memory for
the dump-capture kernel. This ensures that ongoing Direct Memory Access
@@ -249,6 +249,13 @@ Dump-capture kernel config options (Arch Dependent, arm)
AUTO_ZRELADDR=y
+Dump-capture kernel config options (Arch Dependent, arm64)
+----------------------------------------------------------
+
+- Please note that kvm of the dump-capture kernel will not be enabled
+ on non-VHE systems even if it is configured. This is because the CPU
+ will not be reset to EL2 on panic.
+
Extended crashkernel syntax
===========================
@@ -305,6 +312,8 @@ Boot into System Kernel
kernel will automatically locate the crash kernel image within the
first 512MB of RAM if X is not given.
+ On arm64, use "crashkernel=Y[@X]". Note that the start address of
+ the kernel, X if explicitly specified, must be aligned to 2MiB (0x200000).
Load the Dump-capture Kernel
============================
@@ -327,6 +336,8 @@ For s390x:
- Use image or bzImage
For arm:
- Use zImage
+For arm64:
+ - Use vmlinux or Image
If you are using a uncompressed vmlinux image then use following command
to load dump-capture kernel.
@@ -370,6 +381,9 @@ For s390x:
For arm:
"1 maxcpus=1 reset_devices"
+For arm64:
+ "1 maxcpus=1 reset_devices"
+
Notes on loading the dump-capture kernel:
* By default, the ELF headers are stored in ELF64 format to support

Documentation/perf/qcom_l3_pmu.txt

View file
diff --git a/Documentation/perf/qcom_l3_pmu.txt b/Documentation/perf/qcom_l3_pmu.txt
new file mode 100644
index 0000000..96b3a94
--- /dev/null
+++ b/Documentation/perf/qcom_l3_pmu.txt
@@ -0,0 +1,25 @@
+Qualcomm Datacenter Technologies L3 Cache Performance Monitoring Unit (PMU)
+===========================================================================
+
+This driver supports the L3 cache PMUs found in Qualcomm Datacenter Technologies
+Centriq SoCs. The L3 cache on these SOCs is composed of multiple slices, shared
+by all cores within a socket. Each slice is exposed as a separate uncore perf
+PMU with device name l3cache_<socket>_<instance>. User space is responsible
+for aggregating across slices.
+
+The driver provides a description of its available events and configuration
+options in sysfs, see /sys/devices/l3cache*. Given that these are uncore PMUs
+the driver also exposes a "cpumask" sysfs attribute which contains a mask
+consisting of one CPU per socket which will be used to handle all the PMU
+events on that socket.
+
+The hardware implements 32bit event counters and has a flat 8bit event space
+exposed via the "event" format attribute. In addition to the 32bit physical
+counters the driver supports virtual 64bit hardware counters by using hardware
+counter chaining. This feature is exposed via the "lc" (long counter) format
+flag. E.g.:
+
+ perf stat -e l3cache_0_0/read-miss,lc/
+
+Given that these are uncore PMUs the driver does not support sampling, therefore
+"perf record" will not work. Per-task perf sessions are not supported.

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index b1f9b45..ac0ce26 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -983,6 +983,7 @@ F: arch/arm*/include/asm/perf_event.h
F: drivers/perf/*
F: include/linux/perf/arm_pmu.h
F: Documentation/devicetree/bindings/arm/pmu.txt
+F: Documentation/devicetree/bindings/perf/
ARM PORT
M: Russell King <[email protected]>

arch/arm64/Kconfig

View file
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 67695fa..3dcd7ec 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -736,6 +736,17 @@ config KEXEC
but it is independent of the system firmware. And like a reboot
you can start any kernel with it, not just Linux.
+config CRASH_DUMP
+ bool "Build kdump crash kernel"
+ help
+ Generate crash dump after being started by kexec. This should
+ be normally only set in special crash dump kernels which are
+ loaded in the main kernel with kexec-tools into a specially
+ reserved region and then later executed after a crash by
+ kdump/kexec.
+
+ For more details see Documentation/kdump/kdump.txt
+
config XEN_DOM0
def_bool y
depends on XEN

arch/arm64/Kconfig.debug

View file
diff --git a/arch/arm64/Kconfig.debug b/arch/arm64/Kconfig.debug
index fca2f02..cc6bd55 100644
--- a/arch/arm64/Kconfig.debug
+++ b/arch/arm64/Kconfig.debug
@@ -92,6 +92,10 @@ config DEBUG_EFI
the kernel that are only useful when using a debug build of the
UEFI firmware
+config ARM64_RELOC_TEST
+ depends on m
+ tristate "Relocation testing module"
+
source "drivers/hwtracing/coresight/Kconfig"
endmenu

arch/arm64/Makefile

View file
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index b9a4a93..7dedf2d 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -37,10 +37,12 @@ $(warning LSE atomics not supported by binutils)
endif
endif
+ifeq ($(CONFIG_ARM64), y)
brokengasinst := $(call as-instr,1:\n.inst 0\n.rept . - 1b\n\nnop\n.endr\n,,-DCONFIG_BROKEN_GAS_INST=1)
-ifneq ($(brokengasinst),)
+ ifneq ($(brokengasinst),)
$(warning Detected assembler with broken .inst; disassembly will be unreliable)
+ endif
endif
KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr) $(brokengasinst)

arch/arm64/configs/defconfig

View file
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 7c48028..927ee18 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -82,6 +82,7 @@ CONFIG_CMA=y
CONFIG_SECCOMP=y
CONFIG_XEN=y
CONFIG_KEXEC=y
+CONFIG_CRASH_DUMP=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
CONFIG_COMPAT=y
CONFIG_CPU_IDLE=y

arch/arm64/include/asm/acpi.h

View file
diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
index c1976c0..0e99978 100644
--- a/arch/arm64/include/asm/acpi.h
+++ b/arch/arm64/include/asm/acpi.h
@@ -85,6 +85,8 @@ static inline bool acpi_has_cpu_in_madt(void)
return true;
}
+struct acpi_madt_generic_interrupt *acpi_cpu_get_madt_gicc(int cpu);
+
static inline void arch_fix_phys_package_id(int num, u32 slot) { }
void __init acpi_init_cpus(void);

arch/arm64/include/asm/arch_gicv3.h

View file
diff --git a/arch/arm64/include/asm/arch_gicv3.h b/arch/arm64/include/asm/arch_gicv3.h
index f37e3a2..1a98bc8 100644
--- a/arch/arm64/include/asm/arch_gicv3.h
+++ b/arch/arm64/include/asm/arch_gicv3.h
@@ -20,69 +20,14 @@
#include <asm/sysreg.h>
-#define ICC_EOIR1_EL1 sys_reg(3, 0, 12, 12, 1)
-#define ICC_DIR_EL1 sys_reg(3, 0, 12, 11, 1)
-#define ICC_IAR1_EL1 sys_reg(3, 0, 12, 12, 0)
-#define ICC_SGI1R_EL1 sys_reg(3, 0, 12, 11, 5)
-#define ICC_PMR_EL1 sys_reg(3, 0, 4, 6, 0)
-#define ICC_CTLR_EL1 sys_reg(3, 0, 12, 12, 4)
-#define ICC_SRE_EL1 sys_reg(3, 0, 12, 12, 5)
-#define ICC_GRPEN1_EL1 sys_reg(3, 0, 12, 12, 7)
-#define ICC_BPR1_EL1 sys_reg(3, 0, 12, 12, 3)
-
-#define ICC_SRE_EL2 sys_reg(3, 4, 12, 9, 5)
-
-/*
- * System register definitions
- */
-#define ICH_VSEIR_EL2 sys_reg(3, 4, 12, 9, 4)
-#define ICH_HCR_EL2 sys_reg(3, 4, 12, 11, 0)
-#define ICH_VTR_EL2 sys_reg(3, 4, 12, 11, 1)
-#define ICH_MISR_EL2 sys_reg(3, 4, 12, 11, 2)
-#define ICH_EISR_EL2 sys_reg(3, 4, 12, 11, 3)
-#define ICH_ELSR_EL2 sys_reg(3, 4, 12, 11, 5)
-#define ICH_VMCR_EL2 sys_reg(3, 4, 12, 11, 7)
-
-#define __LR0_EL2(x) sys_reg(3, 4, 12, 12, x)
-#define __LR8_EL2(x) sys_reg(3, 4, 12, 13, x)
-
-#define ICH_LR0_EL2 __LR0_EL2(0)
-#define ICH_LR1_EL2 __LR0_EL2(1)
-#define ICH_LR2_EL2 __LR0_EL2(2)
-#define ICH_LR3_EL2 __LR0_EL2(3)
-#define ICH_LR4_EL2 __LR0_EL2(4)
-#define ICH_LR5_EL2 __LR0_EL2(5)
-#define ICH_LR6_EL2 __LR0_EL2(6)
-#define ICH_LR7_EL2 __LR0_EL2(7)
-#define ICH_LR8_EL2 __LR8_EL2(0)
-#define ICH_LR9_EL2 __LR8_EL2(1)
-#define ICH_LR10_EL2 __LR8_EL2(2)
-#define ICH_LR11_EL2 __LR8_EL2(3)
-#define ICH_LR12_EL2 __LR8_EL2(4)
-#define ICH_LR13_EL2 __LR8_EL2(5)
-#define ICH_LR14_EL2 __LR8_EL2(6)
-#define ICH_LR15_EL2 __LR8_EL2(7)
-
-#define __AP0Rx_EL2(x) sys_reg(3, 4, 12, 8, x)
-#define ICH_AP0R0_EL2 __AP0Rx_EL2(0)
-#define ICH_AP0R1_EL2 __AP0Rx_EL2(1)
-#define ICH_AP0R2_EL2 __AP0Rx_EL2(2)
-#define ICH_AP0R3_EL2 __AP0Rx_EL2(3)
-
-#define __AP1Rx_EL2(x) sys_reg(3, 4, 12, 9, x)
-#define ICH_AP1R0_EL2 __AP1Rx_EL2(0)
-#define ICH_AP1R1_EL2 __AP1Rx_EL2(1)
-#define ICH_AP1R2_EL2 __AP1Rx_EL2(2)
-#define ICH_AP1R3_EL2 __AP1Rx_EL2(3)
-
#ifndef __ASSEMBLY__
#include <linux/stringify.h>
#include <asm/barrier.h>
#include <asm/cacheflush.h>
-#define read_gicreg read_sysreg_s
-#define write_gicreg write_sysreg_s
+#define read_gicreg(r) read_sysreg_s(SYS_ ## r)
+#define write_gicreg(v, r) write_sysreg_s(v, SYS_ ## r)
/*
* Low-level accessors
@@ -93,13 +38,13 @@
static inline void gic_write_eoir(u32 irq)
{
- write_sysreg_s(irq, ICC_EOIR1_EL1);
+ write_sysreg_s(irq, SYS_ICC_EOIR1_EL1);
isb();
}
static inline void gic_write_dir(u32 irq)
{
- write_sysreg_s(irq, ICC_DIR_EL1);
+ write_sysreg_s(irq, SYS_ICC_DIR_EL1);
isb();
}
@@ -107,7 +52,7 @@ static inline u64 gic_read_iar_common(void)
{
u64 irqstat;
- irqstat = read_sysreg_s(ICC_IAR1_EL1);
+ irqstat = read_sysreg_s(SYS_ICC_IAR1_EL1);
dsb(sy);
return irqstat;
}
@@ -124,7 +69,7 @@ static inline u64 gic_read_iar_cavium_thunderx(void)
u64 irqstat;
nops(8);
- irqstat = read_sysreg_s(ICC_IAR1_EL1);
+ irqstat = read_sysreg_s(SYS_ICC_IAR1_EL1);
nops(4);
mb();
@@ -133,40 +78,40 @@ static inline u64 gic_read_iar_cavium_thunderx(void)
static inline void gic_write_pmr(u32 val)
{
- write_sysreg_s(val, ICC_PMR_EL1);
+ write_sysreg_s(val, SYS_ICC_PMR_EL1);
}
static inline void gic_write_ctlr(u32 val)
{
- write_sysreg_s(val, ICC_CTLR_EL1);
+ write_sysreg_s(val, SYS_ICC_CTLR_EL1);
isb();
}
static inline void gic_write_grpen1(u32 val)
{
- write_sysreg_s(val, ICC_GRPEN1_EL1);
+ write_sysreg_s(val, SYS_ICC_GRPEN1_EL1);
isb();
}
static inline void gic_write_sgi1r(u64 val)
{
- write_sysreg_s(val, ICC_SGI1R_EL1);
+ write_sysreg_s(val, SYS_ICC_SGI1R_EL1);
}
static inline u32 gic_read_sre(void)
{
- return read_sysreg_s(ICC_SRE_EL1);
+ return read_sysreg_s(SYS_ICC_SRE_EL1);
}
static inline void gic_write_sre(u32 val)
{
- write_sysreg_s(val, ICC_SRE_EL1);
+ write_sysreg_s(val, SYS_ICC_SRE_EL1);
isb();
}
static inline void gic_write_bpr1(u32 val)
{
- asm volatile("msr_s " __stringify(ICC_BPR1_EL1) ", %0" : : "r" (val));
+ write_sysreg_s(val, SYS_ICC_BPR1_EL1);
}
#define gic_read_typer(c) readq_relaxed(c)

arch/arm64/include/asm/bug.h

View file
diff --git a/arch/arm64/include/asm/bug.h b/arch/arm64/include/asm/bug.h
index a9be107..366448e 100644
--- a/arch/arm64/include/asm/bug.h
+++ b/arch/arm64/include/asm/bug.h
@@ -20,9 +20,6 @@
#include <asm/brk-imm.h>
-#ifdef CONFIG_GENERIC_BUG
-#define HAVE_ARCH_BUG
-
#ifdef CONFIG_DEBUG_BUGVERBOSE
#define _BUGVERBOSE_LOCATION(file, line) __BUGVERBOSE_LOCATION(file, line)
#define __BUGVERBOSE_LOCATION(file, line) \
@@ -36,28 +33,35 @@
#define _BUGVERBOSE_LOCATION(file, line)
#endif
-#define _BUG_FLAGS(flags) __BUG_FLAGS(flags)
+#ifdef CONFIG_GENERIC_BUG
-#define __BUG_FLAGS(flags) asm volatile ( \
+#define __BUG_ENTRY(flags) \
".pushsection __bug_table,\"a\"\n\t" \
".align 2\n\t" \
"0: .long 1f - 0b\n\t" \
_BUGVERBOSE_LOCATION(__FILE__, __LINE__) \
".short " #flags "\n\t" \
".popsection\n" \
- \
- "1: brk %[imm]" \
- :: [imm] "i" (BUG_BRK_IMM) \
-)
+ "1: "
+#else
+#define __BUG_ENTRY(flags) ""
+#endif
+
+#define __BUG_FLAGS(flags) \
+ asm volatile ( \
+ __BUG_ENTRY(flags) \
+ "brk %[imm]" :: [imm] "i" (BUG_BRK_IMM) \
+ );
-#define BUG() do { \
- _BUG_FLAGS(0); \
- unreachable(); \
+
+#define BUG() do { \
+ __BUG_FLAGS(0); \
+ unreachable(); \
} while (0)
-#define __WARN_FLAGS(flags) _BUG_FLAGS(BUGFLAG_WARNING|(flags))
+#define __WARN_FLAGS(flags) __BUG_FLAGS(BUGFLAG_WARNING|(flags))
-#endif /* ! CONFIG_GENERIC_BUG */
+#define HAVE_ARCH_BUG
#include <asm-generic/bug.h>

arch/arm64/include/asm/cache.h

View file
diff --git a/arch/arm64/include/asm/cache.h b/arch/arm64/include/asm/cache.h
index 5082b30..ea9bb4e 100644
--- a/arch/arm64/include/asm/cache.h
+++ b/arch/arm64/include/asm/cache.h
@@ -16,7 +16,18 @@
#ifndef __ASM_CACHE_H
#define __ASM_CACHE_H
-#include <asm/cachetype.h>
+#include <asm/cputype.h>
+
+#define CTR_L1IP_SHIFT 14
+#define CTR_L1IP_MASK 3
+#define CTR_CWG_SHIFT 24
+#define CTR_CWG_MASK 15
+
+#define CTR_L1IP(ctr) (((ctr) >> CTR_L1IP_SHIFT) & CTR_L1IP_MASK)
+
+#define ICACHE_POLICY_VPIPT 0
+#define ICACHE_POLICY_VIPT 2
+#define ICACHE_POLICY_PIPT 3
#define L1_CACHE_SHIFT 7
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
@@ -32,6 +43,31 @@
#ifndef __ASSEMBLY__
+#include <linux/bitops.h>
+
+#define ICACHEF_ALIASING 0
+#define ICACHEF_VPIPT 1
+extern unsigned long __icache_flags;
+
+/*
+ * Whilst the D-side always behaves as PIPT on AArch64, aliasing is
+ * permitted in the I-cache.
+ */
+static inline int icache_is_aliasing(void)
+{
+ return test_bit(ICACHEF_ALIASING, &__icache_flags);
+}
+
+static inline int icache_is_vpipt(void)
+{
+ return test_bit(ICACHEF_VPIPT, &__icache_flags);
+}
+
+static inline u32 cache_type_cwg(void)
+{
+ return (read_cpuid_cachetype() >> CTR_CWG_SHIFT) & CTR_CWG_MASK;
+}
+
#define __read_mostly __attribute__((__section__(".data..read_mostly")))
static inline int cache_line_size(void)

arch/arm64/include/asm/cacheflush.h

View file
diff --git a/arch/arm64/include/asm/cacheflush.h b/arch/arm64/include/asm/cacheflush.h
index 5a2a6ee..728f933 100644
--- a/arch/arm64/include/asm/cacheflush.h
+++ b/arch/arm64/include/asm/cacheflush.h
@@ -154,5 +154,6 @@ int set_memory_ro(unsigned long addr, int numpages);
int set_memory_rw(unsigned long addr, int numpages);
int set_memory_x(unsigned long addr, int numpages);
int set_memory_nx(unsigned long addr, int numpages);
+int set_memory_valid(unsigned long addr, unsigned long size, int enable);
#endif

arch/arm64/include/asm/cachetype.h

View before deletion
diff --git a/arch/arm64/include/asm/cachetype.h b/arch/arm64/include/asm/cachetype.h
deleted file mode 100644
index f558869..0000000
--- a/arch/arm64/include/asm/cachetype.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2012 ARM Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-#ifndef __ASM_CACHETYPE_H
-#define __ASM_CACHETYPE_H
-
-#include <asm/cputype.h>
-
-#define CTR_L1IP_SHIFT 14
-#define CTR_L1IP_MASK 3
-#define CTR_CWG_SHIFT 24
-#define CTR_CWG_MASK 15
-
-#define ICACHE_POLICY_RESERVED 0
-#define ICACHE_POLICY_AIVIVT 1
-#define ICACHE_POLICY_VIPT 2
-#define ICACHE_POLICY_PIPT 3
-
-#ifndef __ASSEMBLY__
-
-#include <linux/bitops.h>
-
-#define CTR_L1IP(ctr) (((ctr) >> CTR_L1IP_SHIFT) & CTR_L1IP_MASK)
-
-#define ICACHEF_ALIASING 0
-#define ICACHEF_AIVIVT 1
-
-extern unsigned long __icache_flags;
-
-/*
- * NumSets, bits[27:13] - (Number of sets in cache) - 1
- * Associativity, bits[12:3] - (Associativity of cache) - 1
- * LineSize, bits[2:0] - (Log2(Number of words in cache line)) - 2
- */
-#define CCSIDR_EL1_WRITE_THROUGH BIT(31)
-#define CCSIDR_EL1_WRITE_BACK BIT(30)
-#define CCSIDR_EL1_READ_ALLOCATE BIT(29)
-#define CCSIDR_EL1_WRITE_ALLOCATE BIT(28)
-#define CCSIDR_EL1_LINESIZE_MASK 0x7
-#define CCSIDR_EL1_LINESIZE(x) ((x) & CCSIDR_EL1_LINESIZE_MASK)
-#define CCSIDR_EL1_ASSOCIATIVITY_SHIFT 3
-#define CCSIDR_EL1_ASSOCIATIVITY_MASK 0x3ff

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/cpufeature.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/esr.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/hardirq.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/hw_breakpoint.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/kexec.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/kvm_mmu.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/mmu.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/module.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/pgtable.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/sections.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/smp.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/sysreg.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/uapi/asm/hwcap.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/alternative.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/cacheinfo.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/cpufeature.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/cpuinfo.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/crash_dump.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/debug-monitors.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/efi-header.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/head.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/hibernate.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/machine_kexec.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/module-plts.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/module.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/module.lds

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/perf_event.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/process.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/reloc_test_core.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/reloc_test_syms.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/setup.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/smp.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/traps.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/vmlinux.lds.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kvm/hyp/tlb.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kvm/reset.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kvm/sys_regs.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/mm/context.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/mm/dma-mapping.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/mm/fault.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/mm/flush.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/mm/init.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/mm/mmu.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/mm/pageattr.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/arm64/iort.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/glue.c

View file

This diff is incomplete. Download the complete patch.

drivers/firmware/efi/libstub/fdt.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/perf/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/perf/arm_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/arm_pmu_acpi.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/arm_pmu_platform.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/qcom_l3_pmu.c

View file

This diff is incomplete. Download the complete patch.

include/linux/acpi_iort.h

View file

This diff is incomplete. Download the complete patch.

include/linux/cpuhotplug.h

View file

This diff is incomplete. Download the complete patch.

include/linux/memblock.h

View file

This diff is incomplete. Download the complete patch.

include/linux/pe.h

View file

This diff is incomplete. Download the complete patch.

include/linux/perf/arm_pmu.h

View file

This diff is incomplete. Download the complete patch.

mm/memblock.c

View file

This diff is incomplete. Download the complete patch.

virt/kvm/arm/vgic/vgic.c

View file

This diff is incomplete. Download the complete patch.