Lines Matching +full:address +full:- +full:aligned
1 // SPDX-License-Identifier: GPL-2.0
41 _1KB = 1ULL << 10, /* 1KB -> not page aligned */
80 -1, 0); in is_remap_region_valid()
122 * Using /proc/self/maps, assert that the specified address range is contained
133 while (getline(&line, &len, maps_fp) != -1) { in is_range_mapped()
134 char *first = strtok(line, "- "); in is_range_mapped()
136 char *second = strtok(NULL, "- "); in is_range_mapped()
162 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in mremap_expand_merge()
201 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in mremap_expand_merge_offset()
228 * Returns the start address of the mapping on success, else returns
246 -1, 0); in get_source_mapping()
253 * Check that the address is aligned to the specified alignment. in get_source_mapping()
255 * specified are not considered valid. For instance, 1GB address is in get_source_mapping()
256 * 2MB-aligned, however it will not be considered valid for a in get_source_mapping()
260 if (((unsigned long long) src_addr & (c.src_alignment - 1)) || in get_source_mapping()
276 /* Returns the time taken for the remap on success else returns -1. */
293 ret = -1; in remap_region()
302 /* Mask to zero out lower bits of address for alignment */ in remap_region()
303 align_mask = ~(c.dest_alignment - 1); in remap_region()
304 /* Offset of destination address from the end of the source region */ in remap_region()
305 offset = (c.overlapping) ? -c.dest_alignment : c.dest_alignment; in remap_region()
318 ret = -1; in remap_region()
331 ret = -1; in remap_region()
345 ret = -1; in remap_region()
352 ret = end_ns - start_ns; in remap_region()
355 * Since the destination address is specified using MREMAP_FIXED, subsequent in remap_region()
356 * mremap will unmap any previous mapping at the address range specified by in remap_region()
400 "Usage: %s [[-t <threshold_mb>] [-p <pattern_seed>]]\n" in usage()
401 "-t\t only validate threshold_mb of the remapped region\n" in usage()
405 "-p\t provide a seed to generate the random pattern for\n" in usage()
415 while ((opt = getopt(argc, argv, optstr)) != -1) { in parse_args()
425 return -1; in parse_args()
431 return -1; in parse_args()
465 "mremap - Source and Destination Regions Overlapping"); in main()
469 "mremap - Destination Address Misaligned (1KB-aligned)"); in main()
472 "mremap - Source Address Misaligned (1KB-aligned)"); in main()
474 /* Src addr PTE aligned */ in main()
477 "8KB mremap - Source PTE-aligned, Destination PTE-aligned"); in main()
479 /* Src addr 1MB aligned */ in main()
481 "2MB mremap - Source 1MB-aligned, Destination PTE-aligned"); in main()
483 "2MB mremap - Source 1MB-aligned, Destination 1MB-aligned"); in main()
485 /* Src addr PMD aligned */ in main()
487 "4MB mremap - Source PMD-aligned, Destination PTE-aligned"); in main()
489 "4MB mremap - Source PMD-aligned, Destination 1MB-aligned"); in main()
491 "4MB mremap - Source PMD-aligned, Destination PMD-aligned"); in main()
493 /* Src addr PUD aligned */ in main()
495 "2GB mremap - Source PUD-aligned, Destination PTE-aligned"); in main()
497 "2GB mremap - Source PUD-aligned, Destination 1MB-aligned"); in main()
499 "2GB mremap - Source PUD-aligned, Destination PMD-aligned"); in main()
501 "2GB mremap - Source PUD-aligned, Destination PUD-aligned"); in main()
504 "1GB mremap - Source PTE-aligned, Destination PTE-aligned"); in main()
506 * mremap 1GB region - Page table level aligned time in main()
510 "1GB mremap - Source PMD-aligned, Destination PMD-aligned"); in main()
512 "1GB mremap - Source PUD-aligned, Destination PUD-aligned"); in main()