All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] powerpc/64s/radix: Fix memory hotplug section page table creation
@ 2019-07-24  8:46 Nicholas Piggin
  2019-07-24  8:46 ` [PATCH 2/5] powerpc/64s/radix: Fix memory hot-unplug page table split Nicholas Piggin
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Nicholas Piggin @ 2019-07-24  8:46 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: Madhavan Srinivasan, Aneesh Kumar K . V, Reza Arbab,
	Anju T Sudhakar, Nicholas Piggin

create_physical_mapping expects physical addresses, but creating and
splitting these mappings after boot is supplying virtual (effective)
addresses. This can be irritated by booting with mem= to limit memory
then probing an unused physical memory range:

  echo <addr> > /sys/devices/system/memory/probe

This mostly works by accident, firstly because __va(__va(x)) == __va(x)
so the virtual address does not get corrupted. Secondly because pfn_pte
masks out the upper bits of the pfn beyond the physical address limit,
so a pfn constructed with a 0xc000000000000000 virtual linear address
will be masked back to the correct physical address in the pte.

Cc: Reza Arbab <arbab@linux.vnet.ibm.com>
Fixes: 6cc27341b21a8 ("powerpc/mm: add radix__create_section_mapping()")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/mm/book3s64/radix_pgtable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c
index b4ca9e95e678..c5cc16ab1954 100644
--- a/arch/powerpc/mm/book3s64/radix_pgtable.c
+++ b/arch/powerpc/mm/book3s64/radix_pgtable.c
@@ -902,7 +902,7 @@ int __meminit radix__create_section_mapping(unsigned long start, unsigned long e
 		return -1;
 	}
 
-	return create_physical_mapping(start, end, nid);
+	return create_physical_mapping(__pa(start), __pa(end), nid);
 }
 
 int __meminit radix__remove_section_mapping(unsigned long start, unsigned long end)
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-12-26 17:21 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24  8:46 [PATCH 1/5] powerpc/64s/radix: Fix memory hotplug section page table creation Nicholas Piggin
2019-07-24  8:46 ` [PATCH 2/5] powerpc/64s/radix: Fix memory hot-unplug page table split Nicholas Piggin
2019-07-24  9:55   ` Aneesh Kumar K.V
2019-07-24  8:46 ` [PATCH 3/5] powerpc/perf: fix imc allocation failure handling Nicholas Piggin
2019-07-24  9:58   ` Aneesh Kumar K.V
2019-07-24  8:46 ` [PATCH 4/5] powerpc/64: Add VIRTUAL_BUG_ON checks for __va and __pa addresses Nicholas Piggin
2019-07-24  9:59   ` Aneesh Kumar K.V
2019-07-29 11:57   ` Christophe Leroy
2021-12-24 13:24   ` Christophe Leroy
2021-12-25 10:10     ` Nicholas Piggin
2021-12-26 17:20       ` Christophe Leroy
2019-07-24  8:46 ` [PATCH 5/5] powerpc/64s/radix: Remove redundant pfn_pte bitop, add VM_BUG_ON Nicholas Piggin
2019-07-24  9:59   ` Aneesh Kumar K.V
2019-07-24  9:54 ` [PATCH 1/5] powerpc/64s/radix: Fix memory hotplug section page table creation Aneesh Kumar K.V
2019-08-22 13:08 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.