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

Commit 32bb3295 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "arm: mm: Account for lowmem in the static vm"

parents c0106ca9 f61e9925
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -91,8 +91,7 @@ void __init add_static_vm_early(struct static_vm *svm)
	void *vaddr;

	vm = &svm->vm;
	if (vm_area_check_early(vm))
		return;
	if (!vm_area_check_early(vm))
		vm_area_add_early(vm);
	vaddr = vm->addr;

+6 −4
Original line number Diff line number Diff line
@@ -1487,7 +1487,7 @@ EXPORT_SYMBOL(mem_text_write_kernel_word);
static void __init map_lowmem(void)
{
	struct memblock_region *reg;
	struct vm_struct *vm;
	struct static_vm *svm;
	phys_addr_t start;
	phys_addr_t end;
	unsigned long vaddr;
@@ -1555,9 +1555,10 @@ static void __init map_lowmem(void)
		create_mapping(&map);
	}

	vm = early_alloc_aligned(sizeof(*vm) * nr, __alignof__(*vm));
	svm = early_alloc_aligned(sizeof(*svm) * nr, __alignof__(*svm));

	for_each_memblock(memory, reg) {
		struct vm_struct *vm;

		start = reg->base;
		end = start + reg->size;
@@ -1567,6 +1568,7 @@ static void __init map_lowmem(void)
		if (start >= end)
			break;

		vm = &svm->vm;
		pfn = __phys_to_pfn(start);
		vaddr = __phys_to_virt(start);
		length = end - start;
@@ -1575,10 +1577,10 @@ static void __init map_lowmem(void)
		vm->addr = (void *)(vaddr & PAGE_MASK);
		vm->size = PAGE_ALIGN(length + (vaddr & ~PAGE_MASK));
		vm->phys_addr = __pfn_to_phys(pfn);
		vm->flags = VM_LOWMEM | VM_ARM_STATIC_MAPPING;
		vm->flags = VM_LOWMEM;
		vm->flags |= VM_ARM_MTYPE(type);
		vm->caller = map_lowmem;
		vm_area_add_early(vm++);
		add_static_vm_early(svm++);
	}
}