Lines Matching +full:segment +full:- +full:no +full:- +full:remap

1 // SPDX-License-Identifier: GPL-2.0
47 _1KB = 1ULL << 10, /* 1KB -> not page aligned */
84 unsigned long mid = low + (high - low) / 2; in get_sqrt()
91 high = mid - 1; in get_sqrt()
97 * Returns false if the requested remap region overlaps with an
108 -1, 0); in is_remap_region_valid()
163 while (getline(&line, &len, maps_fp) != -1) { in is_range_mapped()
164 if (sscanf(line, "%lx-%lx", &first_val, &second_val) != 2) { in is_range_mapped()
202 -1, 0); in get_source_mapping()
212 * 2MB-aligned, however it will not be considered valid for a in get_source_mapping()
216 if (((unsigned long long) src_addr & (c.src_alignment - 1)) || in get_source_mapping()
243 char *remap, *start; in mremap_expand_merge() local
246 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in mremap_expand_merge()
254 remap = mremap(start, page_size, 2 * page_size, 0); in mremap_expand_merge()
255 if (remap == MAP_FAILED) { in mremap_expand_merge()
275 * we remove the last then attempt to remap offset from the second page. This
283 char *remap, *start; in mremap_expand_merge_offset() local
286 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in mremap_expand_merge_offset()
295 remap = mremap(start + page_size, page_size, 2 * page_size, 0); in mremap_expand_merge_offset()
296 if (remap == MAP_FAILED) { in mremap_expand_merge_offset()
335 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in mremap_move_within_range()
344 src = (void *)((unsigned long)src & ~(SIZE_MB(2) - 1)); in mremap_move_within_range()
349 dest = src - SIZE_MB(2); in mremap_move_within_range()
374 if (munmap(ptr, size) == -1) in mremap_move_within_range()
383 /* Returns the time taken for the remap on success else returns -1. */
401 ret = -1; in remap_region()
409 align_mask = ~(c.dest_alignment - 1); in remap_region()
411 offset = (c.overlapping) ? -c.dest_alignment : c.dest_alignment; in remap_region()
415 /* Remap after the destination block preamble. */ in remap_region()
426 ksft_print_msg("Couldn't find a valid region to remap to\n"); in remap_region()
427 ret = -1; in remap_region()
434 dest_preamble_addr = mmap((void *) addr - c.dest_preamble_size, c.dest_preamble_size, in remap_region()
437 -1, 0); in remap_region()
441 ret = -1; in remap_region()
456 ret = -1; in remap_region()
463 * chunks, if memcmp() returns non-zero, only then perform an in remap_region()
474 /* brute force iteration only over mismatch segment */ in remap_region()
477 ksft_print_msg("Data after remap doesn't match at offset %llu\n", in remap_region()
481 ret = -1; in remap_region()
493 ksft_print_msg("Data after remap doesn't match at offset %llu\n", in remap_region()
497 ret = -1; in remap_region()
516 /* brute force iteration only over mismatched segment */ in remap_region()
519 ksft_print_msg("Preamble data after remap doesn't match at offset %llu\n", in remap_region()
523 ret = -1; in remap_region()
531 ksft_print_msg("Preamble data after remap doesn't match at offset %llu\n", in remap_region()
535 ret = -1; in remap_region()
543 ret = end_ns - start_ns; in remap_region()
548 * dest_addr and region_size. This significantly affects the remap time of in remap_region()
598 * falls on no mapping. in mremap_move_1mb_from_start()
625 if (src && munmap(src, c.region_size) == -1) in mremap_move_1mb_from_start()
628 if (dest && munmap(dest, c.region_size) == -1) in mremap_move_1mb_from_start()
669 "Usage: %s [[-t <threshold_mb>] [-p <pattern_seed>]]\n" in usage()
670 "-t\t only validate threshold_mb of the remapped region\n" in usage()
671 " \t if 0 is supplied no threshold is used; all tests\n" in usage()
674 "-p\t provide a seed to generate the random pattern for\n" in usage()
684 while ((opt = getopt(argc, argv, optstr)) != -1) { in parse_args()
694 return -1; in parse_args()
700 return -1; in parse_args()
714 /* hard-coded test configs */ in main()
752 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in main()
768 "mremap - Source and Destination Regions Overlapping"); in main()
772 "mremap - Destination Address Misaligned (1KB-aligned)"); in main()
775 "mremap - Source Address Misaligned (1KB-aligned)"); in main()
780 "8KB mremap - Source PTE-aligned, Destination PTE-aligned"); in main()
784 "2MB mremap - Source 1MB-aligned, Destination PTE-aligned"); in main()
786 "2MB mremap - Source 1MB-aligned, Destination 1MB-aligned"); in main()
790 "4MB mremap - Source PMD-aligned, Destination PTE-aligned"); in main()
792 "4MB mremap - Source PMD-aligned, Destination 1MB-aligned"); in main()
794 "4MB mremap - Source PMD-aligned, Destination PMD-aligned"); in main()
798 "2GB mremap - Source PUD-aligned, Destination PTE-aligned"); in main()
800 "2GB mremap - Source PUD-aligned, Destination 1MB-aligned"); in main()
802 "2GB mremap - Source PUD-aligned, Destination PMD-aligned"); in main()
804 "2GB mremap - Source PUD-aligned, Destination PUD-aligned"); in main()
808 "5MB mremap - Source 1MB-aligned, Destination 1MB-aligned"); in main()
812 "5MB mremap - Source 1MB-aligned, Dest 1MB-aligned with 40MB Preamble"); in main()
816 "1GB mremap - Source PTE-aligned, Destination PTE-aligned"); in main()
818 * mremap 1GB region - Page table level aligned time in main()
822 "1GB mremap - Source PMD-aligned, Destination PMD-aligned"); in main()
824 "1GB mremap - Source PUD-aligned, Destination PUD-aligned"); in main()