Skip to content

Commit

Permalink
Automatic merge of 'next-test' into merge-test (2023-08-31 11:23)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpe committed Aug 31, 2023
2 parents 0157225 + 90bae4d commit bf6a2a9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
27 changes: 21 additions & 6 deletions arch/powerpc/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,12 +494,23 @@ static int __init dt_scan_mmu_pid_width(unsigned long node,
return 1;
}

/*
* Outside hotplug the kernel uses this value to map the kernel direct map
* with radix. To be compatible with older kernels, let's keep this value
* as 16M which is also SECTION_SIZE with SPARSEMEM. We can ideally map
* things with 1GB size in the case where we don't support hotplug.
*/
#ifndef CONFIG_MEMORY_HOTPLUG
#define DEFAULT_MEMORY_BLOCK_SIZE SZ_16M
#else
#define DEFAULT_MEMORY_BLOCK_SIZE MIN_MEMORY_BLOCK_SIZE
#endif

static void update_memory_block_size(unsigned long *block_size, unsigned long mem_size)
{
unsigned long section_size = 1UL << SECTION_SIZE_BITS;

for (; *block_size > section_size; *block_size >>= 2) {
unsigned long min_memory_block_size = DEFAULT_MEMORY_BLOCK_SIZE;

for (; *block_size > min_memory_block_size; *block_size >>= 2) {
if ((mem_size & *block_size) == 0)
break;
}
Expand Down Expand Up @@ -529,7 +540,7 @@ static int __init probe_memory_block_size(unsigned long node, const char *uname,
/*
* Nothing in the device tree
*/
*block_size = MIN_MEMORY_BLOCK_SIZE;
*block_size = DEFAULT_MEMORY_BLOCK_SIZE;
else
*block_size = of_read_number(prop, dt_root_size_cells);
/*
Expand Down Expand Up @@ -580,8 +591,12 @@ static int __init probe_memory_block_size(unsigned long node, const char *uname,
*/
compatible = of_get_flat_dt_prop(node, "compatible", NULL);
if (compatible && !strcmp(compatible, "ibm,coherent-device-memory")) {
*block_size = SZ_256M;
return 1;
if (*block_size > SZ_256M)
*block_size = SZ_256M;
/*
* We keep 256M as the upper limit with GPU present.
*/
return 0;
}
}
/* continue looking for other memory device types */
Expand Down
4 changes: 4 additions & 0 deletions arch/powerpc/xmon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ ccflags-remove-$(CONFIG_FUNCTION_TRACER) += $(CC_FLAGS_FTRACE)

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

# Clang stores addresses on the stack causing the frame size to blow
# out. See https://github.com/ClangBuiltLinux/linux/issues/252
ccflags-$(CONFIG_CC_IS_CLANG) += -Wframe-larger-than=4096

obj-y += xmon.o nonstdio.o spr_access.o xmon_bpts.o

ifdef CONFIG_XMON_DISASSEMBLY
Expand Down

0 comments on commit bf6a2a9

Please sign in to comment.