Skip to content

Commit bf6a2a9

Browse files
committed
Automatic merge of 'next-test' into merge-test (2023-08-31 11:23)
2 parents 0157225 + 90bae4d commit bf6a2a9

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

arch/powerpc/mm/init_64.c

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -494,12 +494,23 @@ static int __init dt_scan_mmu_pid_width(unsigned long node,
494494
return 1;
495495
}
496496

497+
/*
498+
* Outside hotplug the kernel uses this value to map the kernel direct map
499+
* with radix. To be compatible with older kernels, let's keep this value
500+
* as 16M which is also SECTION_SIZE with SPARSEMEM. We can ideally map
501+
* things with 1GB size in the case where we don't support hotplug.
502+
*/
503+
#ifndef CONFIG_MEMORY_HOTPLUG
504+
#define DEFAULT_MEMORY_BLOCK_SIZE SZ_16M
505+
#else
506+
#define DEFAULT_MEMORY_BLOCK_SIZE MIN_MEMORY_BLOCK_SIZE
507+
#endif
508+
497509
static void update_memory_block_size(unsigned long *block_size, unsigned long mem_size)
498510
{
499-
unsigned long section_size = 1UL << SECTION_SIZE_BITS;
500-
501-
for (; *block_size > section_size; *block_size >>= 2) {
511+
unsigned long min_memory_block_size = DEFAULT_MEMORY_BLOCK_SIZE;
502512

513+
for (; *block_size > min_memory_block_size; *block_size >>= 2) {
503514
if ((mem_size & *block_size) == 0)
504515
break;
505516
}
@@ -529,7 +540,7 @@ static int __init probe_memory_block_size(unsigned long node, const char *uname,
529540
/*
530541
* Nothing in the device tree
531542
*/
532-
*block_size = MIN_MEMORY_BLOCK_SIZE;
543+
*block_size = DEFAULT_MEMORY_BLOCK_SIZE;
533544
else
534545
*block_size = of_read_number(prop, dt_root_size_cells);
535546
/*
@@ -580,8 +591,12 @@ static int __init probe_memory_block_size(unsigned long node, const char *uname,
580591
*/
581592
compatible = of_get_flat_dt_prop(node, "compatible", NULL);
582593
if (compatible && !strcmp(compatible, "ibm,coherent-device-memory")) {
583-
*block_size = SZ_256M;
584-
return 1;
594+
if (*block_size > SZ_256M)
595+
*block_size = SZ_256M;
596+
/*
597+
* We keep 256M as the upper limit with GPU present.
598+
*/
599+
return 0;
585600
}
586601
}
587602
/* continue looking for other memory device types */

arch/powerpc/xmon/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ ccflags-remove-$(CONFIG_FUNCTION_TRACER) += $(CC_FLAGS_FTRACE)
1212

1313
ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
1414

15+
# Clang stores addresses on the stack causing the frame size to blow
16+
# out. See https://github.com/ClangBuiltLinux/linux/issues/252
17+
ccflags-$(CONFIG_CC_IS_CLANG) += -Wframe-larger-than=4096
18+
1519
obj-y += xmon.o nonstdio.o spr_access.o xmon_bpts.o
1620

1721
ifdef CONFIG_XMON_DISASSEMBLY

0 commit comments

Comments
 (0)