Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1121004rdb; Wed, 24 Jan 2024 05:39:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEK9almzC48emp8TB5Lj5akfRs+EKN9NwCUMgQHm74o5/W9eeCrqO4UQO6mDwVwuQWPpcsI X-Received: by 2002:a17:906:b251:b0:a30:e90a:7f84 with SMTP id ce17-20020a170906b25100b00a30e90a7f84mr611274ejb.165.1706103590403; Wed, 24 Jan 2024 05:39:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706103590; cv=pass; d=google.com; s=arc-20160816; b=f3R4Y2v2/DfCJCqQlilC6DNx/qlWfuXhpAidIW6wcsigd1InLoYe+JdP8aZE3bMd6n XvoJA/YPEja2V7rUh/bI15SR16Hre8KjVFmRufkiZraGtSeAgA4e315PiEPXoryCpwKm TsS1qGXXbxjwhdi6FzpezGrmhlku1pTPmMPHiF6E1vFWJbLEgS0qacMtXfsE+Fel0Jlx oSXvVxXmyPcxKskGag86X4mtvJiCh2ktVTh4DQ1lFbR4yDsHbiS6TwCOwB0JXwKtlHEM Mg8dfzfb7F/2mzNjnfLcyxoq3X4CM7RarvNzxx+vbdxAQOce1jisuRn63qopmxMg5/52 nfJg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=L2dSIR4rbvdDm+KCVPpjilkj3+2xgOobjinuJW9fE8M=; fh=CxKEmSJ47p2lzQOdOFsx5mvG5U/s2Y79LcMJyN13No4=; b=JFpBgxifNNi9e+zmumfOwF8lN5xhEs1ftJJ3CWNLDT+SLcg/6wrLqYo8kRPeWNqG5u DpF1jw/FbRkBuRlWuzlj9FCUdgRBjXMLoCXyZkmH5c49oAIAz8iFHtXbtz3qdiTDFogA xgnMqR9qphr9YEV594TCZE88Zy1e6qiT7UGQlIx8OEW9QkM6QV/BIi8eOHqYIdFt3ZYN LnjKkSrszqXxRUADSRxpSdJYQQOXz9jkjXFxJp4XjRLTAzjZk0/7CO9XhYYF84xfJ/vB 4nEzxrcvvjmUl3hBDOr/EPlGUTKc8L2+xjKjNH/jHr1tc8F1w9DQXquaCTu7mnmz6t/t Momg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UJjmK1gS; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-37071-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37071-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cw17-20020a170906c79100b00a30b487166csi2010527ejb.393.2024.01.24.05.39.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 05:39:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37071-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UJjmK1gS; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-37071-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37071-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2D2FD1F24DA8 for ; Wed, 24 Jan 2024 13:39:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE6C077F18; Wed, 24 Jan 2024 13:39:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UJjmK1gS" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83FA260BB3 for ; Wed, 24 Jan 2024 13:39:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706103582; cv=none; b=Eg5kRNZ1bhFYQofja51yhCUo1syEouNCXbXeqS4PaNEvQzyAhFzTFUFYoh8rm9zabeOrggQ/dQFQ83ikfTGBbxnJJSNALngRMvpqNMv0rehl9Ljq7MUabqq+4p+EJFzxkvVx9pUTslV6c1Z6H1TYHjA5jxjPiQgsWp6MKNtY7es= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706103582; c=relaxed/simple; bh=npa0NVykoMEN5MSYcp671yDBaYHZIPWOdfRNArMuVbk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=a3PsBvHGaTjCoRiI1TKgezlCSdSOARr+ECbwVtcTHmSYSqV+YgBZ8qo3tKacygFOS8zqFYs3j5UmSZT9x6aFKbRzOMelM3BioZ+Lzw5oGgUujKVfV8tM+hG8kaE7+I5P+qpD2HAYmYSvp/A6N8ifV3r0vS1R6LlMCoYwtxXs2BQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=UJjmK1gS; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706103579; 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=UJjmK1gS7rCVvzFojR5tOHV/E3zozGAPq9VCAzG0MLn3jqjakwsNCIBYfp/+ukq0QluAy7 fyNyutgbN/s0ZX3DydeULShbgkb70vYB4ccdkY39q+nC1iOTO2aF9q9nurifDhWgPGudXo W6AdNuWdpXeZrudRbiyeKaYhIB3cPqQ= 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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 >