From patchwork Thu May 16 03:56:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dev Jain X-Patchwork-Id: 13665705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD3DCC25B74 for ; Thu, 16 May 2024 03:58:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E815B6B03A0; Wed, 15 May 2024 23:58:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E31DC6B03A2; Wed, 15 May 2024 23:58:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D206B6B03A4; Wed, 15 May 2024 23:58:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B55516B03A0 for ; Wed, 15 May 2024 23:58:34 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 55E6C814A4 for ; Thu, 16 May 2024 03:58:34 +0000 (UTC) X-FDA: 82122902148.29.060094C Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf07.hostedemail.com (Postfix) with ESMTP id 5A25C4000D for ; Thu, 16 May 2024 03:58:32 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; spf=pass (imf07.hostedemail.com: domain of dev.jain@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=dev.jain@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715831912; a=rsa-sha256; cv=none; b=TjXmHGy7J2wU2ZsVQprtOaqGwWlVCK+XLK0Q2GAqimmyG9/I5isw5CenH3sboXTdNUOSko 17EP/r6kujZBfn2ijlJrK0VL/M3tm8QsOFiAmzfsMmH0LgzP+YzlVMHskOFzDONEmeHpyD Sfw+lpVooB+8bPdwN1E6I46EwbP5dAQ= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; spf=pass (imf07.hostedemail.com: domain of dev.jain@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=dev.jain@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715831912; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=rnbxT+oXFZO2QEEwWjS0tiKth5mTSMr6LQktRVzPZUM=; b=N9K/y5PgWhP3A+kFb224nrYAOSCyC/KowJ7sxsczZYvRKLnpN7L7wi9m+mHHq7dmpjnCZa NQQ2a3O7MIndK9VrGKdAwaIeSWtlj5o56kaV0j2opzDeuljm4ztW5m5jT3iIeeWg6fis4t hdonMR80X1uucYzgVO5i9/ykcrF77Tw= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 96F8BDA7; Wed, 15 May 2024 20:58:55 -0700 (PDT) Received: from e116581.blr.arm.com (e116581.arm.com [10.162.42.15]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CBDA33F762; Wed, 15 May 2024 20:58:27 -0700 (PDT) From: Dev Jain To: akpm@linux-foundation.org, shuah@kernel.org Cc: 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, Dev Jain Subject: [PATCH] selftests/mm: va_high_addr_switch: Do not skip test and give warning message post FEAT_LPA2 Date: Thu, 16 May 2024 09:26:33 +0530 Message-Id: <20240516035633.143793-1-dev.jain@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: 5A25C4000D X-Rspam-User: X-Rspamd-Server: rspam12 X-Stat-Signature: akehjz934sedk86qi9giwdqa869jrqzi X-HE-Tag: 1715831912-763340 X-HE-Meta: U2FsdGVkX1/Go6T0nddsUtCi2M3jL4NQnV2s4vEb+5yT5WKzyQw2sQaPEO5DY35HVc8OMPztJJfV5gNX9JQm3op1vfsgC8YA62TvCdMWFRvLLH6ND3UkxntWpWPhegikrCoOvNtBBbgL9JU0hlRuAcQzPnvaWaTaoWdBRxJMJwmtFQghvKKNW/sGLoxWjJc44x3lqUh8Zb3I+dEmI62p3NlRfGhSssuRBjmWxX5x36ptboq5mV/U/z6RWyhSa3kiG5jntLor0Z6klDwVxEMQM1HsiV3xX/UHrwR1wd7mwuWozLYZpi3tlPLAHhJ2XBc+IqBHXKk19zsZwMUle0YgmDKTKBxmKcI0dIXPu0aHebgtVLiZ0OVi0NIV/H4T7wq0bhTvrOuYmpDfaS225jLCSKAWnVvuForNsWnY/z9UCwWtHiBPd49S7cCjSAE6FQ4FTVOaIdDa50KiAgnRhmCBTDShA+78LprwZcjKZC2z7+p/1zWuZcwCLDZwUrYK8kDbYoSuBIOjZ2U8tmzVI/lWaGLOGd2meczKxCbYFub1btZiNdcd9MXjc1EEH80hMEpW7lEoyXlB6Kq11DWxYDDjhOd5WmHBov71pxEC15O549SC87deRH4qoRwxQSzIeEMApQgCTZ1nxe/7RTInBmJJctxJQuq/Wmtrdwcxx5Q9+Y11Woctbo+q0YYvURti2FFo89+GEaDUf0IqzBuhqOjnzNzzv2hGTw2PAvgNOtlMgOdp7Vp4KdyNjl3E1AzXt+YhEoBmXf4I4Am2n6xNsIFaPaymisIV9EjiT3UhhsxrkWpSqmkOOyqhLnkxy3FSTpZDa/BgsupRRKqBdxZMcNgisDCG68cXVpCRCIgC8DCz1dxwIh/kiH3B7EWIQhl6vPC+epfvsQJDKP1LoSHgegjTJEKe0do4KQPesURVjnPYNsC0PDcQpiRbB+Eyp5qi7LXQ1nOO1SCNVS+ymyPDyL0 ejiNTMO4 qKmR5VSJQLQTgwSN54BZCAwadAHlL0luLww2kB0IcTXyiyN5pDtPMKmsMfXeD3D50e76o6/Bx9lxX5AUJH2cwC/5YF3D1yXWr+3h/+YMTLSjKO/n+1BkdJQgABQvjOcDRgIewa2KWZTEaT52CNCq4XC7M/wS4AXYE2E6Hg+a0RqlT8aoXECXQ5i/B+gLw+EfM2Bk9ZFGS7UvBgs8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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. Instead, don't skip the test, and encourage the user to manually change the macros. Signed-off-by: Dev Jain --- .../testing/selftests/mm/va_high_addr_switch.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/va_high_addr_switch.c b/tools/testing/selftests/mm/va_high_addr_switch.c index cfbc501290d3..ba862f51d395 100644 --- a/tools/testing/selftests/mm/va_high_addr_switch.c +++ b/tools/testing/selftests/mm/va_high_addr_switch.c @@ -292,12 +292,24 @@ static int supported_arch(void) #elif defined(__x86_64__) return 1; #elif defined(__aarch64__) - return getpagesize() == PAGE_SIZE; + return 1; #else return 0; #endif } +#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; }