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 61D9E103E19B for ; Wed, 18 Mar 2026 15:56:54 +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=Upk2/4gDDXO/cxElvvMAVSCb+u1P1mfRQ8i+56q1B8U=; b=xW4CbZizLPNbwoZtElDDrwCdWA mUf76+zTDYsK6xOqnJrJlNPvn2nHwo5YZ/LF1Jcu5AVG9sjH/GPFaogeWbfw7KZcn3shSS9hm/0vi ALft9zsvERlDBxFzMzEk+07uh6+a/CzDy5XFtQjFbLNY42lqWCTnFaBn8E7t6T9kwF99621ylv7sY UspLXhbDSh7z35xluLNP6PnmNMlYXgxQFSAJquVKInGgY52/Xeg2Qp72+eoH3anb1pRYLf9RiL+8L d4cWGcQf1RJjO1QdBer/U3MF6lYQmax4S8d1SHdWaPdbyoWLdMqtLqAZsOJGAwVmbRrp/UDwK5HSr IdBuDfuw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w2tGH-00000008q0F-2zxV; Wed, 18 Mar 2026 15:56:45 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1w2tFx-00000008pgU-29Qg for linux-arm-kernel@bombadil.infradead.org; Wed, 18 Mar 2026 15:56:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=Upk2/4gDDXO/cxElvvMAVSCb+u1P1mfRQ8i+56q1B8U=; b=fylzXErJlfIQbxfIxRDqxyc1aN SwCPhRwgZKx3lJ3/I2ktxuUnkkIIafHL/K1kbvjrt69uvvCNqBnws8/HktCNTBwhmJFvm9BueeFYl ernuT1MgVaPpwJimguAY+U6wUDuEGINTsyPINNtweor+310eqC/QqY8stb5YKzp2IyHS7/RUI8EyJ EzVqmt2rlYiH+xXQlgrvbWK3qw89M7CIrwzez0kJShRCRob+Hm0YwDOComyKRrCEYGEHFuZgCPQJG XuJ6AzirLVWwBYF/u20PQ7e8r4GaGdilu86FfLafCMigKwGa84rTuM38qsrJx9NRoAzEtRS3iDhEK +SiIj3kw==; Received: from foss.arm.com ([217.140.110.172]) by desiato.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w2tFr-0000000Bdm7-1Qv7 for linux-arm-kernel@lists.infradead.org; Wed, 18 Mar 2026 15:56:21 +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 204DA2008; Wed, 18 Mar 2026 08:56:12 -0700 (PDT) Received: from e122027.arm.com (unknown [10.57.61.122]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DC2553F73B; Wed, 18 Mar 2026 08:56:14 -0700 (PDT) From: Steven Price To: kvm@vger.kernel.org, kvmarm@lists.linux.dev Cc: Steven Price , Catalin Marinas , Marc Zyngier , Will Deacon , James Morse , Oliver Upton , Suzuki K Poulose , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Gouly , Alexandru Elisei , Christoffer Dall , Fuad Tabba , linux-coco@lists.linux.dev, Ganapatrao Kulkarni , Gavin Shan , Shanker Donthineni , Alper Gun , "Aneesh Kumar K . V" , Emi Kisanuki , Vishal Annapurve Subject: [PATCH v13 31/48] KVM: arm64: WARN on injected undef exceptions Date: Wed, 18 Mar 2026 15:53:55 +0000 Message-ID: <20260318155413.793430-32-steven.price@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260318155413.793430-1-steven.price@arm.com> References: <20260318155413.793430-1-steven.price@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260318_155619_725625_D47A170D X-CRM114-Status: UNSURE ( 7.40 ) 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 The RMM doesn't allow injection of a undefined exception into a realm guest. Add a WARN to catch if this ever happens. Signed-off-by: Steven Price Reviewed-by: Gavin Shan --- 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 6492397b73d7..613f223bc7a3 100644 --- a/arch/arm64/kvm/inject_fault.c +++ b/arch/arm64/kvm/inject_fault.c @@ -327,6 +327,7 @@ void kvm_inject_size_fault(struct kvm_vcpu *vcpu) */ void kvm_inject_undefined(struct kvm_vcpu *vcpu) { + WARN(vcpu_is_rec(vcpu), "Unexpected undefined exception injection to REC"); if (vcpu_el1_is_32bit(vcpu)) inject_undef32(vcpu); else -- 2.43.0