Revert "FROMGIT: userfaultfd/selftests: create alias mappings in the shmem test"
This reverts commit 4a460b5cba as an
updated version of the patch-set will be merged later.
Signed-off-by: Lokesh Gidra <lokeshgidra@google.com>
Bug: 187930641
Change-Id: I13e7cac79661ef46882cc69ab60327fafd212093
This commit is contained in:
parent
8f6445acee
commit
72a3f935ad
1 changed files with 3 additions and 19 deletions
|
|
@ -277,29 +277,13 @@ static void shmem_release_pages(char *rel_area)
|
|||
|
||||
static void shmem_allocate_area(void **alloc_area)
|
||||
{
|
||||
void *area_alias = NULL;
|
||||
bool is_src = alloc_area == (void **)&area_src;
|
||||
unsigned long offset = is_src ? 0 : nr_pages * page_size;
|
||||
unsigned long offset =
|
||||
alloc_area == (void **)&area_src ? 0 : nr_pages * page_size;
|
||||
|
||||
*alloc_area = mmap(NULL, nr_pages * page_size, PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED, shm_fd, offset);
|
||||
if (*alloc_area == MAP_FAILED)
|
||||
err("mmap of memfd failed");
|
||||
|
||||
area_alias = mmap(NULL, nr_pages * page_size, PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED, shm_fd, offset);
|
||||
if (area_alias == MAP_FAILED)
|
||||
err("mmap of memfd alias failed");
|
||||
|
||||
if (is_src)
|
||||
area_src_alias = area_alias;
|
||||
else
|
||||
area_dst_alias = area_alias;
|
||||
}
|
||||
|
||||
static void shmem_alias_mapping(__u64 *start, size_t len, unsigned long offset)
|
||||
{
|
||||
*start = (unsigned long)area_dst_alias + offset;
|
||||
}
|
||||
|
||||
struct uffd_test_ops {
|
||||
|
|
@ -329,7 +313,7 @@ static struct uffd_test_ops shmem_uffd_test_ops = {
|
|||
.expected_ioctls = SHMEM_EXPECTED_IOCTLS,
|
||||
.allocate_area = shmem_allocate_area,
|
||||
.release_pages = shmem_release_pages,
|
||||
.alias_mapping = shmem_alias_mapping,
|
||||
.alias_mapping = noop_alias_mapping,
|
||||
};
|
||||
|
||||
static struct uffd_test_ops hugetlb_uffd_test_ops = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue