Merge branches 'for-next/52-bit-kva', 'for-next/cpu-topology', 'for-next/error-injection', 'for-next/perf', 'for-next/psci-cpuidle', 'for-next/rng', 'for-next/smpboot', 'for-next/tbi' and 'for-next/tlbi' into for-next/core
* for-next/52-bit-kva: (25 commits) Support for 52-bit virtual addressing in kernel space * for-next/cpu-topology: (9 commits) Move CPU topology parsing into core code and add support for ACPI 6.3 * for-next/error-injection: (2 commits) Support for function error injection via kprobes * for-next/perf: (8 commits) Support for i.MX8 DDR PMU and proper SMMUv3 group validation * for-next/psci-cpuidle: (7 commits) Move PSCI idle code into a new CPUidle driver * for-next/rng: (4 commits) Support for 'rng-seed' property being passed in the devicetree * for-next/smpboot: (3 commits) Reduce fragility of secondary CPU bringup in debug configurations * for-next/tbi: (10 commits) Introduce new syscall ABI with relaxed requirements for pointer tags * for-next/tlbi: (6 commits) Handle spurious page faults arising from kernel space
This commit is contained in:

@@ -50,6 +50,12 @@
|
||||
s64 memstart_addr __ro_after_init = -1;
|
||||
EXPORT_SYMBOL(memstart_addr);
|
||||
|
||||
s64 physvirt_offset __ro_after_init;
|
||||
EXPORT_SYMBOL(physvirt_offset);
|
||||
|
||||
struct page *vmemmap __ro_after_init;
|
||||
EXPORT_SYMBOL(vmemmap);
|
||||
|
||||
phys_addr_t arm64_dma_phys_limit __ro_after_init;
|
||||
|
||||
#ifdef CONFIG_KEXEC_CORE
|
||||
@@ -301,7 +307,7 @@ static void __init fdt_enforce_memory_region(void)
|
||||
|
||||
void __init arm64_memblock_init(void)
|
||||
{
|
||||
const s64 linear_region_size = -(s64)PAGE_OFFSET;
|
||||
const s64 linear_region_size = BIT(vabits_actual - 1);
|
||||
|
||||
/* Handle linux,usable-memory-range property */
|
||||
fdt_enforce_memory_region();
|
||||
@@ -309,19 +315,26 @@ void __init arm64_memblock_init(void)
|
||||
/* Remove memory above our supported physical address size */
|
||||
memblock_remove(1ULL << PHYS_MASK_SHIFT, ULLONG_MAX);
|
||||
|
||||
/*
|
||||
* Ensure that the linear region takes up exactly half of the kernel
|
||||
* virtual address space. This way, we can distinguish a linear address
|
||||
* from a kernel/module/vmalloc address by testing a single bit.
|
||||
*/
|
||||
BUILD_BUG_ON(linear_region_size != BIT(VA_BITS - 1));
|
||||
|
||||
/*
|
||||
* Select a suitable value for the base of physical memory.
|
||||
*/
|
||||
memstart_addr = round_down(memblock_start_of_DRAM(),
|
||||
ARM64_MEMSTART_ALIGN);
|
||||
|
||||
physvirt_offset = PHYS_OFFSET - PAGE_OFFSET;
|
||||
|
||||
vmemmap = ((struct page *)VMEMMAP_START - (memstart_addr >> PAGE_SHIFT));
|
||||
|
||||
/*
|
||||
* If we are running with a 52-bit kernel VA config on a system that
|
||||
* does not support it, we have to offset our vmemmap and physvirt_offset
|
||||
* s.t. we avoid the 52-bit portion of the direct linear map
|
||||
*/
|
||||
if (IS_ENABLED(CONFIG_ARM64_VA_BITS_52) && (vabits_actual != 52)) {
|
||||
vmemmap += (_PAGE_OFFSET(48) - _PAGE_OFFSET(52)) >> PAGE_SHIFT;
|
||||
physvirt_offset = PHYS_OFFSET - _PAGE_OFFSET(48);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove the memory that we will not be able to cover with the
|
||||
* linear mapping. Take care not to clip the kernel which may be
|
||||
|
Reference in New Issue
Block a user