Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/mm: remove unnecessary ia64 code and comment

IA64 has gone with commit cf8e8658100d ("arch: Remove Itanium (IA-64)
architecture"), so remove unnecessary ia64 special mm code and comment in
selftests too.

Link: https://lkml.kernel.org/r/20240819130609.3386195-1-tujinjiang@huawei.com
Signed-off-by: Jinjiang Tu <tujinjiang@huawei.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Nanyong Sun <sunnanyong@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Jinjiang Tu and committed by
Andrew Morton
2f4db286 489a744e

+8 -67
+1 -1
tools/testing/selftests/mm/Makefile
··· 112 112 113 113 endif 114 114 115 - ifneq (,$(filter $(ARCH),arm64 ia64 mips64 parisc64 powerpc riscv64 s390x sparc64 x86_64 s390)) 115 + ifneq (,$(filter $(ARCH),arm64 mips64 parisc64 powerpc riscv64 s390x sparc64 x86_64 s390)) 116 116 TEST_GEN_FILES += va_high_addr_switch 117 117 TEST_GEN_FILES += virtual_address_range 118 118 TEST_GEN_FILES += write_to_hugetlbfs
+1 -17
tools/testing/selftests/mm/hugepage-mmap.c
··· 8 8 * like /mnt) using the command mount -t hugetlbfs nodev /mnt. In this 9 9 * example, the app is requesting memory of size 256MB that is backed by 10 10 * huge pages. 11 - * 12 - * For the ia64 architecture, the Linux kernel reserves Region number 4 for 13 - * huge pages. That means that if one requires a fixed address, a huge page 14 - * aligned address starting with 0x800000... will be required. If a fixed 15 - * address is not required, the kernel will select an address in the proper 16 - * range. 17 - * Other architectures, such as ppc64, i386 or x86_64 are not so constrained. 18 11 */ 19 12 #define _GNU_SOURCE 20 13 #include <stdlib.h> ··· 19 26 20 27 #define LENGTH (256UL*1024*1024) 21 28 #define PROTECTION (PROT_READ | PROT_WRITE) 22 - 23 - /* Only ia64 requires this */ 24 - #ifdef __ia64__ 25 - #define ADDR (void *)(0x8000000000000000UL) 26 - #define FLAGS (MAP_SHARED | MAP_FIXED) 27 - #else 28 - #define ADDR (void *)(0x0UL) 29 - #define FLAGS (MAP_SHARED) 30 - #endif 31 29 32 30 static void check_bytes(char *addr) 33 31 { ··· 58 74 if (fd < 0) 59 75 ksft_exit_fail_msg("memfd_create() failed: %s\n", strerror(errno)); 60 76 61 - addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, fd, 0); 77 + addr = mmap(NULL, LENGTH, PROTECTION, MAP_SHARED, fd, 0); 62 78 if (addr == MAP_FAILED) { 63 79 close(fd); 64 80 ksft_exit_fail_msg("mmap(): %s\n", strerror(errno));
+1 -17
tools/testing/selftests/mm/hugepage-shm.c
··· 8 8 * SHM_HUGETLB in the shmget system call to inform the kernel that it is 9 9 * requesting huge pages. 10 10 * 11 - * For the ia64 architecture, the Linux kernel reserves Region number 4 for 12 - * huge pages. That means that if one requires a fixed address, a huge page 13 - * aligned address starting with 0x800000... will be required. If a fixed 14 - * address is not required, the kernel will select an address in the proper 15 - * range. 16 - * Other architectures, such as ppc64, i386 or x86_64 are not so constrained. 17 - * 18 11 * Note: The default shared memory limit is quite low on many kernels, 19 12 * you may need to increase it via: 20 13 * ··· 32 39 33 40 #define dprintf(x) printf(x) 34 41 35 - /* Only ia64 requires this */ 36 - #ifdef __ia64__ 37 - #define ADDR (void *)(0x8000000000000000UL) 38 - #define SHMAT_FLAGS (SHM_RND) 39 - #else 40 - #define ADDR (void *)(0x0UL) 41 - #define SHMAT_FLAGS (0) 42 - #endif 43 - 44 42 int main(void) 45 43 { 46 44 int shmid; ··· 45 61 } 46 62 printf("shmid: 0x%x\n", shmid); 47 63 48 - shmaddr = shmat(shmid, ADDR, SHMAT_FLAGS); 64 + shmaddr = shmat(shmid, NULL, 0); 49 65 if (shmaddr == (char *)-1) { 50 66 perror("Shared memory attach failure"); 51 67 shmctl(shmid, IPC_RMID, NULL);
+2 -15
tools/testing/selftests/mm/hugepage-vmemmap.c
··· 22 22 #define PM_PFRAME_BITS 55 23 23 #define PM_PFRAME_MASK ~((1UL << PM_PFRAME_BITS) - 1) 24 24 25 - /* 26 - * For ia64 architecture, Linux kernel reserves Region number 4 for hugepages. 27 - * That means the addresses starting with 0x800000... will need to be 28 - * specified. Specifying a fixed address is not required on ppc64, i386 29 - * or x86_64. 30 - */ 31 - #ifdef __ia64__ 32 - #define MAP_ADDR (void *)(0x8000000000000000UL) 33 - #define MAP_FLAGS (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | MAP_FIXED) 34 - #else 35 - #define MAP_ADDR NULL 36 - #define MAP_FLAGS (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB) 37 - #endif 38 - 39 25 static size_t pagesize; 40 26 static size_t maplength; 41 27 ··· 99 113 exit(1); 100 114 } 101 115 102 - addr = mmap(MAP_ADDR, maplength, PROT_READ | PROT_WRITE, MAP_FLAGS, -1, 0); 116 + addr = mmap(NULL, maplength, PROT_READ | PROT_WRITE, 117 + MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB, -1, 0); 103 118 if (addr == MAP_FAILED) { 104 119 perror("mmap"); 105 120 exit(1);
+2 -16
tools/testing/selftests/mm/map_hugetlb.c
··· 4 4 * system call with MAP_HUGETLB flag. Before running this program make 5 5 * sure the administrator has allocated enough default sized huge pages 6 6 * to cover the 256 MB allocation. 7 - * 8 - * For ia64 architecture, Linux kernel reserves Region number 4 for hugepages. 9 - * That means the addresses starting with 0x800000... will need to be 10 - * specified. Specifying a fixed address is not required on ppc64, i386 11 - * or x86_64. 12 7 */ 13 8 #include <stdlib.h> 14 9 #include <stdio.h> ··· 15 20 16 21 #define LENGTH (256UL*1024*1024) 17 22 #define PROTECTION (PROT_READ | PROT_WRITE) 18 - 19 - /* Only ia64 requires this */ 20 - #ifdef __ia64__ 21 - #define ADDR (void *)(0x8000000000000000UL) 22 - #define FLAGS (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | MAP_FIXED) 23 - #else 24 - #define ADDR (void *)(0x0UL) 25 - #define FLAGS (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB) 26 - #endif 27 23 28 24 static void check_bytes(char *addr) 29 25 { ··· 46 60 void *addr; 47 61 size_t hugepage_size; 48 62 size_t length = LENGTH; 49 - int flags = FLAGS; 63 + int flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB; 50 64 int shift = 0; 51 65 52 66 hugepage_size = default_huge_page_size(); ··· 71 85 ksft_print_msg("Default size hugepages\n"); 72 86 ksft_print_msg("Mapping %lu Mbytes\n", (unsigned long)length >> 20); 73 87 74 - addr = mmap(ADDR, length, PROTECTION, flags, -1, 0); 88 + addr = mmap(NULL, length, PROTECTION, flags, -1, 0); 75 89 if (addr == MAP_FAILED) 76 90 ksft_exit_fail_msg("mmap: %s\n", strerror(errno)); 77 91
+1 -1
tools/testing/selftests/mm/run_vmtests.sh
··· 189 189 fi 190 190 191 191 # filter 64bit architectures 192 - ARCH64STR="arm64 ia64 mips64 parisc64 ppc64 ppc64le riscv64 s390x sparc64 x86_64" 192 + ARCH64STR="arm64 mips64 parisc64 ppc64 ppc64le riscv64 s390x sparc64 x86_64" 193 193 if [ -z "$ARCH" ]; then 194 194 ARCH=$(uname -m 2>/dev/null | sed -e 's/aarch64.*/arm64/') 195 195 fi