Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5878159pxv; Thu, 29 Jul 2021 00:15:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8kOCwq2HHlH16OCgd9TguZ9+tHZL9+Y0Lgo7NlDUZpw3qRpeSmWmppCKlMyt8rnjkM2jg X-Received: by 2002:a6b:5d14:: with SMTP id r20mr3092525iob.140.1627542900738; Thu, 29 Jul 2021 00:15:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627542900; cv=none; d=google.com; s=arc-20160816; b=rFCjUt3PRr8lP2JwDdv8LggCGbjNTAjOXqET3R22SjHUFSUTxhZ/m2jxbbM2VPXnZJ JvNAd/wNFJmWV08wy2IqOPdiB+AukM2ezzO0wUSskQ5AP5xzMWARk21YMuceFy7Sp46M LnTXCQLzqTNcVRDaCFgJYKRk+uiFXTadM8ajKOohGTJ8noxV4YQTey4AAd2duJtcadmL 7dyAxaPz00LsojB0d2dBStvxIpLO1uvheq8EA++2UmCuw8nyJlXb6cdZCni+1GGkw1Ge rwoXwRgMcLy4TopCwerlujiDT5qfE7SIbz0NLm0Fma6yzx4MaTloXSL2cQhE9PEXw12M 1O5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=lpl8UURL/FjJiAz4c/bchQMRURSqcS/RzUsB2Yp8kR4=; b=jb+J9xifd6rxs7kpTIggSAPhMuanxxtrx2TsNIcMLTh6/T7Fw88ZVvpessnC6XYCYO uHef0sy4f8/Dbl4sNLz5bek0jHsM0f+/IgzXjbBFUnX1uaS2ayI8EYVEXv3lywPskMlT 89RnAOnldT5iDDkFJHT2SZCR/+r7BRlVoMTWWfcsv19XzWAzjFQGg93720GgLTWUFHYI dTRfQptCeny0Xx3meoUNKLUU8zLFIvHgzfSa7I+C18XP3M4wteVe367LA16pCfK8axjR DdfL799A5YxhqBcwuDpIu3ISp/JirOfcwWJ5S3FHBCFMtj+LWi3IpskbSpVSWBs7FXEX qxxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p6si2971265ilo.37.2021.07.29.00.14.46; Thu, 29 Jul 2021 00:15:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234458AbhG2HNj (ORCPT + 99 others); Thu, 29 Jul 2021 03:13:39 -0400 Received: from foss.arm.com ([217.140.110.172]:41662 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234079AbhG2HNj (ORCPT ); Thu, 29 Jul 2021 03:13:39 -0400 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 4D8D96D; Thu, 29 Jul 2021 00:13:36 -0700 (PDT) Received: from [10.163.65.237] (unknown [10.163.65.237]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 92DF13F73D; Thu, 29 Jul 2021 00:13:32 -0700 (PDT) Subject: Re: [PATCH v4 00/12] mm/debug_vm_pgtable: Enhancements To: Gavin Shan , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, gerald.schaefer@linux.ibm.com, aneesh.kumar@linux.ibm.com, christophe.leroy@csgroup.eu, cai@lca.pw, catalin.marinas@arm.com, will@kernel.org, akpm@linux-foundation.org, chuhu@redhat.com, shan.gavin@gmail.com References: <20210727061401.592616-1-gshan@redhat.com> From: Anshuman Khandual Message-ID: <8b969a2a-a883-3ce2-fac4-70ac2e3fd157@arm.com> Date: Thu, 29 Jul 2021 12:44:20 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210727061401.592616-1-gshan@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/27/21 11:43 AM, Gavin Shan wrote: > There are couple of issues with current implementations and this series > tries to resolve the issues: > > (a) All needed information are scattered in variables, passed to various > test functions. The code is organized in pretty much relaxed fashion. > > (b) The page isn't allocated from buddy during page table entry modifying > tests. The page can be invalid, conflicting to the implementations > of set_xxx_at() on ARM64. The target page is accessed so that the iCache > can be flushed when execution permission is given on ARM64. Besides, > the target page can be unmapped and access to it causes kernel crash. > > "struct pgtable_debug_args" is introduced to address issue (a). For issue > (b), the used page is allocated from buddy in page table entry modifying > tests. The corresponding tets will be skipped if we fail to allocate the > (huge) page. For other test cases, the original page around to kernel > symbol (@start_kernel) is still used. > > The patches are organized as below. PATCH[2-10] could be combined to one > patch, but it will make the review harder: > > PATCH[1] introduces "struct pgtable_debug_args" as place holder of all > needed information. With it, the old and new implementation > can coexist. > PATCH[2-10] uses "struct pgtable_debug_args" in various test functions. > PATCH[11] removes the unused code for old implementation. > PATCH[12] fixes the issue of corrupted page flag for ARM64 > > Changelog > ========= > v4: > * Determine the page allocation method according to > MAX_ORDER (Anshuman) > * Move existing comments to init_args() (Anshuman) > * Code refactoring as suggested by Anshuman (Anshuman) > * Improved commit log and add comments for flush_dcache_page() > in PATCH[v4 12/12] (Anshuman) > * Address misc comments (Anshuman This series builds ok on all supported platforms but should also be tested on them as well i.e s390, ppc, arc and riscv. I was able to do some tests on arm64 and x86 platforms.