riscv: selftests: Remove mmap hint address checksThe mmap behavior that restricts the addresses returned by mmap causedunexpected behavior, so get rid of the test cases that check thatbehavior.
riscv: selftests: Remove mmap hint address checksThe mmap behavior that restricts the addresses returned by mmap causedunexpected behavior, so get rid of the test cases that check thatbehavior.Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>Fixes: 73d05262a2ca ("selftests: riscv: Generalize mm selftests")Link: https://lore.kernel.org/r/20240826-riscv_mmap-v1-2-cd8962afe47f@rivosinc.comSigned-off-by: Palmer Dabbelt <palmer@rivosinc.com>
show more ...
selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mkCentralize the _GNU_SOURCE definition to CFLAGS in lib.mk. Removeredundant defines from Makefiles that import lib.mk. Convert any usage of
selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mkCentralize the _GNU_SOURCE definition to CFLAGS in lib.mk. Removeredundant defines from Makefiles that import lib.mk. Convert any usage of"#define _GNU_SOURCE 1" to "#define _GNU_SOURCE".This uses the form "-D_GNU_SOURCE=", which is equivalent to"#define _GNU_SOURCE".Otherwise using "-D_GNU_SOURCE" is equivalent to "-D_GNU_SOURCE=1" and"#define _GNU_SOURCE 1", which is less commonly seen in source code andwould require many changes in selftests to avoid redefinition warnings.Link: https://lkml.kernel.org/r/20240625223454.1586259-2-edliaw@google.comSigned-off-by: Edward Liaw <edliaw@google.com>Suggested-by: John Hubbard <jhubbard@nvidia.com>Acked-by: Shuah Khan <skhan@linuxfoundation.org>Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>Cc: Albert Ou <aou@eecs.berkeley.edu>Cc: André Almeida <andrealmeid@igalia.com>Cc: Darren Hart <dvhart@infradead.org>Cc: Dave Hansen <dave.hansen@linux.intel.com>Cc: Davidlohr Bueso <dave@stgolabs.net>Cc: David S. Miller <davem@davemloft.net>Cc: Eric Dumazet <edumazet@google.com>Cc: Eric W. Biederman <ebiederm@xmission.com>Cc: Fenghua Yu <fenghua.yu@intel.com>Cc: Ingo Molnar <mingo@redhat.com>Cc: Jakub Kicinski <kuba@kernel.org>Cc: Jarkko Sakkinen <jarkko@kernel.org>Cc: Jason Gunthorpe <jgg@ziepe.ca>Cc: Kees Cook <kees@kernel.org>Cc: Kevin Tian <kevin.tian@intel.com>Cc: Palmer Dabbelt <palmer@dabbelt.com>Cc: Paolo Abeni <pabeni@redhat.com>Cc: Paolo Bonzini <pbonzini@redhat.com>Cc: Paul Walmsley <paul.walmsley@sifive.com>Cc: Peter Zijlstra <peterz@infradead.org>Cc: Reinette Chatre <reinette.chatre@intel.com>Cc: Sean Christopherson <seanjc@google.com>Cc: Thomas Gleixner <tglx@linutronix.de>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Merge patch series "riscv: mm: Extend mappable memory up to hint address"Charlie Jenkins <charlie@rivosinc.com> says:On riscv, mmap currently returns an address from the largest addressspace tha
Merge patch series "riscv: mm: Extend mappable memory up to hint address"Charlie Jenkins <charlie@rivosinc.com> says:On riscv, mmap currently returns an address from the largest addressspace that can fit entirely inside of the hint address. This makes itsuch that the hint address is almost never returned. This patch raisesthe mappable area up to and including the hint address. This allows mmapto often return the hint address, which allows a performance improvementover searching for a valid address as well as making the behavior moresimilar to other architectures.Note that a previous patch introduced stronger semantics compared toother architectures for riscv mmap. On riscv, mmap will not use bits inthe upper bits of the virtual address depending on the hint address. Onother architectures, a random address is returned in the address spacerequested. On all architectures the hint address will be returned if itis available. This allows riscv applications to configure how many bitsin the virtual address should be left empty. This has the two benefitsof being able to request address spaces that are smaller than thedefault and doesn't require the application to know the page tablelayout of riscv.* b4-shazam-merge: docs: riscv: Define behavior of mmap selftests: riscv: Generalize mm selftests riscv: mm: Use hint address in mmap if availableLink: https://lore.kernel.org/r/20240130-use_mmap_hint_address-v3-0-8a655cfa8bcb@rivosinc.comSigned-off-by: Palmer Dabbelt <palmer@rivosinc.com>
selftests: riscv: Generalize mm selftestsThe behavior of mmap on riscv is defined to not provide an address thatuses more bits than the hint address, if provided. Make the testsreflect that.Sig
selftests: riscv: Generalize mm selftestsThe behavior of mmap on riscv is defined to not provide an address thatuses more bits than the hint address, if provided. Make the testsreflect that.Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>Link: https://lore.kernel.org/r/20240130-use_mmap_hint_address-v3-2-8a655cfa8bcb@rivosinc.comSigned-off-by: Palmer Dabbelt <palmer@rivosinc.com>
tools: selftests: riscv: Fix compile warnings in mm testsWhen building the mm tests with a riscv32 compiler, we see a rangeof shift-count-overflow errors from shifting 1UL by more than 32 bitsin
tools: selftests: riscv: Fix compile warnings in mm testsWhen building the mm tests with a riscv32 compiler, we see a rangeof shift-count-overflow errors from shifting 1UL by more than 32 bitsin do_mmaps(). Since, the relevant code is only called from code thatis gated by `__riscv_xlen == 64`, we can just apply the same gatingto do_mmaps().Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>Reviewed-by: Andrew Jones <ajones@ventanamicro.com>Link: https://lore.kernel.org/r/20231123185821.2272504-6-christoph.muellner@vrull.euSigned-off-by: Palmer Dabbelt <palmer@rivosinc.com>
riscv: kselftests: Fix mm build by removing testcases subdirectorykselftests fails to build because the mm/testcases subdirectory is notcreated and then the compiler fails to output the binary the
riscv: kselftests: Fix mm build by removing testcases subdirectorykselftests fails to build because the mm/testcases subdirectory is notcreated and then the compiler fails to output the binary there.So fix this by simply removing this subdirectory which is not veryuseful.Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>Link: https://lore.kernel.org/r/20230915100113.13131-1-alexghiti@rivosinc.comSigned-off-by: Palmer Dabbelt <palmer@rivosinc.com>
RISC-V: mm: Add tests for RISC-V mmAdd tests that enforce mmap hint address behavior. mmap should defaultto sv48. mmap will provide an address at the highest address space thatcan fit into the hi
RISC-V: mm: Add tests for RISC-V mmAdd tests that enforce mmap hint address behavior. mmap should defaultto sv48. mmap will provide an address at the highest address space thatcan fit into the hint address, unless the hint address is less than sv39and not 0, then it will return a sv39 address.These tests are split into two files: mmap_default.c and mmap_bottomup.cbecause a new process must be exec'd in order to change the mmap layout.The run_mmap.sh script sets the stack to be unlimited for themmap_bottomup.c test which triggers a bottomup layout.Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>Link: https://lore.kernel.org/r/20230809232218.849726-3-charlie@rivosinc.comSigned-off-by: Palmer Dabbelt <palmer@rivosinc.com>