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 2586EC30653 for ; Thu, 4 Jul 2024 14:21:25 +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: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-Owner; bh=z65aN3a7+bpIAeJCNxRnpn8O54RY6BXv5Mazj3FaaLg=; b=36X30dlkMR2Wcg9OvOKgb5pVq2 rO0zkeSd1xPBerLMMqs8dZU5jehFWY56aWtcOOXF7SGkZllhQB/gLx8/pWmEk+FAqtlJPJUK22cGn ZFW86AgebYwYThtr+YpxsVTPGXOl8lB71qJy6UxPf9QS1L0gRQThUXi6BMI6dgcS+o9EZlqNgcdp7 DD0JEgXAt8Ti0uFr7630I5O3g8P04C/L3TlebdY+6uuG7k/IWtpL/DUvcgF2/JP5YyrYXX7Xq9fuJ ubWqbQrn9z60FJ6jOVcQqZ5w8TLOwSMIeqlVUPkBk5GJaZ031BEXa4/e7t2ijeqBpF76NZmkakWJ2 T1xL4P7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sPNKk-0000000DRJk-0THT; Thu, 04 Jul 2024 14:21:14 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sPNKW-0000000DRFX-3iIF for linux-arm-kernel@lists.infradead.org; Thu, 04 Jul 2024 14:21:02 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 63D296278C; Thu, 4 Jul 2024 14:20:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47ED2C3277B; Thu, 4 Jul 2024 14:20:57 +0000 (UTC) Date: Thu, 4 Jul 2024 15:20:55 +0100 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Fuad Tabba , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev Subject: Re: [PATCH v2 0/4] KVM: arm64: Fix underallocation of storage for SVE state Message-ID: References: <20240606-kvm-arm64-fix-pkvm-sve-vl-v2-0-c88f4eb4b14b@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240606-kvm-arm64-fix-pkvm-sve-vl-v2-0-c88f4eb4b14b@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240704_072101_068023_895EAA20 X-CRM114-Status: GOOD ( 13.68 ) 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, Jun 06, 2024 at 04:21:42PM +0100, Mark Brown wrote: > As observed during review the pKVM support for saving host SVE state is > broken if an asymmetric system has VLs larger than the maximum shared > VL, fix this by discovering then using the maximum VL for allocations > and using RDVL during the save/restore process. > > Signed-off-by: Mark Brown > --- > Changes in v2: > - Downgrade check for a late CPU increasing maximum VL to a warning only > but do it unconditionally since pKVM prevents late CPUs anyway. > - Commit log tweaks. > - Link to v1: https://lore.kernel.org/r/20240605-kvm-arm64-fix-pkvm-sve-vl-v1-0-680d6b43b4c1@kernel.org > > --- > Mark Brown (4): > arm64/fpsimd: Introduce __bit_to_vl() helper > arm64/fpsimd: Discover maximum vector length implemented by any CPU > KVM: arm64: Fix FFR offset calculation for pKVM host state save and restore > KVM: arm64: Avoid underallocating storage for host SVE state Since the patches address a KVM issue, I think it should go via Oliver/Marc's tree. But happy to queue it via the arm64 tree if people think otherwise. Thanks. -- Catalin