Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be092017 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull arm64 updates from Will Deacon:

 - virt_to_page/page_address optimisations

 - support for NUMA systems described using device-tree

 - support for hibernate/suspend-to-disk

 - proper support for maxcpus= command line parameter

 - detection and graceful handling of AArch64-only CPUs

 - miscellaneous cleanups and non-critical fixes

* tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (92 commits)
  arm64: do not enforce strict 16 byte alignment to stack pointer
  arm64: kernel: Fix incorrect brk randomization
  arm64: cpuinfo: Missing NULL terminator in compat_hwcap_str
  arm64: secondary_start_kernel: Remove unnecessary barrier
  arm64: Ensure pmd_present() returns false after pmd_mknotpresent()
  arm64: Replace hard-coded values in the pmd/pud_bad() macros
  arm64: Implement pmdp_set_access_flags() for hardware AF/DBM
  arm64: Fix typo in the pmdp_huge_get_and_clear() definition
  arm64: mm: remove unnecessary EXPORT_SYMBOL_GPL
  arm64: always use STRICT_MM_TYPECHECKS
  arm64: kvm: Fix kvm teardown for systems using the extended idmap
  arm64: kaslr: increase randomization granularity
  arm64: kconfig: drop CONFIG_RTC_LIB dependency
  arm64: make ARCH_SUPPORTS_DEBUG_PAGEALLOC depend on !HIBERNATION
  arm64: hibernate: Refuse to hibernate if the boot cpu is offline
  arm64: kernel: Add support for hibernate/suspend-to-disk
  PM / Hibernate: Call flush_icache_range() on pages restored in-place
  arm64: Add new asm macro copy_page
  arm64: Promote KERNEL_START/KERNEL_END definitions to a header file
  arm64: kernel: Include _AC definition in page.h
  ...
parents fb6363e9 e6d9a525
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -132,6 +132,10 @@ NOTE: versions prior to v4.6 cannot make use of memory below the
physical offset of the Image so it is recommended that the Image be
placed as close as possible to the start of system RAM.

If an initrd/initramfs is passed to the kernel at boot, it must reside
entirely within a 1 GB aligned physical memory window of up to 32 GB in
size that fully covers the kernel Image as well.

Any memory described to the kernel (even that below the start of the
image) which is not marked as reserved from the kernel (e.g., with a
memreserve region in the device tree) will be considered as available to
+275 −0
Original line number Diff line number Diff line
==============================================================================
NUMA binding description.
==============================================================================

==============================================================================
1 - Introduction
==============================================================================

Systems employing a Non Uniform Memory Access (NUMA) architecture contain
collections of hardware resources including processors, memory, and I/O buses,
that comprise what is commonly known as a NUMA node.
Processor accesses to memory within the local NUMA node is generally faster
than processor accesses to memory outside of the local NUMA node.
DT defines interfaces that allow the platform to convey NUMA node
topology information to OS.

==============================================================================
2 - numa-node-id
==============================================================================

For the purpose of identification, each NUMA node is associated with a unique
token known as a node id. For the purpose of this binding
a node id is a 32-bit integer.

A device node is associated with a NUMA node by the presence of a
numa-node-id property which contains the node id of the device.

Example:
	/* numa node 0 */
	numa-node-id = <0>;

	/* numa node 1 */
	numa-node-id = <1>;

==============================================================================
3 - distance-map
==============================================================================

The optional device tree node distance-map describes the relative
distance (memory latency) between all numa nodes.

- compatible : Should at least contain "numa-distance-map-v1".

- distance-matrix
  This property defines a matrix to describe the relative distances
  between all numa nodes.
  It is represented as a list of node pairs and their relative distance.

  Note:
	1. Each entry represents distance from first node to second node.
	The distances are equal in either direction.
	2. The distance from a node to self (local distance) is represented
	with value 10 and all internode distance should be represented with
	a value greater than 10.
	3. distance-matrix should have entries in lexicographical ascending
	order of nodes.
	4. There must be only one device node distance-map which must
	reside in the root node.
	5. If the distance-map node is not present, a default
	distance-matrix is used.

