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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8028FCAC5BB for ; Wed, 1 Oct 2025 12:31:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aeXq1FtEKMEGcd1X6F5pimnL4GuLi9B4eChqnBDj3p8=; b=A25nQ3okWeBCuoDt0vsqh0DXjX zecCRyHNzYQcIPZSNjgABw+VI48VEOWB3V7ydJE+cv5UP4nQ+36LKHu7tgbn9B8RgB8Lp8spOrv5I kDbMV1lyyExYBEAeGIS2vjUIKhbUlzkqXNRfL47pJQVp7FzxZbdAH9j5x1z6c7a0lKRKU7B912j7x cSJxCxndx81Kwj9FYMcoz1U1mVOaMNFTC2+4+v5P43TvSCPMEC5tlVUF0plOe7gYDwctbF1NycpHb QkpDO74QYkmgLKqY6MUOiEw8VpCt/Yc30TOa28dcQmsO/DnbAedinUF0/YbmuQpT5EqQ0EWa1tRk6 TDDFzn4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v3vzT-00000007thr-1FnS; Wed, 01 Oct 2025 12:31:27 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v3vqf-00000007m41-430U for linux-arm-kernel@lists.infradead.org; Wed, 01 Oct 2025 12:22:23 +0000 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 C67DA16F2; Wed, 1 Oct 2025 05:22:12 -0700 (PDT) Received: from [10.57.66.40] (unknown [10.57.66.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1DC5B3F66E; Wed, 1 Oct 2025 05:22:14 -0700 (PDT) Message-ID: <9e1b474e-b822-469a-990f-b27389a7f0e0@arm.com> Date: Wed, 1 Oct 2025 14:22:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v5 00/18] pkeys-based page table hardening To: Will Deacon Cc: Yang Shi , linux-hardening@vger.kernel.org, Rick Edgecombe , linux-kernel@vger.kernel.org, Andrew Morton , Andy Lutomirski , Catalin Marinas , Dave Hansen , David Hildenbrand , Ira Weiny , Jann Horn , Jeff Xu , Joey Gouly , Kees Cook , Linus Walleij , Lorenzo Stoakes , Marc Zyngier , Mark Brown , Matthew Wilcox , Maxwell Bland , "Mike Rapoport (IBM)" , Peter Zijlstra , Pierre Langlois , Quentin Perret , Ryan Roberts , Thomas Gleixner , Vlastimil Babka , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, x86@kernel.org References: <20250815085512.2182322-1-kevin.brodsky@arm.com> <98c9689f-157b-4fbb-b1b4-15e5a68e2d32@os.amperecomputing.com> <8e4e5648-9b70-4257-92c5-14c60928e240@arm.com> <8f7b3f4e-bf56-4030-952f-962291e53ccc@arm.com> Content-Language: en-GB From: Kevin Brodsky In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251001_052222_057650_ED53F00C X-CRM114-Status: GOOD ( 18.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 18/09/2025 16:57, Will Deacon wrote: > On Thu, Sep 18, 2025 at 04:15:52PM +0200, Kevin Brodsky wrote: >> [...] >> >> For now, my plan is to stick to solution 3 from [2], i.e. force the >> linear map to be PTE-mapped. This is easily done on arm64 as it is the >> default, and is required for rodata=full, unless [1] is applied and the >> system supports BBML2_NOABORT. See [1] for the potential performance >> improvements we'd be missing out on (~5% ballpark). I'm not quite sure >> what the picture looks like on x86 - it may well be more significant as >> Rick suggested. > Just as a data point, but forcing the linear map down to 4k would likely > prevent us from being able to enable this on Android. We've measured a > considerable (double digit %) increase in CPU power consumption for some > real-life camera workloads when mapping the linear map at 4k granularity > thanks to the additional memory traffic from the PTW. Good to know! > At some point, KFENCE required 4k granularity for the linear map, but we > fixed it. rodata=full requires 4k granularity, but there are patches to > fix that too. So I think we should avoid making the same mistake from > the start for this series. Understood, makes sense. I'll be looking into implementing the custom PTP allocator I suggested above then. - Kevin