Commit 4e00c5af authored by Logan Gunthorpe's avatar Logan Gunthorpe Committed by Linus Torvalds
Browse files

powerpc/mm: thread pgprot_t through create_section_mapping()



In prepartion to support a pgprot_t argument for arch_add_memory().

Signed-off-by: default avatarLogan Gunthorpe <logang@deltatee.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Eric Badger <ebadger@gigaio.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Link: http://lkml.kernel.org/r/20200306170846.9333-6-logang@deltatee.com


Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 30796e18
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -251,7 +251,8 @@ extern int __meminit hash__vmemmap_create_mapping(unsigned long start,
extern void hash__vmemmap_remove_mapping(unsigned long start,
				     unsigned long page_size);

int hash__create_section_mapping(unsigned long start, unsigned long end, int nid);
int hash__create_section_mapping(unsigned long start, unsigned long end,
				 int nid, pgprot_t prot);
int hash__remove_section_mapping(unsigned long start, unsigned long end);

#endif /* !__ASSEMBLY__ */
+2 −1
Original line number Diff line number Diff line
@@ -294,7 +294,8 @@ static inline unsigned long radix__get_tree_size(void)
}

#ifdef CONFIG_MEMORY_HOTPLUG
int radix__create_section_mapping(unsigned long start, unsigned long end, int nid);
int radix__create_section_mapping(unsigned long start, unsigned long end,
				  int nid, pgprot_t prot);
int radix__remove_section_mapping(unsigned long start, unsigned long end);
#endif /* CONFIG_MEMORY_HOTPLUG */
#endif /* __ASSEMBLY__ */
+2 −1
Original line number Diff line number Diff line
@@ -13,7 +13,8 @@
#endif /* CONFIG_SPARSEMEM */

#ifdef CONFIG_MEMORY_HOTPLUG
extern int create_section_mapping(unsigned long start, unsigned long end, int nid);
extern int create_section_mapping(unsigned long start, unsigned long end,
				  int nid, pgprot_t prot);
extern int remove_section_mapping(unsigned long start, unsigned long end);

#ifdef CONFIG_PPC_BOOK3S_64
+3 −2
Original line number Diff line number Diff line
@@ -809,7 +809,8 @@ int resize_hpt_for_hotplug(unsigned long new_mem_size)
	return 0;
}

int hash__create_section_mapping(unsigned long start, unsigned long end, int nid)
int hash__create_section_mapping(unsigned long start, unsigned long end,
				 int nid, pgprot_t prot)
{
	int rc;

@@ -819,7 +820,7 @@ int hash__create_section_mapping(unsigned long start, unsigned long end, int nid
	}

	rc = htab_bolt_mapping(start, end, __pa(start),
			       pgprot_val(PAGE_KERNEL), mmu_linear_psize,
			       pgprot_val(prot), mmu_linear_psize,
			       mmu_kernel_ssize);

	if (rc < 0) {
+4 −3
Original line number Diff line number Diff line
@@ -171,12 +171,13 @@ void mmu_cleanup_all(void)
}

#ifdef CONFIG_MEMORY_HOTPLUG
int __meminit create_section_mapping(unsigned long start, unsigned long end, int nid)
int __meminit create_section_mapping(unsigned long start, unsigned long end,
				     int nid, pgprot_t prot)
{
	if (radix_enabled())
		return radix__create_section_mapping(start, end, nid);
		return radix__create_section_mapping(start, end, nid, prot);

	return hash__create_section_mapping(start, end, nid);
	return hash__create_section_mapping(start, end, nid, prot);
}

int __meminit remove_section_mapping(unsigned long start, unsigned long end)
Loading