Example:
	4 nodes connected in mesh/ring topology as below,

		0_______20______1
		|               |
		|               |
		20             20
		|               |
		|               |
		|_______________|
		3       20      2

	if relative distance for each hop is 20,
	then internode distance would be,
	      0 -> 1 = 20
	      1 -> 2 = 20
	      2 -> 3 = 20
	      3 -> 0 = 20
	      0 -> 2 = 40
	      1 -> 3 = 40

     and dt presentation for this distance matrix is,

		distance-map {
			 compatible = "numa-distance-map-v1";
			 distance-matrix = <0 0  10>,
					   <0 1  20>,
					   <0 2  40>,
					   <0 3  20>,
					   <1 0  20>,
					   <1 1  10>,
					   <1 2  20>,
					   <1 3  40>,
					   <2 0  40>,
					   <2 1  20>,
					   <2 2  10>,
					   <2 3  20>,
					   <3 0  20>,
					   <3 1  40>,
					   <3 2  20>,
					   <3 3  10>;
		};

==============================================================================
4 - Example dts
==============================================================================

Dual socket system consists of 2 boards connected through ccn bus and
each board having one socket/soc of 8 cpus, memory and pci bus.

	memory@c00000 {
		device_type = "memory";
		reg = <0x0 0xc00000 0x0 0x80000000>;
		/* node 0 */
		numa-node-id = <0>;
	};

	memory@10000000000 {
		device_type = "memory";
		reg = <0x100 0x0 0x0 0x80000000>;
		/* node 1 */
		numa-node-id = <1>;
	};

	cpus {
		#address-cells = <2>;
		#size-cells = <0>;

		cpu@0 {
			device_type = "cpu";
			compatible =  "arm,armv8";
			reg = <0x0 0x0>;
			enable-method = "psci";
			/* node 0 */
			numa-node-id = <0>;
		};
		cpu@1 {
			device_type = "cpu";
			compatible =  "arm,armv8";
			reg = <0x0 0x1>;
			enable-method = "psci";
			numa-node-id = <0>;
		};
		cpu@2 {
			device_type = "cpu";
			compatible =  "arm,armv8";
			reg = <0x0 0x2>;
			enable-method = "psci";
			numa-node-id = <0>;
		};
		cpu@3 {
			device_type = "cpu";
			compatible =  "arm,armv8";
			reg = <0x0 0x3>;
			enable-method = "psci";
			numa-node-id = <0>;
		};
		cpu@4 {
			device_type = "cpu";
			compatible =  "arm,armv8";
			reg = <0x0 0x4>;
			enable-method = "psci";
			numa-node-id = <0>;
		};
		cpu@5 {
			device_type = "cpu";
			compatible =  "arm,armv8";
			reg = <0x0 0x5>;
			enable-method = "psci";
			numa-node-id = <0>;
		};
		cpu@6 {
			device_type = "cpu";
			compatible =  "arm,armv8";
			reg = <0x0 0x6>;
			enable-method = "psci";
			numa-node-id = <0>;
		};
		cpu@7 {
			device_type = "cpu";
			compatible =  "arm,armv8";
			reg = <0x0 0x7>;
			enable-method = "psci";
			numa-node-id = <0>;
		};
		cpu@8 {
			device_type = "cpu";
			compatible =  "arm,armv8";
			reg = <0x0 0x8>;
			enable-method = "psci";
			/* node 1 */
			numa-node-id = <1>;
		};
		cpu@9 {
			device_type = "cpu";
			compatible =  "arm,armv8";
			reg = <0x0 0x9>;
			enable-method = "psci";
			numa-node-id = <1>;
		};
		cpu@a {
			device_type = "cpu";
			compatible =  "arm,armv8";
			reg = <0x0 0xa>;
			enable-method = "psci";
			numa-node-id = <1>;
		};
		cpu@b {
			device_type = "cpu";
			compatible =  "arm,armv8";
			reg = <0x0 0xb>;
			enable-method = "psci";
			numa-node-id = <1>;
		};
		cpu@c {
			device_type = "cpu";
			compatible =  "arm,armv8";
			reg = <0x0 0xc>;
			enable-method = "psci";
			numa-node-id = <1>;
		};
		cpu@d {
			device_type = "cpu";
			compatible =  "arm,armv8";
			reg = <0x0 0xd>;
			enable-method = "psci";
			numa-node-id = <1>;
		};
		cpu@e {
			device_type = "cpu";
			compatible =  "arm,armv8";
			reg = <0x0 0xe>;
			enable-method = "psci";
			numa-node-id = <1>;
		};
		cpu@f {
			device_type = "cpu";
			compatible =  "arm,armv8";
			reg = <0x0 0xf>;
			enable-method = "psci";
			numa-node-id = <1>;
		};
	};

	pcie0: pcie0@848000000000 {
		compatible = "arm,armv8";
		device_type = "pci";
		bus-range = <0 255>;
		#size-cells = <2>;
		#address-cells = <3>;
		reg = <0x8480 0x00000000 0 0x10000000>;  /* Configuration space */
		ranges = <0x03000000 0x8010 0x00000000 0x8010 0x00000000 0x70 0x00000000>;
		/* node 0 */
		numa-node-id = <0>;
        };

	pcie1: pcie1@948000000000 {
		compatible = "arm,armv8";
		device_type = "pci";
		bus-range = <0 255>;
		#size-cells = <2>;
		#address-cells = <3>;
		reg = <0x9480 0x00000000 0 0x10000000>;  /* Configuration space */
		ranges = <0x03000000 0x9010 0x00000000 0x9010 0x00000000 0x70 0x00000000>;
		/* node 1 */
		numa-node-id = <1>;
        };

	distance-map {
		compatible = "numa-distance-map-v1";
		distance-matrix = <0 0 10>,
				  <0 1 20>,
				  <1 1 10>;
	};
