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 21365EB64DD for ; Fri, 23 Jun 2023 15:37:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=reF/yzXDHGIdLu8dbYi2hDMIiQluJsHWIaNEbFf24jo=; b=Tc9qJJ93Jz7DOD t2lgxkeUtzqxSBbAzUPFvnyFxRfCUdKmrCZjI2TN/7ZPYFQ8TsPpoMpA5smI1+hAmGvkR9UO8dGm0 neFafL1PE/VmRXouCrpC0HO1Oj7rFK2TQQN9YDE+wTzT5VqpTQIPv0hhGOBF+dpPyQpDScuVkYzRl OfBLVC3Z6jP7vKosEo50DxFEeewajdaDvUqztSim7MrpjrKmLtHKn56+9LUYux4vtr/2LlsdTbgvY QRQTXWqWD7t3KzG/swuMDXGm6RhHaoBPDebjc35bN40r9JuQFcknWd82gcxeoDEylU3HMbvgsdDtn sL+zuSbI+t3PVIOwx0BQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qCiqL-003xh2-1f; Fri, 23 Jun 2023 15:37:01 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qCiqI-003xH7-0w for linux-arm-kernel@lists.infradead.org; Fri, 23 Jun 2023 15:36:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6+W2hry1AcXhsigH/cF9EASBVVJLJxcSUG3JYvs/xq4=; b=YhcDaN5C/V3C7rXSuAZJbUV/UI nc0GqUDnjIb7Smn3BYFrQEcCHKxAnVwnn+qNKDrcOtzF1mXONidIEKFcDny9o2x8w0rxSCQR3IF6/ tbwU/rNkHf+6xAv5HXAePHDEBV+8xAbOdbFIdmzaFn7w9CyInMY5hdBGKUSCCP3qNdUSjc5Lw7ELd kpKMu7NThY5MX7IB0itqCl5FU+S1MImSgL3NpzwkyZTOK3q/u8DWBXekF3Q9BRVqyW56FgNB3oSkt 1595rfBTLnwgM6m5gEMSJgH0EvaeHwAIMcRP6YjViIVrUdMVMqs2/Baer2aSVvcf95h43apFhDhDI fXKdDImQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:48960) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qCio8-0005ZA-UD; Fri, 23 Jun 2023 16:34:44 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qCio6-0001ZY-Fe; Fri, 23 Jun 2023 16:34:42 +0100 Date: Fri, 23 Jun 2023 16:34:42 +0100 From: "Russell King (Oracle)" To: Ard Biesheuvel Cc: Marc Zyngier , Quentin Perret , Mark Rutland , Catalin Marinas , Jonathan Corbet , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org Subject: Re: [PATCH RFC 00/17] arm64 kernel text replication Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230623_083658_330450_2E31E354 X-CRM114-Status: GOOD ( 23.39 ) 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 Fri, Jun 23, 2023 at 05:24:20PM +0200, Ard Biesheuvel wrote: > (cc Marc and Quentin) > > On Mon, 5 Jun 2023 at 11:05, Russell King (Oracle) > wrote: > > > > Hi, > > > > Are there any comments on this? > > > > Hi Russell, > > I think the proposed approach is sound, but it is rather intrusive, as > you've pointed out already (wrt KASLR and KASAN etc). And once my LPA2 > work gets merged (which uses root level -1 when booted on LPA2 capable > hardware, and level 0 otherwise), we'll have yet another combination > that is either fully incompatible, or cumbersome to support at the > very least. > > I wonder if it would be worthwhile to explore an alternative approach, > using pKVM and the host stage2: > > - all stage1 kernel mappings remain as they are, and the kernel code > running at EL1 has no awareness of the replication beyond being > involved in allocating the memory; > - host is booted in protected KVM mode, which means that the host > kernel executes under a stage 2 mapping; > - each NUMA node has its own set of stage 2 page tables, and maps the > kernel's code/rodata IPA range to a NUMA local PA range > - the kernel's code and rodata are mapped read-only in the primary > stage-2 mapping so updates trap to EL2, permitting the hypervisor to > replicate those update to all clones. > > Note that pKVM retains the capabilities of ordinary KVM, so as long as > you boot at EL2, the only downside compared to your approach would be > the increased TLB footprint due to the stage 2 mappings for the host > kernel. > > Marc, Quentin, Will: any thoughts? Thanks for taking a look. That sounds great, but my initial question would be whether, with such a setup, one could then run VMs under such a kernel without hardware that supports nested virtualisation? I suspect the answer would be no. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel