1. 09 9月, 2022 3 次提交
  2. 23 8月, 2022 5 次提交
  3. 17 8月, 2022 1 次提交
  4. 10 8月, 2022 1 次提交
  5. 30 7月, 2022 1 次提交
    • Z
      memblock,arm64: expand the static memblock memory table · 450d0e74
      Zhou Guanghui 提交于
      In a system(Huawei Ascend ARM64 SoC) using HBM, a multi-bit ECC error
      occurs, and the BIOS will mark the corresponding area (for example, 2 MB)
      as unusable.  When the system restarts next time, these areas are not
      reported or reported as EFI_UNUSABLE_MEMORY.  Both cases lead to an
      increase in the number of memblocks, whereas EFI_UNUSABLE_MEMORY leads to
      a larger number of memblocks.
      
      For example, if the EFI_UNUSABLE_MEMORY type is reported:
      ...
      memory[0x92]    [0x0000200834a00000-0x0000200835bfffff], 0x0000000001200000 bytes on node 7 flags: 0x0
      memory[0x93]    [0x0000200835c00000-0x0000200835dfffff], 0x0000000000200000 bytes on node 7 flags: 0x4
      memory[0x94]    [0x0000200835e00000-0x00002008367fffff], 0x0000000000a00000 bytes on node 7 flags: 0x0
      memory[0x95]    [0x0000200836800000-0x00002008369fffff], 0x0000000000200000 bytes on node 7 flags: 0x4
      memory[0x96]    [0x0000200836a00000-0x0000200837bfffff], 0x0000000001200000 bytes on node 7 flags: 0x0
      memory[0x97]    [0x0000200837c00000-0x0000200837dfffff], 0x0000000000200000 bytes on node 7 flags: 0x4
      memory[0x98]    [0x0000200837e00000-0x000020087fffffff], 0x0000000048200000 bytes on node 7 flags: 0x0
      memory[0x99]    [0x0000200880000000-0x0000200bcfffffff], 0x0000000350000000 bytes on node 6 flags: 0x0
      memory[0x9a]    [0x0000200bd0000000-0x0000200bd01fffff], 0x0000000000200000 bytes on node 6 flags: 0x4
      memory[0x9b]    [0x0000200bd0200000-0x0000200bd07fffff], 0x0000000000600000 bytes on node 6 flags: 0x0
      memory[0x9c]    [0x0000200bd0800000-0x0000200bd09fffff], 0x0000000000200000 bytes on node 6 flags: 0x4
      memory[0x9d]    [0x0000200bd0a00000-0x0000200fcfffffff], 0x00000003ff600000 bytes on node 6 flags: 0x0
      memory[0x9e]    [0x0000200fd0000000-0x0000200fd01fffff], 0x0000000000200000 bytes on node 6 flags: 0x4
      memory[0x9f]    [0x0000200fd0200000-0x0000200fffffffff], 0x000000002fe00000 bytes on node 6 flags: 0x0
      ...
      
      The EFI memory map is parsed to construct the memblock arrays before the
      memblock arrays can be resized.  As the result, memory regions beyond
      INIT_MEMBLOCK_REGIONS are lost.
      
      Add a new macro INIT_MEMBLOCK_MEMORY_REGIONS to replace
      INIT_MEMBLOCK_REGTIONS to define the size of the static memblock.memory
      array.
      
      Allow overriding memblock.memory array size with architecture defined
      INIT_MEMBLOCK_MEMORY_REGIONS and make arm64 to set
      INIT_MEMBLOCK_MEMORY_REGIONS to 1024 when CONFIG_EFI is enabled.
      
      Link: https://lkml.kernel.org/r/20220615102742.96450-1-zhouguanghui1@huawei.comSigned-off-by: NZhou Guanghui <zhouguanghui1@huawei.com>
      Acked-by: NMike Rapoport <rppt@linux.ibm.com>
      Tested-by: NDarren Hart <darren@os.amperecomputing.com>
      Acked-by: Will Deacon <will@kernel.org>		[arm64]
      Reviewed-by: NAnshuman Khandual <anshuman.khandual@arm.com>
      Cc: Xu Qiang <xuqiang36@huawei.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      450d0e74
  6. 28 7月, 2022 4 次提交
  7. 26 7月, 2022 13 次提交
  8. 25 7月, 2022 1 次提交
    • J
      random: handle archrandom with multiple longs · d349ab99
      Jason A. Donenfeld 提交于
      The archrandom interface was originally designed for x86, which supplies
      RDRAND/RDSEED for receiving random words into registers, resulting in
      one function to generate an int and another to generate a long. However,
      other architectures don't follow this.
      
      On arm64, the SMCCC TRNG interface can return between one and three
      longs. On s390, the CPACF TRNG interface can return arbitrary amounts,
      with four longs having the same cost as one. On UML, the os_getrandom()
      interface can return arbitrary amounts.
      
      So change the api signature to take a "max_longs" parameter designating
      the maximum number of longs requested, and then return the number of
      longs generated.
      
      Since callers need to check this return value and loop anyway, each arch
      implementation does not bother implementing its own loop to try again to
      fill the maximum number of longs. Additionally, all existing callers
      pass in a constant max_longs parameter. Taken together, these two things
      mean that the codegen doesn't really change much for one-word-at-a-time
      platforms, while performance is greatly improved on platforms such as
      s390.
      Acked-by: NHeiko Carstens <hca@linux.ibm.com>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Acked-by: NMichael Ellerman <mpe@ellerman.id.au>
      Acked-by: NBorislav Petkov <bp@suse.de>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      d349ab99
  9. 23 7月, 2022 3 次提交
  10. 20 7月, 2022 6 次提交
  11. 18 7月, 2022 2 次提交
    • J
      random: remove CONFIG_ARCH_RANDOM · 9592eef7
      Jason A. Donenfeld 提交于
      When RDRAND was introduced, there was much discussion on whether it
      should be trusted and how the kernel should handle that. Initially, two
      mechanisms cropped up, CONFIG_ARCH_RANDOM, a compile time switch, and
      "nordrand", a boot-time switch.
      
      Later the thinking evolved. With a properly designed RNG, using RDRAND
      values alone won't harm anything, even if the outputs are malicious.
      Rather, the issue is whether those values are being *trusted* to be good
      or not. And so a new set of options were introduced as the real
      ones that people use -- CONFIG_RANDOM_TRUST_CPU and "random.trust_cpu".
      With these options, RDRAND is used, but it's not always credited. So in
      the worst case, it does nothing, and in the best case, maybe it helps.
      
      Along the way, CONFIG_ARCH_RANDOM's meaning got sort of pulled into the
      center and became something certain platforms force-select.
      
      The old options don't really help with much, and it's a bit odd to have
      special handling for these instructions when the kernel can deal fine
      with the existence or untrusted existence or broken existence or
      non-existence of that CPU capability.
      
      Simplify the situation by removing CONFIG_ARCH_RANDOM and using the
      ordinary asm-generic fallback pattern instead, keeping the two options
      that are actually used. For now it leaves "nordrand" for now, as the
      removal of that will take a different route.
      Acked-by: NMichael Ellerman <mpe@ellerman.id.au>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: NBorislav Petkov <bp@suse.de>
      Acked-by: NHeiko Carstens <hca@linux.ibm.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      9592eef7
    • A
      arm64/mm: move protection_map[] inside the platform · 42251045
      Anshuman Khandual 提交于
      This moves protection_map[] inside the platform and makes it a static.
      
      Link: https://lkml.kernel.org/r/20220711070600.2378316-6-anshuman.khandual@arm.comSigned-off-by: NAnshuman Khandual <anshuman.khandual@arm.com>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Brian Cain <bcain@quicinc.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Nicholas Piggin <npiggin@gmail.com>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Vineet Gupta <vgupta@kernel.org>
      Cc: WANG Xuerui <kernel@xen0n.name>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      42251045