Skip to content

Commit 95d0b9d

Browse files
committed
Merge tag 'powerpc-6.3-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: - Fix a false positive warning in __pte_needs_flush() (with DEBUG_VM=y) - Fix oops when a PF_IO_WORKER thread tries to core dump - Don't try to reconfigure VAS when it's disabled Thanks to Benjamin Gray, Haren Myneni, Jens Axboe, Nathan Lynch, and Russell Currey. * tag 'powerpc-6.3-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/pseries/vas: Ignore VAS update for DLPAR if copy/paste is not enabled powerpc: Don't try to copy PPR for task with NULL pt_regs powerpc/64s: Fix __pte_needs_flush() false positive warning
2 parents f7772da + eca9f6e commit 95d0b9d

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

arch/powerpc/include/asm/book3s/64/tlbflush.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ static inline void flush_tlb_fix_spurious_fault(struct vm_area_struct *vma,
148148
*/
149149
}
150150

151+
static inline bool __pte_protnone(unsigned long pte)
152+
{
153+
return (pte & (pgprot_val(PAGE_NONE) | _PAGE_RWX)) == pgprot_val(PAGE_NONE);
154+
}
155+
151156
static inline bool __pte_flags_need_flush(unsigned long oldval,
152157
unsigned long newval)
153158
{
@@ -164,8 +169,8 @@ static inline bool __pte_flags_need_flush(unsigned long oldval,
164169
/*
165170
* We do not expect kernel mappings or non-PTEs or not-present PTEs.
166171
*/
167-
VM_WARN_ON_ONCE(oldval & _PAGE_PRIVILEGED);
168-
VM_WARN_ON_ONCE(newval & _PAGE_PRIVILEGED);
172+
VM_WARN_ON_ONCE(!__pte_protnone(oldval) && oldval & _PAGE_PRIVILEGED);
173+
VM_WARN_ON_ONCE(!__pte_protnone(newval) && newval & _PAGE_PRIVILEGED);
169174
VM_WARN_ON_ONCE(!(oldval & _PAGE_PTE));
170175
VM_WARN_ON_ONCE(!(newval & _PAGE_PTE));
171176
VM_WARN_ON_ONCE(!(oldval & _PAGE_PRESENT));

arch/powerpc/kernel/ptrace/ptrace-view.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,19 @@ static int gpr_set(struct task_struct *target, const struct user_regset *regset,
290290
static int ppr_get(struct task_struct *target, const struct user_regset *regset,
291291
struct membuf to)
292292
{
293+
if (!target->thread.regs)
294+
return -EINVAL;
295+
293296
return membuf_write(&to, &target->thread.regs->ppr, sizeof(u64));
294297
}
295298

296299
static int ppr_set(struct task_struct *target, const struct user_regset *regset,
297300
unsigned int pos, unsigned int count, const void *kbuf,
298301
const void __user *ubuf)
299302
{
303+
if (!target->thread.regs)
304+
return -EINVAL;
305+
300306
return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
301307
&target->thread.regs->ppr, 0, sizeof(u64));
302308
}

arch/powerpc/platforms/pseries/vas.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,13 @@ int pseries_vas_dlpar_cpu(void)
856856
{
857857
int new_nr_creds, rc;
858858

859+
/*
860+
* NX-GZIP is not enabled. Nothing to do for DLPAR event
861+
*/
862+
if (!copypaste_feat)
863+
return 0;
864+
865+
859866
rc = h_query_vas_capabilities(H_QUERY_VAS_CAPABILITIES,
860867
vascaps[VAS_GZIP_DEF_FEAT_TYPE].feat,
861868
(u64)virt_to_phys(&hv_cop_caps));
@@ -1012,6 +1019,7 @@ static int __init pseries_vas_init(void)
10121019
* Linux supports user space COPY/PASTE only with Radix
10131020
*/
10141021
if (!radix_enabled()) {
1022+
copypaste_feat = false;
10151023
pr_err("API is supported only with radix page tables\n");
10161024
return -ENOTSUPP;
10171025
}

0 commit comments

Comments
 (0)