diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-06-09 12:44:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-06-09 12:44:46 -0400 |
commit | a92f63cd13776e35d3ccb63187d1d95ab16f24a5 (patch) | |
tree | 0f0e8ca8177df725fd738e7fe8db0e32cefdc388 | |
parent | 788a73f4e5c8f606a500a6c3fa35c6d9b2cd9979 (diff) | |
parent | c6ee9619e2edd9912316f7e2eaf9ffa14fafe9f9 (diff) |
Merge tag 'powerpc-4.12-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman:
"Mostly fairly minor, of note are:
- Fix percpu allocations to be NUMA aware
- Limit 4k page size config to 64TB virtual address space
- Avoid needlessly restoring FP and vector registers
Thanks to Aneesh Kumar K.V, Breno Leitao, Christophe Leroy, Frederic
Barrat, Madhavan Srinivasan, Michael Bringmann, Nicholas Piggin,
Vaibhav Jain"
* tag 'powerpc-4.12-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/book3s64: Move PPC_DT_CPU_FTRs and enable it by default
powerpc/mm/4k: Limit 4k page size config to 64TB virtual address space
cxl: Fix error path on bad ioctl
powerpc/perf: Fix Power9 test_adder fields
powerpc/numa: Fix percpu allocations to be NUMA aware
cxl: Avoid double free_irq() for psl,slice interrupts
powerpc/kernel: Initialize load_tm on task creation
powerpc/kernel: Fix FP and vector register restoration
powerpc/64: Reclaim CPU_FTR_SUBCORE
powerpc/hotplug-mem: Fix missing endian conversion of aa_index
powerpc/sysdev/simple_gpio: Fix oops in gpio save_regs function
powerpc/spufs: Fix coredump of SPU contexts
powerpc/64s: Add dt_cpu_ftrs boot time setup option
-rw-r--r-- | Documentation/admin-guide/kernel-parameters.txt | 9 | ||||
-rw-r--r-- | arch/powerpc/Kconfig | 16 | ||||
-rw-r--r-- | arch/powerpc/include/asm/book3s/64/hash-4k.h | 2 | ||||
-rw-r--r-- | arch/powerpc/include/asm/cputable.h | 3 | ||||
-rw-r--r-- | arch/powerpc/include/asm/processor.h | 25 | ||||
-rw-r--r-- | arch/powerpc/include/asm/topology.h | 14 | ||||
-rw-r--r-- | arch/powerpc/kernel/dt_cpu_ftrs.c | 58 | ||||
-rw-r--r-- | arch/powerpc/kernel/process.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup-common.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup_64.c | 4 | ||||
-rw-r--r-- | arch/powerpc/mm/mmu_context_book3s64.c | 2 | ||||
-rw-r--r-- | arch/powerpc/perf/power9-pmu.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/Kconfig | 11 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/coredump.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/subcore.c | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/hotplug-memory.c | 2 | ||||
-rw-r--r-- | arch/powerpc/sysdev/simple_gpio.c | 3 | ||||
-rw-r--r-- | drivers/misc/cxl/file.c | 7 | ||||
-rw-r--r-- | drivers/misc/cxl/native.c | 14 |
19 files changed, 131 insertions, 58 deletions
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 15f79c27748d..0f5c3b4347c6 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt | |||
@@ -866,6 +866,15 @@ | |||
866 | 866 | ||
867 | dscc4.setup= [NET] | 867 | dscc4.setup= [NET] |
868 | 868 | ||
869 | dt_cpu_ftrs= [PPC] | ||
870 | Format: {"off" | "known"} | ||
871 | Control how the dt_cpu_ftrs device-tree binding is | ||
872 | used for CPU feature discovery and setup (if it | ||
873 | exists). | ||
874 | off: Do not use it, fall back to legacy cpu table. | ||
875 | known: Do not pass through unknown features to guests | ||
876 | or userspace, only those that the kernel is aware of. | ||
877 | |||
869 | dump_apple_properties [X86] | 878 | dump_apple_properties [X86] |
870 | Dump name and content of EFI device properties on | 879 | Dump name and content of EFI device properties on |
871 | x86 Macs. Useful for driver authors to determine | 880 | x86 Macs. Useful for driver authors to determine |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index f7c8f9972f61..964da1891ea9 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -380,22 +380,6 @@ source "arch/powerpc/platforms/Kconfig" | |||
380 | 380 | ||
381 | menu "Kernel options" | 381 | menu "Kernel options" |
382 | 382 | ||
383 | config PPC_DT_CPU_FTRS | ||
384 | bool "Device-tree based CPU feature discovery & setup" | ||
385 | depends on PPC_BOOK3S_64 | ||
386 | default n | ||
387 | help | ||
388 | This enables code to use a new device tree binding for describing CPU | ||
389 | compatibility and features. Saying Y here will attempt to use the new | ||
390 | binding if the firmware provides it. Currently only the skiboot | ||
391 | firmware provides this binding. | ||
392 | If you're not sure say Y. | ||
393 | |||
394 | config PPC_CPUFEATURES_ENABLE_UNKNOWN | ||
395 | bool "cpufeatures pass through unknown features to guest/userspace" | ||
396 | depends on PPC_DT_CPU_FTRS | ||
397 | default y | ||
398 | |||
399 | config HIGHMEM | 383 | config HIGHMEM |
400 | bool "High memory support" | 384 | bool "High memory support" |
401 | depends on PPC32 | 385 | depends on PPC32 |
diff --git a/arch/powerpc/include/asm/book3s/64/hash-4k.h b/arch/powerpc/include/asm/book3s/64/hash-4k.h index b4b5e6b671ca..0c4e470571ca 100644 --- a/arch/powerpc/include/asm/book3s/64/hash-4k.h +++ b/arch/powerpc/include/asm/book3s/64/hash-4k.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #define H_PTE_INDEX_SIZE 9 | 8 | #define H_PTE_INDEX_SIZE 9 |
9 | #define H_PMD_INDEX_SIZE 7 | 9 | #define H_PMD_INDEX_SIZE 7 |
10 | #define H_PUD_INDEX_SIZE 9 | 10 | #define H_PUD_INDEX_SIZE 9 |
11 | #define H_PGD_INDEX_SIZE 12 | 11 | #define H_PGD_INDEX_SIZE 9 |
12 | 12 | ||
13 | #ifndef __ASSEMBLY__ | 13 | #ifndef __ASSEMBLY__ |
14 | #define H_PTE_TABLE_SIZE (sizeof(pte_t) << H_PTE_INDEX_SIZE) | 14 | #define H_PTE_TABLE_SIZE (sizeof(pte_t) << H_PTE_INDEX_SIZE) |
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h index c2d509584a98..d02ad93bf708 100644 --- a/arch/powerpc/include/asm/cputable.h +++ b/arch/powerpc/include/asm/cputable.h | |||
@@ -214,7 +214,6 @@ enum { | |||
214 | #define CPU_FTR_DAWR LONG_ASM_CONST(0x0400000000000000) | 214 | #define CPU_FTR_DAWR LONG_ASM_CONST(0x0400000000000000) |
215 | #define CPU_FTR_DABRX LONG_ASM_CONST(0x0800000000000000) | 215 | #define CPU_FTR_DABRX LONG_ASM_CONST(0x0800000000000000) |
216 | #define CPU_FTR_PMAO_BUG LONG_ASM_CONST(0x1000000000000000) | 216 | #define CPU_FTR_PMAO_BUG LONG_ASM_CONST(0x1000000000000000) |
217 | #define CPU_FTR_SUBCORE LONG_ASM_CONST(0x2000000000000000) | ||
218 | #define CPU_FTR_POWER9_DD1 LONG_ASM_CONST(0x4000000000000000) | 217 | #define CPU_FTR_POWER9_DD1 LONG_ASM_CONST(0x4000000000000000) |
219 | 218 | ||
220 | #ifndef __ASSEMBLY__ | 219 | #ifndef __ASSEMBLY__ |
@@ -463,7 +462,7 @@ enum { | |||
463 | CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ | 462 | CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ |
464 | CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \ | 463 | CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \ |
465 | CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_DAWR | \ | 464 | CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_DAWR | \ |
466 | CPU_FTR_ARCH_207S | CPU_FTR_TM_COMP | CPU_FTR_SUBCORE) | 465 | CPU_FTR_ARCH_207S | CPU_FTR_TM_COMP) |
467 | #define CPU_FTRS_POWER8E (CPU_FTRS_POWER8 | CPU_FTR_PMAO_BUG) | 466 | #define CPU_FTRS_POWER8E (CPU_FTRS_POWER8 | CPU_FTR_PMAO_BUG) |
468 | #define CPU_FTRS_POWER8_DD1 (CPU_FTRS_POWER8 & ~CPU_FTR_DBELL) | 467 | #define CPU_FTRS_POWER8_DD1 (CPU_FTRS_POWER8 & ~CPU_FTR_DBELL) |
469 | #define CPU_FTRS_POWER9 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ | 468 | #define CPU_FTRS_POWER9 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ |
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h index a2123f291ab0..bb99b651085a 100644 --- a/arch/powerpc/include/asm/processor.h +++ b/arch/powerpc/include/asm/processor.h | |||
@@ -110,13 +110,18 @@ void release_thread(struct task_struct *); | |||
110 | #define TASK_SIZE_128TB (0x0000800000000000UL) | 110 | #define TASK_SIZE_128TB (0x0000800000000000UL) |
111 | #define TASK_SIZE_512TB (0x0002000000000000UL) | 111 | #define TASK_SIZE_512TB (0x0002000000000000UL) |
112 | 112 | ||
113 | #ifdef CONFIG_PPC_BOOK3S_64 | 113 | /* |
114 | * For now 512TB is only supported with book3s and 64K linux page size. | ||
115 | */ | ||
116 | #if defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_PPC_64K_PAGES) | ||
114 | /* | 117 | /* |
115 | * Max value currently used: | 118 | * Max value currently used: |
116 | */ | 119 | */ |
117 | #define TASK_SIZE_USER64 TASK_SIZE_512TB | 120 | #define TASK_SIZE_USER64 TASK_SIZE_512TB |
121 | #define DEFAULT_MAP_WINDOW_USER64 TASK_SIZE_128TB | ||
118 | #else | 122 | #else |
119 | #define TASK_SIZE_USER64 TASK_SIZE_64TB | 123 | #define TASK_SIZE_USER64 TASK_SIZE_64TB |
124 | #define DEFAULT_MAP_WINDOW_USER64 TASK_SIZE_64TB | ||
120 | #endif | 125 | #endif |
121 | 126 | ||
122 | /* | 127 | /* |
@@ -132,7 +137,7 @@ void release_thread(struct task_struct *); | |||
132 | * space during mmap's. | 137 | * space during mmap's. |
133 | */ | 138 | */ |
134 | #define TASK_UNMAPPED_BASE_USER32 (PAGE_ALIGN(TASK_SIZE_USER32 / 4)) | 139 | #define TASK_UNMAPPED_BASE_USER32 (PAGE_ALIGN(TASK_SIZE_USER32 / 4)) |
135 | #define TASK_UNMAPPED_BASE_USER64 (PAGE_ALIGN(TASK_SIZE_128TB / 4)) | 140 | #define TASK_UNMAPPED_BASE_USER64 (PAGE_ALIGN(DEFAULT_MAP_WINDOW_USER64 / 4)) |
136 | 141 | ||
137 | #define TASK_UNMAPPED_BASE ((is_32bit_task()) ? \ | 142 | #define TASK_UNMAPPED_BASE ((is_32bit_task()) ? \ |
138 | TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64 ) | 143 | TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64 ) |
@@ -143,21 +148,15 @@ void release_thread(struct task_struct *); | |||
143 | * with 128TB and conditionally enable upto 512TB | 148 | * with 128TB and conditionally enable upto 512TB |
144 | */ | 149 | */ |
145 | #ifdef CONFIG_PPC_BOOK3S_64 | 150 | #ifdef CONFIG_PPC_BOOK3S_64 |
146 | #define DEFAULT_MAP_WINDOW ((is_32bit_task()) ? \ | 151 | #define DEFAULT_MAP_WINDOW ((is_32bit_task()) ? \ |
147 | TASK_SIZE_USER32 : TASK_SIZE_128TB) | 152 | TASK_SIZE_USER32 : DEFAULT_MAP_WINDOW_USER64) |
148 | #else | 153 | #else |
149 | #define DEFAULT_MAP_WINDOW TASK_SIZE | 154 | #define DEFAULT_MAP_WINDOW TASK_SIZE |
150 | #endif | 155 | #endif |
151 | 156 | ||
152 | #ifdef __powerpc64__ | 157 | #ifdef __powerpc64__ |
153 | 158 | ||
154 | #ifdef CONFIG_PPC_BOOK3S_64 | 159 | #define STACK_TOP_USER64 DEFAULT_MAP_WINDOW_USER64 |
155 | /* Limit stack to 128TB */ | ||
156 | #define STACK_TOP_USER64 TASK_SIZE_128TB | ||
157 | #else | ||
158 | #define STACK_TOP_USER64 TASK_SIZE_USER64 | ||
159 | #endif | ||
160 | |||
161 | #define STACK_TOP_USER32 TASK_SIZE_USER32 | 160 | #define STACK_TOP_USER32 TASK_SIZE_USER32 |
162 | 161 | ||
163 | #define STACK_TOP (is_32bit_task() ? \ | 162 | #define STACK_TOP (is_32bit_task() ? \ |
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h index 8b3b46b7b0f2..329771559cbb 100644 --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h | |||
@@ -44,8 +44,22 @@ extern void __init dump_numa_cpu_topology(void); | |||
44 | extern int sysfs_add_device_to_node(struct device *dev, int nid); | 44 | extern int sysfs_add_device_to_node(struct device *dev, int nid); |
45 | extern void sysfs_remove_device_from_node(struct device *dev, int nid); | 45 | extern void sysfs_remove_device_from_node(struct device *dev, int nid); |
46 | 46 | ||
47 | static inline int early_cpu_to_node(int cpu) | ||
48 | { | ||
49 | int nid; | ||
50 | |||
51 | nid = numa_cpu_lookup_table[cpu]; | ||
52 | |||
53 | /* | ||
54 | * Fall back to node 0 if nid is unset (it should be, except bugs). | ||
55 | * This allows callers to safely do NODE_DATA(early_cpu_to_node(cpu)). | ||
56 | */ | ||
57 | return (nid < 0) ? 0 : nid; | ||
58 | } | ||
47 | #else | 59 | #else |
48 | 60 | ||
61 | static inline int early_cpu_to_node(int cpu) { return 0; } | ||
62 | |||
49 | static inline void dump_numa_cpu_topology(void) {} | 63 | static inline void dump_numa_cpu_topology(void) {} |
50 | 64 | ||
51 | static inline int sysfs_add_device_to_node(struct device *dev, int nid) | 65 | static inline int sysfs_add_device_to_node(struct device *dev, int nid) |
diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c b/arch/powerpc/kernel/dt_cpu_ftrs.c index fcc7588a96d6..4c7656dc4e04 100644 --- a/arch/powerpc/kernel/dt_cpu_ftrs.c +++ b/arch/powerpc/kernel/dt_cpu_ftrs.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/export.h> | 8 | #include <linux/export.h> |
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/jump_label.h> | 10 | #include <linux/jump_label.h> |
11 | #include <linux/libfdt.h> | ||
11 | #include <linux/memblock.h> | 12 | #include <linux/memblock.h> |
12 | #include <linux/printk.h> | 13 | #include <linux/printk.h> |
13 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
@@ -642,7 +643,6 @@ static struct dt_cpu_feature_match __initdata | |||
642 | {"processor-control-facility", feat_enable_dbell, CPU_FTR_DBELL}, | 643 | {"processor-control-facility", feat_enable_dbell, CPU_FTR_DBELL}, |
643 | {"processor-control-facility-v3", feat_enable_dbell, CPU_FTR_DBELL}, | 644 | {"processor-control-facility-v3", feat_enable_dbell, CPU_FTR_DBELL}, |
644 | {"processor-utilization-of-resources-register", feat_enable_purr, 0}, | 645 | {"processor-utilization-of-resources-register", feat_enable_purr, 0}, |
645 | {"subcore", feat_enable, CPU_FTR_SUBCORE}, | ||
646 | {"no-execute", feat_enable, 0}, | 646 | {"no-execute", feat_enable, 0}, |
647 | {"strong-access-ordering", feat_enable, CPU_FTR_SAO}, | 647 | {"strong-access-ordering", feat_enable, CPU_FTR_SAO}, |
648 | {"cache-inhibited-large-page", feat_enable_large_ci, 0}, | 648 | {"cache-inhibited-large-page", feat_enable_large_ci, 0}, |
@@ -671,12 +671,24 @@ static struct dt_cpu_feature_match __initdata | |||
671 | {"wait-v3", feat_enable, 0}, | 671 | {"wait-v3", feat_enable, 0}, |
672 | }; | 672 | }; |
673 | 673 | ||
674 | /* XXX: how to configure this? Default + boot time? */ | 674 | static bool __initdata using_dt_cpu_ftrs; |
675 | #ifdef CONFIG_PPC_CPUFEATURES_ENABLE_UNKNOWN | 675 | static bool __initdata enable_unknown = true; |
676 | #define CPU_FEATURE_ENABLE_UNKNOWN 1 | 676 | |
677 | #else | 677 | static int __init dt_cpu_ftrs_parse(char *str) |
678 | #define CPU_FEATURE_ENABLE_UNKNOWN 0 | 678 | { |
679 | #endif | 679 | if (!str) |
680 | return 0; | ||
681 | |||
682 | if (!strcmp(str, "off")) | ||
683 | using_dt_cpu_ftrs = false; | ||
684 | else if (!strcmp(str, "known")) | ||
685 | enable_unknown = false; | ||
686 | else | ||
687 | return 1; | ||
688 | |||
689 | return 0; | ||
690 | } | ||
691 | early_param("dt_cpu_ftrs", dt_cpu_ftrs_parse); | ||
680 | 692 | ||
681 | static void __init cpufeatures_setup_start(u32 isa) | 693 | static void __init cpufeatures_setup_start(u32 isa) |
682 | { | 694 | { |
@@ -707,7 +719,7 @@ static bool __init cpufeatures_process_feature(struct dt_cpu_feature *f) | |||
707 | } | 719 | } |
708 | } | 720 | } |
709 | 721 | ||
710 | if (!known && CPU_FEATURE_ENABLE_UNKNOWN) { | 722 | if (!known && enable_unknown) { |
711 | if (!feat_try_enable_unknown(f)) { | 723 | if (!feat_try_enable_unknown(f)) { |
712 | pr_info("not enabling: %s (unknown and unsupported by kernel)\n", | 724 | pr_info("not enabling: %s (unknown and unsupported by kernel)\n", |
713 | f->name); | 725 | f->name); |
@@ -756,6 +768,26 @@ static void __init cpufeatures_setup_finished(void) | |||
756 | cur_cpu_spec->cpu_features, cur_cpu_spec->mmu_features); | 768 | cur_cpu_spec->cpu_features, cur_cpu_spec->mmu_features); |
757 | } | 769 | } |
758 | 770 | ||
771 | static int __init disabled_on_cmdline(void) | ||
772 | { | ||
773 | unsigned long root, chosen; | ||
774 | const char *p; | ||
775 | |||
776 | root = of_get_flat_dt_root(); | ||
777 | chosen = of_get_flat_dt_subnode_by_name(root, "chosen"); | ||
778 | if (chosen == -FDT_ERR_NOTFOUND) | ||
779 | return false; | ||
780 | |||
781 | p = of_get_flat_dt_prop(chosen, "bootargs", NULL); | ||
782 | if (!p) | ||
783 | return false; | ||
784 | |||
785 | if (strstr(p, "dt_cpu_ftrs=off")) | ||
786 | return true; | ||
787 | |||
788 | return false; | ||
789 | } | ||
790 | |||
759 | static int __init fdt_find_cpu_features(unsigned long node, const char *uname, | 791 | static int __init fdt_find_cpu_features(unsigned long node, const char *uname, |
760 | int depth, void *data) | 792 | int depth, void *data) |
761 | { | 793 | { |
@@ -766,8 +798,6 @@ static int __init fdt_find_cpu_features(unsigned long node, const char *uname, | |||
766 | return 0; | 798 | return 0; |
767 | } | 799 | } |
768 | 800 | ||
769 | static bool __initdata using_dt_cpu_ftrs = false; | ||
770 | |||
771 | bool __init dt_cpu_ftrs_in_use(void) | 801 | bool __init dt_cpu_ftrs_in_use(void) |
772 | { | 802 | { |
773 | return using_dt_cpu_ftrs; | 803 | return using_dt_cpu_ftrs; |
@@ -775,6 +805,8 @@ bool __init dt_cpu_ftrs_in_use(void) | |||
775 | 805 | ||
776 | bool __init dt_cpu_ftrs_init(void *fdt) | 806 | bool __init dt_cpu_ftrs_init(void *fdt) |
777 | { | 807 | { |
808 | using_dt_cpu_ftrs = false; | ||
809 | |||
778 | /* Setup and verify the FDT, if it fails we just bail */ | 810 | /* Setup and verify the FDT, if it fails we just bail */ |
779 | if (!early_init_dt_verify(fdt)) | 811 | if (!early_init_dt_verify(fdt)) |
780 | return false; | 812 | return false; |
@@ -782,6 +814,9 @@ bool __init dt_cpu_ftrs_init(void *fdt) | |||
782 | if (!of_scan_flat_dt(fdt_find_cpu_features, NULL)) | 814 | if (!of_scan_flat_dt(fdt_find_cpu_features, NULL)) |
783 | return false; | 815 | return false; |
784 | 816 | ||
817 | if (disabled_on_cmdline()) | ||
818 | return false; | ||
819 | |||
785 | cpufeatures_setup_cpu(); | 820 | cpufeatures_setup_cpu(); |
786 | 821 | ||
787 | using_dt_cpu_ftrs = true; | 822 | using_dt_cpu_ftrs = true; |
@@ -1027,5 +1062,8 @@ static int __init dt_cpu_ftrs_scan_callback(unsigned long node, const char | |||
1027 | 1062 | ||
1028 | void __init dt_cpu_ftrs_scan(void) | 1063 | void __init dt_cpu_ftrs_scan(void) |
1029 | { | 1064 | { |
1065 | if (!using_dt_cpu_ftrs) | ||
1066 | return; | ||
1067 | |||
1030 | of_scan_flat_dt(dt_cpu_ftrs_scan_callback, NULL); | 1068 | of_scan_flat_dt(dt_cpu_ftrs_scan_callback, NULL); |
1031 | } | 1069 | } |
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index baae104b16c7..2ad725ef4368 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -1666,6 +1666,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp) | |||
1666 | #ifdef CONFIG_VSX | 1666 | #ifdef CONFIG_VSX |
1667 | current->thread.used_vsr = 0; | 1667 | current->thread.used_vsr = 0; |
1668 | #endif | 1668 | #endif |
1669 | current->thread.load_fp = 0; | ||
1669 | memset(¤t->thread.fp_state, 0, sizeof(current->thread.fp_state)); | 1670 | memset(¤t->thread.fp_state, 0, sizeof(current->thread.fp_state)); |
1670 | current->thread.fp_save_area = NULL; | 1671 | current->thread.fp_save_area = NULL; |
1671 | #ifdef CONFIG_ALTIVEC | 1672 | #ifdef CONFIG_ALTIVEC |
@@ -1674,6 +1675,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp) | |||
1674 | current->thread.vr_save_area = NULL; | 1675 | current->thread.vr_save_area = NULL; |
1675 | current->thread.vrsave = 0; | 1676 | current->thread.vrsave = 0; |
1676 | current->thread.used_vr = 0; | 1677 | current->thread.used_vr = 0; |
1678 | current->thread.load_vec = 0; | ||
1677 | #endif /* CONFIG_ALTIVEC */ | 1679 | #endif /* CONFIG_ALTIVEC */ |
1678 | #ifdef CONFIG_SPE | 1680 | #ifdef CONFIG_SPE |
1679 | memset(current->thread.evr, 0, sizeof(current->thread.evr)); | 1681 | memset(current->thread.evr, 0, sizeof(current->thread.evr)); |
@@ -1685,6 +1687,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp) | |||
1685 | current->thread.tm_tfhar = 0; | 1687 | current->thread.tm_tfhar = 0; |
1686 | current->thread.tm_texasr = 0; | 1688 | current->thread.tm_texasr = 0; |
1687 | current->thread.tm_tfiar = 0; | 1689 | current->thread.tm_tfiar = 0; |
1690 | current->thread.load_tm = 0; | ||
1688 | #endif /* CONFIG_PPC_TRANSACTIONAL_MEM */ | 1691 | #endif /* CONFIG_PPC_TRANSACTIONAL_MEM */ |
1689 | } | 1692 | } |
1690 | EXPORT_SYMBOL(start_thread); | 1693 | EXPORT_SYMBOL(start_thread); |
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 71dcda91755d..857129acf960 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -928,7 +928,7 @@ void __init setup_arch(char **cmdline_p) | |||
928 | 928 | ||
929 | #ifdef CONFIG_PPC_MM_SLICES | 929 | #ifdef CONFIG_PPC_MM_SLICES |
930 | #ifdef CONFIG_PPC64 | 930 | #ifdef CONFIG_PPC64 |
931 | init_mm.context.addr_limit = TASK_SIZE_128TB; | 931 | init_mm.context.addr_limit = DEFAULT_MAP_WINDOW_USER64; |
932 | #else | 932 | #else |
933 | #error "context.addr_limit not initialized." | 933 | #error "context.addr_limit not initialized." |
934 | #endif | 934 | #endif |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index f35ff9dea4fb..a8c1f99e9607 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -661,7 +661,7 @@ void __init emergency_stack_init(void) | |||
661 | 661 | ||
662 | static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align) | 662 | static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align) |
663 | { | 663 | { |
664 | return __alloc_bootmem_node(NODE_DATA(cpu_to_node(cpu)), size, align, | 664 | return __alloc_bootmem_node(NODE_DATA(early_cpu_to_node(cpu)), size, align, |
665 | __pa(MAX_DMA_ADDRESS)); | 665 | __pa(MAX_DMA_ADDRESS)); |
666 | } | 666 | } |
667 | 667 | ||
@@ -672,7 +672,7 @@ static void __init pcpu_fc_free(void *ptr, size_t size) | |||
672 | 672 | ||
673 | static int pcpu_cpu_distance(unsigned int from, unsigned int to) | 673 | static int pcpu_cpu_distance(unsigned int from, unsigned int to) |
674 | { | 674 | { |
675 | if (cpu_to_node(from) == cpu_to_node(to)) | 675 | if (early_cpu_to_node(from) == early_cpu_to_node(to)) |
676 | return LOCAL_DISTANCE; | 676 | return LOCAL_DISTANCE; |
677 | else | 677 | else |
678 | return REMOTE_DISTANCE; | 678 | return REMOTE_DISTANCE; |
diff --git a/arch/powerpc/mm/mmu_context_book3s64.c b/arch/powerpc/mm/mmu_context_book3s64.c index c6dca2ae78ef..a3edf813d455 100644 --- a/arch/powerpc/mm/mmu_context_book3s64.c +++ b/arch/powerpc/mm/mmu_context_book3s64.c | |||
@@ -99,7 +99,7 @@ static int hash__init_new_context(struct mm_struct *mm) | |||
99 | * mm->context.addr_limit. Default to max task size so that we copy the | 99 | * mm->context.addr_limit. Default to max task size so that we copy the |
100 | * default values to paca which will help us to handle slb miss early. | 100 | * default values to paca which will help us to handle slb miss early. |
101 | */ | 101 | */ |
102 | mm->context.addr_limit = TASK_SIZE_128TB; | 102 | mm->context.addr_limit = DEFAULT_MAP_WINDOW_USER64; |
103 | 103 | ||
104 | /* | 104 | /* |
105 | * The old code would re-promote on fork, we don't do that when using | 105 | * The old code would re-promote on fork, we don't do that when using |
diff --git a/arch/powerpc/perf/power9-pmu.c b/arch/powerpc/perf/power9-pmu.c index 018f8e90ac35..bb28e1a41257 100644 --- a/arch/powerpc/perf/power9-pmu.c +++ b/arch/powerpc/perf/power9-pmu.c | |||
@@ -402,7 +402,7 @@ static struct power_pmu power9_isa207_pmu = { | |||
402 | .name = "POWER9", | 402 | .name = "POWER9", |
403 | .n_counter = MAX_PMU_COUNTERS, | 403 | .n_counter = MAX_PMU_COUNTERS, |
404 | .add_fields = ISA207_ADD_FIELDS, | 404 | .add_fields = ISA207_ADD_FIELDS, |
405 | .test_adder = ISA207_TEST_ADDER, | 405 | .test_adder = P9_DD1_TEST_ADDER, |
406 | .compute_mmcr = isa207_compute_mmcr, | 406 | .compute_mmcr = isa207_compute_mmcr, |
407 | .config_bhrb = power9_config_bhrb, | 407 | .config_bhrb = power9_config_bhrb, |
408 | .bhrb_filter_map = power9_bhrb_filter_map, | 408 | .bhrb_filter_map = power9_bhrb_filter_map, |
@@ -421,7 +421,7 @@ static struct power_pmu power9_pmu = { | |||
421 | .name = "POWER9", | 421 | .name = "POWER9", |
422 | .n_counter = MAX_PMU_COUNTERS, | 422 | .n_counter = MAX_PMU_COUNTERS, |
423 | .add_fields = ISA207_ADD_FIELDS, | 423 | .add_fields = ISA207_ADD_FIELDS, |
424 | .test_adder = P9_DD1_TEST_ADDER, | 424 | .test_adder = ISA207_TEST_ADDER, |
425 | .compute_mmcr = isa207_compute_mmcr, | 425 | .compute_mmcr = isa207_compute_mmcr, |
426 | .config_bhrb = power9_config_bhrb, | 426 | .config_bhrb = power9_config_bhrb, |
427 | .bhrb_filter_map = power9_bhrb_filter_map, | 427 | .bhrb_filter_map = power9_bhrb_filter_map, |
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index 33244e3d9375..4fd64d3f5c44 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig | |||
@@ -59,6 +59,17 @@ config PPC_OF_BOOT_TRAMPOLINE | |||
59 | 59 | ||
60 | In case of doubt, say Y | 60 | In case of doubt, say Y |
61 | 61 | ||
62 | config PPC_DT_CPU_FTRS | ||
63 | bool "Device-tree based CPU feature discovery & setup" | ||
64 | depends on PPC_BOOK3S_64 | ||
65 | default y | ||
66 | help | ||
67 | This enables code to use a new device tree binding for describing CPU | ||
68 | compatibility and features. Saying Y here will attempt to use the new | ||
69 | binding if the firmware provides it. Currently only the skiboot | ||
70 | firmware provides this binding. | ||
71 | If you're not sure say Y. | ||
72 | |||
62 | config UDBG_RTAS_CONSOLE | 73 | config UDBG_RTAS_CONSOLE |
63 | bool "RTAS based debug console" | 74 | bool "RTAS based debug console" |
64 | depends on PPC_RTAS | 75 | depends on PPC_RTAS |
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c index e5a891ae80ee..84b7ac926ce6 100644 --- a/arch/powerpc/platforms/cell/spufs/coredump.c +++ b/arch/powerpc/platforms/cell/spufs/coredump.c | |||
@@ -175,6 +175,8 @@ static int spufs_arch_write_note(struct spu_context *ctx, int i, | |||
175 | skip = roundup(cprm->pos - total + sz, 4) - cprm->pos; | 175 | skip = roundup(cprm->pos - total + sz, 4) - cprm->pos; |
176 | if (!dump_skip(cprm, skip)) | 176 | if (!dump_skip(cprm, skip)) |
177 | goto Eio; | 177 | goto Eio; |
178 | |||
179 | rc = 0; | ||
178 | out: | 180 | out: |
179 | free_page((unsigned long)buf); | 181 | free_page((unsigned long)buf); |
180 | return rc; | 182 | return rc; |
diff --git a/arch/powerpc/platforms/powernv/subcore.c b/arch/powerpc/platforms/powernv/subcore.c index 0babef11136f..8c6119280c13 100644 --- a/arch/powerpc/platforms/powernv/subcore.c +++ b/arch/powerpc/platforms/powernv/subcore.c | |||
@@ -407,7 +407,13 @@ static DEVICE_ATTR(subcores_per_core, 0644, | |||
407 | 407 | ||
408 | static int subcore_init(void) | 408 | static int subcore_init(void) |
409 | { | 409 | { |
410 | if (!cpu_has_feature(CPU_FTR_SUBCORE)) | 410 | unsigned pvr_ver; |
411 | |||
412 | pvr_ver = PVR_VER(mfspr(SPRN_PVR)); | ||
413 | |||
414 | if (pvr_ver != PVR_POWER8 && | ||
415 | pvr_ver != PVR_POWER8E && | ||
416 | pvr_ver != PVR_POWER8NVL) | ||
411 | return 0; | 417 | return 0; |
412 | 418 | ||
413 | /* | 419 | /* |
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index e104c71ea44a..1fb162ba9d1c 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c | |||
@@ -124,6 +124,7 @@ static struct property *dlpar_clone_drconf_property(struct device_node *dn) | |||
124 | for (i = 0; i < num_lmbs; i++) { | 124 | for (i = 0; i < num_lmbs; i++) { |
125 | lmbs[i].base_addr = be64_to_cpu(lmbs[i].base_addr); | 125 | lmbs[i].base_addr = be64_to_cpu(lmbs[i].base_addr); |
126 | lmbs[i].drc_index = be32_to_cpu(lmbs[i].drc_index); | 126 | lmbs[i].drc_index = be32_to_cpu(lmbs[i].drc_index); |
127 | lmbs[i].aa_index = be32_to_cpu(lmbs[i].aa_index); | ||
127 | lmbs[i].flags = be32_to_cpu(lmbs[i].flags); | 128 | lmbs[i].flags = be32_to_cpu(lmbs[i].flags); |
128 | } | 129 | } |
129 | 130 | ||
@@ -147,6 +148,7 @@ static void dlpar_update_drconf_property(struct device_node *dn, | |||
147 | for (i = 0; i < num_lmbs; i++) { | 148 | for (i = 0; i < num_lmbs; i++) { |
148 | lmbs[i].base_addr = cpu_to_be64(lmbs[i].base_addr); | 149 | lmbs[i].base_addr = cpu_to_be64(lmbs[i].base_addr); |
149 | lmbs[i].drc_index = cpu_to_be32(lmbs[i].drc_index); | 150 | lmbs[i].drc_index = cpu_to_be32(lmbs[i].drc_index); |
151 | lmbs[i].aa_index = cpu_to_be32(lmbs[i].aa_index); | ||
150 | lmbs[i].flags = cpu_to_be32(lmbs[i].flags); | 152 | lmbs[i].flags = cpu_to_be32(lmbs[i].flags); |
151 | } | 153 | } |
152 | 154 | ||
diff --git a/arch/powerpc/sysdev/simple_gpio.c b/arch/powerpc/sysdev/simple_gpio.c index ef470b470b04..6afddae2fb47 100644 --- a/arch/powerpc/sysdev/simple_gpio.c +++ b/arch/powerpc/sysdev/simple_gpio.c | |||
@@ -75,7 +75,8 @@ static int u8_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) | |||
75 | 75 | ||
76 | static void u8_gpio_save_regs(struct of_mm_gpio_chip *mm_gc) | 76 | static void u8_gpio_save_regs(struct of_mm_gpio_chip *mm_gc) |
77 | { | 77 | { |
78 | struct u8_gpio_chip *u8_gc = gpiochip_get_data(&mm_gc->gc); | 78 | struct u8_gpio_chip *u8_gc = |
79 | container_of(mm_gc, struct u8_gpio_chip, mm_gc); | ||
79 | 80 | ||
80 | u8_gc->data = in_8(mm_gc->regs); | 81 | u8_gc->data = in_8(mm_gc->regs); |
81 | } | 82 | } |
diff --git a/drivers/misc/cxl/file.c b/drivers/misc/cxl/file.c index 17b433f1ce23..0761271d68c5 100644 --- a/drivers/misc/cxl/file.c +++ b/drivers/misc/cxl/file.c | |||
@@ -159,11 +159,8 @@ static long afu_ioctl_start_work(struct cxl_context *ctx, | |||
159 | 159 | ||
160 | /* Do this outside the status_mutex to avoid a circular dependency with | 160 | /* Do this outside the status_mutex to avoid a circular dependency with |
161 | * the locking in cxl_mmap_fault() */ | 161 | * the locking in cxl_mmap_fault() */ |
162 | if (copy_from_user(&work, uwork, | 162 | if (copy_from_user(&work, uwork, sizeof(work))) |
163 | sizeof(struct cxl_ioctl_start_work))) { | 163 | return -EFAULT; |
164 | rc = -EFAULT; | ||
165 | goto out; | ||
166 | } | ||
167 | 164 | ||
168 | mutex_lock(&ctx->status_mutex); | 165 | mutex_lock(&ctx->status_mutex); |
169 | if (ctx->status != OPENED) { | 166 | if (ctx->status != OPENED) { |
diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c index 871a2f09c718..8d6ea9712dbd 100644 --- a/drivers/misc/cxl/native.c +++ b/drivers/misc/cxl/native.c | |||
@@ -1302,13 +1302,16 @@ int cxl_native_register_psl_err_irq(struct cxl *adapter) | |||
1302 | 1302 | ||
1303 | void cxl_native_release_psl_err_irq(struct cxl *adapter) | 1303 | void cxl_native_release_psl_err_irq(struct cxl *adapter) |
1304 | { | 1304 | { |
1305 | if (adapter->native->err_virq != irq_find_mapping(NULL, adapter->native->err_hwirq)) | 1305 | if (adapter->native->err_virq == 0 || |
1306 | adapter->native->err_virq != | ||
1307 | irq_find_mapping(NULL, adapter->native->err_hwirq)) | ||
1306 | return; | 1308 | return; |
1307 | 1309 | ||
1308 | cxl_p1_write(adapter, CXL_PSL_ErrIVTE, 0x0000000000000000); | 1310 | cxl_p1_write(adapter, CXL_PSL_ErrIVTE, 0x0000000000000000); |
1309 | cxl_unmap_irq(adapter->native->err_virq, adapter); | 1311 | cxl_unmap_irq(adapter->native->err_virq, adapter); |
1310 | cxl_ops->release_one_irq(adapter, adapter->native->err_hwirq); | 1312 | cxl_ops->release_one_irq(adapter, adapter->native->err_hwirq); |
1311 | kfree(adapter->irq_name); | 1313 | kfree(adapter->irq_name); |
1314 | adapter->native->err_virq = 0; | ||
1312 | } | 1315 | } |
1313 | 1316 | ||
1314 | int cxl_native_register_serr_irq(struct cxl_afu *afu) | 1317 | int cxl_native_register_serr_irq(struct cxl_afu *afu) |
@@ -1346,13 +1349,15 @@ int cxl_native_register_serr_irq(struct cxl_afu *afu) | |||
1346 | 1349 | ||
1347 | void cxl_native_release_serr_irq(struct cxl_afu *afu) | 1350 | void cxl_native_release_serr_irq(struct cxl_afu *afu) |
1348 | { | 1351 | { |
1349 | if (afu->serr_virq != irq_find_mapping(NULL, afu->serr_hwirq)) | 1352 | if (afu->serr_virq == 0 || |
1353 | afu->serr_virq != irq_find_mapping(NULL, afu->serr_hwirq)) | ||
1350 | return; | 1354 | return; |
1351 | 1355 | ||
1352 | cxl_p1n_write(afu, CXL_PSL_SERR_An, 0x0000000000000000); | 1356 | cxl_p1n_write(afu, CXL_PSL_SERR_An, 0x0000000000000000); |
1353 | cxl_unmap_irq(afu->serr_virq, afu); | 1357 | cxl_unmap_irq(afu->serr_virq, afu); |
1354 | cxl_ops->release_one_irq(afu->adapter, afu->serr_hwirq); | 1358 | cxl_ops->release_one_irq(afu->adapter, afu->serr_hwirq); |
1355 | kfree(afu->err_irq_name); | 1359 | kfree(afu->err_irq_name); |
1360 | afu->serr_virq = 0; | ||
1356 | } | 1361 | } |
1357 | 1362 | ||
1358 | int cxl_native_register_psl_irq(struct cxl_afu *afu) | 1363 | int cxl_native_register_psl_irq(struct cxl_afu *afu) |
@@ -1375,12 +1380,15 @@ int cxl_native_register_psl_irq(struct cxl_afu *afu) | |||
1375 | 1380 | ||
1376 | void cxl_native_release_psl_irq(struct cxl_afu *afu) | 1381 | void cxl_native_release_psl_irq(struct cxl_afu *afu) |
1377 | { | 1382 | { |
1378 | if (afu->native->psl_virq != irq_find_mapping(NULL, afu->native->psl_hwirq)) | 1383 | if (afu->native->psl_virq == 0 || |
1384 | afu->native->psl_virq != | ||
1385 | irq_find_mapping(NULL, afu->native->psl_hwirq)) | ||
1379 | return; | 1386 | return; |
1380 | 1387 | ||
1381 | cxl_unmap_irq(afu->native->psl_virq, afu); | 1388 | cxl_unmap_irq(afu->native->psl_virq, afu); |
1382 | cxl_ops->release_one_irq(afu->adapter, afu->native->psl_hwirq); | 1389 | cxl_ops->release_one_irq(afu->adapter, afu->native->psl_hwirq); |
1383 | kfree(afu->psl_irq_name); | 1390 | kfree(afu->psl_irq_name); |
1391 | afu->native->psl_virq = 0; | ||
1384 | } | 1392 | } |
1385 | 1393 | ||
1386 | static void recover_psl_err(struct cxl_afu *afu, u64 errstat) | 1394 | static void recover_psl_err(struct cxl_afu *afu, u64 errstat) |