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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1DE0C433E0 for ; Fri, 5 Mar 2021 19:07:38 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5F6B46509E for ; Fri, 5 Mar 2021 19:07:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F6B46509E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KidVLTwEKsO6bAGBzh4gzlCnZp/LCcRfbKREJsOhYTo=; b=ShTWI6Aqlng7k9xDstsNUCiOH IYJN2DrS25fNzRgY6sN4XIdq4fQrwEGx0/7D7fFzz9Mzu4ogbY1JBglXXpg98F+IaRF082wlEZvv1 EfIcbzgJd8n3NSUplhDVGSos18A3BiMVzatQV0EwywREJWLVpGCa2ouw5WmTeV6Ur4kyPEbh1htEH tEQvANYj3iPhawzSwBBXNeh/Dh2c7GDaH6D+CQz3yj1ssUpvxI5f14oEPbNKlpYPKd3x0Os+50IP4 45cfT7i3WrX1OEb8hEoYzZr9rQUeBH6xbaF9e5Fob50RUV1sJYjRl5oRPvBi79JKKiMRmPhvXnyKU l//gRK62Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lIFm8-00G6vN-4n; Fri, 05 Mar 2021 19:06:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lIFm1-00G6tG-Ta for linux-arm-kernel@lists.infradead.org; Fri, 05 Mar 2021 19:06:08 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id F315D6509E; Fri, 5 Mar 2021 19:06:02 +0000 (UTC) Date: Fri, 5 Mar 2021 19:06:00 +0000 From: Catalin Marinas To: Ard Biesheuvel Cc: linux-arm-kernel@lists.infradead.org, maz@kernel.org, will@kernel.org, mark.rutland@arm.com, anshuman.khandual@arm.com, qperret@google.com, kernel-team@android.com Subject: Re: [PATCH 2/2] arm64: mm: use XN table mapping attributes for the linear region Message-ID: <20210305190600.GK23855@arm.com> References: <20210304171145.12281-1-ardb@kernel.org> <20210304171145.12281-3-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210304171145.12281-3-ardb@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210305_190606_348717_9CE38240 X-CRM114-Status: GOOD ( 12.83 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Mar 04, 2021 at 06:11:45PM +0100, Ard Biesheuvel wrote: > The way the arm64 kernel virtual address space is constructed guarantees > that swapper PGD entries are never shared between the linear region on > the one hand, and the vmalloc region on the other, which is where all > kernel text, module text and BPF text mappings reside. > > This means that mappings in the linear region (which never require > executable permissions) never share any table entries at any level with > mappings that do require executable permissions, and so we can set the > table-level PXN/UXN attributes for all table entries that are created > while setting up mappings in the linear region. Since swapper's PGD > level page table is mapped r/o itself, this adds another layer of > robustness to the way the kernel manages its own page tables. In ARMv8.1 the architecture added the possibility of disabling the hierarchical page table permissions (FEAT_HPDS) so that we can use these bits for software. Is there any big advantage to using the hierarchical permissions vs some sanity check in set_pte() for example? -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel