lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 19 May 2024 16:48:23 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Dev Jain <dev.jain@....com>
Cc: shuah@...nel.org, linux-mm@...ck.org, linux-kselftest@...r.kernel.org,
 linux-kernel@...r.kernel.org, Anshuman.Khandual@....com,
 kirill.shutemov@...ux.intel.com, AneeshKumar.KizhakeVeetil@....com
Subject: Re: [PATCH] selftests/mm: va_high_addr_switch: Do not skip test and
 give warning message post FEAT_LPA2

On Thu, 16 May 2024 09:26:33 +0530 Dev Jain <dev.jain@....com> wrote:

> Post FEAT_LPA2, Aarch64 extends the 4KB and 16KB translation granule to
> large virtual addresses. Currently, the test is being skipped for said
> granule sizes, because the page sizes have been statically defined; to
> work around that would mean breaking the nice array of structs used for
> adding testcases.

Which array is that?  testcases[]?  If so, we could keep if fairly nice
by doing the array population at runtime.  Something like:

static struct testcase *testcases;

static void init_thing()
{
	struct testcase t[] = {
		...
	};

	testcases = malloc(sizeof(t));
	memcpy(testcases, t, sizeof(t));
}
	
>  
> +#if defined(__aarch64__)
> +void failure_message(void)
> +{
> +	printf("TEST MAY FAIL: Are you running on a pagesize other than 64K?\n");
> +	printf("If yes, please change macros manually. Ensure to change the\n");
> +	printf("address macros too if running defconfig on 16K pagesize,\n");
> +	printf("since userspace VA = 47 bits post FEAT_LPA2.\n");
> +}
> +#else
> +void failure_message(void) {}
> +#endif
> +
>  int main(int argc, char **argv)
>  {
>  	int ret;
> @@ -308,5 +320,8 @@ int main(int argc, char **argv)
>  	ret = run_test(testcases, ARRAY_SIZE(testcases));
>  	if (argc == 2 && !strcmp(argv[1], "--run-hugetlb"))
>  		ret = run_test(hugetlb_testcases, ARRAY_SIZE(hugetlb_testcases));
> +
> +	if (ret)
> +		failure_message();
>  	return ret;
>  }

This seems rather lame :(.  It would be nice to fix this for once and
for all.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