linux/arch/arm64
Jisheng Zhang 0e2aba6948 arm64: mm: pass original fault address to handle_mm_fault() in PER_VMA_LOCK block
When reading the arm64's PER_VMA_LOCK support code, I found a bit
difference between arm64 and other arch when calling handle_mm_fault()
during VMA lock-based page fault handling: the fault address is masked
before passing to handle_mm_fault(). This is also different from the
usage in mmap_lock-based handling. I think we need to pass the
original fault address to handle_mm_fault() as we did in
commit 84c5e23ede ("arm64: mm: Pass original fault address to
handle_mm_fault()").

If we go through the code path further, we can find that the "masked"
fault address can cause mismatched fault address between perf sw
major/minor page fault sw event and perf page fault sw event:

do_page_fault
  perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, ..., addr)   // orig addr
  handle_mm_fault
    mm_account_fault
      perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, ...) // masked addr

Fixes: cd7f176aea ("arm64/mm: try VMA lock-based page fault handling first")
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20230524131305.2808-1-jszhang@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
2023-06-02 13:02:44 +01:00
..
boot hte: Changes for v6.4-rc1 2023-05-03 11:00:27 -07:00
configs arm64: defconfig: enable building the nvmem-reboot-mode module 2023-04-17 16:38:41 +02:00
crypto crypto: arm64/aes-neonbs - fix crash with CFI enabled 2023-03-14 17:06:44 +08:00
hyperv
include arm64: perf: Mark all accessor functions inline 2023-05-16 14:57:29 +01:00
kernel arm64: mte: Do not set PG_mte_tagged if tags were not initialized 2023-05-16 14:59:16 +01:00
kvm s390: 2023-05-01 12:06:20 -07:00
lib arm: uaccess: Remove memcpy_page_flushcache() 2023-03-27 16:26:19 +01:00
mm arm64: mm: pass original fault address to handle_mm_fault() in PER_VMA_LOCK block 2023-06-02 13:02:44 +01:00
net bpf, arm64: Fixed a BTI error on returning to patched function 2023-04-03 17:44:03 +02:00
tools s390: 2023-05-01 12:06:20 -07:00
xen
Kbuild
Kconfig arm64: Remove the ARCH_FORCE_MAX_ORDER config input prompt 2023-06-02 13:00:52 +01:00
Kconfig.debug
Kconfig.platforms arm64 updates for 6.3: 2023-02-21 15:27:48 -08:00
Makefile arm64 updates for 6.3: 2023-02-21 15:27:48 -08:00