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 the arm64 linear map range detection for tagged addresses and
replace the bitwise operations with subtract (virt_addr_valid(),
__is_lm_address(), __lm_to_phys())"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
arm64: Use simpler arithmetics for the linear map macros
arm64: Do not pass tagged addresses to __is_lm_address()

+4 -4
+3 -3
arch/arm64/include/asm/memory.h
··· 251 251 * lives in the [PAGE_OFFSET, PAGE_END) interval at the bottom of the 252 252 * kernel's TTBR1 address range. 253 253 */ 254 - #define __is_lm_address(addr) (((u64)(addr) ^ PAGE_OFFSET) < (PAGE_END - PAGE_OFFSET)) 254 + #define __is_lm_address(addr) (((u64)(addr) - PAGE_OFFSET) < (PAGE_END - PAGE_OFFSET)) 255 255 256 - #define __lm_to_phys(addr) (((addr) & ~PAGE_OFFSET) + PHYS_OFFSET) 256 + #define __lm_to_phys(addr) (((addr) - PAGE_OFFSET) + PHYS_OFFSET) 257 257 #define __kimg_to_phys(addr) ((addr) - kimage_voffset) 258 258 259 259 #define __virt_to_phys_nodebug(x) ({ \ ··· 332 332 #endif /* !CONFIG_SPARSEMEM_VMEMMAP || CONFIG_DEBUG_VIRTUAL */ 333 333 334 334 #define virt_addr_valid(addr) ({ \ 335 - __typeof__(addr) __addr = addr; \ 335 + __typeof__(addr) __addr = __tag_reset(addr); \ 336 336 __is_lm_address(__addr) && pfn_valid(virt_to_pfn(__addr)); \ 337 337 }) 338 338
+1 -1
arch/arm64/mm/physaddr.c
··· 9 9 10 10 phys_addr_t __virt_to_phys(unsigned long x) 11 11 { 12 - WARN(!__is_lm_address(x), 12 + WARN(!__is_lm_address(__tag_reset(x)), 13 13 "virt_to_phys used for non-linear address: %pK (%pS)\n", 14 14 (void *)x, 15 15 (void *)x);