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 B2325C27C4F for ; Tue, 18 Jun 2024 15:07:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 39DE96B0208; Tue, 18 Jun 2024 11:07:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 34E2E6B020A; Tue, 18 Jun 2024 11:07:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2159B6B020C; Tue, 18 Jun 2024 11:07:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 01F366B0208 for ; Tue, 18 Jun 2024 11:07:38 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C289C161B0E for ; Tue, 18 Jun 2024 15:03:56 +0000 (UTC) X-FDA: 82244329272.16.D6E70AF Received: from mx0b-00823401.pphosted.com (mx0b-00823401.pphosted.com [148.163.152.46]) by imf22.hostedemail.com (Postfix) with ESMTP id 0DDB4C0093 for ; Tue, 18 Jun 2024 15:03:33 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=motorola.com header.s=DKIM202306 header.b=2OfyujLT; spf=pass (imf22.hostedemail.com: domain of mbland@motorola.com designates 148.163.152.46 as permitted sender) smtp.mailfrom=mbland@motorola.com; dmarc=pass (policy=none) header.from=motorola.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718723009; 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=LsDqHofp7K+2f2J0vx8uTn82tMHjx9v5dUOBs6FATk0=; b=nluJOm87RXGLxEJYtJX4HAuJOmmKSjQyQbpCcem4Bbl8YsCMeou3rde/iR/mOZn4Y2Tm6L 8ZFna38m0E6G8ZdMJ6q0PEyQ/YqSg8vfxCiIQNktieX32mi1R0a68K4DXCzqne+wHyAWda TOTYUC1XVqx0gbpUVX3DF2e8afyyQMk= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=motorola.com header.s=DKIM202306 header.b=2OfyujLT; spf=pass (imf22.hostedemail.com: domain of mbland@motorola.com designates 148.163.152.46 as permitted sender) smtp.mailfrom=mbland@motorola.com; dmarc=pass (policy=none) header.from=motorola.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718723009; a=rsa-sha256; cv=none; b=cYCnxfbyZ408AJ4jCsJxQo7dm2utgpxjzDSlZn7XcwIj/eOpYoJu+mcTatW9Ck4cDy5StP h67iV6OGipDpmryFEkG+qabvbXJjMe9MR/gYRYPsdNqaa6YYuPHlpF4zov8IessT4VfEnF nIaIS1mPRmG+iSNO3I6v5nYOHE9I8Wk= Received: from pps.filterd (m0355090.ppops.net [127.0.0.1]) by m0355090.ppops.net (8.18.1.2/8.18.1.2) with ESMTP id 45IEew5e009691; Tue, 18 Jun 2024 15:03:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=motorola.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=DKIM202306; bh=LsDqHofp7K+2f2J0vx8uTn8 2tMHjx9v5dUOBs6FATk0=; b=2OfyujLTu3HMNZ/1kzSJ7E1hMLjFWJzgZiOaS3K oRs1TGdAoCy1YW6xeop2sf/8y1LFz8HGoX5igUdv5lCr5PEm7MsN7azev4rIkkTG mO6Vzt+Y5ef1nlT/APQIsXsaI6u9ChRY9JurZ+0SvYKIq8eOFiii6fQFEg68RhgG oYaSMdFpo8C4zTzIIO2CZO3GptHawdoNaUGWva06xhWCmEF3zRJvLCWa+EbrQyiX C4Svw4UQT4bVcuAq71bXyzFYnR1W6+SoyAuzj+B2hLOc9tiau9O+ouvEr7OJBoy0 8y21NM+a5F/la2x3fRmN4OPtzoAj89tsUByfesGdwNYrn+g== Received: from va32lpfpp03.lenovo.com ([104.232.228.23]) by m0355090.ppops.net (PPS) with ESMTPS id 3ysp9ry9k0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Jun 2024 15:03:24 +0000 (GMT) Received: from va32lmmrp01.lenovo.com (va32lmmrp01.mot.com [10.62.177.113]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by va32lpfpp03.lenovo.com (Postfix) with ESMTPS id 4W3VPS1FQLz51Q9v; Tue, 18 Jun 2024 15:03:24 +0000 (UTC) Received: from ilclasset02 (ilclasset02.mot.com [100.64.49.13]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: mbland) by va32lmmrp01.lenovo.com (Postfix) with ESMTPSA id 4W3VPR6DTRz2VZRs; Tue, 18 Jun 2024 15:03:23 +0000 (UTC) Date: Tue, 18 Jun 2024 10:03:22 -0500 From: Maxwell Bland To: Catalin Marinas Cc: linux-mm@kvack.org, Will Deacon , Jonathan Corbet , Andrew Morton , Ard Biesheuvel , Mark Rutland , Christophe Leroy , Alexandre Ghiti , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] ptdump: add intermediate directory support Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Proofpoint-GUID: 36Dl4qhOa9MmtRZLkP33Gicrqq9UYwHt X-Proofpoint-ORIG-GUID: 36Dl4qhOa9MmtRZLkP33Gicrqq9UYwHt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-18_02,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 mlxlogscore=999 priorityscore=1501 malwarescore=0 suspectscore=0 clxscore=1015 spamscore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406180112 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 0DDB4C0093 X-Stat-Signature: farw3axie3wuxj483bf4ud8c3wdkx8zi X-Rspam-User: X-HE-Tag: 1718723013-652074 X-HE-Meta: U2FsdGVkX1+Q4D75/AbjFJpufh4B6EImlx3pzxhrJZdzaFrHxye0vI82tPpORPfOALpP6d183CkZz0UnJ6R8tZ279QtBAfW87sNZ2wTioJff6ONYk1zjiZUuAFrCd/UqrxQohUnsrSP4IhX24kA0PorYhe8X59mSWne79TBAUqnKtWTXTl9hlRHyTf415NF8qrJEOWryam+hYEWUXNmplUmyarbfe4rUwd2KdvdJwSd52pDdqEhX5FFs4yiR7fGNcQjdEOXzXBwtrVE3WzdvNzoUukSgRqfHmAQnsuQ+Djk9QqyM2cLBdx9Qu7UwiA3ENgbOgFWxkKUv6xgADqUDDCc/k7cHFiR8sNMM7ZIyiXhqVv4awVLzB+83nh8sUb3Rb0gE8JZKP19CXBXPfA/2tK6EWh8zhGHD/EXH1jECACW2zU7R7E6BWrGO806ptj2ELI0GPgNVcMhKlRNtBZ1Nz2ocPSmRcHJWzLSPpQj+8J/YKHUR4zOtAYWLVVNKpWWNpTpUR+EOMoF34f8jfmgG4C7Fd5tAO09N3sR442uFOgpvrKZ9arf8dXl1MkM6yXBzy8Lwtsm3Jttx2D2v9SBtzui5uMkkezTYAE0rvRkb43qaLvZdUxvSj7bMZFP9pNeXADWrkh/okdlxfIOCYK8xHEzx6aqZ8HetOn+V4ArtzMRhGcH1rK7iD9KB46nZrd8z1P1k4rwAql67HZkMCGSbJ1T9r7xL6Dt8caInQCTaZ5FMQ87idzeHECyW3NdjFbuF1nY8/F/m1ep2G2hmjAW71gvnek0GernhZvMvU46BjG9Tb6Y2ODQK3rOzj0Bn8qqslUCHtXnrXO2OJknhww66+N4gSGMDTPOTpaPRM5k+8p4dIqu/HC/OCQhmboGRJww18dkF6DF2K+1fKPUKSlnIDozcxT2tudScpejPc9NojrUY6cg1D7E0Fh+iANcd9VxJO5YTL7vqqqZIHQavqGB 4O2hnUZN YMedIDwn7IA4mvRo8/8YBfvx/d5oYMCCvH3XZNFOAkSX8hXAqmCDVj06DPBmgO6fJyiDAHhTqqcTdvFUUUqqKm49DO8F4NxgE3ZD01FbKIdfs7cvcKqi5CEhbbOmXtNLlGFG9S28bAWHVsUCzST/fuTeGrAwtUV3lXUJQmgIT2o40RxzjSmL+2YeJfGUtt6GElFUUNr3kJcBsFJUXj82c6xHEni/GIkAS/RtX5ID11fxJKM5VpURPIRuEc+ezThkHN51fA8Gfo2/XV+d5M0vPawB7M6GBZpdaKj46 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 Wed, May 08, 2024 at 12:20:41PM GMT, Catalin Marinas wrote: > On Tue, Apr 30, 2024 at 11:05:01AM -0500, Maxwell Bland wrote: > > -ptdump is a debugfs interface that provides a detailed dump of the Hi Catalin! Apologies for the delayed response to this review, life got in the way. A version 4 that addresses your comments is available here: https://lore.kernel.org/all/aw675dhrbplkitj3szjut2vyidsxokogkjj3vi76wl2x4wybtg@5rhk5ca5zpmv/ > > +Assessing these attributes can assist in understanding the memory layout, > > +access patterns and security characteristics of the kernel pages. > > I presume there's some new text here. Yes. Though after having a bit of time to think on it, I just reworked the presentation altogether for version 4. > > > }, { > > .mask = PTE_UXN, > > .val = PTE_UXN, > > Since you are adding a separate pmd_bits[] array, I think we could get > rid of the PTE_TABLE_BIT entry. It doesn't make sense for ptes anyway. Done! Sweet. > > +static const struct prot_bits pud_bits[] = { > [...] > > +}; > > Do we need pud_bits[] as well? Can we not just use pmd_bits[]? Call it > pxd_bits if you want, the format is the same for all p*d entries. Thanks, done! > > Please separate the alignment changes into a different patch Done! > > + delta = (addr - st->start_address); > > What's this supposed to show? In your example, it's strange that the PGD > is shown as 128 bytes: This was a bug due to my misunderstanding of what we were going for here. Thank you for pointing it out, as it made it easy to notice and patch. > > if (pgd_leaf(val)) { > > st->note_page(st, addr, 0, pgd_val(val)); > > walk->action = ACTION_CONTINUE; > > Is the difference between leaf and non-leaf calls only the walk->action? > We could have a single call to st->note_page() and keep the walk->action > setting separately. Do we also need to set ACTION_SUBTREE in case the > entry is a table entry? Or is it done in the caller somewhere? I could > not figure out. ACTION_SUBTREE is the default walk action, so it is implicitly set for table descriptors. > > An alternative would be to have an ARCH_WANT_NON_LEAF_PTDUMP Kconfig > option instead of a bool note_non_leaf in struct ptdump_state. This > option seems to be entirely static, not sure it's worth a struct member > for it. You'd use IS_ENABLED() above instead of st->note_non_leaf. This was an excellent idea, thank you. Incorporated. BRs and thanks again for your help on this, Maxwell Bland