Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Catalin Marinas:

- Fix huge_ptep_set_access_flags() to return "changed" when any of the
ptes in the contiguous range is changed, not just the last one

- Fix the adr_l assembly macro to work in modules under KASLR

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
arm64: assembler: make adr_l work in modules under KASLR
arm64: hugetlb: fix the wrong return value for huge_ptep_set_access_flags

+28 -10
+27 -9
arch/arm64/include/asm/assembler.h
··· 164 164 165 165 /* 166 166 * Pseudo-ops for PC-relative adr/ldr/str <reg>, <symbol> where 167 - * <symbol> is within the range +/- 4 GB of the PC. 167 + * <symbol> is within the range +/- 4 GB of the PC when running 168 + * in core kernel context. In module context, a movz/movk sequence 169 + * is used, since modules may be loaded far away from the kernel 170 + * when KASLR is in effect. 168 171 */ 169 172 /* 170 173 * @dst: destination register (64 bit wide) 171 174 * @sym: name of the symbol 172 - * @tmp: optional scratch register to be used if <dst> == sp, which 173 - * is not allowed in an adrp instruction 174 175 */ 175 - .macro adr_l, dst, sym, tmp= 176 - .ifb \tmp 176 + .macro adr_l, dst, sym 177 + #ifndef MODULE 177 178 adrp \dst, \sym 178 179 add \dst, \dst, :lo12:\sym 179 - .else 180 - adrp \tmp, \sym 181 - add \dst, \tmp, :lo12:\sym 182 - .endif 180 + #else 181 + movz \dst, #:abs_g3:\sym 182 + movk \dst, #:abs_g2_nc:\sym 183 + movk \dst, #:abs_g1_nc:\sym 184 + movk \dst, #:abs_g0_nc:\sym 185 + #endif 183 186 .endm 184 187 185 188 /* ··· 193 190 * the address 194 191 */ 195 192 .macro ldr_l, dst, sym, tmp= 193 + #ifndef MODULE 196 194 .ifb \tmp 197 195 adrp \dst, \sym 198 196 ldr \dst, [\dst, :lo12:\sym] ··· 201 197 adrp \tmp, \sym 202 198 ldr \dst, [\tmp, :lo12:\sym] 203 199 .endif 200 + #else 201 + .ifb \tmp 202 + adr_l \dst, \sym 203 + ldr \dst, [\dst] 204 + .else 205 + adr_l \tmp, \sym 206 + ldr \dst, [\tmp] 207 + .endif 208 + #endif 204 209 .endm 205 210 206 211 /* ··· 219 206 * while <src> needs to be preserved. 220 207 */ 221 208 .macro str_l, src, sym, tmp 209 + #ifndef MODULE 222 210 adrp \tmp, \sym 223 211 str \src, [\tmp, :lo12:\sym] 212 + #else 213 + adr_l \tmp, \sym 214 + str \src, [\tmp] 215 + #endif 224 216 .endm 225 217 226 218 /*
+1 -1
arch/arm64/mm/hugetlbpage.c
··· 239 239 ncontig = find_num_contig(vma->vm_mm, addr, cpte, 240 240 *cpte, &pgsize); 241 241 for (i = 0; i < ncontig; ++i, ++cpte, addr += pgsize) { 242 - changed = ptep_set_access_flags(vma, addr, cpte, 242 + changed |= ptep_set_access_flags(vma, addr, cpte, 243 243 pfn_pte(pfn, 244 244 hugeprot), 245 245 dirty);