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 41F7CEED610 for ; Thu, 12 Sep 2024 14:57:36 +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-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=O6k/zbh1EeDTCveth2KPQsNp7n0V+2hocLeoRUycZ7U=; b=gfaclvPpgG+aDPOqHjuGPWjKWb B7NNROMFepSHsxx236WBUvhUpXEtT03Wr5Lyw+fvc47sSXIczPLoHHgD6oBy/MKB0MWeyV4LOjTea pbtaf7Tt4WZto7mKusrvMkHC5ao1QkWDlu7LabNQHmYCb7b6A4v9wnwkrvHvWDQPJyDUju3CCQWjb SpEfDqhlz70u2lqJox7mQG6M1WuTffjO5R9tNKmnWBMTYSIr7XYhKkVzymUm7DRnFW6PFGRMnxs+x oWRuP+knWJIG0sVuFdY78HLnhjg+0hO4duhveqcf8HePnvesPeOl9pLNw4J/4wsFhQfxqqPNhmWek ONJMxJrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1solG7-0000000DS5r-1vDX; Thu, 12 Sep 2024 14:57:23 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1solF3-0000000DS22-2q75 for linux-arm-kernel@lists.infradead.org; Thu, 12 Sep 2024 14:56:18 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 394A95C5B81; Thu, 12 Sep 2024 14:56:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CEBBC4CEC3; Thu, 12 Sep 2024 14:56:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726152976; bh=86au2B0wjGy7LvSXF0wyg5cS7DuvPtZR14wDerQ7g1I=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=czMOKCYjYsq1PPOlsslj/EcWjZZO2zmwTlE6Lg+dzTcRAFQmvZ7SXFh87LsersfQT bGqilWmXHHW+ETTnM3rqK8ENZvZxvJzScKo1fKK8nKHBF+hRJir79nblDaUUN/gp4X sVVyxt5FxN1gfG9C6JHNdGXFP4rWmmPeQWadE0JxVCapAzyecyVudf4LuiHIOUE3Zf aw7UJuWgzUwbkbxeRVVs2acCGcjRx7cGiuBMpgdMd392vNuNlWIMY4PwqyvLxpW7rw rA+lV1IhX5cUGAGEJSBc2Bng3fQ7nSfj5e/E0ERLQZRc3cSLicuxqbxdnHWmmpoI3c ttoBCTIxBCAIA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1solF0-00CTTg-5d; Thu, 12 Sep 2024 15:56:14 +0100 Date: Thu, 12 Sep 2024 15:56:13 +0100 Message-ID: <86ldzw7wfm.wl-maz@kernel.org> From: Marc Zyngier To: Mark Brown Cc: Fuad Tabba , Oliver Upton , James Morse , Suzuki K Poulose , Catalin Marinas , Will Deacon , Dave Martin , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] KVM: arm64: Constrain the host to the maximum shared SVE VL with pKVM In-Reply-To: <17cb5e48-ca96-433a-a351-639dd339dfb7@sirena.org.uk> References: <20240912-kvm-arm64-limit-guest-vl-v2-1-dd2c29cb2ac9@kernel.org> <17cb5e48-ca96-433a-a351-639dd339dfb7@sirena.org.uk> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: broonie@kernel.org, tabba@google.com, oliver.upton@linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, Dave.Martin@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240912_075617_803252_F9011AC2 X-CRM114-Status: GOOD ( 20.06 ) 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 Thu, 12 Sep 2024 15:45:27 +0100, Mark Brown wrote: > > [1 ] > On Thu, Sep 12, 2024 at 03:21:43PM +0100, Fuad Tabba wrote: > > > One part that you haven't changed is setting ZCR_EL2 during el2 setup: > > arch/arm64/include/asm/el2_setup.h: .Linit_sve_ : lines 290/291 > > > I guess at that point it's not straightforward to figure sve_max_vl. > > Is there a window after el2 setup where we might actually get the VL > > implied by ZCR_ELx_LEN_MASK, or would it always get set to > > sve_vq_from_vl(kvm_host_sve_max_vl) - 1 ? > > Yeah, at that point we have no idea what any other cores might look like > and there's just generally a bootstrapping issue - we need to see the > actual maximum VLs for the PEs to work out what the maximum VL for the > system is so we can tell KVM what to enforce. That's fine. By the time KVM initialises, all the "early" CPUs will be on, and pKVM actively prevents any late onlining of CPUs. The only gotcha would be if "something" snapshots the "large" VL in between two CPU boots, but we really don't expect that sort of things. M. -- Without deviation from the norm, progress is not possible.