Skip to content

Commit a2c7a54

Browse files
committed
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc fixes from Benjamin Herrenschmidt: "This is mostly bug fixes (some of them regressions, some of them I deemed worth merging now) along with some patches from Li Zhong hooking up the new context tracking stuff (for the new full NO_HZ)" * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (25 commits) powerpc: Set show_unhandled_signals to 1 by default powerpc/perf: Fix setting of "to" addresses for BHRB powerpc/pmu: Fix order of interpreting BHRB target entries powerpc/perf: Move BHRB code into CONFIG_PPC64 region powerpc: select HAVE_CONTEXT_TRACKING for pSeries powerpc: Use the new schedule_user API on userspace preemption powerpc: Exit user context on notify resume powerpc: Exception hooks for context tracking subsystem powerpc: Syscall hooks for context tracking subsystem powerpc/booke64: Fix kernel hangs at kernel_dbg_exc powerpc: Fix irq_set_affinity() return values powerpc: Provide __bswapdi2 powerpc/powernv: Fix starting of secondary CPUs on OPALv2 and v3 powerpc/powernv: Detect OPAL v3 API version powerpc: Fix MAX_STACK_TRACE_ENTRIES too low warning again powerpc: Make CONFIG_RTAS_PROC depend on CONFIG_PROC_FS powerpc: Bring all threads online prior to migration/hibernation powerpc/rtas_flash: Fix validate_flash buffer overflow issue powerpc/kexec: Fix kexec when using VMX optimised memcpy powerpc: Fix build errors STRICT_MM_TYPECHECKS ...
2 parents 674825d + e34166a commit a2c7a54

45 files changed

Lines changed: 763 additions & 206 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/powerpc/Kconfig.debug‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,31 @@ config PPC_EARLY_DEBUG_OPAL_HVSI
262262
Select this to enable early debugging for the PowerNV platform
263263
using an "hvsi" console
264264

265+
config PPC_EARLY_DEBUG_MEMCONS
266+
bool "In memory console"
267+
help
268+
Select this to enable early debugging using an in memory console.
269+
This console provides input and output buffers stored within the
270+
kernel BSS and should be safe to select on any system. A debugger
271+
can then be used to read kernel output or send input to the console.
265272
endchoice
266273

274+
config PPC_MEMCONS_OUTPUT_SIZE
275+
int "In memory console output buffer size"
276+
depends on PPC_EARLY_DEBUG_MEMCONS
277+
default 4096
278+
help
279+
Selects the size of the output buffer (in bytes) of the in memory
280+
console.
281+
282+
config PPC_MEMCONS_INPUT_SIZE
283+
int "In memory console input buffer size"
284+
depends on PPC_EARLY_DEBUG_MEMCONS
285+
default 128
286+
help
287+
Selects the size of the input buffer (in bytes) of the in memory
288+
console.
289+
267290
config PPC_EARLY_DEBUG_OPAL
268291
def_bool y
269292
depends on PPC_EARLY_DEBUG_OPAL_RAW || PPC_EARLY_DEBUG_OPAL_HVSI
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#ifndef _ASM_POWERPC_CONTEXT_TRACKING_H
2+
#define _ASM_POWERPC_CONTEXT_TRACKING_H
3+
4+
#ifdef CONFIG_CONTEXT_TRACKING
5+
#define SCHEDULE_USER bl .schedule_user
6+
#else
7+
#define SCHEDULE_USER bl .schedule
8+
#endif
9+
10+
#endif

‎arch/powerpc/include/asm/firmware.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#define FW_FEATURE_BEST_ENERGY ASM_CONST(0x0000000080000000)
5353
#define FW_FEATURE_TYPE1_AFFINITY ASM_CONST(0x0000000100000000)
5454
#define FW_FEATURE_PRRN ASM_CONST(0x0000000200000000)
55+
#define FW_FEATURE_OPALv3 ASM_CONST(0x0000000400000000)
5556

5657
#ifndef __ASSEMBLY__
5758

@@ -69,7 +70,8 @@ enum {
6970
FW_FEATURE_SET_MODE | FW_FEATURE_BEST_ENERGY |
7071
FW_FEATURE_TYPE1_AFFINITY | FW_FEATURE_PRRN,
7172
FW_FEATURE_PSERIES_ALWAYS = 0,
72-
FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL | FW_FEATURE_OPALv2,
73+
FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL | FW_FEATURE_OPALv2 |
74+
FW_FEATURE_OPALv3,
7375
FW_FEATURE_POWERNV_ALWAYS = 0,
7476
FW_FEATURE_PS3_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,
7577
FW_FEATURE_PS3_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,

‎arch/powerpc/include/asm/hw_irq.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,12 @@ static inline bool arch_irqs_disabled(void)
9696
#endif
9797

9898
#define hard_irq_disable() do { \
99+
u8 _was_enabled = get_paca()->soft_enabled; \
99100
__hard_irq_disable(); \
100-
if (local_paca->soft_enabled) \
101-
trace_hardirqs_off(); \
102101
get_paca()->soft_enabled = 0; \
103102
get_paca()->irq_happened |= PACA_IRQ_HARD_DIS; \
103+
if (_was_enabled) \
104+
trace_hardirqs_off(); \
104105
} while(0)
105106

