Skip to contentSkip to conversation

Fix vm kselftest build

PATCH In review Oleksandr Tymoshenko 2 participants 6 messages Jul 15, 2022 – Jul 23, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Fix vm kselftest build

This patchset reverts duplicates of two backported commits that created exact copies of functions added by the original backports.

Oleksandr Tymoshenko (2):
Revert "selftest/vm: verify remap destination address in mremap_test" Revert "selftest/vm: verify mmap addr in mremap_test"

 tools/testing/selftests/vm/mremap_test.c | 53 ------------------------
 1 file changed, 53 deletions(-)
Signature · 1 line
2.37.0.170.g444d1eabd0-goog
#1 lore raw

PATCH 1/2 Revert "selftest/vm: verify remap destination address in mremap_test"

This reverts commit 0b4e16093e081a3ab08b0d6cedf79b249f41b248.

The upstream commit 18d609daa546 ("selftest/vm: verify remap destination address in mremap_test") was backported as commit 2688d967ec65 ("selftest/vm: verify remap destination address in mremap_test"). Repeated backport introduced the duplicate of function is_remap_region_valid to the file breakign the vm selftest build.

Fixes 0b4e16093e08 ("selftest/vm: verify remap destination address in mremap_test")
---
 tools/testing/selftests/vm/mremap_test.c | 24 ------------------------
 1 file changed, 24 deletions(-)
tools/testing/selftests/vm/mremap_test.c +0 -24
index 8f4dbbd60c09..efcbf537b3d5 100644
@@ -66,30 +66,6 @@ enum {
 	.expect_failure = should_fail				\
 }
 
-/*
- * Returns false if the requested remap region overlaps with an
- * existing mapping (e.g text, stack) else returns true.
- */
-static bool is_remap_region_valid(void *addr, unsigned long long size)
-{
-	void *remap_addr = NULL;
-	bool ret = true;
-
-	/* Use MAP_FIXED_NOREPLACE flag to ensure region is not mapped */
-	remap_addr = mmap(addr, size, PROT_READ | PROT_WRITE,
-					 MAP_FIXED_NOREPLACE | MAP_ANONYMOUS | MAP_SHARED,
-					 -1, 0);
-
-	if (remap_addr == MAP_FAILED) {
-		if (errno == EEXIST)
-			ret = false;
-	} else {
-		munmap(remap_addr, size);
-	}
-
-	return ret;
-}
-
 /* Returns mmap_min_addr sysctl tunable from procfs */
 static unsigned long long get_mmap_min_addr(void)
 {
Signature · 1 line
2.37.0.170.g444d1eabd0-goog
#2 lore raw

PATCH 2/2 Revert "selftest/vm: verify mmap addr in mremap_test"

In reply to Oleksandr Tymoshenko

This reverts commit e8b9989597daac896b3400b7005f24bf15233d9a.

The upstream commit 9c85a9bae267 ("selftest/vm: verify mmap addr in mremap_test") was backported as commit a17404fcbfd0 ("selftest/vm:
verify mmap addr in mremap_test"). Repeated backport introduced the duplicate of function get_mmap_min_addr to the file breakign the vm selftest build.

Fixes e8b9989597da ("selftest/vm: verify mmap addr in mremap_test")
---
 tools/testing/selftests/vm/mremap_test.c | 29 ------------------------
 1 file changed, 29 deletions(-)
tools/testing/selftests/vm/mremap_test.c +0 -29
index efcbf537b3d5..e3ce33a9954e 100644
@@ -66,35 +66,6 @@ enum {
 	.expect_failure = should_fail				\
 }
 
-/* Returns mmap_min_addr sysctl tunable from procfs */
-static unsigned long long get_mmap_min_addr(void)
-{
-	FILE *fp;
-	int n_matched;
-	static unsigned long long addr;
-
-	if (addr)
-		return addr;
-
-	fp = fopen("/proc/sys/vm/mmap_min_addr", "r");
-	if (fp == NULL) {
-		ksft_print_msg("Failed to open /proc/sys/vm/mmap_min_addr: %s\n",
-			strerror(errno));
-		exit(KSFT_SKIP);
-	}
-
-	n_matched = fscanf(fp, "%llu", &addr);
-	if (n_matched != 1) {
-		ksft_print_msg("Failed to read /proc/sys/vm/mmap_min_addr: %s\n",
-			strerror(errno));
-		fclose(fp);
-		exit(KSFT_SKIP);
-	}
-
-	fclose(fp);
-	return addr;
-}
-
 /*
  * Returns false if the requested remap region overlaps with an
  * existing mapping (e.g text, stack) else returns true.
Signature · 1 line
2.37.0.170.g444d1eabd0-goog
maintainer
#3 lore raw
In reply to Oleksandr Tymoshenko
Quoted 9 lines · Oleksandr Tymoshenko

This patchset reverts duplicates of two backported commits that created exact copies of functions added by the original backports.

Oleksandr Tymoshenko (2):
Revert "selftest/vm: verify remap destination address in mremap_test" Revert "selftest/vm: verify mmap addr in mremap_test"

 tools/testing/selftests/vm/mremap_test.c | 53 ------------------------
 1 file changed, 53 deletions(-)

For what stable tree(s) are you wanting these to be applied to?

thanks,

greg k-h

#4 lore raw
Quoted 5 lines · Greg KH
Quoted 3 lines · Oleksandr Tymoshenko

This patchset reverts duplicates of two backported commits that created exact copies of functions added by the original backports.

Quoted 8 lines
Quoted 6 lines

Oleksandr Tymoshenko (2):
Revert "selftest/vm: verify remap destination address in mremap_test" Revert "selftest/vm: verify mmap addr in mremap_test"

 tools/testing/selftests/vm/mremap_test.c | 53 ------------------------
 1 file changed, 53 deletions(-)

For what stable tree(s) are you wanting these to be applied to?

5.15, only this branch is affected

maintainer
#5 lore raw
Quoted 10 lines · Oleksandr Tymoshenko
Quoted 9 lines · Greg KH
Quoted 7 lines · Oleksandr Tymoshenko

This patchset reverts duplicates of two backported commits that created exact copies of functions added by the original backports.

Oleksandr Tymoshenko (2):
Revert "selftest/vm: verify remap destination address in mremap_test" Revert "selftest/vm: verify mmap addr in mremap_test"

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
 tools/testing/selftests/vm/mremap_test.c | 53 ------------------------
 1 file changed, 53 deletions(-)

For what stable tree(s) are you wanting these to be applied to?

5.15, only this branch is affected

thanks, now queued up.

greg k-h