diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-05-03 13:28:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-05-03 13:28:36 -0400 |
commit | 180d89f6ef9c22d088e324eb5e7d030ef3f84df0 (patch) | |
tree | e9e9a4f24f8d056eed34c89bfe3209f33c189b7e | |
parent | 6c3c1eb3c35e8856d6dcb01b412316a676f58bbe (diff) | |
parent | 0aab3747091db309b8a484cfd382a41644552aa3 (diff) |
Merge tag 'powerpc-4.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux
Pull powerpc fixes from Michael Ellerman:
- build fix for SMP=n in book3s_xics.c
- fix for Daniel's pci_controller_ops on powernv.
- revert the TM syscall abort patch for now.
- CPU affinity fix from Nathan.
- two EEH fixes from Gavin.
- fix for CR corruption from Sam.
- selftest build fix.
* tag 'powerpc-4.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux:
powerpc/powernv: Restore non-volatile CRs after nap
powerpc/eeh: Delay probing EEH device during hotplug
powerpc/eeh: Fix race condition in pcibios_set_pcie_reset_state()
powerpc/pseries: Correct cpu affinity for dlpar added cpus
selftests/powerpc: Fix the pmu install rule
Revert "powerpc/tm: Abort syscalls in active transactions"
powerpc/powernv: Fix early pci_controller_ops loading.
powerpc/kvm: Fix SMP=n build error in book3s_xics.c
-rw-r--r-- | Documentation/powerpc/transactional_memory.txt | 32 | ||||
-rw-r--r-- | arch/powerpc/include/uapi/asm/tm.h | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/eeh.c | 11 | ||||
-rw-r--r-- | arch/powerpc/kernel/entry_64.S | 19 | ||||
-rw-r--r-- | arch/powerpc/kernel/idle_power7.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kvm/book3s_xics.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/pci-ioda.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/dlpar.c | 10 | ||||
-rw-r--r-- | tools/testing/selftests/powerpc/pmu/Makefile | 2 | ||||
-rw-r--r-- | tools/testing/selftests/powerpc/tm/Makefile | 2 |
10 files changed, 37 insertions, 47 deletions
diff --git a/Documentation/powerpc/transactional_memory.txt b/Documentation/powerpc/transactional_memory.txt index ba0a2a4a54ba..ded69794a5c0 100644 --- a/Documentation/powerpc/transactional_memory.txt +++ b/Documentation/powerpc/transactional_memory.txt | |||
@@ -74,23 +74,22 @@ Causes of transaction aborts | |||
74 | Syscalls | 74 | Syscalls |
75 | ======== | 75 | ======== |
76 | 76 | ||
77 | Syscalls made from within an active transaction will not be performed and the | 77 | Performing syscalls from within transaction is not recommended, and can lead |
78 | transaction will be doomed by the kernel with the failure code TM_CAUSE_SYSCALL | 78 | to unpredictable results. |
79 | | TM_CAUSE_PERSISTENT. | ||
80 | 79 | ||
81 | Syscalls made from within a suspended transaction are performed as normal and | 80 | Syscalls do not by design abort transactions, but beware: The kernel code will |
82 | the transaction is not explicitly doomed by the kernel. However, what the | 81 | not be running in transactional state. The effect of syscalls will always |
83 | kernel does to perform the syscall may result in the transaction being doomed | 82 | remain visible, but depending on the call they may abort your transaction as a |
84 | by the hardware. The syscall is performed in suspended mode so any side | 83 | side-effect, read soon-to-be-aborted transactional data that should not remain |
85 | effects will be persistent, independent of transaction success or failure. No | 84 | invisible, etc. If you constantly retry a transaction that constantly aborts |
86 | guarantees are provided by the kernel about which syscalls will affect | 85 | itself by calling a syscall, you'll have a livelock & make no progress. |
87 | transaction success. | ||
88 | 86 | ||
89 | Care must be taken when relying on syscalls to abort during active transactions | 87 | Simple syscalls (e.g. sigprocmask()) "could" be OK. Even things like write() |
90 | if the calls are made via a library. Libraries may cache values (which may | 88 | from, say, printf() should be OK as long as the kernel does not access any |
91 | give the appearance of success) or perform operations that cause transaction | 89 | memory that was accessed transactionally. |
92 | failure before entering the kernel (which may produce different failure codes). | 90 | |
93 | Examples are glibc's getpid() and lazy symbol resolution. | 91 | Consider any syscalls that happen to work as debug-only -- not recommended for |
92 | production use. Best to queue them up till after the transaction is over. | ||
94 | 93 | ||
95 | 94 | ||
96 | Signals | 95 | Signals |
@@ -177,7 +176,8 @@ kernel aborted a transaction: | |||
177 | TM_CAUSE_RESCHED Thread was rescheduled. | 176 | TM_CAUSE_RESCHED Thread was rescheduled. |
178 | TM_CAUSE_TLBI Software TLB invalid. | 177 | TM_CAUSE_TLBI Software TLB invalid. |
179 | TM_CAUSE_FAC_UNAV FP/VEC/VSX unavailable trap. | 178 | TM_CAUSE_FAC_UNAV FP/VEC/VSX unavailable trap. |
180 | TM_CAUSE_SYSCALL Syscall from active transaction. | 179 | TM_CAUSE_SYSCALL Currently unused; future syscalls that must abort |
180 | transactions for consistency will use this. | ||
181 | TM_CAUSE_SIGNAL Signal delivered. | 181 | TM_CAUSE_SIGNAL Signal delivered. |
182 | TM_CAUSE_MISC Currently unused. | 182 | TM_CAUSE_MISC Currently unused. |
183 | TM_CAUSE_ALIGNMENT Alignment fault. | 183 | TM_CAUSE_ALIGNMENT Alignment fault. |
diff --git a/arch/powerpc/include/uapi/asm/tm.h b/arch/powerpc/include/uapi/asm/tm.h index 5047659815a5..5d836b7c1176 100644 --- a/arch/powerpc/include/uapi/asm/tm.h +++ b/arch/powerpc/include/uapi/asm/tm.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #define TM_CAUSE_RESCHED 0xde | 11 | #define TM_CAUSE_RESCHED 0xde |
12 | #define TM_CAUSE_TLBI 0xdc | 12 | #define TM_CAUSE_TLBI 0xdc |
13 | #define TM_CAUSE_FAC_UNAV 0xda | 13 | #define TM_CAUSE_FAC_UNAV 0xda |
14 | #define TM_CAUSE_SYSCALL 0xd8 | 14 | #define TM_CAUSE_SYSCALL 0xd8 /* future use */ |
15 | #define TM_CAUSE_MISC 0xd6 /* future use */ | 15 | #define TM_CAUSE_MISC 0xd6 /* future use */ |
16 | #define TM_CAUSE_SIGNAL 0xd4 | 16 | #define TM_CAUSE_SIGNAL 0xd4 |
17 | #define TM_CAUSE_ALIGNMENT 0xd2 | 17 | #define TM_CAUSE_ALIGNMENT 0xd2 |
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c index 44b480e3a5af..9ee61d15653d 100644 --- a/arch/powerpc/kernel/eeh.c +++ b/arch/powerpc/kernel/eeh.c | |||
@@ -749,21 +749,24 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state stat | |||
749 | eeh_unfreeze_pe(pe, false); | 749 | eeh_unfreeze_pe(pe, false); |
750 | eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED); | 750 | eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED); |
751 | eeh_pe_dev_traverse(pe, eeh_restore_dev_state, dev); | 751 | eeh_pe_dev_traverse(pe, eeh_restore_dev_state, dev); |
752 | eeh_pe_state_clear(pe, EEH_PE_ISOLATED); | ||
752 | break; | 753 | break; |
753 | case pcie_hot_reset: | 754 | case pcie_hot_reset: |
755 | eeh_pe_state_mark(pe, EEH_PE_ISOLATED); | ||
754 | eeh_ops->set_option(pe, EEH_OPT_FREEZE_PE); | 756 | eeh_ops->set_option(pe, EEH_OPT_FREEZE_PE); |
755 | eeh_pe_dev_traverse(pe, eeh_disable_and_save_dev_state, dev); | 757 | eeh_pe_dev_traverse(pe, eeh_disable_and_save_dev_state, dev); |
756 | eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED); | 758 | eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED); |
757 | eeh_ops->reset(pe, EEH_RESET_HOT); | 759 | eeh_ops->reset(pe, EEH_RESET_HOT); |
758 | break; | 760 | break; |
759 | case pcie_warm_reset: | 761 | case pcie_warm_reset: |
762 | eeh_pe_state_mark(pe, EEH_PE_ISOLATED); | ||
760 | eeh_ops->set_option(pe, EEH_OPT_FREEZE_PE); | 763 | eeh_ops->set_option(pe, EEH_OPT_FREEZE_PE); |
761 | eeh_pe_dev_traverse(pe, eeh_disable_and_save_dev_state, dev); | 764 | eeh_pe_dev_traverse(pe, eeh_disable_and_save_dev_state, dev); |
762 | eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED); | 765 | eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED); |
763 | eeh_ops->reset(pe, EEH_RESET_FUNDAMENTAL); | 766 | eeh_ops->reset(pe, EEH_RESET_FUNDAMENTAL); |
764 | break; | 767 | break; |
765 | default: | 768 | default: |
766 | eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED); | 769 | eeh_pe_state_clear(pe, EEH_PE_ISOLATED | EEH_PE_CFG_BLOCKED); |
767 | return -EINVAL; | 770 | return -EINVAL; |
768 | }; | 771 | }; |
769 | 772 | ||
@@ -1058,6 +1061,9 @@ void eeh_add_device_early(struct pci_dn *pdn) | |||
1058 | if (!edev || !eeh_enabled()) | 1061 | if (!edev || !eeh_enabled()) |
1059 | return; | 1062 | return; |
1060 | 1063 | ||
1064 | if (!eeh_has_flag(EEH_PROBE_MODE_DEVTREE)) | ||
1065 | return; | ||
1066 | |||
1061 | /* USB Bus children of PCI devices will not have BUID's */ | 1067 | /* USB Bus children of PCI devices will not have BUID's */ |
1062 | phb = edev->phb; | 1068 | phb = edev->phb; |
1063 | if (NULL == phb || | 1069 | if (NULL == phb || |
@@ -1112,6 +1118,9 @@ void eeh_add_device_late(struct pci_dev *dev) | |||
1112 | return; | 1118 | return; |
1113 | } | 1119 | } |
1114 | 1120 | ||
1121 | if (eeh_has_flag(EEH_PROBE_MODE_DEV)) | ||
1122 | eeh_ops->probe(pdn, NULL); | ||
1123 | |||
1115 | /* | 1124 | /* |
1116 | * The EEH cache might not be removed correctly because of | 1125 | * The EEH cache might not be removed correctly because of |
1117 | * unbalanced kref to the device during unplug time, which | 1126 | * unbalanced kref to the device during unplug time, which |
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index 8ca9434c40e6..afbc20019c2e 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <asm/ftrace.h> | 34 | #include <asm/ftrace.h> |
35 | #include <asm/hw_irq.h> | 35 | #include <asm/hw_irq.h> |
36 | #include <asm/context_tracking.h> | 36 | #include <asm/context_tracking.h> |
37 | #include <asm/tm.h> | ||
38 | 37 | ||
39 | /* | 38 | /* |
40 | * System calls. | 39 | * System calls. |
@@ -146,24 +145,6 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) | |||
146 | andi. r11,r10,_TIF_SYSCALL_DOTRACE | 145 | andi. r11,r10,_TIF_SYSCALL_DOTRACE |
147 | bne syscall_dotrace | 146 | bne syscall_dotrace |
148 | .Lsyscall_dotrace_cont: | 147 | .Lsyscall_dotrace_cont: |
149 | #ifdef CONFIG_PPC_TRANSACTIONAL_MEM | ||
150 | BEGIN_FTR_SECTION | ||
151 | b 1f | ||
152 | END_FTR_SECTION_IFCLR(CPU_FTR_TM) | ||
153 | extrdi. r11, r12, 1, (63-MSR_TS_T_LG) /* transaction active? */ | ||
154 | beq+ 1f | ||
155 | |||
156 | /* Doom the transaction and don't perform the syscall: */ | ||
157 | mfmsr r11 | ||
158 | li r12, 1 | ||
159 | rldimi r11, r12, MSR_TM_LG, 63-MSR_TM_LG | ||
160 | mtmsrd r11, 0 | ||
161 | li r11, (TM_CAUSE_SYSCALL|TM_CAUSE_PERSISTENT) | ||
162 | TABORT(R11) | ||
163 | |||
164 | b .Lsyscall_exit | ||
165 | 1: | ||
166 | #endif | ||
167 | cmpldi 0,r0,NR_syscalls | 148 | cmpldi 0,r0,NR_syscalls |
168 | bge- syscall_enosys | 149 | bge- syscall_enosys |
169 | 150 | ||
diff --git a/arch/powerpc/kernel/idle_power7.S b/arch/powerpc/kernel/idle_power7.S index eeaa0d5f69d5..ccde8f084ce4 100644 --- a/arch/powerpc/kernel/idle_power7.S +++ b/arch/powerpc/kernel/idle_power7.S | |||
@@ -501,9 +501,11 @@ BEGIN_FTR_SECTION | |||
501 | CHECK_HMI_INTERRUPT | 501 | CHECK_HMI_INTERRUPT |
502 | END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) | 502 | END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) |
503 | ld r1,PACAR1(r13) | 503 | ld r1,PACAR1(r13) |
504 | ld r6,_CCR(r1) | ||
504 | ld r4,_MSR(r1) | 505 | ld r4,_MSR(r1) |
505 | ld r5,_NIP(r1) | 506 | ld r5,_NIP(r1) |
506 | addi r1,r1,INT_FRAME_SIZE | 507 | addi r1,r1,INT_FRAME_SIZE |
508 | mtcr r6 | ||
507 | mtspr SPRN_SRR1,r4 | 509 | mtspr SPRN_SRR1,r4 |
508 | mtspr SPRN_SRR0,r5 | 510 | mtspr SPRN_SRR0,r5 |
509 | rfid | 511 | rfid |
diff --git a/arch/powerpc/kvm/book3s_xics.c b/arch/powerpc/kvm/book3s_xics.c index 8f3e6cc54d95..c6ca7db64673 100644 --- a/arch/powerpc/kvm/book3s_xics.c +++ b/arch/powerpc/kvm/book3s_xics.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/err.h> | 12 | #include <linux/err.h> |
13 | #include <linux/gfp.h> | 13 | #include <linux/gfp.h> |
14 | #include <linux/anon_inodes.h> | 14 | #include <linux/anon_inodes.h> |
15 | #include <linux/spinlock.h> | ||
15 | 16 | ||
16 | #include <asm/uaccess.h> | 17 | #include <asm/uaccess.h> |
17 | #include <asm/kvm_book3s.h> | 18 | #include <asm/kvm_book3s.h> |
@@ -20,7 +21,6 @@ | |||
20 | #include <asm/xics.h> | 21 | #include <asm/xics.h> |
21 | #include <asm/debug.h> | 22 | #include <asm/debug.h> |
22 | #include <asm/time.h> | 23 | #include <asm/time.h> |
23 | #include <asm/spinlock.h> | ||
24 | 24 | ||
25 | #include <linux/debugfs.h> | 25 | #include <linux/debugfs.h> |
26 | #include <linux/seq_file.h> | 26 | #include <linux/seq_file.h> |
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 920c252d1f49..f8bc950efcae 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c | |||
@@ -2693,7 +2693,6 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np, | |||
2693 | hose->last_busno = 0xff; | 2693 | hose->last_busno = 0xff; |
2694 | } | 2694 | } |
2695 | hose->private_data = phb; | 2695 | hose->private_data = phb; |
2696 | hose->controller_ops = pnv_pci_controller_ops; | ||
2697 | phb->hub_id = hub_id; | 2696 | phb->hub_id = hub_id; |
2698 | phb->opal_id = phb_id; | 2697 | phb->opal_id = phb_id; |
2699 | phb->type = ioda_type; | 2698 | phb->type = ioda_type; |
@@ -2812,6 +2811,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np, | |||
2812 | pnv_pci_controller_ops.enable_device_hook = pnv_pci_enable_device_hook; | 2811 | pnv_pci_controller_ops.enable_device_hook = pnv_pci_enable_device_hook; |
2813 | pnv_pci_controller_ops.window_alignment = pnv_pci_window_alignment; | 2812 | pnv_pci_controller_ops.window_alignment = pnv_pci_window_alignment; |
2814 | pnv_pci_controller_ops.reset_secondary_bus = pnv_pci_reset_secondary_bus; | 2813 | pnv_pci_controller_ops.reset_secondary_bus = pnv_pci_reset_secondary_bus; |
2814 | hose->controller_ops = pnv_pci_controller_ops; | ||
2815 | 2815 | ||
2816 | #ifdef CONFIG_PCI_IOV | 2816 | #ifdef CONFIG_PCI_IOV |
2817 | ppc_md.pcibios_fixup_sriov = pnv_pci_ioda_fixup_iov_resources; | 2817 | ppc_md.pcibios_fixup_sriov = pnv_pci_ioda_fixup_iov_resources; |
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c index b4b11096ea8b..019d34aaf054 100644 --- a/arch/powerpc/platforms/pseries/dlpar.c +++ b/arch/powerpc/platforms/pseries/dlpar.c | |||
@@ -412,6 +412,10 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count) | |||
412 | if (rc) | 412 | if (rc) |
413 | return -EINVAL; | 413 | return -EINVAL; |
414 | 414 | ||
415 | rc = dlpar_acquire_drc(drc_index); | ||
416 | if (rc) | ||
417 | return -EINVAL; | ||
418 | |||
415 | parent = of_find_node_by_path("/cpus"); | 419 | parent = of_find_node_by_path("/cpus"); |
416 | if (!parent) | 420 | if (!parent) |
417 | return -ENODEV; | 421 | return -ENODEV; |
@@ -422,12 +426,6 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count) | |||
422 | 426 | ||
423 | of_node_put(parent); | 427 | of_node_put(parent); |
424 | 428 | ||
425 | rc = dlpar_acquire_drc(drc_index); | ||
426 | if (rc) { | ||
427 | dlpar_free_cc_nodes(dn); | ||
428 | return -EINVAL; | ||
429 | } | ||
430 | |||
431 | rc = dlpar_attach_node(dn); | 429 | rc = dlpar_attach_node(dn); |
432 | if (rc) { | 430 | if (rc) { |
433 | dlpar_release_drc(drc_index); | 431 | dlpar_release_drc(drc_index); |
diff --git a/tools/testing/selftests/powerpc/pmu/Makefile b/tools/testing/selftests/powerpc/pmu/Makefile index 5a161175bbd4..a9099d9f8f39 100644 --- a/tools/testing/selftests/powerpc/pmu/Makefile +++ b/tools/testing/selftests/powerpc/pmu/Makefile | |||
@@ -26,7 +26,7 @@ override define EMIT_TESTS | |||
26 | $(MAKE) -s -C ebb emit_tests | 26 | $(MAKE) -s -C ebb emit_tests |
27 | endef | 27 | endef |
28 | 28 | ||
29 | DEFAULT_INSTALL := $(INSTALL_RULE) | 29 | DEFAULT_INSTALL_RULE := $(INSTALL_RULE) |
30 | override define INSTALL_RULE | 30 | override define INSTALL_RULE |
31 | $(DEFAULT_INSTALL_RULE) | 31 | $(DEFAULT_INSTALL_RULE) |
32 | $(MAKE) -C ebb install | 32 | $(MAKE) -C ebb install |
diff --git a/tools/testing/selftests/powerpc/tm/Makefile b/tools/testing/selftests/powerpc/tm/Makefile index 1b616fa79e93..6bff955e1d55 100644 --- a/tools/testing/selftests/powerpc/tm/Makefile +++ b/tools/testing/selftests/powerpc/tm/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | TEST_PROGS := tm-resched-dscr tm-syscall | 1 | TEST_PROGS := tm-resched-dscr |
2 | 2 | ||
3 | all: $(TEST_PROGS) | 3 | all: $(TEST_PROGS) |
4 | 4 | ||