aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-08-29 15:12:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-29 15:12:15 -0400
commit2a90309e062382ca0bd10bc2004abcab8fa0944b (patch)
tree68c254cd3c0f2088431556524db64ccfe56fd715
parent3eab887a55424fc2c27553b7bfe32330df83f7b8 (diff)
parent78a3e8889b4b6b99775ed954696ff3e017f5d19b (diff)
Merge tag 'powerpc-4.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Ben Herrenschmidt: "This was meant to be sent early last week, but I has a change pending on one of the fixes and other things made me forget all about. Ugh. We have some misc fixes for powerpc 4.8. Some trivial bits and some regressions, and a trivial cleanup or two that I saw no point in letting rot in patchwork" * tag 'powerpc-4.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc: signals: Discard transaction state from signal frames powerpc/powernv : Drop reference added by kset_find_obj() powerpc/tm: do not use r13 for tabort_syscall powerpc: move hmi.c to arch/powerpc/kvm/ powerpc: sysdev: cpm: fix gpio save_regs functions powerpc/pseries: PACA save area fix for MCE vs MCE powerpc/pseries: PACA save area fix for general exception vs MCE powerpc/prom: Fix sub-processor option passed to ibm, client-architecture-support powerpc, hotplug: Avoid to touch non-existent cpumasks. powerpc: migrate exception table users off module.h and onto extable.h powerpc/powernv/pci: fix iterator signedness powerpc/pseries: use pci_host_bridge.release_fn() to kfree(phb) cxl: use pcibios_free_controller_deferred() when removing vPHBs powerpc: mpc8349emitx: Delete unnecessary assignment for the field "owner" powerpc/512x: Delete unnecessary assignment for the field "owner" drivers/macintosh: Delete owner assignment powerpc: cputhreads: Add missing include file
-rw-r--r--Documentation/powerpc/transactional_memory.txt2
-rw-r--r--arch/powerpc/include/asm/cputhreads.h1
-rw-r--r--arch/powerpc/include/asm/hmi.h2
-rw-r--r--arch/powerpc/include/asm/paca.h12
-rw-r--r--arch/powerpc/include/asm/pci-bridge.h1
-rw-r--r--arch/powerpc/kernel/Makefile2
-rw-r--r--arch/powerpc/kernel/entry_64.S12
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S29
-rw-r--r--arch/powerpc/kernel/kprobes.c2
-rw-r--r--arch/powerpc/kernel/pci-common.c36
-rw-r--r--arch/powerpc/kernel/prom_init.c9
-rw-r--r--arch/powerpc/kernel/signal_32.c14
-rw-r--r--arch/powerpc/kernel/signal_64.c14
-rw-r--r--arch/powerpc/kernel/smp.c2
-rw-r--r--arch/powerpc/kernel/traps.c3
-rw-r--r--arch/powerpc/kvm/Makefile1
-rw-r--r--arch/powerpc/kvm/book3s_hv_hmi.c (renamed from arch/powerpc/kernel/hmi.c)0
-rw-r--r--arch/powerpc/mm/fault.c2
-rw-r--r--arch/powerpc/platforms/512x/mpc512x_lpbfifo.c1
-rw-r--r--arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c1
-rw-r--r--arch/powerpc/platforms/embedded6xx/holly.c2
-rw-r--r--arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c2
-rw-r--r--arch/powerpc/platforms/powernv/opal-dump.c7
-rw-r--r--arch/powerpc/platforms/powernv/opal-elog.c7
-rw-r--r--arch/powerpc/platforms/powernv/pci-ioda.c2
-rw-r--r--arch/powerpc/platforms/pseries/pci.c4
-rw-r--r--arch/powerpc/platforms/pseries/pci_dlpar.c7
-rw-r--r--arch/powerpc/sysdev/cpm1.c6
-rw-r--r--arch/powerpc/sysdev/cpm_common.c3
-rw-r--r--arch/powerpc/sysdev/fsl_rio.c2
-rw-r--r--drivers/macintosh/ams/ams-i2c.c1
-rw-r--r--drivers/macintosh/windfarm_pm112.c1
-rw-r--r--drivers/macintosh/windfarm_pm72.c1
-rw-r--r--drivers/macintosh/windfarm_rm31.c1
-rw-r--r--drivers/misc/cxl/vphb.c10
-rw-r--r--drivers/pci/host-bridge.c1
36 files changed, 160 insertions, 43 deletions
diff --git a/Documentation/powerpc/transactional_memory.txt b/Documentation/powerpc/transactional_memory.txt
index ba0a2a4a54ba..e32fdbb4c9a7 100644
--- a/Documentation/powerpc/transactional_memory.txt
+++ b/Documentation/powerpc/transactional_memory.txt
@@ -167,6 +167,8 @@ signal will be rolled back anyway.
167For signals taken in non-TM or suspended mode, we use the 167For signals taken in non-TM or suspended mode, we use the
168normal/non-checkpointed stack pointer. 168normal/non-checkpointed stack pointer.
169 169
170Any transaction initiated inside a sighandler and suspended on return
171from the sighandler to the kernel will get reclaimed and discarded.
170 172
171Failure cause codes used by kernel 173Failure cause codes used by kernel
172================================== 174==================================
diff --git a/arch/powerpc/include/asm/cputhreads.h b/arch/powerpc/include/asm/cputhreads.h
index 666bef4ebfae..9377bdf42eb8 100644
--- a/arch/powerpc/include/asm/cputhreads.h
+++ b/arch/powerpc/include/asm/cputhreads.h
@@ -3,6 +3,7 @@
3 3
4#ifndef __ASSEMBLY__ 4#ifndef __ASSEMBLY__
5#include <linux/cpumask.h> 5#include <linux/cpumask.h>
6#include <asm/cpu_has_feature.h>
6 7
7/* 8/*
8 * Mapping of threads to cores 9 * Mapping of threads to cores
diff --git a/arch/powerpc/include/asm/hmi.h b/arch/powerpc/include/asm/hmi.h
index 88b4901ac4ee..85b7a1a21e22 100644
--- a/arch/powerpc/include/asm/hmi.h
+++ b/arch/powerpc/include/asm/hmi.h
@@ -21,7 +21,7 @@
21#ifndef __ASM_PPC64_HMI_H__ 21#ifndef __ASM_PPC64_HMI_H__
22#define __ASM_PPC64_HMI_H__ 22#define __ASM_PPC64_HMI_H__
23 23
24#ifdef CONFIG_PPC_BOOK3S_64 24#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
25 25
26#define CORE_TB_RESYNC_REQ_BIT 63 26#define CORE_TB_RESYNC_REQ_BIT 63
27#define MAX_SUBCORE_PER_CORE 4 27#define MAX_SUBCORE_PER_CORE 4
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index 148303e7771f..6a6792bb39fb 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -183,11 +183,6 @@ struct paca_struct {
183 */ 183 */
184 u16 in_mce; 184 u16 in_mce;
185 u8 hmi_event_available; /* HMI event is available */ 185 u8 hmi_event_available; /* HMI event is available */
186 /*
187 * Bitmap for sibling subcore status. See kvm/book3s_hv_ras.c for
188 * more details
189 */
190 struct sibling_subcore_state *sibling_subcore_state;
191#endif 186#endif
192 187
193 /* Stuff for accurate time accounting */ 188 /* Stuff for accurate time accounting */
@@ -202,6 +197,13 @@ struct paca_struct {
202 struct kvmppc_book3s_shadow_vcpu shadow_vcpu; 197 struct kvmppc_book3s_shadow_vcpu shadow_vcpu;
203#endif 198#endif
204 struct kvmppc_host_state kvm_hstate; 199 struct kvmppc_host_state kvm_hstate;
200#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
201 /*
202 * Bitmap for sibling subcore status. See kvm/book3s_hv_ras.c for
203 * more details
204 */
205 struct sibling_subcore_state *sibling_subcore_state;
206#endif
205#endif 207#endif
206}; 208};
207 209
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index b5e88e4a171a..c0309c59bed8 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -301,6 +301,7 @@ extern void pci_process_bridge_OF_ranges(struct pci_controller *hose,
301/* Allocate & free a PCI host bridge structure */ 301/* Allocate & free a PCI host bridge structure */
302extern struct pci_controller *pcibios_alloc_controller(struct device_node *dev); 302extern struct pci_controller *pcibios_alloc_controller(struct device_node *dev);
303extern void pcibios_free_controller(struct pci_controller *phb); 303extern void pcibios_free_controller(struct pci_controller *phb);
304extern void pcibios_free_controller_deferred(struct pci_host_bridge *bridge);
304 305
305#ifdef CONFIG_PCI 306#ifdef CONFIG_PCI
306extern int pcibios_vaddr_is_ioport(void __iomem *address); 307extern int pcibios_vaddr_is_ioport(void __iomem *address);
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index b2027a5cf508..fe4c075bcf50 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -41,7 +41,7 @@ obj-$(CONFIG_VDSO32) += vdso32/
41obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o 41obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
42obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_ppc970.o cpu_setup_pa6t.o 42obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_ppc970.o cpu_setup_pa6t.o
43obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_power.o 43obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_power.o
44obj-$(CONFIG_PPC_BOOK3S_64) += mce.o mce_power.o hmi.o 44obj-$(CONFIG_PPC_BOOK3S_64) += mce.o mce_power.o
45obj-$(CONFIG_PPC_BOOK3E_64) += exceptions-64e.o idle_book3e.o 45obj-$(CONFIG_PPC_BOOK3E_64) += exceptions-64e.o idle_book3e.o
46obj-$(CONFIG_PPC64) += vdso64/ 46obj-$(CONFIG_PPC64) += vdso64/
47obj-$(CONFIG_ALTIVEC) += vecemu.o 47obj-$(CONFIG_ALTIVEC) += vecemu.o
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 6b8bc0dd09d4..5afd03e5e8b8 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -368,13 +368,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
368tabort_syscall: 368tabort_syscall:
369 /* Firstly we need to enable TM in the kernel */ 369 /* Firstly we need to enable TM in the kernel */
370 mfmsr r10 370 mfmsr r10
371 li r13, 1 371 li r9, 1
372 rldimi r10, r13, MSR_TM_LG, 63-MSR_TM_LG 372 rldimi r10, r9, MSR_TM_LG, 63-MSR_TM_LG
373 mtmsrd r10, 0 373 mtmsrd r10, 0
374 374
375 /* tabort, this dooms the transaction, nothing else */ 375 /* tabort, this dooms the transaction, nothing else */
376 li r13, (TM_CAUSE_SYSCALL|TM_CAUSE_PERSISTENT) 376 li r9, (TM_CAUSE_SYSCALL|TM_CAUSE_PERSISTENT)
377 TABORT(R13) 377 TABORT(R9)
378 378
379 /* 379 /*
380 * Return directly to userspace. We have corrupted user register state, 380 * Return directly to userspace. We have corrupted user register state,
@@ -382,8 +382,8 @@ tabort_syscall:
382 * resume after the tbegin of the aborted transaction with the 382 * resume after the tbegin of the aborted transaction with the
383 * checkpointed register state. 383 * checkpointed register state.
384 */ 384 */
385 li r13, MSR_RI 385 li r9, MSR_RI
386 andc r10, r10, r13 386 andc r10, r10, r9
387 mtmsrd r10, 1 387 mtmsrd r10, 1
388 mtspr SPRN_SRR0, r11 388 mtspr SPRN_SRR0, r11
389 mtspr SPRN_SRR1, r12 389 mtspr SPRN_SRR1, r12
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index df6d45eb4115..bffec73dbffc 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -485,7 +485,23 @@ machine_check_fwnmi:
485 EXCEPTION_PROLOG_0(PACA_EXMC) 485 EXCEPTION_PROLOG_0(PACA_EXMC)
486machine_check_pSeries_0: 486machine_check_pSeries_0:
487 EXCEPTION_PROLOG_1(PACA_EXMC, KVMTEST, 0x200) 487 EXCEPTION_PROLOG_1(PACA_EXMC, KVMTEST, 0x200)
488 EXCEPTION_PROLOG_PSERIES_1(machine_check_common, EXC_STD) 488 /*
489 * The following is essentially EXCEPTION_PROLOG_PSERIES_1 with the
490 * difference that MSR_RI is not enabled, because PACA_EXMC is being
491 * used, so nested machine check corrupts it. machine_check_common
492 * enables MSR_RI.
493 */
494 ld r12,PACAKBASE(r13)
495 ld r10,PACAKMSR(r13)
496 xori r10,r10,MSR_RI
497 mfspr r11,SPRN_SRR0
498 LOAD_HANDLER(r12, machine_check_common)
499 mtspr SPRN_SRR0,r12
500 mfspr r12,SPRN_SRR1
501 mtspr SPRN_SRR1,r10
502 rfid
503 b . /* prevent speculative execution */
504
489 KVM_HANDLER_SKIP(PACA_EXMC, EXC_STD, 0x200) 505 KVM_HANDLER_SKIP(PACA_EXMC, EXC_STD, 0x200)
490 KVM_HANDLER_SKIP(PACA_EXGEN, EXC_STD, 0x300) 506 KVM_HANDLER_SKIP(PACA_EXGEN, EXC_STD, 0x300)
491 KVM_HANDLER_SKIP(PACA_EXSLB, EXC_STD, 0x380) 507 KVM_HANDLER_SKIP(PACA_EXSLB, EXC_STD, 0x380)
@@ -969,14 +985,17 @@ ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX)
969machine_check_common: 985machine_check_common:
970 986
971 mfspr r10,SPRN_DAR 987 mfspr r10,SPRN_DAR
972 std r10,PACA_EXGEN+EX_DAR(r13) 988 std r10,PACA_EXMC+EX_DAR(r13)
973 mfspr r10,SPRN_DSISR 989 mfspr r10,SPRN_DSISR
974 stw r10,PACA_EXGEN+EX_DSISR(r13) 990 stw r10,PACA_EXMC+EX_DSISR(r13)
975 EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC) 991 EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC)
976 FINISH_NAP 992 FINISH_NAP
977 RECONCILE_IRQ_STATE(r10, r11) 993 RECONCILE_IRQ_STATE(r10, r11)
978 ld r3,PACA_EXGEN+EX_DAR(r13) 994 ld r3,PACA_EXMC+EX_DAR(r13)
979 lwz r4,PACA_EXGEN+EX_DSISR(r13) 995 lwz r4,PACA_EXMC+EX_DSISR(r13)
996 /* Enable MSR_RI when finished with PACA_EXMC */
997 li r10,MSR_RI
998 mtmsrd r10,1
980 std r3,_DAR(r1) 999 std r3,_DAR(r1)
981 std r4,_DSISR(r1) 1000 std r4,_DSISR(r1)
982 bl save_nvgprs 1001 bl save_nvgprs
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index 3ed8ec09b5c9..e785cc9e1ecd 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -29,7 +29,7 @@
29#include <linux/kprobes.h> 29#include <linux/kprobes.h>
30#include <linux/ptrace.h> 30#include <linux/ptrace.h>
31#include <linux/preempt.h> 31#include <linux/preempt.h>
32#include <linux/module.h> 32#include <linux/extable.h>
33#include <linux/kdebug.h> 33#include <linux/kdebug.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35#include <asm/code-patching.h> 35#include <asm/code-patching.h>
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 7fdf324d5b51..e58908066b0e 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -154,6 +154,42 @@ void pcibios_free_controller(struct pci_controller *phb)
154EXPORT_SYMBOL_GPL(pcibios_free_controller); 154EXPORT_SYMBOL_GPL(pcibios_free_controller);
155 155
156/* 156/*
157 * This function is used to call pcibios_free_controller()
158 * in a deferred manner: a callback from the PCI subsystem.
159 *
160 * _*DO NOT*_ call pcibios_free_controller() explicitly if
161 * this is used (or it may access an invalid *phb pointer).
162 *
163 * The callback occurs when all references to the root bus
164 * are dropped (e.g., child buses/devices and their users).
165 *
166 * It's called as .release_fn() of 'struct pci_host_bridge'
167 * which is associated with the 'struct pci_controller.bus'
168 * (root bus) - it expects .release_data to hold a pointer
169 * to 'struct pci_controller'.
170 *
171 * In order to use it, register .release_fn()/release_data
172 * like this:
173 *
174 * pci_set_host_bridge_release(bridge,
175 * pcibios_free_controller_deferred
176 * (void *) phb);
177 *
178 * e.g. in the pcibios_root_bridge_prepare() callback from
179 * pci_create_root_bus().
180 */
181void pcibios_free_controller_deferred(struct pci_host_bridge *bridge)
182{
183 struct pci_controller *phb = (struct pci_controller *)
184 bridge->release_data;
185
186 pr_debug("domain %d, dynamic %d\n", phb->global_number, phb->is_dynamic);
187
188 pcibios_free_controller(phb);
189}
190EXPORT_SYMBOL_GPL(pcibios_free_controller_deferred);
191
192/*
157 * The function is used to return the minimal alignment 193 * The function is used to return the minimal alignment
158 * for memory or I/O windows of the associated P2P bridge. 194 * for memory or I/O windows of the associated P2P bridge.
159 * By default, 4KiB alignment for I/O windows and 1MiB for 195 * By default, 4KiB alignment for I/O windows and 1MiB for
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 4e74fc588a3f..d3eff99e938c 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -695,7 +695,7 @@ unsigned char ibm_architecture_vec[] = {
695 OV4_MIN_ENT_CAP, /* minimum VP entitled capacity */ 695 OV4_MIN_ENT_CAP, /* minimum VP entitled capacity */
696 696
697 /* option vector 5: PAPR/OF options */ 697 /* option vector 5: PAPR/OF options */
698 VECTOR_LENGTH(18), /* length */ 698 VECTOR_LENGTH(21), /* length */
699 0, /* don't ignore, don't halt */ 699 0, /* don't ignore, don't halt */
700 OV5_FEAT(OV5_LPAR) | OV5_FEAT(OV5_SPLPAR) | OV5_FEAT(OV5_LARGE_PAGES) | 700 OV5_FEAT(OV5_LPAR) | OV5_FEAT(OV5_SPLPAR) | OV5_FEAT(OV5_LARGE_PAGES) |
701 OV5_FEAT(OV5_DRCONF_MEMORY) | OV5_FEAT(OV5_DONATE_DEDICATE_CPU) | 701 OV5_FEAT(OV5_DRCONF_MEMORY) | OV5_FEAT(OV5_DONATE_DEDICATE_CPU) |
@@ -726,8 +726,11 @@ unsigned char ibm_architecture_vec[] = {
726 0, 726 0,
727 0, 727 0,
728 OV5_FEAT(OV5_PFO_HW_RNG) | OV5_FEAT(OV5_PFO_HW_ENCR) | 728 OV5_FEAT(OV5_PFO_HW_RNG) | OV5_FEAT(OV5_PFO_HW_ENCR) |
729 OV5_FEAT(OV5_PFO_HW_842), 729 OV5_FEAT(OV5_PFO_HW_842), /* Byte 17 */
730 OV5_FEAT(OV5_SUB_PROCESSORS), 730 0, /* Byte 18 */
731 0, /* Byte 19 */
732 0, /* Byte 20 */
733 OV5_FEAT(OV5_SUB_PROCESSORS), /* Byte 21 */
731 734
732 /* option vector 6: IBM PAPR hints */ 735 /* option vector 6: IBM PAPR hints */
733 VECTOR_LENGTH(3), /* length */ 736 VECTOR_LENGTH(3), /* length */
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index b6aa378aff63..a7daf749b97f 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -1226,7 +1226,21 @@ long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
1226 (regs->gpr[1] + __SIGNAL_FRAMESIZE + 16); 1226 (regs->gpr[1] + __SIGNAL_FRAMESIZE + 16);
1227 if (!access_ok(VERIFY_READ, rt_sf, sizeof(*rt_sf))) 1227 if (!access_ok(VERIFY_READ, rt_sf, sizeof(*rt_sf)))
1228 goto bad; 1228 goto bad;
1229
1229#ifdef CONFIG_PPC_TRANSACTIONAL_MEM 1230#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
1231 /*
1232 * If there is a transactional state then throw it away.
1233 * The purpose of a sigreturn is to destroy all traces of the
1234 * signal frame, this includes any transactional state created
1235 * within in. We only check for suspended as we can never be
1236 * active in the kernel, we are active, there is nothing better to
1237 * do than go ahead and Bad Thing later.
1238 * The cause is not important as there will never be a
1239 * recheckpoint so it's not user visible.
1240 */
1241 if (MSR_TM_SUSPENDED(mfmsr()))
1242 tm_reclaim_current(0);
1243
1230 if (__get_user(tmp, &rt_sf->uc.uc_link)) 1244 if (__get_user(tmp, &rt_sf->uc.uc_link))
1231 goto bad; 1245 goto bad;
1232 uc_transact = (struct ucontext __user *)(uintptr_t)tmp; 1246 uc_transact = (struct ucontext __user *)(uintptr_t)tmp;
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 7e49984d4331..70409bb90a95 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -676,7 +676,21 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
676 if (__copy_from_user(&set, &uc->uc_sigmask, sizeof(set))) 676 if (__copy_from_user(&set, &uc->uc_sigmask, sizeof(set)))
677 goto badframe; 677 goto badframe;
678 set_current_blocked(&set); 678 set_current_blocked(&set);
679
679#ifdef CONFIG_PPC_TRANSACTIONAL_MEM 680#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
681 /*
682 * If there is a transactional state then throw it away.
683 * The purpose of a sigreturn is to destroy all traces of the
684 * signal frame, this includes any transactional state created
685 * within in. We only check for suspended as we can never be
686 * active in the kernel, we are active, there is nothing better to
687 * do than go ahead and Bad Thing later.
688 * The cause is not important as there will never be a
689 * recheckpoint so it's not user visible.
690 */
691 if (MSR_TM_SUSPENDED(mfmsr()))
692 tm_reclaim_current(0);
693
680 if (__get_user(msr, &uc->uc_mcontext.gp_regs[PT_MSR])) 694 if (__get_user(msr, &uc->uc_mcontext.gp_regs[PT_MSR]))
681 goto badframe; 695 goto badframe;
682 if (MSR_TM_ACTIVE(msr)) { 696 if (MSR_TM_ACTIVE(msr)) {
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 25a39052bf6b..9c6f3fd58059 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -830,7 +830,7 @@ int __cpu_disable(void)
830 830
831 /* Update sibling maps */ 831 /* Update sibling maps */
832 base = cpu_first_thread_sibling(cpu); 832 base = cpu_first_thread_sibling(cpu);
833 for (i = 0; i < threads_per_core; i++) { 833 for (i = 0; i < threads_per_core && base + i < nr_cpu_ids; i++) {
834 cpumask_clear_cpu(cpu, cpu_sibling_mask(base + i)); 834 cpumask_clear_cpu(cpu, cpu_sibling_mask(base + i));
835 cpumask_clear_cpu(base + i, cpu_sibling_mask(cpu)); 835 cpumask_clear_cpu(base + i, cpu_sibling_mask(cpu));
836 cpumask_clear_cpu(cpu, cpu_core_mask(base + i)); 836 cpumask_clear_cpu(cpu, cpu_core_mask(base + i));
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 2cb589264cb7..62859ebe0062 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -25,7 +25,8 @@
25#include <linux/user.h> 25#include <linux/user.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/module.h> 28#include <linux/extable.h>
29#include <linux/module.h> /* print_modules */
29#include <linux/prctl.h> 30#include <linux/prctl.h>
30#include <linux/delay.h> 31#include <linux/delay.h>
31#include <linux/kprobes.h> 32#include <linux/kprobes.h>
diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile
index 1f9e5529e692..855d4b95d752 100644
--- a/arch/powerpc/kvm/Makefile
+++ b/arch/powerpc/kvm/Makefile
@@ -78,6 +78,7 @@ kvm-book3s_64-builtin-xics-objs-$(CONFIG_KVM_XICS) := \
78 78
79ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE 79ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
80kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HANDLER) += \ 80kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HANDLER) += \
81 book3s_hv_hmi.o \
81 book3s_hv_rmhandlers.o \ 82 book3s_hv_rmhandlers.o \
82 book3s_hv_rm_mmu.o \ 83 book3s_hv_rm_mmu.o \
83 book3s_hv_ras.o \ 84 book3s_hv_ras.o \
diff --git a/arch/powerpc/kernel/hmi.c b/arch/powerpc/kvm/book3s_hv_hmi.c
index e3f738eb1cac..e3f738eb1cac 100644
--- a/arch/powerpc/kernel/hmi.c
+++ b/arch/powerpc/kvm/book3s_hv_hmi.c
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index a4db22f65021..bb1ffc559f38 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -26,7 +26,7 @@
26#include <linux/mm.h> 26#include <linux/mm.h>
27#include <linux/interrupt.h> 27#include <linux/interrupt.h>
28#include <linux/highmem.h> 28#include <linux/highmem.h>
29#include <linux/module.h> 29#include <linux/extable.h>
30#include <linux/kprobes.h> 30#include <linux/kprobes.h>
31#include <linux/kdebug.h> 31#include <linux/kdebug.h>
32#include <linux/perf_event.h> 32#include <linux/perf_event.h>
diff --git a/arch/powerpc/platforms/512x/mpc512x_lpbfifo.c b/arch/powerpc/platforms/512x/mpc512x_lpbfifo.c
index 8eb82b043dd8..d93dd4acf40b 100644
--- a/arch/powerpc/platforms/512x/mpc512x_lpbfifo.c
+++ b/arch/powerpc/platforms/512x/mpc512x_lpbfifo.c
@@ -528,7 +528,6 @@ static struct platform_driver mpc512x_lpbfifo_driver = {
528 .remove = mpc512x_lpbfifo_remove, 528 .remove = mpc512x_lpbfifo_remove,
529 .driver = { 529 .driver = {
530 .name = DRV_NAME, 530 .name = DRV_NAME,
531 .owner = THIS_MODULE,
532 .of_match_table = mpc512x_lpbfifo_match, 531 .of_match_table = mpc512x_lpbfifo_match,
533 }, 532 },
534}; 533};
diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
index dbcd0303afed..63c5ab6489c9 100644
--- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
+++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
@@ -222,7 +222,6 @@ static const struct of_device_id mcu_of_match_table[] = {
222static struct i2c_driver mcu_driver = { 222static struct i2c_driver mcu_driver = {
223 .driver = { 223 .driver = {
224 .name = "mcu-mpc8349emitx", 224 .name = "mcu-mpc8349emitx",
225 .owner = THIS_MODULE,
226 .of_match_table = mcu_of_match_table, 225 .of_match_table = mcu_of_match_table,
227 }, 226 },
228 .probe = mcu_probe, 227 .probe = mcu_probe,
diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c
index dafba1057a47..dfd310031549 100644
--- a/arch/powerpc/platforms/embedded6xx/holly.c
+++ b/arch/powerpc/platforms/embedded6xx/holly.c
@@ -26,7 +26,7 @@
26#include <linux/tty.h> 26#include <linux/tty.h>
27#include <linux/serial_core.h> 27#include <linux/serial_core.h>
28#include <linux/of_platform.h> 28#include <linux/of_platform.h>
29#include <linux/module.h> 29#include <linux/extable.h>
30 30
31#include <asm/time.h> 31#include <asm/time.h>
32#include <asm/machdep.h> 32#include <asm/machdep.h>
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
index 80804f9916ee..f97bab8e37a2 100644
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
+++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -23,7 +23,7 @@
23#include <linux/pci.h> 23#include <linux/pci.h>
24#include <linux/kdev_t.h> 24#include <linux/kdev_t.h>
25#include <linux/console.h> 25#include <linux/console.h>
26#include <linux/module.h> 26#include <linux/extable.h>
27#include <linux/delay.h> 27#include <linux/delay.h>
28#include <linux/irq.h> 28#include <linux/irq.h>
29#include <linux/seq_file.h> 29#include <linux/seq_file.h>
diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c
index 2ee96431f736..4c827826c05e 100644
--- a/arch/powerpc/platforms/powernv/opal-dump.c
+++ b/arch/powerpc/platforms/powernv/opal-dump.c
@@ -370,6 +370,7 @@ static irqreturn_t process_dump(int irq, void *data)
370 uint32_t dump_id, dump_size, dump_type; 370 uint32_t dump_id, dump_size, dump_type;
371 struct dump_obj *dump; 371 struct dump_obj *dump;
372 char name[22]; 372 char name[22];
373 struct kobject *kobj;
373 374
374 rc = dump_read_info(&dump_id, &dump_size, &dump_type); 375 rc = dump_read_info(&dump_id, &dump_size, &dump_type);
375 if (rc != OPAL_SUCCESS) 376 if (rc != OPAL_SUCCESS)
@@ -381,8 +382,12 @@ static irqreturn_t process_dump(int irq, void *data)
381 * that gracefully and not create two conflicting 382 * that gracefully and not create two conflicting
382 * entries. 383 * entries.
383 */ 384 */
384 if (kset_find_obj(dump_kset, name)) 385 kobj = kset_find_obj(dump_kset, name);
386 if (kobj) {
387 /* Drop reference added by kset_find_obj() */
388 kobject_put(kobj);
385 return 0; 389 return 0;
390 }
386 391
387 dump = create_dump_obj(dump_id, dump_size, dump_type); 392 dump = create_dump_obj(dump_id, dump_size, dump_type);
388 if (!dump) 393 if (!dump)
diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c
index 37f959bf392e..f2344cbd2f46 100644
--- a/arch/powerpc/platforms/powernv/opal-elog.c
+++ b/arch/powerpc/platforms/powernv/opal-elog.c
@@ -247,6 +247,7 @@ static irqreturn_t elog_event(int irq, void *data)
247 uint64_t elog_type; 247 uint64_t elog_type;
248 int rc; 248 int rc;
249 char name[2+16+1]; 249 char name[2+16+1];
250 struct kobject *kobj;
250 251
251 rc = opal_get_elog_size(&id, &size, &type); 252 rc = opal_get_elog_size(&id, &size, &type);
252 if (rc != OPAL_SUCCESS) { 253 if (rc != OPAL_SUCCESS) {
@@ -269,8 +270,12 @@ static irqreturn_t elog_event(int irq, void *data)
269 * that gracefully and not create two conflicting 270 * that gracefully and not create two conflicting
270 * entries. 271 * entries.
271 */ 272 */
272 if (kset_find_obj(elog_kset, name)) 273 kobj = kset_find_obj(elog_kset, name);
274 if (kobj) {
275 /* Drop reference added by kset_find_obj() */
276 kobject_put(kobj);
273 return IRQ_HANDLED; 277 return IRQ_HANDLED;
278 }
274 279
275 create_elog_obj(log_id, elog_size, elog_type); 280 create_elog_obj(log_id, elog_size, elog_type);
276 281
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index fd9444f9fb0c..13218263e66e 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -149,7 +149,7 @@ static void pnv_ioda_reserve_pe(struct pnv_phb *phb, int pe_no)
149 149
150static struct pnv_ioda_pe *pnv_ioda_alloc_pe(struct pnv_phb *phb) 150static struct pnv_ioda_pe *pnv_ioda_alloc_pe(struct pnv_phb *phb)
151{ 151{
152 unsigned long pe = phb->ioda.total_pe_num - 1; 152 long pe;
153 153
154 for (pe = phb->ioda.total_pe_num - 1; pe >= 0; pe--) { 154 for (pe = phb->ioda.total_pe_num - 1; pe >= 0; pe--) {
155 if (!test_and_set_bit(pe, phb->ioda.pe_alloc)) 155 if (!test_and_set_bit(pe, phb->ioda.pe_alloc))
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c
index fe16a50700de..09eba5a9929a 100644
--- a/arch/powerpc/platforms/pseries/pci.c
+++ b/arch/powerpc/platforms/pseries/pci.c
@@ -119,6 +119,10 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge)
119 119
120 bus = bridge->bus; 120 bus = bridge->bus;
121 121
122 /* Rely on the pcibios_free_controller_deferred() callback. */
123 pci_set_host_bridge_release(bridge, pcibios_free_controller_deferred,
124 (void *) pci_bus_to_host(bus));
125
122 dn = pcibios_get_phb_of_node(bus); 126 dn = pcibios_get_phb_of_node(bus);
123 if (!dn) 127 if (!dn)
124 return 0; 128 return 0;
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c
index 906dbaa97fe2..547fd13e4f8e 100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -106,8 +106,11 @@ int remove_phb_dynamic(struct pci_controller *phb)
106 release_resource(res); 106 release_resource(res);
107 } 107 }
108 108
109 /* Free pci_controller data structure */ 109 /*
110 pcibios_free_controller(phb); 110 * The pci_controller data structure is freed by
111 * the pcibios_free_controller_deferred() callback;
112 * see pseries_root_bridge_prepare().
113 */
111 114
112 return 0; 115 return 0;
113} 116}
diff --git a/arch/powerpc/sysdev/cpm1.c b/arch/powerpc/sysdev/cpm1.c
index 6c110994d902..81d49476c47e 100644
--- a/arch/powerpc/sysdev/cpm1.c
+++ b/arch/powerpc/sysdev/cpm1.c
@@ -534,7 +534,8 @@ struct cpm1_gpio16_chip {
534 534
535static void cpm1_gpio16_save_regs(struct of_mm_gpio_chip *mm_gc) 535static void cpm1_gpio16_save_regs(struct of_mm_gpio_chip *mm_gc)
536{ 536{
537 struct cpm1_gpio16_chip *cpm1_gc = gpiochip_get_data(&mm_gc->gc); 537 struct cpm1_gpio16_chip *cpm1_gc =
538 container_of(mm_gc, struct cpm1_gpio16_chip, mm_gc);
538 struct cpm_ioport16 __iomem *iop = mm_gc->regs; 539 struct cpm_ioport16 __iomem *iop = mm_gc->regs;
539 540
540 cpm1_gc->cpdata = in_be16(&iop->dat); 541 cpm1_gc->cpdata = in_be16(&iop->dat);
@@ -649,7 +650,8 @@ struct cpm1_gpio32_chip {
649 650
650static void cpm1_gpio32_save_regs(struct of_mm_gpio_chip *mm_gc) 651static void cpm1_gpio32_save_regs(struct of_mm_gpio_chip *mm_gc)
651{ 652{
652 struct cpm1_gpio32_chip *cpm1_gc = gpiochip_get_data(&mm_gc->gc); 653 struct cpm1_gpio32_chip *cpm1_gc =
654 container_of(mm_gc, struct cpm1_gpio32_chip, mm_gc);
653 struct cpm_ioport32b __iomem *iop = mm_gc->regs; 655 struct cpm_ioport32b __iomem *iop = mm_gc->regs;
654 656
655 cpm1_gc->cpdata = in_be32(&iop->dat); 657 cpm1_gc->cpdata = in_be32(&iop->dat);
diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c
index 911456d17713..947f42007734 100644
--- a/arch/powerpc/sysdev/cpm_common.c
+++ b/arch/powerpc/sysdev/cpm_common.c
@@ -94,7 +94,8 @@ struct cpm2_gpio32_chip {
94 94
95static void cpm2_gpio32_save_regs(struct of_mm_gpio_chip *mm_gc) 95static void cpm2_gpio32_save_regs(struct of_mm_gpio_chip *mm_gc)
96{ 96{
97 struct cpm2_gpio32_chip *cpm2_gc = gpiochip_get_data(&mm_gc->gc); 97 struct cpm2_gpio32_chip *cpm2_gc =
98 container_of(mm_gc, struct cpm2_gpio32_chip, mm_gc);
98 struct cpm2_ioports __iomem *iop = mm_gc->regs; 99 struct cpm2_ioports __iomem *iop = mm_gc->regs;
99 100
100 cpm2_gc->cpdata = in_be32(&iop->dat); 101 cpm2_gc->cpdata = in_be32(&iop->dat);
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index 68e7c0dd2e45..3cc7cace194a 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/module.h> 26#include <linux/extable.h>
27#include <linux/types.h> 27#include <linux/types.h>
28#include <linux/dma-mapping.h> 28#include <linux/dma-mapping.h>
29#include <linux/interrupt.h> 29#include <linux/interrupt.h>
diff --git a/drivers/macintosh/ams/ams-i2c.c b/drivers/macintosh/ams/ams-i2c.c
index 978eda8d6678..8a3ba565106f 100644
--- a/drivers/macintosh/ams/ams-i2c.c
+++ b/drivers/macintosh/ams/ams-i2c.c
@@ -73,7 +73,6 @@ MODULE_DEVICE_TABLE(i2c, ams_id);
73static struct i2c_driver ams_i2c_driver = { 73static struct i2c_driver ams_i2c_driver = {
74 .driver = { 74 .driver = {
75 .name = "ams", 75 .name = "ams",
76 .owner = THIS_MODULE,
77 }, 76 },
78 .probe = ams_i2c_probe, 77 .probe = ams_i2c_probe,
79 .remove = ams_i2c_remove, 78 .remove = ams_i2c_remove,
diff --git a/drivers/macintosh/windfarm_pm112.c b/drivers/macintosh/windfarm_pm112.c
index 3024685e4cca..96d16fca68b2 100644
--- a/drivers/macintosh/windfarm_pm112.c
+++ b/drivers/macintosh/windfarm_pm112.c
@@ -668,7 +668,6 @@ static struct platform_driver wf_pm112_driver = {
668 .remove = wf_pm112_remove, 668 .remove = wf_pm112_remove,
669 .driver = { 669 .driver = {
670 .name = "windfarm", 670 .name = "windfarm",
671 .owner = THIS_MODULE,
672 }, 671 },
673}; 672};
674 673
diff --git a/drivers/macintosh/windfarm_pm72.c b/drivers/macintosh/windfarm_pm72.c
index 2f506b9d5a52..e88cfb36a74d 100644
--- a/drivers/macintosh/windfarm_pm72.c
+++ b/drivers/macintosh/windfarm_pm72.c
@@ -789,7 +789,6 @@ static struct platform_driver wf_pm72_driver = {
789 .remove = wf_pm72_remove, 789 .remove = wf_pm72_remove,
790 .driver = { 790 .driver = {
791 .name = "windfarm", 791 .name = "windfarm",
792 .owner = THIS_MODULE,
793 }, 792 },
794}; 793};
795 794
diff --git a/drivers/macintosh/windfarm_rm31.c b/drivers/macintosh/windfarm_rm31.c
index 82fc86a90c1a..bdfcb8a8bfbb 100644
--- a/drivers/macintosh/windfarm_rm31.c
+++ b/drivers/macintosh/windfarm_rm31.c
@@ -682,7 +682,6 @@ static struct platform_driver wf_rm31_driver = {
682 .remove = wf_rm31_remove, 682 .remove = wf_rm31_remove,
683 .driver = { 683 .driver = {
684 .name = "windfarm", 684 .name = "windfarm",
685 .owner = THIS_MODULE,
686 }, 685 },
687}; 686};
688 687
diff --git a/drivers/misc/cxl/vphb.c b/drivers/misc/cxl/vphb.c
index 7ada5f1b7bb6..3519acebfdab 100644
--- a/drivers/misc/cxl/vphb.c
+++ b/drivers/misc/cxl/vphb.c
@@ -230,6 +230,11 @@ int cxl_pci_vphb_add(struct cxl_afu *afu)
230 if (phb->bus == NULL) 230 if (phb->bus == NULL)
231 return -ENXIO; 231 return -ENXIO;
232 232
233 /* Set release hook on root bus */
234 pci_set_host_bridge_release(to_pci_host_bridge(phb->bus->bridge),
235 pcibios_free_controller_deferred,
236 (void *) phb);
237
233 /* Claim resources. This might need some rework as well depending 238 /* Claim resources. This might need some rework as well depending
234 * whether we are doing probe-only or not, like assigning unassigned 239 * whether we are doing probe-only or not, like assigning unassigned
235 * resources etc... 240 * resources etc...
@@ -256,7 +261,10 @@ void cxl_pci_vphb_remove(struct cxl_afu *afu)
256 afu->phb = NULL; 261 afu->phb = NULL;
257 262
258 pci_remove_root_bus(phb->bus); 263 pci_remove_root_bus(phb->bus);
259 pcibios_free_controller(phb); 264 /*
265 * We don't free phb here - that's handled by
266 * pcibios_free_controller_deferred()
267 */
260} 268}
261 269
262static bool _cxl_pci_is_vphb_device(struct pci_controller *phb) 270static bool _cxl_pci_is_vphb_device(struct pci_controller *phb)
diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c
index 5f4a2e04c8d7..add66236215c 100644
--- a/drivers/pci/host-bridge.c
+++ b/drivers/pci/host-bridge.c
@@ -44,6 +44,7 @@ void pci_set_host_bridge_release(struct pci_host_bridge *bridge,
44 bridge->release_fn = release_fn; 44 bridge->release_fn = release_fn;
45 bridge->release_data = release_data; 45 bridge->release_data = release_data;
46} 46}
47EXPORT_SYMBOL_GPL(pci_set_host_bridge_release);
47 48
48void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region, 49void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region,
49 struct resource *res) 50 struct resource *res)