Skip to content

Commit 13da6ac

Browse files
committed
Merge tag 'powerpc-5.3-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: "One fix for a boot hang on some Freescale machines when PREEMPT is enabled. Two CVE fixes for bugs in our handling of FP registers and transactional memory, both of which can result in corrupted FP state, or FP state leaking between processes. Thanks to: Chris Packham, Christophe Leroy, Gustavo Romero, Michael Neuling" * tag 'powerpc-5.3-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/tm: Fix restoring FP/VMX facility incorrectly on interrupts powerpc/tm: Fix FP/VMX unavailable exceptions inside a transaction powerpc/64e: Drop stale call to smp_processor_id() which hangs SMP startup
2 parents d41a3ef + a8318c1 commit 13da6ac

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

arch/powerpc/kernel/process.c

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,8 @@ static void check_if_tm_restore_required(struct task_struct *tsk)
101101
}
102102
}
103103

104-
static bool tm_active_with_fp(struct task_struct *tsk)
105-
{
106-
return MSR_TM_ACTIVE(tsk->thread.regs->msr) &&
107-
(tsk->thread.ckpt_regs.msr & MSR_FP);
108-
}
109-
110-
static bool tm_active_with_altivec(struct task_struct *tsk)
111-
{
112-
return MSR_TM_ACTIVE(tsk->thread.regs->msr) &&
113-
(tsk->thread.ckpt_regs.msr & MSR_VEC);
114-
}
115104
#else
116105
static inline void check_if_tm_restore_required(struct task_struct *tsk) { }
117-
static inline bool tm_active_with_fp(struct task_struct *tsk) { return false; }
118-
static inline bool tm_active_with_altivec(struct task_struct *tsk) { return false; }
119106
#endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
120107

121108
bool strict_msr_control;
@@ -252,7 +239,7 @@ EXPORT_SYMBOL(enable_kernel_fp);
252239

253240
static int restore_fp(struct task_struct *tsk)
254241
{
255-
if (tsk->thread.load_fp || tm_active_with_fp(tsk)) {
242+
if (tsk->thread.load_fp) {
256243
load_fp_state(&current->thread.fp_state);
257244
current->thread.load_fp++;
258245
return 1;
@@ -334,8 +321,7 @@ EXPORT_SYMBOL_GPL(flush_altivec_to_thread);
334321

335322
static int restore_altivec(struct task_struct *tsk)
336323
{
337-
if (cpu_has_feature(CPU_FTR_ALTIVEC) &&
338-
(tsk->thread.load_vec || tm_active_with_altivec(tsk))) {
324+
if (cpu_has_feature(CPU_FTR_ALTIVEC) && (tsk->thread.load_vec)) {
339325
load_vr_state(&tsk->thread.vr_state);
340326
tsk->thread.used_vr = 1;
341327
tsk->thread.load_vec++;
@@ -497,13 +483,14 @@ void giveup_all(struct task_struct *tsk)
497483
if (!tsk->thread.regs)
498484
return;
499485

486+
check_if_tm_restore_required(tsk);
487+
500488
usermsr = tsk->thread.regs->msr;
501489

502490
if ((usermsr & msr_all_available) == 0)
503491
return;
504492

505493
msr_check_and_set(msr_all_available);
506-
check_if_tm_restore_required(tsk);
507494

508495
WARN_ON((usermsr & MSR_VSX) && !((usermsr & MSR_FP) && (usermsr & MSR_VEC)));
509496

arch/powerpc/mm/nohash/tlb.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,6 @@ static void early_init_this_mmu(void)
630630
#ifdef CONFIG_PPC_FSL_BOOK3E
631631
if (mmu_has_feature(MMU_FTR_TYPE_FSL_E)) {
632632
unsigned int num_cams;
633-
int __maybe_unused cpu = smp_processor_id();
634633
bool map = true;
635634

636635
/* use a quarter of the TLBCAM for bolted linear map */

0 commit comments

Comments
 (0)