From patchwork Fri May 24 14:19:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13673216 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 1F880C25B74 for ; Fri, 24 May 2024 14:20:26 +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:References:In-Reply-To: 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: List-Owner; bh=hMPCoNqLqmix+rA3JObZkUvjEe3kB+cU7biq17XezLo=; b=S6RvTSt4Ze+e86 ZcnGfN/Qkji8Cq0i4fa1BxizyKxq4pTdbqLEzFVL0u7f5Y7N474kXRzGYj31SQkWvBIy22OvGhw8X M+ZvnF/U2eOm4/LYh/cnGzbhPB/1VKEZze0YEAeZdvcrQpt7JdxHLnBehYajRjYh783SaQLFawmCS x6oCy7B4jW22FigJcSKPZV5qXBD8Hv1W2YwJy2+RY8L1q07aNO91UgcpTbVW4rzK5CGxKPOjyds+z tR9LmMM6Z2CIuuGe9SfrFa/icJ3R+i/A3PE78oQo+w6Jv+tMpe77GWFfRXQUpt1FUvT4l5QgrfqOM 4tQS40AlAXNA0/muiWQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAVmL-000000096IJ-0aEr; Fri, 24 May 2024 14:20:17 +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 1sAVmH-000000096GP-3tQD for linux-arm-kernel@lists.infradead.org; Fri, 24 May 2024 14:20:15 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 53A1563048; Fri, 24 May 2024 14:20:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 074B3C32782; Fri, 24 May 2024 14:20:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716560413; bh=iIdRYg57SpeBw9lBpc2D4+wuU3F3SdjQYymK7xok+G0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BA6ph51Fp/v6UuF+peq85zhAGG5SWQWnU4+1HfNiovp29zouMfIUR1PgzCiVvQSnS 78lrwP6TXP/4epSVxDfc3lMWO2dmvmYOVkIMSqEGKckOojDPGzFzrfuN55wqqybkT/ cDfXv1/x6t2l7CQruK043drSBUQnHnH6yx7bh/nBiV+wlNZVH5wQiJQ598V4KLDj+l t/vPmcx4WjK2KESEMkRwpw5i8eg3lI+UeBVL6+gvTmRFFD2oVV5kjhn+JURyyhBjFg 6OmMkZ7BIS5jHjihscPkTh/v9cIDRBq+V2YXlSRm+XBapkrS6bLtyC6rsr/MBM73/s rsyaKAtnN3ymg== 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 1sAVmF-00FRdK-2z; Fri, 24 May 2024 15:20:11 +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 , stable@vger.kernel.org Subject: [PATCH 2/3] KVM: arm64: Allow AArch32 PSTATE.M to be restored as System mode Date: Fri, 24 May 2024 15:19:55 +0100 Message-Id: <20240524141956.1450304-3-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240524141956.1450304-1-maz@kernel.org> References: <20240524141956.1450304-1-maz@kernel.org> 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, stable@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-20240524_072014_038359_7DE41968 X-CRM114-Status: GOOD ( 11.14 ) 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 It appears that we don't allowed a vcpu to be restored in AArch32 System mode, as we *never* included it in the list of valid modes. Just add it to the list of allowed modes. Fixes: 0d854a60b1d7 ("arm64: KVM: enable initialization of a 32bit vcpu") Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org --- arch/arm64/kvm/guest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index d9617b11f7a8..11098eb7eb44 100644 --- a/arch/arm64/kvm/guest.c +++ b/arch/arm64/kvm/guest.c @@ -251,6 +251,7 @@ static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) case PSR_AA32_MODE_SVC: case PSR_AA32_MODE_ABT: case PSR_AA32_MODE_UND: + case PSR_AA32_MODE_SYS: if (!vcpu_el1_is_32bit(vcpu)) return -EINVAL; break;