Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp372391lqp; Mon, 10 Jun 2024 06:50:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVGny0Wt4PAa9HjUZfd9z9MDFGSs+uyGDcsmDKWhJjbEtIoyIldxbNtTb9L9vYpGtgRFr0RzoJuXQHPD2RhcWQ8laFw+SXv3OCkgJbS/A== X-Google-Smtp-Source: AGHT+IFy4iWNoAU0mz/cbBEdTnPzsmME+9QBsUzLjBB9duXR9ZLH7hSu2o2DFiBRIjMRNRtnve8t X-Received: by 2002:a50:8ad8:0:b0:57c:6461:5c62 with SMTP id 4fb4d7f45d1cf-57c64615c82mr4502143a12.37.1718027422877; Mon, 10 Jun 2024 06:50:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718027422; cv=pass; d=google.com; s=arc-20160816; b=tZwjDoyPoPsk/DgZRiZa8T5HqbzqdKCNca0hgZd+2W49OpaveZFQczA+31XRk3UqtZ sZa194l6Fd3uxGh2JxTISA2mN+mIw/16ExVtFH5y42hLv08/LF4J85LWK9jdTFPzMqNA iiK2cJZIhJIgXR51zZ6ATi+8Dnx6F2LXEXVd1Sa+DBBYTOjp4WB6Hqj8bZ7LnJOwsjtO 4/WF1obrmyRtX4pDD2u1IpAM6Pvk4/kWkseykxKpJFOFnthsuESnd7Ohk7BcdNu0WdKJ gHdMGEAvqx4DtxQ3mbIXeWAEA7fswAHoRZ5AEsRo7H94l2EFqgqMnZbBt33vhszSO5IZ njqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=efuhdo0i03t5yOkas8ZyTg+oZMkYR/wT7SM72lv7bDI=; fh=NDCPdPn2hiqHaiIRDYQAzsW9PK20CTia4nECGof6enU=; b=hSAxPN0aQjibohQQ8smCvIvi+gO1vhDoCEDtl/q+zVPxyxdPLCPYC03m44+hQ1Z3bT 2VMcP6PSG5G4Ji7ZzKrh8O9mWMfeJ9C7Pi8h2EDSxwlRtVw4VXiYUOUCLgR6rWULq7Rd 4LIgyIK+vYFUoKe/70+FY//S+o19gYIX2M65J+V9HxJYOdtEe8WVhlXNqxAJm+XCmzc5 F4YzcQ5kMyvcUVB41ZQd4alofb9XfoWdS7YgD0lYUj2haYDlN+ETl4nM1Ct3ES1Zr60O y+aDcKhU9qXkLU1Xs+PpaGgNLf1nrK0hVpSWZWQsHcp0CD9LeM0195kK4ax2zVgKsoEZ 0teQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-208272-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208272-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c605bc00bsi3175140a12.401.2024.06.10.06.50.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 06:50:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208272-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-208272-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208272-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6861D1F23141 for ; Mon, 10 Jun 2024 13:50:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE6E515531A; Mon, 10 Jun 2024 13:43:42 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 029B61552F9; Mon, 10 Jun 2024 13:43:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718027022; cv=none; b=VwwcYZZxvrHovnbj4153nKKlw45GmWhh9vVrQripgzVtP4hYBSzv++4QYfwxTQ408ifjnjS3ljGL6eYFJOD2GakbA61ZPd1BbMSwPJbUAOJE0NTWm5SpoRwG2uNesK9GX6iswziBTZQ5aaS9WoYY1326aLuTS8IPZEdolKJPLys= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718027022; c=relaxed/simple; bh=/ylcxNjyNjOH/FxoiCWd7H6320+ueYCpQ0azhp+BuI4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CbOrcOex00Ld3lxDSUg4wxJShytr1X3rF+Sh9qgj1Y93CjTBzRns/pOO4KgoLM5+mgoEq2ZvX5YnCShOGQJ4TnsiN1eyBtHIu6dEg8fT9m9m1zPvd+IYm/BNkgEznrte5BnpqDxYUDwWIB8aIlyCL/1+pfts8/sE+Nlptoa8vOM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 324751688; Mon, 10 Jun 2024 06:44:05 -0700 (PDT) Received: from e122027.cambridge.arm.com (e122027.cambridge.arm.com [10.1.35.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6FCB63F58B; Mon, 10 Jun 2024 06:43:37 -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 Subject: [PATCH v3 25/43] KVM: arm64: WARN on injected undef exceptions Date: Mon, 10 Jun 2024 14:41:44 +0100 Message-Id: <20240610134202.54893-26-steven.price@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610134202.54893-1-steven.price@arm.com> References: <20240610134202.54893-1-steven.price@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- arch/arm64/kvm/inject_fault.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/kvm/inject_fault.c b/arch/arm64/kvm/inject_fault.c index a640e839848e..44ce1c9bdc2e 100644 --- a/arch/arm64/kvm/inject_fault.c +++ b/arch/arm64/kvm/inject_fault.c @@ -224,6 +224,8 @@ void kvm_inject_size_fault(struct kvm_vcpu *vcpu) */ void kvm_inject_undefined(struct kvm_vcpu *vcpu) { + if (vcpu_is_rec(vcpu)) + WARN(1, "Cannot inject undefined exception into REC. Continuing with unknown behaviour"); if (vcpu_el1_is_32bit(vcpu)) inject_undef32(vcpu); else -- 2.34.1