From patchwork Fri May 24 14:19:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13673218 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 3C66FC25B7A for ; Fri, 24 May 2024 14:20:37 +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:MIME-Version:Message-Id:Date:Subject:Cc :To: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=i+qqSQV0DuW+APqE5ynqMoTgNUvhWKUc0Nwm8jIK25w=; b=wsIxAxl0prDg7F FIZkA/ClHEadKDEzhHuK9bV+h9WximU+P+mD+9+4qDFb8qBpe3KeYmtBnUJaaTYB+X/ouqrw/f6h4 lLcmGpFMrZzpsM0FzgNlB6I74ZdnIoLicx0LmxYWTh5+F8Uh7FlXdwXfz6GGqr8HJ4ZRjvIHbMu6P RiiAqq7iUCnLvrR1ZURzkMWVrmeNhgRY8uTBOY9X6TsqJfePOTVaLwajWNbaLkEK+3ufMEKJxw3W4 Hf8AmeJzrLDRW7sctzBmCC/wjrSGQxyXiqExBF/08WtveTlAE/1g7kd7RBDuT6PbpBNfqvMSQv6Ns VB/bZsCbhuzOsbDytpFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAVmW-000000096OE-0x4S; Fri, 24 May 2024 14:20:28 +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 1sAVmH-000000096GO-41JE for linux-arm-kernel@lists.infradead.org; Fri, 24 May 2024 14:20:16 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 31ACF62F45; Fri, 24 May 2024 14:20:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD007C2BD11; Fri, 24 May 2024 14:20:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716560412; bh=YBi+a6DVfeuDyoA3vrhAmhhyd6I32xXQvbZRZPEE1vM=; h=From:To:Cc:Subject:Date:From; b=u6XfOWo8jW/W+2/vjwiF0UL/ieFeF6FBwhwAovskkv/t//4Jk7nPJogDiaMCRqFzl sEUpFvZHGMqNwwQh3I2jBLquhKBtrsM2Mz1NAeEdks/GUpG++y/dNqkANwKVNwbQsj Y/jwfnwY1dv58fuNZpd1bLD0N4x//uzqGliUl6TFgb1SSpXvh5/zQqLESuZQVZwEL3 hCP4XQGuZxWYic1/3sto9Bi0ahAEwI7I+RD7pOFGRLnb3hHWTSQc53h42On08Uu25a uY5o1KfkY5nhrAMwW4FG2uwhAeUxEnIlGfm2oegfQqEIXhWdED4MrYjst8ZheFOO14 0NrUlBpE9n3Cw== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sAVmE-00FRdK-I3; Fri, 24 May 2024 15:20:10 +0100 From: Marc Zyngier To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Nina Schoetterl-Glausch , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu Subject: [PATCH 0/3] KVM/arm64 fixes for AArch32 handling Date: Fri, 24 May 2024 15:19:53 +0100 Message-Id: <20240524141956.1450304-1-maz@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, nsg@linux.ibm.com, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com 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-20240524_072014_076722_31EBE7D9 X-CRM114-Status: GOOD ( 10.16 ) 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 The (very much unloved) AArch32 handling has recently been found lacking in a number of ways: - Nina spotted a brown paper-bag quality bug in the register narrowing code when writing one of the core registers (GPRs, PSTATE) from userspace - We never allowed System mode to be restored. Nobody ever complained, but this is wrong nonetheless - The handling of traps failing their condition check went from dodgy to outright broken when the handling of ESR_EL2 was upgraded from 32 to 64 bit (patch already posted). All these are stable material, and I plan to merge them after -rc1 is released. M. Marc Zyngier (3): KVM: arm64: Fix AArch32 register narrowing on userspace write KVM: arm64: Allow AArch32 PSTATE.M to be restored as System mode KVM: arm64: AArch32: Fix spurious trapping of conditional instructions arch/arm64/kvm/guest.c | 3 ++- arch/arm64/kvm/hyp/aarch32.c | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) Acked-by: Oliver Upton