From mboxrd@z Thu Jan 1 00:00:00 1970 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 51771C47DDF for ; Wed, 24 Jan 2024 13:39:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C44DA6B0078; Wed, 24 Jan 2024 08:39:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BF44A6B007B; Wed, 24 Jan 2024 08:39:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ABC106B007D; Wed, 24 Jan 2024 08:39:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 96E4E6B0078 for ; Wed, 24 Jan 2024 08:39:41 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 20B6CC0C6E for ; Wed, 24 Jan 2024 13:39:41 +0000 (UTC) X-FDA: 81714312162.20.F40E178 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 445AF40006 for ; Wed, 24 Jan 2024 13:39:38 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="M2Gpk35/"; spf=pass (imf17.hostedemail.com: domain of audra@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=audra@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706103578; a=rsa-sha256; cv=none; b=DWe+ezGe/qyZeKUdZKm2p0qIHR7WMI2oFutVmc6uUUQqfxD89frEESOD6/MZ9ROdQKRNsV ngnnofqrunzXJoEZULojGXQulvYahZVBI4ovLPNQx8PeI4a0Wt2FdW6Mmv0lNUKZGsdc1i NJBAQ7yjlB60oKkRFFojveqbfc9F2gU= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="M2Gpk35/"; spf=pass (imf17.hostedemail.com: domain of audra@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=audra@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706103578; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=L2dSIR4rbvdDm+KCVPpjilkj3+2xgOobjinuJW9fE8M=; b=N7xaAf+TdE+J7oRT9iBuzZa3/2hlUbqVdBsV6HB/b2sS5czGIcEtmOHwswOOnHMknIkzAl 45GIbGpoC9OOK+Iw09KVnCabr2KfVb0XqoGZh77eZXQmIywJzTKFimEsd1W3PQ8rwaKk8s e35fM18V6WOCq7OTq3htkC4QO/5zJJw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706103577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=L2dSIR4rbvdDm+KCVPpjilkj3+2xgOobjinuJW9fE8M=; b=M2Gpk35/bh3lgkOC8H9GK039bXcibnlDRPw+BRMQHHfBVJzTfyFioWvyM7O7m7ON7gWI+u /nbJn5a6wlH2xpEfsMn0sArpc6N9j0IJyzYzdguGQCyQnrJ4wKibimgKCAYPwu5EgjTB+z xClGyUgjqjYzpXpnb6ZcGNaM7gDsU1o= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-447-xkn0jY63Mbux5a5ldMJXKg-1; Wed, 24 Jan 2024 08:39:36 -0500 X-MC-Unique: xkn0jY63Mbux5a5ldMJXKg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8B67B1C068CE; Wed, 24 Jan 2024 13:39:35 +0000 (UTC) Received: from fedora (unknown [10.22.16.111]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 24A7C40C1430; Wed, 24 Jan 2024 13:39:35 +0000 (UTC) Date: Wed, 24 Jan 2024 08:39:33 -0500 From: Audra Mitchell To: Andrew Morton Cc: shuah@kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, raquini@redhat.com, Adam Sindelar Subject: Re: [PATCH] selftests/mm: Update va_high_addr_switch.sh to check CPU for la57 flag Message-ID: References: <20240119205801.62769-1-audra@redhat.com> <20240121143153.5dcfe26dea53ba0e896dbf85@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240121143153.5dcfe26dea53ba0e896dbf85@linux-foundation.org> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 445AF40006 X-Stat-Signature: 5qpqgjzcq93nqyyfxtkpyu89pygtsge3 X-Rspam-User: X-HE-Tag: 1706103578-622845 X-HE-Meta: U2FsdGVkX1/o9ie86dqb10E+TWpk+YLiCWDYc8ks+BzDnlQFF0FjwZffvurUs6jn2P7tkVz9igoyfZeeYyoNnqv9IUwig4loK6dyxoWKwJYVGnFgXEgd/K1Sn192I+PIR7gg/tV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qP9aCCzETP9mhayr+TIrtZhmV+MLhbDAbIsDdZVh9iaaXOtEdBFDcuNJJ 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: On Sun, Jan 21, 2024 at 02:31:53PM -0800, Andrew Morton wrote: > On Fri, 19 Jan 2024 15:58:01 -0500 Audra Mitchell wrote: > > > In order for the page table level 5 to be in use, the CPU must have the > > setting enabled in addition to the CONFIG option. Check for the flag to be > > set to avoid false test failures on systems that do not have this cpu flag > > set. > > > > Thanks. > > I'll add > > Cc: Adam Sindelar > Fixes: 4f2930c6718a ("selftests/vm: only run 128TBswitch with 5-level paging") > Cc: > > A more complete description of these "test failures" would be helpful > please. > Hey, sorry for the incomplete description. The test does a series of mmap calls including three using the MAP_FIXED flag and specifying an address that is 1<<47 or 1<<48. These addresses are only available if you are using level 5 page tables, which requires both the CPU to have the capabiltiy (la57 flag) and the kernel to be configured. Currently the test only checks for the kernel configuration option, so this test can still report a false positive. Here are the three failing lines: $ ./va_high_addr_switch | grep FAILED mmap(ADDR_SWITCH_HINT, 2 * PAGE_SIZE, MAP_FIXED): 0xffffffffffffffff - FAILED mmap(HIGH_ADDR, MAP_FIXED): 0xffffffffffffffff - FAILED mmap(ADDR_SWITCH_HINT, 2 * PAGE_SIZE, MAP_FIXED): 0xffffffffffffffff - FAILED I thought (for about a second) refactoring the test so that these three mmap calls will only be run on systems with the level 5 page tables available, but the whole point of the test is to check the level 5 feature... If you would like me to also update the description on the patch let me know and I'll update it and resubmit. Thanks! > > --- a/tools/testing/selftests/mm/va_high_addr_switch.sh > > +++ b/tools/testing/selftests/mm/va_high_addr_switch.sh > > @@ -29,9 +29,15 @@ check_supported_x86_64() > > # See man 1 gzip under '-f'. > > local pg_table_levels=$(gzip -dcfq "${config}" | grep PGTABLE_LEVELS | cut -d'=' -f 2) > > > > + local cpu_supports_pl5=$(awk '/^flags/ {if (/la57/) {print 0;} > > + else {print 1}; exit}' /proc/cpuinfo 2>/dev/null) > > + > > if [[ "${pg_table_levels}" -lt 5 ]]; then > > echo "$0: PGTABLE_LEVELS=${pg_table_levels}, must be >= 5 to run this test" > > exit $ksft_skip > > + elif [[ "${cpu_supports_pl5}" -ne 0 ]]; then > > + echo "$0: CPU does not have the necessary la57 flag to support page table level 5" > > + exit $ksft_skip > > fi > > } > > > > -- > > 2.43.0 >