Skip to content

Commit d5603db

Browse files
Automatic merge of 'next' into merge (2026-01-10 15:34)
2 parents 27527b2 + 815a8d2 commit d5603db

File tree

28 files changed

+326
-150
lines changed

28 files changed

+326
-150
lines changed

arch/powerpc/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,9 +1293,8 @@ config TASK_SIZE_BOOL
12931293
Say N here unless you know what you are doing.
12941294

12951295
config TASK_SIZE
1296-
hex "Size of user task space" if TASK_SIZE_BOOL
1296+
hex "Size of maximum user task space" if TASK_SIZE_BOOL
12971297
default "0x80000000" if PPC_8xx
1298-
default "0xb0000000" if PPC_BOOK3S_32 && EXECMEM
12991298
default "0xc0000000"
13001299

13011300
config MODULES_SIZE_BOOL

arch/powerpc/include/asm/barrier.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ do { \
102102

103103
#else /* !CONFIG_PPC_BARRIER_NOSPEC */
104104
#define barrier_nospec_asm
105-
#define barrier_nospec()
105+
#define barrier_nospec() do {} while (0)
106106
#endif /* CONFIG_PPC_BARRIER_NOSPEC */
107107

108108
/*

arch/powerpc/include/asm/book3s/32/kup.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ static __always_inline unsigned long __kuap_get_and_assert_locked(void)
9797
}
9898
#define __kuap_get_and_assert_locked __kuap_get_and_assert_locked
9999

100-
static __always_inline void allow_user_access(void __user *to, const void __user *from,
101-
u32 size, unsigned long dir)
100+
static __always_inline void allow_user_access(void __user *to, unsigned long dir)
102101
{
103102
BUILD_BUG_ON(!__builtin_constant_p(dir));
104103

arch/powerpc/include/asm/book3s/32/mmu-hash.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,15 @@ extern s32 patch__hash_page_B, patch__hash_page_C;
192192
extern s32 patch__flush_hash_A0, patch__flush_hash_A1, patch__flush_hash_A2;
193193
extern s32 patch__flush_hash_B;
194194

195+
#include <linux/sizes.h>
196+
#include <linux/align.h>
197+
195198
#include <asm/reg.h>
196199
#include <asm/task_size_32.h>
197200

198201
static __always_inline void update_user_segment(u32 n, u32 val)
199202
{
200-
if (n << 28 < TASK_SIZE)
203+
if (n << 28 < ALIGN(TASK_SIZE, SZ_256M))
201204
mtsr(val + n * 0x111, n << 28);
202205
}
203206

arch/powerpc/include/asm/book3s/32/pgtable.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,6 @@ void unmap_kernel_page(unsigned long va);
195195
#define VMALLOC_END ioremap_bot
196196
#endif
197197

198-
#define MODULES_END ALIGN_DOWN(PAGE_OFFSET, SZ_256M)
199-
#define MODULES_SIZE (CONFIG_MODULES_SIZE * SZ_1M)
200-
#define MODULES_VADDR (MODULES_END - MODULES_SIZE)
201-
202198
#ifndef __ASSEMBLER__
203199
#include <linux/sched.h>
204200
#include <linux/threads.h>

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,7 @@ __bad_kuap_fault(struct pt_regs *regs, unsigned long address, bool is_write)
353353
return (regs->amr & AMR_KUAP_BLOCK_READ) == AMR_KUAP_BLOCK_READ;
354354
}
355355

356-
static __always_inline void allow_user_access(void __user *to, const void __user *from,
357-
unsigned long size, unsigned long dir)
356+
static __always_inline void allow_user_access(void __user *to, unsigned long dir)
358357
{
359358
unsigned long thread_amr = 0;
360359

@@ -383,8 +382,7 @@ static __always_inline unsigned long get_kuap(void)
383382

384383
static __always_inline void set_kuap(unsigned long value) { }
385384

386-
static __always_inline void allow_user_access(void __user *to, const void __user *from,
387-
unsigned long size, unsigned long dir)
385+
static __always_inline void allow_user_access(void __user *to, unsigned long dir)
388386
{ }
389387

390388
#endif /* !CONFIG_PPC_KUAP */

arch/powerpc/include/asm/eeh.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ void eeh_pe_dev_traverse(struct eeh_pe *root,
289289
void eeh_pe_restore_bars(struct eeh_pe *pe);
290290
const char *eeh_pe_loc_get(struct eeh_pe *pe);
291291
struct pci_bus *eeh_pe_bus_get(struct eeh_pe *pe);
292+
const char *eeh_pe_loc_get_bus(struct pci_bus *bus);
293+
struct pci_bus *eeh_pe_bus_get_nolock(struct eeh_pe *pe);
292294

293295
void eeh_show_enabled(void);
294296
int __init eeh_init(struct eeh_ops *ops);

arch/powerpc/include/asm/kup.h

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ static __always_inline void __kuap_kernel_restore(struct pt_regs *regs, unsigned
7272
* platforms.
7373
*/
7474
#ifndef CONFIG_PPC_BOOK3S_64
75-
static __always_inline void allow_user_access(void __user *to, const void __user *from,
76-
unsigned long size, unsigned long dir) { }
75+
static __always_inline void allow_user_access(void __user *to, unsigned long dir) { }
7776
static __always_inline void prevent_user_access(unsigned long dir) { }
7877
static __always_inline unsigned long prevent_user_access_return(void) { return 0UL; }
7978
static __always_inline void restore_user_access(unsigned long flags) { }
@@ -132,55 +131,6 @@ static __always_inline void kuap_assert_locked(void)
132131
kuap_get_and_assert_locked();
133132
}
134133

135-
static __always_inline void allow_read_from_user(const void __user *from, unsigned long size)
136-
{
137-
barrier_nospec();
138-
allow_user_access(NULL, from, size, KUAP_READ);
139-
}
140-
141-
static __always_inline void allow_write_to_user(void __user *to, unsigned long size)
142-
{
143-
allow_user_access(to, NULL, size, KUAP_WRITE);
144-
}
145-
146-
static __always_inline void allow_read_write_user(void __user *to, const void __user *from,
147-
unsigned long size)
148-
{
149-
barrier_nospec();
150-
allow_user_access(to, from, size, KUAP_READ_WRITE);
151-
}
152-
153-
static __always_inline void prevent_read_from_user(const void __user *from, unsigned long size)
154-
{
155-
prevent_user_access(KUAP_READ);
156-
}
157-
158-
static __always_inline void prevent_write_to_user(void __user *to, unsigned long size)
159-
{
160-
prevent_user_access(KUAP_WRITE);
161-
}
162-
163-
static __always_inline void prevent_read_write_user(void __user *to, const void __user *from,
164-
unsigned long size)
165-
{
166-
prevent_user_access(KUAP_READ_WRITE);
167-
}
168-
169-
static __always_inline void prevent_current_access_user(void)
170-
{
171-
prevent_user_access(KUAP_READ_WRITE);
172-
}
173-
174-
static __always_inline void prevent_current_read_from_user(void)
175-
{
176-
prevent_user_access(KUAP_READ);
177-
}
178-
179-
static __always_inline void prevent_current_write_to_user(void)
180-
{
181-
prevent_user_access(KUAP_WRITE);
182-
}
183-
184134
#endif /* !__ASSEMBLER__ */
185135

186136
#endif /* _ASM_POWERPC_KUAP_H_ */

arch/powerpc/include/asm/nohash/32/kup-8xx.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ static __always_inline void uaccess_end_8xx(void)
4949
"i"(SPRN_MD_AP), "r"(MD_APG_KUAP), "i"(MMU_FTR_KUAP) : "memory");
5050
}
5151

52-
static __always_inline void allow_user_access(void __user *to, const void __user *from,
53-
unsigned long size, unsigned long dir)
52+
static __always_inline void allow_user_access(void __user *to, unsigned long dir)
5453
{
5554
uaccess_begin_8xx(MD_APG_INIT);
5655
}

arch/powerpc/include/asm/nohash/32/mmu-8xx.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,6 @@
170170

171171
#define mmu_linear_psize MMU_PAGE_8M
172172

173-
#define MODULES_END PAGE_OFFSET
174-
#define MODULES_SIZE (CONFIG_MODULES_SIZE * SZ_1M)
175-
#define MODULES_VADDR (MODULES_END - MODULES_SIZE)
176-
177173
#ifndef __ASSEMBLER__
178174

179175
#include <linux/mmdebug.h>

0 commit comments

Comments
 (0)