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 5EA54C98321 for ; Thu, 24 Sep 2026 16:07:34 +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=iSfBy7J0qfLRxtFizLu6yNNn+UytpBoiQkJcgv1dHfw=; b=qBSiJbEG1faSJDl/79aNIDfnHo DSpPW7d4VepPtPBMkGHDFFBeexKyeaznbMl385gpSXaM0ACthzluUQ/1gNoiK6wn8YrD+fwScMW0m xLta1r7NhW42z4fUca3uzBFrXUQrVTSnGeS1FjyK4C31zQSgEb9T1QijFCIAoSCwlq2yZisVK6dcO 0xBSgpGzq1/xI3uCpJGJ2yWsYCr2SzRnhs65Fr3V5wyHlpFeKTMDZztWVjt5Yqn+SiGi+Y1pqIQbr +OCxeq+MWhXQFXCBZ9+yZ6MSBbCnTrAP2d9BsK6JNUkiR00Igispv5S3ZyHuw1OPM+ZAJVhJKvO6G Kf4K8piQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x9lyp-0000000BXok-2JyE; Thu, 24 Sep 2026 16:07:27 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x9ly9-0000000BXPO-278u for linux-arm-kernel@lists.infradead.org; Thu, 24 Sep 2026 16:06:46 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 555781EDB; Thu, 24 Sep 2026 09:06:41 -0700 (PDT) Received: from ewhatever.cambridge.arm.com (ewhatever.cambridge.arm.com [10.2.197.99]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B34573F86C; Thu, 24 Sep 2026 09:06:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1790266004; bh=1DYRIPe8PKoi5a5tSzSos3MNlYuYMYyYfWo3uNo+uDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ILdBX9BpTIh+oUiiBaKCiAb+ZwBfDuI3rKINORMCNIssuj6sl0+xbySKHrSSSTSku aSNvR0h1OXbbamKGJ4LYWYZWT11lP+Ys+fIGibACCerX5URmZCH06BNHAbtILOkpY9 PQ2x5RdGXYaI7KEs1E1CPVeUHO6TCzXi70Y9zZL4= From: Suzuki K Poulose To: kvm@vger.kernel.org, kvmarm@lists.linux.dev Cc: maz@kernel.org, will@kernel.org, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, steven.price@arm.com, aneesh.kumar@kernel.org, oupton@kernel.org, gshan@redhat.com, joey.gouly@arm.com, tabba@google.com, yuzenghui@huawei.com, linux-coco@lists.linux.dev, gankulkarni@os.amperecomputing.com, sdonthineni@nvidia.com, alpergun@google.com, fj0570is@fujitsu.com, WeiLin.Chang@arm.com, lpieralisi@kernel.org, enju.kohei@fujitsu.com, sudeep.holla@arm.com, jonathan.cameron@oss.qualcomm.com, Suzuki K Poulose Subject: [PATCH v20 19/22] KVM: arm64: CCA: WARN on injected undef exceptions Date: Thu, 24 Sep 2026 17:05:01 +0100 Message-ID: <20260924160504.853911-20-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260924160504.853911-1-suzuki.poulose@arm.com> References: <20260924160504.853911-1-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260924_090645_656385_76563C95 X-CRM114-Status: UNSURE ( 8.45 ) 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: 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 From: Steven Price The RMM doesn't allow injection of a undefined exception into a realm guest. Add a WARN to catch if this ever happens. Reviewed-by: Jonathan Cameron Signed-off-by: Steven Price Signed-off-by: Suzuki K Poulose --- Changes since v15: * Switch to KVM_BUG() to mark the VM as bugged as well. Changes since v6: * if (x) WARN(1, ...) makes no sense, just WARN(x, ...)! --- arch/arm64/kvm/inject_fault.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kvm/inject_fault.c b/arch/arm64/kvm/inject_fault.c index d6c4fc16f8795..d61a3ff04fabb 100644 --- a/arch/arm64/kvm/inject_fault.c +++ b/arch/arm64/kvm/inject_fault.c @@ -317,6 +317,7 @@ void kvm_inject_size_fault(struct kvm_vcpu *vcpu) */ void kvm_inject_undefined(struct kvm_vcpu *vcpu) { + KVM_BUG(vcpu_is_rec(vcpu), vcpu->kvm, "Unexpected undefined exception injection to REC"); if (vcpu_el1_is_32bit(vcpu)) inject_undef32(vcpu); else -- 2.43.0