106107
static inline bool lazy_irq_pending(void)

‎arch/powerpc/include/asm/opal.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ enum OpalMCE_TlbErrorType {
243243

244244
enum OpalThreadStatus {
245245
OPAL_THREAD_INACTIVE = 0x0,
246-
OPAL_THREAD_STARTED = 0x1
246+
OPAL_THREAD_STARTED = 0x1,
247+
OPAL_THREAD_UNAVAILABLE = 0x2 /* opal-v3 */
247248
};
248249

249250
enum OpalPciBusCompare {
@@ -563,6 +564,8 @@ extern void opal_nvram_init(void);
563564

564565
extern int opal_machine_check(struct pt_regs *regs);
565566

567+
extern void opal_shutdown(void);
568+
566569
#endif /* __ASSEMBLY__ */
567570

568571
#endif /* __OPAL_H */

‎arch/powerpc/include/asm/pgalloc-64.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
186186

187187
static inline pgtable_t pmd_pgtable(pmd_t pmd)
188188
{
189-
return (pgtable_t)(pmd_val(pmd) & -sizeof(pte_t)*PTRS_PER_PTE);
189+
return (pgtable_t)(pmd_val(pmd) & ~PMD_MASKED_BITS);
190190
}
191191

192192
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,

‎arch/powerpc/include/asm/pte-hash64-64k.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
* generic accessors and iterators here
4848
*/
4949
#define __real_pte(e,p) ((real_pte_t) { \
50-
(e), ((e) & _PAGE_COMBO) ? \
50+
(e), (pte_val(e) & _PAGE_COMBO) ? \
5151
(pte_val(*((p) + PTRS_PER_PTE))) : 0 })
5252
#define __rpte_to_hidx(r,index) ((pte_val((r).pte) & _PAGE_COMBO) ? \
5353
(((r).hidx >> ((index)<<2)) & 0xf) : ((pte_val((r).pte) >> 12) & 0xf))

‎arch/powerpc/include/asm/rtas.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ extern void rtas_progress(char *s, unsigned short hex);
264264
extern void rtas_initialize(void);
265265
extern int rtas_suspend_cpu(struct rtas_suspend_me_data *data);
266266
extern int rtas_suspend_last_cpu(struct rtas_suspend_me_data *data);
267+
extern int rtas_online_cpus_mask(cpumask_var_t cpus);
268+
extern int rtas_offline_cpus_mask(cpumask_var_t cpus);
267269
extern int rtas_ibm_suspend_me(struct rtas_args *);
268270

269271
struct rtc_time;

‎arch/powerpc/include/asm/thread_info.h‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static inline struct thread_info *current_thread_info(void)
9797
#define TIF_PERFMON_CTXSW 6 /* perfmon needs ctxsw calls */
9898
#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */
9999
#define TIF_SINGLESTEP 8 /* singlestepping active */
100-
#define TIF_MEMDIE 9 /* is terminating due to OOM killer */
100+
#define TIF_NOHZ 9 /* in adaptive nohz mode */
101101
#define TIF_SECCOMP 10 /* secure computing */
102102
#define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */
103103
#define TIF_NOERROR 12 /* Force successful syscall return */
@@ -106,6 +106,7 @@ static inline struct thread_info *current_thread_info(void)
106106
#define TIF_SYSCALL_TRACEPOINT 15 /* syscall tracepoint instrumentation */
107107
#define TIF_EMULATE_STACK_STORE 16 /* Is an instruction emulation
108108
for stack store? */
109+
#define TIF_MEMDIE 17 /* is terminating due to OOM killer */
109110

110111
/* as above, but as bit values */
111112
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -124,8 +125,10 @@ static inline struct thread_info *current_thread_info(void)
124125
#define _TIF_UPROBE (1<<TIF_UPROBE)
125126
#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT)
126127
#define _TIF_EMULATE_STACK_STORE (1<<TIF_EMULATE_STACK_STORE)
128+
#define _TIF_NOHZ (1<<TIF_NOHZ)
127129
#define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
128-
_TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT)
130+
_TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT | \
131+
_TIF_NOHZ)
129132

130133
#define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
131134
_TIF_NOTIFY_RESUME | _TIF_UPROBE)

‎arch/powerpc/include/asm/udbg.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ extern void __init udbg_init_40x_realmode(void);
5252
extern void __init udbg_init_cpm(void);
5353
extern void __init udbg_init_usbgecko(void);
5454
extern void __init udbg_init_wsp(void);
55+
extern void __init udbg_init_memcons(void);
5556
extern void __init udbg_init_ehv_bc(void);
5657
extern void __init udbg_init_ps3gelic(void);
5758
extern void __init udbg_init_debug_opal_raw(void);

0 commit comments

Comments
 (0)