1. 16 10月, 2021 1 次提交
  2. 11 9月, 2021 7 次提交
  3. 10 9月, 2021 3 次提交
    • C
      arm64: kdump: Skip kmemleak scan reserved memory for kdump · 85f58eb1
      Chen Wandun 提交于
      Trying to boot with kdump + kmemleak, command will result in a crash:
      "echo scan > /sys/kernel/debug/kmemleak"
      
      crashkernel reserved: 0x0000000007c00000 - 0x0000000027c00000 (512 MB)
      Kernel command line: BOOT_IMAGE=(hd1,gpt2)/vmlinuz-5.14.0-rc5-next-20210809+ root=/dev/mapper/ao-root ro rd.lvm.lv=ao/root rd.lvm.lv=ao/swap crashkernel=512M
      Unable to handle kernel paging request at virtual address ffff000007c00000
      Mem abort info:
        ESR = 0x96000007
        EC = 0x25: DABT (current EL), IL = 32 bits
        SET = 0, FnV = 0
        EA = 0, S1PTW = 0
        FSC = 0x07: level 3 translation fault
      Data abort info:
        ISV = 0, ISS = 0x00000007
        CM = 0, WnR = 0
      swapper pgtable: 64k pages, 48-bit VAs, pgdp=00002024f0d80000
      [ffff000007c00000] pgd=1800205ffffd0003, p4d=1800205ffffd0003, pud=1800205ffffd0003, pmd=1800205ffffc0003, pte=0068000007c00f06
      Internal error: Oops: 96000007 [#1] SMP
      pstate: 804000c9 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      pc : scan_block+0x98/0x230
      lr : scan_block+0x94/0x230
      sp : ffff80008d6cfb70
      x29: ffff80008d6cfb70 x28: 0000000000000000 x27: 0000000000000000
      x26: 00000000000000c0 x25: 0000000000000001 x24: 0000000000000000
      x23: ffffa88a6b18b398 x22: ffff000007c00ff9 x21: ffffa88a6ac7fc40
      x20: ffffa88a6af6a830 x19: ffff000007c00000 x18: 0000000000000000
      x17: 0000000000000000 x16: 0000000000000000 x15: ffffffffffffffff
      x14: ffffffff00000000 x13: ffffffffffffffff x12: 0000000000000020
      x11: 0000000000000000 x10: 0000000001080000 x9 : ffffa88a6951c77c
      x8 : ffffa88a6a893988 x7 : ffff203ff6cfb3c0 x6 : ffffa88a6a52b3c0
      x5 : ffff203ff6cfb3c0 x4 : 0000000000000000 x3 : 0000000000000000
      x2 : 0000000000000001 x1 : ffff20226cb56a40 x0 : 0000000000000000
      Call trace:
       scan_block+0x98/0x230
       scan_gray_list+0x120/0x270
       kmemleak_scan+0x3a0/0x648
       kmemleak_write+0x3ac/0x4c8
       full_proxy_write+0x6c/0xa0
       vfs_write+0xc8/0x2b8
       ksys_write+0x70/0xf8
       __arm64_sys_write+0x24/0x30
       invoke_syscall+0x4c/0x110
       el0_svc_common+0x9c/0x190
       do_el0_svc+0x30/0x98
       el0_svc+0x28/0xd8
       el0t_64_sync_handler+0x90/0xb8
       el0t_64_sync+0x180/0x184
      
      The reserved memory for kdump will be looked up by kmemleak, this area
      will be set invalid when kdump service is bring up. That will result in
      crash when kmemleak scan this area.
      
      Fixes: a7259df7 ("memblock: make memblock_find_in_range method private")
      Signed-off-by: NChen Wandun <chenwandun@huawei.com>
      Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
      Reviewed-by: NMike Rapoport <rppt@linux.ibm.com>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Link: https://lore.kernel.org/r/20210910064844.3827813-1-chenwandun@huawei.comSigned-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      85f58eb1
    • H
      parisc: Implement __get/put_kernel_nofault() · 67102872
      Helge Deller 提交于
      Remove CONFIG_SET_FS from parisc, so we need to add
      __get_kernel_nofault() and __put_kernel_nofault(), define
      HAVE_GET_KERNEL_NOFAULT and remove set_fs(), get_fs(), load_sr2(),
      thread_info->addr_limit, KERNEL_DS and USER_DS.
      
      The nice side-effect of this patch is that we now can directly access
      userspace via sr3 without the need to use a temporary sr2 which is
      either copied from sr3 or set to zero (for kernel space).
      Signed-off-by: NHelge Deller <deller@gmx.de>
      Suggested-by: NArnd Bergmann <arnd@kernel.org>
      67102872
    • A
      arm64: mm: limit linear region to 51 bits for KVM in nVHE mode · 88053ec8
      Ard Biesheuvel 提交于
      KVM in nVHE mode divides up its VA space into two equal halves, and
      picks the half that does not conflict with the HYP ID map to map its
      linear region. This worked fine when the kernel's linear map itself was
      guaranteed to cover precisely as many bits of VA space, but this was
      changed by commit f4693c27 ("arm64: mm: extend linear region for
      52-bit VA configurations").
      
      The result is that, depending on the placement of the ID map, kernel-VA
      to hyp-VA translations may produce addresses that either conflict with
      other HYP mappings (including the ID map itself) or generate addresses
      outside of the 52-bit addressable range, neither of which is likely to
      lead to anything useful.
      
      Given that 52-bit capable cores are guaranteed to implement VHE, this
      only affects configurations such as pKVM where we opt into non-VHE mode
      even if the hardware is VHE capable. So just for these configurations,
      let's limit the kernel linear map to 51 bits and work around the
      problem.
      
      Fixes: f4693c27 ("arm64: mm: extend linear region for 52-bit VA configurations")
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Link: https://lore.kernel.org/r/20210826165613.60774-1-ardb@kernel.orgSigned-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      88053ec8
  4. 09 9月, 2021 18 次提交
  5. 08 9月, 2021 2 次提交
    • H
      s390/ftrace: remove incorrect __va usage · 9652cb80
      Heiko Carstens 提交于
      The address of ftrace_graph_caller is already virtual.
      Using __va() to translate the address is wrong.
      Reviewed-by: NAlexander Gordeev <agordeev@linux.ibm.com>
      Signed-off-by: NHeiko Carstens <hca@linux.ibm.com>
      9652cb80
    • L
      Revert "mm/gup: remove try_get_page(), call try_get_compound_head() directly" · cd1adf1b
      Linus Torvalds 提交于
      This reverts commit 9857a17f.
      
      That commit was completely broken, and I should have caught on to it
      earlier.  But happily, the kernel test robot noticed the breakage fairly
      quickly.
      
      The breakage is because "try_get_page()" is about avoiding the page
      reference count overflow case, but is otherwise the exact same as a
      plain "get_page()".
      
      In contrast, "try_get_compound_head()" is an entirely different beast,
      and uses __page_cache_add_speculative() because it's not just about the
      page reference count, but also about possibly racing with the underlying
      page going away.
      
      So all the commentary about how
      
       "try_get_page() has fallen a little behind in terms of maintenance,
        try_get_compound_head() handles speculative page references more
        thoroughly"
      
      was just completely wrong: yes, try_get_compound_head() handles
      speculative page references, but the point is that try_get_page() does
      not, and must not.
      
      So there's no lack of maintainance - there are fundamentally different
      semantics.
      
      A speculative page reference would be entirely wrong in "get_page()",
      and it's entirely wrong in "try_get_page()".  It's not about
      speculation, it's purely about "uhhuh, you can't get this page because
      you've tried to increment the reference count too much already".
      
      The reason the kernel test robot noticed this bug was that it hit the
      VM_BUG_ON() in __page_cache_add_speculative(), which is all about
      verifying that the context of any speculative page access is correct.
      But since that isn't what try_get_page() is all about, the VM_BUG_ON()
      tests things that are not correct to test for try_get_page().
      Reported-by: Nkernel test robot <oliver.sang@intel.com>
      Cc: John Hubbard <jhubbard@nvidia.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cd1adf1b
  6. 07 9月, 2021 7 次提交
  7. 06 9月, 2021 2 次提交