Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3407396ybx; Sun, 3 Nov 2019 18:16:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwIEmBYJvIyGtKAl7IJ53o7XGi+998wB/ZAld4bsC6NAU4DE9j4drb6O+iN4xSJ+xq2tMH4 X-Received: by 2002:aa7:c645:: with SMTP id z5mr26982871edr.204.1572833794377; Sun, 03 Nov 2019 18:16:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572833794; cv=none; d=google.com; s=arc-20160816; b=0MOzVRQMQ2mHMN/CYmXU4WvB9fnT6LP6ki4S2jVpQLosDRVWmZ8CN6ixMJ3hOoj1jG KW4ndzLc6AfDG9zd6zxkfw9AQVmL+gvt82XCqvApGsXjb5tGiuD42/8YEWSGReDBxMTL IeNlZOPH76XYG+egijvFzAPeAMRiNSn2IfTVDi37v1uVIcvXGm3HH+rts7gMEZ8bORWw 1tjfaT6jzdPEtMrUFmaABvi00HHgaV/z84ErFxTRullTod9ELBuxEOILOZkhTRAOHQSw AZhyNCLLfDJbmkE1QGMtAI7zDEiYiZu1lXn0DWP5GD4uXGOipmIYXd1JRU7fLQImMfze waHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=8+2oPheOQ5A+sTNzwC+AqTeNnpYVr+e67cobx0HsDhc=; b=ybC5rymZJTBPO1DjlWGf5nyYbyalGaS7o3KkNn+pmPMv90ksdrbV6m5C9dCBrUfqwC LHXm4YhdtlycFGszHXqQUYSaEPgMYDY0kxLWj9km8m0V6iP4FIhEMHrUpKK3mlVgMILw JuA8oplG9BTkhfwQfYBiIjaydiV4nHWn+O9VHUKoYwa49cdQQAX4A+xpL/FuG4IrXtWZ 0+22YCkKE/Lp+7eMsYxfraBM1SDPPM58+FI9Ku3a6+0GPPML+8OHwxjXyblTJ2spQ7oq ufeKytDNtFUx1FJDbf5fhv3r1Z2rkahYT0GA4FfE5AOPROecLkhiEvFQa5eTSb4xh5up Ui2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w29si808713edd.270.2019.11.03.18.16.10; Sun, 03 Nov 2019 18:16:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728672AbfKDCPl (ORCPT + 99 others); Sun, 3 Nov 2019 21:15:41 -0500 Received: from foss.arm.com ([217.140.110.172]:34396 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728227AbfKDCPk (ORCPT ); Sun, 3 Nov 2019 21:15:40 -0500 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 E7F6631F; Sun, 3 Nov 2019 18:15:39 -0800 (PST) Received: from [10.163.1.23] (unknown [10.163.1.23]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6E4893F67D; Sun, 3 Nov 2019 18:15:22 -0800 (PST) Subject: Re: [PATCH V8] mm/debug: Add tests validating architecture page table helpers To: Qian Cai Cc: linux-mm@kvack.org, Andrew Morton , Vlastimil Babka , Greg Kroah-Hartman , Thomas Gleixner , Mike Rapoport , Jason Gunthorpe , Dan Williams , Peter Zijlstra , Michal Hocko , Mark Rutland , Mark Brown , Steven Price , Ard Biesheuvel , Masahiro Yamada , Kees Cook , Tetsuo Handa , Matthew Wilcox , Sri Krishna chowdary , Dave Hansen , Russell King - ARM Linux , Michael Ellerman , Paul Mackerras , Martin Schwidefsky , Heiko Carstens , "David S. Miller" , Vineet Gupta , James Hogan , Paul Burton , Ralf Baechle , "Kirill A . Shutemov" , Gerald Schaefer , Christophe Leroy , Ingo Molnar , linux-snps-arc@lists.infradead.org, linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org References: <1572240562-23630-1-git-send-email-anshuman.khandual@arm.com> From: Anshuman Khandual Message-ID: Date: Mon, 4 Nov 2019 07:45:56 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/29/2019 04:01 PM, Qian Cai wrote: > > >> On Oct 28, 2019, at 1:29 AM, Anshuman Khandual wrote: >> >> This adds tests which will validate architecture page table helpers and >> other accessors in their compliance with expected generic MM semantics. >> This will help various architectures in validating changes to existing >> page table helpers or addition of new ones. >> >> This test covers basic page table entry transformations including but not >> limited to old, young, dirty, clean, write, write protect etc at various >> level along with populating intermediate entries with next page table page >> and validating them. >> >> Test page table pages are allocated from system memory with required size >> and alignments. The mapped pfns at page table levels are derived from a >> real pfn representing a valid kernel text symbol. This test gets called >> right after page_alloc_init_late(). >> >> This gets build and run when CONFIG_DEBUG_VM_PGTABLE is selected along with >> CONFIG_VM_DEBUG. Architectures willing to subscribe this test also need to >> select CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE which for now is limited to x86 and >> arm64. Going forward, other architectures too can enable this after fixing >> build or runtime problems (if any) with their page table helpers. >> >> Folks interested in making sure that a given platform's page table helpers >> conform to expected generic MM semantics should enable the above config >> which will just trigger this test during boot. Any non conformity here will >> be reported as an warning which would need to be fixed. This test will help >> catch any changes to the agreed upon semantics expected from generic MM and >> enable platforms to accommodate it thereafter. > > This looks like a perfect candidate to streamline with the new kunit framework, no? I have not been following the kunit test framework. But being highly dependent on existing MM accessors (generic or platform) and very much page table modification centric, mm/ is the best place for this test IMHO. It is now also part of DEBUG_VM set of tests. Probably in future all existing MM tests (mm/ or lib/) might move to kunit framework but for now it should remain with DEBUG_VM set of tests.