+4 −2
Original line number Diff line number Diff line
@@ -168,16 +168,18 @@ bytes respectively. Such letter suffixes can also be entirely omitted.

	acpi=		[HW,ACPI,X86,ARM64]
			Advanced Configuration and Power Interface
			Format: { force | off | strict | noirq | rsdt |
			Format: { force | on | off | strict | noirq | rsdt |
				  copy_dsdt }
			force -- enable ACPI if default was off
			on -- enable ACPI but allow fallback to DT [arm64]
			off -- disable ACPI if default was on
			noirq -- do not use ACPI for IRQ routing
			strict -- Be less tolerant of platforms that are not
				strictly ACPI specification compliant.
			rsdt -- prefer RSDT over (default) XSDT
			copy_dsdt -- copy DSDT to memory
			For ARM64, ONLY "acpi=off" or "acpi=force" are available
			For ARM64, ONLY "acpi=off", "acpi=on" or "acpi=force"
			are available

			See also Documentation/power/runtime_pm.txt, pci=noacpi

+9 −1
Original line number Diff line number Diff line
@@ -265,6 +265,15 @@ static inline void __cpu_init_stage2(void)
	kvm_call_hyp(__init_stage2_translation);
}

static inline void __cpu_reset_hyp_mode(phys_addr_t boot_pgd_ptr,
					phys_addr_t phys_idmap_start)
{
	/*
	 * TODO
	 * kvm_call_reset(boot_pgd_ptr, phys_idmap_start);
	 */
}

static inline int kvm_arch_dev_ioctl_check_extension(long ext)
{
	return 0;
@@ -277,7 +286,6 @@ void kvm_mmu_wp_memory_region(struct kvm *kvm, int slot);

struct kvm_vcpu *kvm_mpidr_to_vcpu(struct kvm *kvm, unsigned long mpidr);

static inline void kvm_arch_hardware_disable(void) {}
static inline void kvm_arch_hardware_unsetup(void) {}
static inline void kvm_arch_sync_events(struct kvm *kvm) {}
static inline void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu) {}
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ void kvm_mmu_free_memory_caches(struct kvm_vcpu *vcpu);
phys_addr_t kvm_mmu_get_httbr(void);
phys_addr_t kvm_mmu_get_boot_httbr(void);
phys_addr_t kvm_get_idmap_vector(void);
phys_addr_t kvm_get_idmap_start(void);
int kvm_mmu_init(void);
void kvm_clear_hyp_idmap(void);

Loading