Skip to content

Commit b92d964

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Will Deacon: "Three arm64 fixes for -rc3. They're all pretty straightforward: a couple of NUMA issues from the Huawei folks and a thinko in __page_to_voff that seems to be benign, but is certainly better off fixed. Summary: - couple of NUMA fixes - thinko in __page_to_voff" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: mm: fix __page_to_voff definition arm64/numa: fix incorrect log for memory-less node arm64/numa: fix pcpu_cpu_distance() to get correct CPU proximity
2 parents c38c04c + 3fa72fe commit b92d964

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

arch/arm64/include/asm/memory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ static inline void *phys_to_virt(phys_addr_t x)
217217
#define _virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
218218
#else
219219
#define __virt_to_pgoff(kaddr) (((u64)(kaddr) & ~PAGE_OFFSET) / PAGE_SIZE * sizeof(struct page))
220-
#define __page_to_voff(kaddr) (((u64)(page) & ~VMEMMAP_START) * PAGE_SIZE / sizeof(struct page))
220+
#define __page_to_voff(page) (((u64)(page) & ~VMEMMAP_START) * PAGE_SIZE / sizeof(struct page))
221221

222222
#define page_to_virt(page) ((void *)((__page_to_voff(page)) | PAGE_OFFSET))
223223
#define virt_to_page(vaddr) ((struct page *)((__virt_to_pgoff(vaddr)) | VMEMMAP_START))

arch/arm64/mm/numa.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static int __init early_cpu_to_node(int cpu)
147147

148148
static int __init pcpu_cpu_distance(unsigned int from, unsigned int to)
149149
{
150-
return node_distance(from, to);
150+
return node_distance(early_cpu_to_node(from), early_cpu_to_node(to));
151151
}
152152

153153
static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size,
@@ -223,8 +223,11 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)
223223
void *nd;
224224
int tnid;
225225

226-
pr_info("Initmem setup node %d [mem %#010Lx-%#010Lx]\n",
227-
nid, start_pfn << PAGE_SHIFT, (end_pfn << PAGE_SHIFT) - 1);
226+
if (start_pfn < end_pfn)
227+
pr_info("Initmem setup node %d [mem %#010Lx-%#010Lx]\n", nid,
228+
start_pfn << PAGE_SHIFT, (end_pfn << PAGE_SHIFT) - 1);
229+
else
230+
pr_info("Initmem setup node %d [<memory-less node>]\n", nid);
228231

229232
nd_pa = memblock_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);
230233
nd = __va(nd_pa);

0 commit comments

Comments
 (0)