From patchwork Tue Oct 22 14:40:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 13845759 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 63E5ED2C561 for ; Tue, 22 Oct 2024 14:43:40 +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-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ebytSZ4fnQtkutJ1QsmMdjHFA2gtzeW0MTM2G6KKgWc=; b=gSyT2EFbcSQ2J8WbpEADUlEV5k dsIFe5W6bWMEhekdqmoEhbe9WwMLTxH4scbxg1Sety4uGkSZwsONxAfYWOwkp+jXMpnOc5kemctqi vOQssth9+XJc78B7RYaFSH/vhZPjJ2bddZQfJvacsiAg0fCF0mCElU5929aCpU7F24M2HcQzVjxvN /+/wxRY1ORAr4gTb1Hz7OoUGQvz3nrvKTMqtKZGuWM7MUuFOlCZ8sHg4VE34nRXzypiXJkSkaiUke wYtYdsWCK1sNegnZCJnUxhieEGsbWaiFe223ZrgKDCJZKZ1ex4qhtWZI+EsvLvgdFWgBIw6jVbp+x lIueQfow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3G6a-0000000B8nj-3ee3; Tue, 22 Oct 2024 14:43:28 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3G3c-0000000B8NN-1PCL for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2024 14:40:25 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 2E4EE5C5D77; Tue, 22 Oct 2024 14:40:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E95D5C4CEE6; Tue, 22 Oct 2024 14:40:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729608023; bh=OiX1pDTPcyDAhIHmZUWZEV/cXKJscPtv9OwJmaPy9FU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j5nJ4K2QIKNRJ5BkEJxD0f10CqsAhVH4tcBG9F2N/jNw2LKura2LxDK7WvRB8WP5c qWK0KBXuOK3mOdJIL4KYtfj+al/tLdqPBCS6M9UHMoA37KQlTpJS6TdWXtPQIP4pcV 8sJ6NGr2ZQsit08QglOHZEvAKxrCsv2Z009mNtPXw3iDunqXIUGtg6kC8WqS7a0IAm Ucvlp4aR5XlOYwF2gkp1wWsVRuhF7jvzIQohvHS4b5HswzNuqdtNgSUZeky6vf5qiz 69Bep19I7KJIYaWgDqkvqiNcRPhzw7mwHAEcKwhHu3lCItT64fxisgvRGs7WxNEk29 DA3JZ6JuoUMdQ== From: Will Deacon To: linux-arm-kernel@lists.infradead.org Cc: Will Deacon , Marc Zyngier , Oliver Upton , Joey Gouly , Fuad Tabba , kvmarm@lists.linux.dev Subject: [PATCH 1/2] KVM: arm64: Just advertise SEIS as 0 when emulating ICC_CTLR_EL1 Date: Tue, 22 Oct 2024 15:40:15 +0100 Message-Id: <20241022144016.27350-2-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20241022144016.27350-1-will@kernel.org> References: <20241022144016.27350-1-will@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241022_074024_437805_B6D2144E X-CRM114-Status: GOOD ( 10.75 ) 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 ICC_CTLR_EL1 accesses from a guest are trapped and emulated on systems with broken SEIS support and without FEAT_GICv3_TDIR. On such systems, we mask SEIS support in 'kvm_vgic_global_state.ich_vtr_el2' and so the value of ICC_CTLR_EL1.SEIS visible to the guest is always zero. Simplify the ICC_CTLR_EL1 read emulation to return 0 for the SEIS field, rather than reading an always-zero value from the global state. Cc: Marc Zyngier Cc: Oliver Upton Signed-off-by: Will Deacon Reviewed-by: Marc Zyngier --- arch/arm64/kvm/hyp/vgic-v3-sr.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/kvm/hyp/vgic-v3-sr.c b/arch/arm64/kvm/hyp/vgic-v3-sr.c index 18d4677002b1..3f9741e51d41 100644 --- a/arch/arm64/kvm/hyp/vgic-v3-sr.c +++ b/arch/arm64/kvm/hyp/vgic-v3-sr.c @@ -1012,9 +1012,6 @@ static void __vgic_v3_read_ctlr(struct kvm_vcpu *vcpu, u32 vmcr, int rt) val = ((vtr >> 29) & 7) << ICC_CTLR_EL1_PRI_BITS_SHIFT; /* IDbits */ val |= ((vtr >> 23) & 7) << ICC_CTLR_EL1_ID_BITS_SHIFT; - /* SEIS */ - if (kvm_vgic_global_state.ich_vtr_el2 & ICH_VTR_SEIS_MASK) - val |= BIT(ICC_CTLR_EL1_SEIS_SHIFT); /* A3V */ val |= ((vtr >> 21) & 1) << ICC_CTLR_EL1_A3V_SHIFT; /* EOImode */