Lines Matching +full:5 +full:a
40 // Try a simple operation for to "test" for kernel support this prevents
97 unsigned long num_pages = 5; in mremap_dontunmap_simple()
104 memset(source_mapping, 'a', num_pages * page_size); in mremap_dontunmap_simple()
113 // the dest_mapping contains a's. in mremap_dontunmap_simple()
115 (dest_mapping, num_pages * page_size, 'a') != 0, in mremap_dontunmap_simple()
128 // This test validates that MREMAP_DONTUNMAP on a shared mapping works as expected.
131 unsigned long num_pages = 5; in mremap_dontunmap_simple_shmem()
146 memset(source_mapping, 'a', num_pages * page_size); in mremap_dontunmap_simple_shmem()
162 // the dest_mapping contains a's. in mremap_dontunmap_simple_shmem()
164 (dest_mapping, num_pages * page_size, 'a') != 0, in mremap_dontunmap_simple_shmem()
170 (source_mapping, num_pages * page_size, 'a') != 0, in mremap_dontunmap_simple_shmem()
180 // This test validates MREMAP_DONTUNMAP will move page tables to a specific
185 unsigned long num_pages = 5; in mremap_dontunmap_simple_fixed()
187 // Since we want to guarantee that we can remap to a point, we will in mremap_dontunmap_simple_fixed()
188 // create a mapping up front. in mremap_dontunmap_simple_fixed()
199 memset(source_mapping, 'a', num_pages * page_size); in mremap_dontunmap_simple_fixed()
210 // to be gone and replaced with a's. in mremap_dontunmap_simple_fixed()
212 (dest_mapping, num_pages * page_size, 'a') != 0, in mremap_dontunmap_simple_fixed()
227 // This test validates that we can MREMAP_DONTUNMAP for a portion of an
240 * With the destination mapping containing 5 pages of As. in mremap_dontunmap_partial_mapping()
250 memset(source_mapping, 'a', num_pages * page_size); in mremap_dontunmap_partial_mapping()
252 // We will grab the last 5 pages of the source and move them. in mremap_dontunmap_partial_mapping()
254 mremap(source_mapping + (5 * page_size), 5 * page_size, in mremap_dontunmap_partial_mapping()
255 5 * page_size, in mremap_dontunmap_partial_mapping()
259 // We expect the first 5 pages of the source to contain a's and the in mremap_dontunmap_partial_mapping()
260 // final 5 pages to contain zeros. in mremap_dontunmap_partial_mapping()
261 BUG_ON(check_region_contains_byte(source_mapping, 5 * page_size, 'a') != in mremap_dontunmap_partial_mapping()
262 0, "first 5 pages of source should have original pages"); in mremap_dontunmap_partial_mapping()
264 (source_mapping + (5 * page_size), 5 * page_size, 0) != 0, in mremap_dontunmap_partial_mapping()
265 "final 5 pages of source should have no ptes"); in mremap_dontunmap_partial_mapping()
267 // Finally we expect the destination to have 5 pages worth of a's. in mremap_dontunmap_partial_mapping()
268 BUG_ON(check_region_contains_byte(dest_mapping, 5 * page_size, 'a') != in mremap_dontunmap_partial_mapping()
271 BUG_ON(munmap(dest_mapping, 5 * page_size) == -1, in mremap_dontunmap_partial_mapping()
278 // This test validates that we can remap over only a portion of a mapping.
294 * With the destination mapping containing 5 pages of As. in mremap_dontunmap_partial_mapping_overwrite()
300 mmap(NULL, 5 * page_size, PROT_READ | PROT_WRITE, in mremap_dontunmap_partial_mapping_overwrite()
303 memset(source_mapping, 'a', 5 * page_size); in mremap_dontunmap_partial_mapping_overwrite()
311 // We will grab the last 5 pages of the source and move them. in mremap_dontunmap_partial_mapping_overwrite()
313 mremap(source_mapping, 5 * page_size, in mremap_dontunmap_partial_mapping_overwrite()
314 5 * page_size, in mremap_dontunmap_partial_mapping_overwrite()
319 BUG_ON(check_region_contains_byte(source_mapping, 5 * page_size, 0) != in mremap_dontunmap_partial_mapping_overwrite()
320 0, "first 5 pages of source should have no ptes"); in mremap_dontunmap_partial_mapping_overwrite()
322 // Finally we expect the destination to have 5 pages worth of a's. in mremap_dontunmap_partial_mapping_overwrite()
323 BUG_ON(check_region_contains_byte(dest_mapping, 5 * page_size, 'a') != 0, in mremap_dontunmap_partial_mapping_overwrite()
326 // Finally the last 5 pages shouldn't have been touched. in mremap_dontunmap_partial_mapping_overwrite()
327 BUG_ON(check_region_contains_byte(dest_mapping + (5 * page_size), in mremap_dontunmap_partial_mapping_overwrite()
328 5 * page_size, 'X') != 0, in mremap_dontunmap_partial_mapping_overwrite()
329 "dest mapping should have retained the last 5 pages"); in mremap_dontunmap_partial_mapping_overwrite()
333 BUG_ON(munmap(source_mapping, 5 * page_size) == -1, in mremap_dontunmap_partial_mapping_overwrite()
351 ksft_set_plan(5); in main()
353 // Keep a page sized buffer around for when we need it. in main()
357 BUG_ON(page_buffer == MAP_FAILED, "unable to mmap a page."); in main()