Commit 5a55d36f authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'powerpc-5.9-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
 "Some more powerpc fixes for 5.9:

   - Opt us out of the DEBUG_VM_PGTABLE support for now as it's causing
     crashes.

   - Fix a long standing bug in our DMA mask handling that was hidden
     until recently, and which caused problems with some drivers.

   - Fix a boot failure on systems with large amounts of RAM, and no
     hugepage support and using Radix MMU, only seen in the lab.

   - A few other minor fixes.

  Thanks to Alexey Kardashevskiy, Aneesh Kumar K.V, Gautham R. Shenoy,
  Hari Bathini, Ira Weiny, Nick Desaulniers, Shirisha Ganta, Vaibhav
  Jain, and Vaidyanathan Srinivasan"

* tag 'powerpc-5.9-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/papr_scm: Limit the readability of 'perf_stats' sysfs attribute
  cpuidle: pseries: Fix CEDE latency conversion from tb to us
  powerpc/dma: Fix dma_map_ops::get_required_mask
  Revert "powerpc/build: vdso linker warning for orphan sections"
  powerpc/mm: Remove DEBUG_VM_PGTABLE support on powerpc
  selftests/powerpc: Skip PROT_SAO test in guests/LPARS
  powerpc/book3s64/radix: Fix boot failure with large amount of guest memory
