Message ID | 20240605-kvm-arm64-fix-pkvm-sve-vl-v1-0-680d6b43b4c1@kernel.org (mailing list archive) |
---|---|
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 3549BC27C5E for <linux-arm-kernel@archiver.kernel.org>; Wed, 5 Jun 2024 11:50:22 +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:Cc:To:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=kAxZ8qh4zjnlzQ33xYKd56t+gt5EgKj1zYnpmKW7rZU=; b=cWuUhMBLZPPnmN nTd5vW9kxKhUzpKwZtGosU1jrZtq/vB0nle2KTHcbvO5GE5K7NbuQj15/1lqzqok2GUvwVp/Qd7LX E7PEvtxojCkxyEMuUPFA1+NwAnl5Jzg/Id7wknxYvcP+ERpFgNIR5QnqsWxb3Xg55deuTBxnSlB+D yuESV7Gls3aewwgywLCYdFxR9zH7QTcZHBDynJcy4DZLsEEPpzQVbtpHi15Y/dkr2d11Vhtls3bhI yAUXxEa84E2rDW78xp5yrPoEqXQEFfCiCgceLLyo6+gwL35X2xm9MOTyz4Amhe+X7mcv/jm0AoNNW h/5bRahsRMEdvoJy/SVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEp9d-00000005mT9-13Ot; Wed, 05 Jun 2024 11:50:09 +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 1sEp9Z-00000005mPj-2D8t for linux-arm-kernel@lists.infradead.org; Wed, 05 Jun 2024 11:50:06 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id CBF1261657; Wed, 5 Jun 2024 11:50:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A1A4C32786; Wed, 5 Jun 2024 11:50:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588204; bh=SBQCKZifEPOxIOTgbUM/XODaGoNdobSf2QES1yw7iAA=; h=From:Subject:Date:To:Cc:From; b=Keh9xRST+Rj9UveGAcphGxlIbytEGvAKf2tTEbsoLlQaSP+AAoKYPqRrgCmMPe4fh CfWxq8d6wIzS/I8AhgK2lJnaMBtoP9+O9JUzkAeEq1DurTwsXwplNLZCcW6nJxJtNl PJ2fCjhd2FD5CDrjIZvXqMC+naEPhGr/TT2JzAsafNVdu1hpSe5p/o0uHusoNcWeYU cHs+t7SLNj6wTzERdP5pm5jlunM/RyaYM8x4nfHYCBbQQz3TyXEeOzozOjuORdyWSt 2v/b/aICBkJJP8Yc+5KFaaPoDnbjwi1U+VmAJAHFwMBNvLHltubSoLFUGdNzCuoUeG CtJI9PDr/Hf7A== From: Mark Brown <broonie@kernel.org> Subject: [PATCH 0/4] KVM: arm64: Fix underallocation of storage for SVE state Date: Wed, 05 Jun 2024 12:41:26 +0100 Message-Id: <20240605-kvm-arm64-fix-pkvm-sve-vl-v1-0-680d6b43b4c1@kernel.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAOdOYGYC/x3MQQqAIBCF4avIrBvQkoSuEi0qpxrKEgUJpLtnL T/438sQKTBF6ESGQIkjX2eBqgTM23iuhGyLoZa1lq3UuCeHY3CtxoVv9B9jIkwHqma2Ri3W2El C2ftAJfm/++F5Xi6OVr1rAAAA To: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Marc Zyngier <maz@kernel.org>, Oliver Upton <oliver.upton@linux.dev>, James Morse <james.morse@arm.com>, Suzuki K Poulose <suzuki.poulose@arm.com>, Fuad Tabba <tabba@google.com> Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, Mark Brown <broonie@kernel.org> X-Mailer: b4 0.14-dev-d4707 X-Developer-Signature: v=1; a=openpgp-sha256; l=1401; i=broonie@kernel.org; h=from:subject:message-id; bh=SBQCKZifEPOxIOTgbUM/XODaGoNdobSf2QES1yw7iAA=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBmYFDm6hO8bPCS7tdj//OV90xJulySV0nlZRmUoVx7 atNp/EeJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZmBQ5gAKCRAk1otyXVSH0NmEB/ 9kIzl7JVowupzSHv5DNrF6MZgboFE8vKIcWYpcWQXTx0AJb/cC+D0KcIPrxQM0CnuFeUaxA3Lh8ni4 wxwSqyA302Vwl35F3cIRN6dXsWtbVz4U9ztR3Kz6N0EufvQL5ipNOkWhvnDcwX7aCIfJl0cfDqB1qW asqTC8yHBCNu627cZ9MzeWhPJlDuw4PrfdyhT7jdpWXJA2X9JpylQ33MOvlkge9YxYpIyoN/8i7Cw0 vOMkjv5ONz3Rb9KWQJUFfLhLXy5Brmvr7Uq5kBvifKOMwgRgQjlUtXpucOoyJx6V8ocDBkn+LXQvjw q/Wk6CiY3L0mvlRycBEvI0Y0T7a0nI X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_045005_670945_35F1AC5E X-CRM114-Status: UNSURE ( 7.41 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
KVM: arm64: Fix underallocation of storage for SVE state
|
expand
|
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 <broonie@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 arch/arm64/include/asm/fpsimd.h | 17 +++++++++++++++ arch/arm64/include/asm/kvm_host.h | 2 +- arch/arm64/include/asm/kvm_hyp.h | 3 ++- arch/arm64/include/asm/kvm_pkvm.h | 2 +- arch/arm64/kernel/fpsimd.c | 38 +++++++++++++++++++++++++++------ arch/arm64/kvm/hyp/fpsimd.S | 5 +++++ arch/arm64/kvm/hyp/include/hyp/switch.h | 2 +- arch/arm64/kvm/hyp/nvhe/hyp-main.c | 6 +++--- arch/arm64/kvm/hyp/nvhe/pkvm.c | 2 +- arch/arm64/kvm/reset.c | 6 +++--- 10 files changed, 65 insertions(+), 18 deletions(-) --- base-commit: afb91f5f8ad7af172d993a34fde1947892408f53 change-id: 20240604-kvm-arm64-fix-pkvm-sve-vl-13cd71fd7db0 Best regards,