1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

powerpc fixes for 6.14 #3

- Couple of patches to fix KASAN failduring boot
  - Fix to avoid warnings/errors when building with 4k page size
 
 Thanks to: Christophe Leroy, Ritesh Harjani (IBM), Erhard Furtner
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEqX2DNAOgU8sBX3pRpnEsdPSHZJQFAmezCJUACgkQpnEsdPSH
 ZJTCsg//de7Nn6mbVRvdIYWYskRcIQykOuRGuPWcJ6fPPgWnjByQ09DJ6XxFAaSI
 2yQflWOuP4SbKUINhsxLbOaDfkrbIIi05+C2KJoHc1SFxEeiLDJXKnLRtQ87kRGC
 /vQmdJKxm5Zd1ap8gWXXjzfC88INhO2ahjk1aDhLvL6KOW00AHZ3ifJZrQ4VJjrr
 1FZsnfCLNOTunJuxNu2v0xCO1kwmjfnn0wqRG6bW74iAeKKqS63k3SRT6DA/UiSQ
 g9fy3oROFPyqBAIa1vlfufeU0mcMVvYj8O0cAG9kze1MB4jKKOsJGEBiPwgIYsFM
 BoaBT45ZFPMuGvVrgHKFn1sM5ReR1tn6eaK5xrcR6K511JBDG6D9byAL/dNyvSii
 lcs4vpPL/a2hcmDd9z4sD8lhNZtloVqw2FqII0u1+d+70flDQ1cP252xrbD80yys
 /Q+vxnGcCAEQV8gqAB0RsYd2mTQfOp36jhiqAHSQT9uxCpuy9h2eSqfeGLH13eUQ
 JNC9c2uyH9sfQdrdai8NRympTGbKzGwltOkX9o5Jq/TZeaG/Yh9+s7Ow9WXYAzgZ
 G9UBlLUTzLVYhFm5He5TgMcyeKt7bAv093J5hJy5nGhalp0g9XvTwbLSQSBeBoIk
 52TnsCNsQd6sOrT5r4fiuLZ4WcMj0kyeJLV9G3282R1nPEi69OI=
 =oBBZ
 -----END PGP SIGNATURE-----

Merge tag 'powerpc-6.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Madhavan Srinivasan:

 - Couple of patches to fix KASAN failduring boot

 - Fix to avoid warnings/errors when building with 4k page size

Thanks to Christophe Leroy, Ritesh Harjani (IBM), and Erhard Furtner

* tag 'powerpc-6.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/code-patching: Fix KASAN hit by not flagging text patching area as VM_ALLOC
  powerpc/64s: Rewrite __real_pte() and __rpte_to_hidx() as static inline
  powerpc/code-patching: Disable KASAN report during patching via temporary mm
This commit is contained in:
Linus Torvalds 2025-02-17 10:32:19 -08:00
commit 6186bdd120
2 changed files with 13 additions and 3 deletions

View file

@ -77,9 +77,17 @@
/*
* With 4K page size the real_pte machinery is all nops.
*/
#define __real_pte(e, p, o) ((real_pte_t){(e)})
static inline real_pte_t __real_pte(pte_t pte, pte_t *ptep, int offset)
{
return (real_pte_t){pte};
}
#define __rpte_to_pte(r) ((r).pte)
#define __rpte_to_hidx(r,index) (pte_val(__rpte_to_pte(r)) >> H_PAGE_F_GIX_SHIFT)
static inline unsigned long __rpte_to_hidx(real_pte_t rpte, unsigned long index)
{
return pte_val(__rpte_to_pte(rpte)) >> H_PAGE_F_GIX_SHIFT;
}
#define pte_iterate_hashed_subpages(rpte, psize, va, index, shift) \
do { \

View file

@ -108,7 +108,7 @@ static int text_area_cpu_up(unsigned int cpu)
unsigned long addr;
int err;
area = get_vm_area(PAGE_SIZE, VM_ALLOC);
area = get_vm_area(PAGE_SIZE, 0);
if (!area) {
WARN_ONCE(1, "Failed to create text area for cpu %d\n",
cpu);
@ -493,7 +493,9 @@ static int __do_patch_instructions_mm(u32 *addr, u32 *code, size_t len, bool rep
orig_mm = start_using_temp_mm(patching_mm);
kasan_disable_current();
err = __patch_instructions(patch_addr, code, len, repeat_instr);
kasan_enable_current();
/* context synchronisation performed by __patch_instructions */
stop_using_temp_mm(patching_mm, orig_mm);