linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Dev Jain <dev.jain@arm.com>
Cc: shuah@kernel.org, linux-mm@kvack.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	Anshuman.Khandual@arm.com, kirill.shutemov@linux.intel.com,
	AneeshKumar.KizhakeVeetil@arm.com
Subject: Re: [PATCH] selftests/mm: va_high_addr_switch: Do not skip test and give warning message post FEAT_LPA2
Date: Sun, 19 May 2024 16:48:23 -0700	[thread overview]
Message-ID: <20240519164823.8e21acfd2bf9ad13f7798f1a@linux-foundation.org> (raw)
In-Reply-To: <20240516035633.143793-1-dev.jain@arm.com>

On Thu, 16 May 2024 09:26:33 +0530 Dev Jain <dev.jain@arm.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.



  reply	other threads:[~2024-05-19 23:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-16  3:56 [PATCH] selftests/mm: va_high_addr_switch: Do not skip test and give warning message post FEAT_LPA2 Dev Jain
2024-05-19 23:48 ` Andrew Morton [this message]
2024-05-21 12:52   ` Dev Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240519164823.8e21acfd2bf9ad13f7798f1a@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=AneeshKumar.KizhakeVeetil@arm.com \
    --cc=Anshuman.Khandual@arm.com \
    --cc=dev.jain@arm.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).