parents 794a9965 0460534b
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
| nios2: | TODO | | nios2: | TODO |
| openrisc: | TODO | | openrisc: | TODO |
| parisc: | TODO | | parisc: | TODO |
| powerpc: | ok | | powerpc: | TODO |
| riscv: | ok | | riscv: | ok |
| s390: | ok | | s390: | ok |
| sh: | TODO | | sh: | TODO |
......
...@@ -116,7 +116,6 @@ config PPC ...@@ -116,7 +116,6 @@ config PPC
# #
select ARCH_32BIT_OFF_T if PPC32 select ARCH_32BIT_OFF_T if PPC32
select ARCH_HAS_DEBUG_VIRTUAL select ARCH_HAS_DEBUG_VIRTUAL
select ARCH_HAS_DEBUG_VM_PGTABLE
select ARCH_HAS_DEVMEM_IS_ALLOWED select ARCH_HAS_DEVMEM_IS_ALLOWED
select ARCH_HAS_ELF_RANDOMIZE select ARCH_HAS_ELF_RANDOMIZE
select ARCH_HAS_FORTIFY_SOURCE select ARCH_HAS_FORTIFY_SOURCE
......
...@@ -239,14 +239,14 @@ static inline void early_init_mmu_secondary(void) ...@@ -239,14 +239,14 @@ static inline void early_init_mmu_secondary(void)
extern void hash__setup_initial_memory_limit(phys_addr_t first_memblock_base, extern void hash__setup_initial_memory_limit(phys_addr_t first_memblock_base,
phys_addr_t first_memblock_size); phys_addr_t first_memblock_size);
extern void radix__setup_initial_memory_limit(phys_addr_t first_memblock_base,
phys_addr_t first_memblock_size);
static inline void setup_initial_memory_limit(phys_addr_t first_memblock_base, static inline void setup_initial_memory_limit(phys_addr_t first_memblock_base,
phys_addr_t first_memblock_size) phys_addr_t first_memblock_size)
{ {
if (early_radix_enabled()) /*
return radix__setup_initial_memory_limit(first_memblock_base, * Hash has more strict restrictions. At this point we don't
first_memblock_size); * know which translations we will pick. Hence go with hash
* restrictions.
*/
return hash__setup_initial_memory_limit(first_memblock_base, return hash__setup_initial_memory_limit(first_memblock_base,
first_memblock_size); first_memblock_size);
} }
......
...@@ -120,7 +120,8 @@ u64 dma_iommu_get_required_mask(struct device *dev) ...@@ -120,7 +120,8 @@ u64 dma_iommu_get_required_mask(struct device *dev)
if (!tbl) if (!tbl)
return 0; return 0;
mask = 1ULL < (fls_long(tbl->it_offset + tbl->it_size) - 1); mask = 1ULL << (fls_long(tbl->it_offset + tbl->it_size) +
tbl->it_page_shift - 1);
mask += mask - 1; mask += mask - 1;
return mask; return mask;
......
...@@ -50,7 +50,7 @@ $(obj-vdso32): %.o: %.S FORCE ...@@ -50,7 +50,7 @@ $(obj-vdso32): %.o: %.S FORCE
# actual build commands # actual build commands
quiet_cmd_vdso32ld = VDSO32L $@ quiet_cmd_vdso32ld = VDSO32L $@
cmd_vdso32ld = $(VDSOCC) $(c_flags) $(CC32FLAGS) -o $@ $(call cc-ldoption, -Wl$(comma)--orphan-handling=warn) -Wl,-T$(filter %.lds,$^) $(filter %.o,$^) cmd_vdso32ld = $(VDSOCC) $(c_flags) $(CC32FLAGS) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^)
quiet_cmd_vdso32as = VDSO32A $@ quiet_cmd_vdso32as = VDSO32A $@
cmd_vdso32as = $(VDSOCC) $(a_flags) $(CC32FLAGS) -c -o $@ $< cmd_vdso32as = $(VDSOCC) $(a_flags) $(CC32FLAGS) -c -o $@ $<
......
...@@ -111,7 +111,6 @@ SECTIONS ...@@ -111,7 +111,6 @@ SECTIONS
*(.note.GNU-stack) *(.note.GNU-stack)
*(.data .data.* .gnu.linkonce.d.* .sdata*) *(.data .data.* .gnu.linkonce.d.* .sdata*)
*(.bss .sbss .dynbss .dynsbss) *(.bss .sbss .dynbss .dynsbss)
*(.glink .iplt .plt .rela*)
} }
} }
......
...@@ -34,7 +34,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE ...@@ -34,7 +34,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
# actual build commands # actual build commands
quiet_cmd_vdso64ld = VDSO64L $@ quiet_cmd_vdso64ld = VDSO64L $@
cmd_vdso64ld = $(CC) $(c_flags) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^) $(call cc-ldoption, -Wl$(comma)--orphan-handling=warn) cmd_vdso64ld = $(CC) $(c_flags) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^)
# install commands for the unstripped file # install commands for the unstripped file
quiet_cmd_vdso_install = INSTALL $@ quiet_cmd_vdso_install = INSTALL $@
......
...@@ -30,7 +30,7 @@ SECTIONS ...@@ -30,7 +30,7 @@ SECTIONS
. = ALIGN(16); . = ALIGN(16);
.text : { .text : {
*(.text .stub .text.* .gnu.linkonce.t.* __ftr_alt_*) *(.text .stub .text.* .gnu.linkonce.t.* __ftr_alt_*)
*(.sfpr) *(.sfpr .glink)
} :text } :text
PROVIDE(__etext = .); PROVIDE(__etext = .);
PROVIDE(_etext = .); PROVIDE(_etext = .);
...@@ -111,7 +111,6 @@ SECTIONS ...@@ -111,7 +111,6 @@ SECTIONS
*(.branch_lt) *(.branch_lt)
*(.data .data.* .gnu.linkonce.d.* .sdata*) *(.data .data.* .gnu.linkonce.d.* .sdata*)
*(.bss .sbss .dynbss .dynsbss) *(.bss .sbss .dynbss .dynsbss)
*(.glink .iplt .plt .rela*)
} }
} }
......
...@@ -734,21 +734,6 @@ void radix__mmu_cleanup_all(void) ...@@ -734,21 +734,6 @@ void radix__mmu_cleanup_all(void)
} }
} }
void radix__setup_initial_memory_limit(phys_addr_t first_memblock_base,
phys_addr_t first_memblock_size)
{
/*
* We don't currently support the first MEMBLOCK not mapping 0
* physical on those processors
*/
BUG_ON(first_memblock_base != 0);
/*
* Radix mode is not limited by RMA / VRMA addressing.
*/
ppc64_rma_size = ULONG_MAX;
}
#ifdef CONFIG_MEMORY_HOTPLUG #ifdef CONFIG_MEMORY_HOTPLUG
static void free_pte_table(pte_t *pte_start, pmd_t *pmd) static void free_pte_table(pte_t *pte_start, pmd_t *pmd)
{ {
......
...@@ -433,9 +433,16 @@ void __init mmu_early_init_devtree(void) ...@@ -433,9 +433,16 @@ void __init mmu_early_init_devtree(void)
if (!(mfmsr() & MSR_HV)) if (!(mfmsr() & MSR_HV))
early_check_vec5(); early_check_vec5();
if (early_radix_enabled()) if (early_radix_enabled()) {
radix__early_init_devtree(); radix__early_init_devtree();
else /*
* We have finalized the translation we are going to use by now.
* Radix mode is not limited by RMA / VRMA addressing.
* Hence don't limit memblock allocations.
*/
ppc64_rma_size = ULONG_MAX;
memblock_set_current_limit(MEMBLOCK_ALLOC_ANYWHERE);
} else
hash__early_init_devtree(); hash__early_init_devtree();
} }
#endif /* CONFIG_PPC_BOOK3S_64 */ #endif /* CONFIG_PPC_BOOK3S_64 */
...@@ -822,7 +822,7 @@ static ssize_t perf_stats_show(struct device *dev, ...@@ -822,7 +822,7 @@ static ssize_t perf_stats_show(struct device *dev,
kfree(stats); kfree(stats);
return rc ? rc : seq_buf_used(&s); return rc ? rc : seq_buf_used(&s);
} }
DEVICE_ATTR_RO(perf_stats); DEVICE_ATTR_ADMIN_RO(perf_stats);
static ssize_t flags_show(struct device *dev, static ssize_t flags_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
......
...@@ -361,7 +361,10 @@ static void __init fixup_cede0_latency(void) ...@@ -361,7 +361,10 @@ static void __init fixup_cede0_latency(void)
for (i = 0; i < nr_xcede_records; i++) { for (i = 0; i < nr_xcede_records; i++) {
struct xcede_latency_record *record = &payload->records[i]; struct xcede_latency_record *record = &payload->records[i];
u64 latency_tb = be64_to_cpu(record->latency_ticks); u64 latency_tb = be64_to_cpu(record->latency_ticks);
u64 latency_us = tb_to_ns(latency_tb) / NSEC_PER_USEC; u64 latency_us = DIV_ROUND_UP_ULL(tb_to_ns(latency_tb), NSEC_PER_USEC);
if (latency_us == 0)
pr_warn("cpuidle: xcede record %d has an unrealistic latency of 0us.\n", i);
if (latency_us < min_latency_us) if (latency_us < min_latency_us)
min_latency_us = latency_us; min_latency_us = latency_us;
...@@ -378,10 +381,14 @@ static void __init fixup_cede0_latency(void) ...@@ -378,10 +381,14 @@ static void __init fixup_cede0_latency(void)
* Perform the fix-up. * Perform the fix-up.
*/ */
if (min_latency_us < dedicated_states[1].exit_latency) { if (min_latency_us < dedicated_states[1].exit_latency) {
u64 cede0_latency = min_latency_us - 1; /*
* We set a minimum of 1us wakeup latency for cede0 to
* distinguish it from snooze
*/
u64 cede0_latency = 1;
if (cede0_latency <= 0) if (min_latency_us > cede0_latency)
cede0_latency = min_latency_us; cede0_latency = min_latency_us - 1;
dedicated_states[1].exit_latency = cede0_latency; dedicated_states[1].exit_latency = cede0_latency;
dedicated_states[1].target_residency = 10 * (cede0_latency); dedicated_states[1].target_residency = 10 * (cede0_latency);
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <unistd.h>
#include <asm/cputable.h> #include <asm/cputable.h>
...@@ -18,9 +19,13 @@ int test_prot_sao(void) ...@@ -18,9 +19,13 @@ int test_prot_sao(void)
{ {
char *p; char *p;
/* SAO was introduced in 2.06 and removed in 3.1 */ /*
* SAO was introduced in 2.06 and removed in 3.1. It's disabled in
* guests/LPARs by default, so also skip if we are running in a guest.
*/
SKIP_IF(!have_hwcap(PPC_FEATURE_ARCH_2_06) || SKIP_IF(!have_hwcap(PPC_FEATURE_ARCH_2_06) ||
have_hwcap2(PPC_FEATURE2_ARCH_3_1)); have_hwcap2(PPC_FEATURE2_ARCH_3_1) ||
access("/proc/device-tree/rtas/ibm,hypertas-functions", F_OK) == 0);
/* /*
* Ensure we can ask for PROT_SAO. * Ensure we can ask for PROT_SAO.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment