kup.h (475c8749d9542392d7e0855097d29ed14877ad0a) | kup.h (3dc12dfe74300febc568c3b530c0f9bee01f2821) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef _ASM_POWERPC_BOOK3S_32_KUP_H 3#define _ASM_POWERPC_BOOK3S_32_KUP_H 4 5#include <asm/bug.h> 6#include <asm/book3s/32/mmu-hash.h> 7 8#ifdef __ASSEMBLY__ --- 169 unchanged lines hidden (view full) --- 178} 179 180static inline bool 181bad_kuap_fault(struct pt_regs *regs, unsigned long address, bool is_write) 182{ 183 unsigned long begin = regs->kuap & 0xf0000000; 184 unsigned long end = regs->kuap << 28; 185 | 1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef _ASM_POWERPC_BOOK3S_32_KUP_H 3#define _ASM_POWERPC_BOOK3S_32_KUP_H 4 5#include <asm/bug.h> 6#include <asm/book3s/32/mmu-hash.h> 7 8#ifdef __ASSEMBLY__ --- 169 unchanged lines hidden (view full) --- 178} 179 180static inline bool 181bad_kuap_fault(struct pt_regs *regs, unsigned long address, bool is_write) 182{ 183 unsigned long begin = regs->kuap & 0xf0000000; 184 unsigned long end = regs->kuap << 28; 185 |
186 if (!is_write) 187 return false; 188 189 return WARN(address < begin || address >= end, 190 "Bug: write fault blocked by segment registers !"); | 186 return is_write && (address < begin || address >= end); |
191} 192 193#endif /* CONFIG_PPC_KUAP */ 194 195#endif /* __ASSEMBLY__ */ 196 197#endif /* _ASM_POWERPC_BOOK3S_32_KUP_H */ | 187} 188 189#endif /* CONFIG_PPC_KUAP */ 190 191#endif /* __ASSEMBLY__ */ 192 193#endif /* _ASM_POWERPC_BOOK3S_32_KUP_H */ |