From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta1.migadu.com (out-27.mta1.migadu.com [95.215.58.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22A614E7805 for ; Mon, 28 Sep 2026 15:25:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.27 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790609120; cv=none; b=M1FbY3NCp5IZ3IJ1IJjeE0H/5jSewMqVkyMqDcYrmn6mZqm60YoHWDpH1chRUZcc+7Py/qRicTiH4/QD9wtlfersdIYBDD82i+o2bYQv2HAOmIWdUFHnJzLdfgGcHBPQNz6H2P/HBjI5skqV70w7YMHdSYeZZp6nW2m5+VbNVSU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790609120; c=relaxed/simple; bh=r5HnM/f7PTKF6og9shC2Jz8ilToiTnP5/ASxGy5XQl4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TA9/2hNCQJg26x4lx4U/N2QbkAT4gN8TiWk+TvAMLH1GvgCLQU2e6/HrQ4jf7GI7PKRRpyIJtchhgUne2CPyOgb08YLhZQbsSIN/CTYBBk+FS4k+1RVDDdOg9KDBcLWxArKswu6Uu+pornq5rc+wInZHL+bYncSG8aCW6gqMrw0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=o/gZV6bl; arc=none smtp.client-ip=95.215.58.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="o/gZV6bl" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=r5HnM/f7PTKF6og9shC2Jz8ilToiTnP5/ASxGy5XQl4=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1790609117; v=1; x=1791213917; b=o/gZV6bl7bWaHHpehOR7bXjmcFiuqElqRdp/NQ4ATWYamhI0y1AXh8AHXToHzc3Orm6jjyhr /piCItKOYj2fQ60Xifcdt/InIPx2q98CAOi9z8+eL2VDQhFpOVrhTh9rHKXDOBB/P60NDJtDqKz fMrdUY76WVOEOBzpZaBezGWw= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 63cb18f08da356ba; Mon, 28 Sep 2026 15:25:12 +0000 X-Mizu-Trace-ID: 63cb18f08da356ba X-Migadu-Flow: FLOW_OUT From: Fuad Tabba To: Marc Zyngier , Oliver Upton , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Joey Gouly , Suzuki K Poulose , Zenghui Yu , Steffen Eiden , Catalin Marinas , Will Deacon , Mark Rutland , Jing Zhang , Karl Mehltretter , Fuad Tabba , kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 01/10] KVM: arm64: Don't WARN on SMCCC filter reserved range allocation failure Date: Mon, 28 Sep 2026 16:24:58 +0100 Message-Id: <20260928152507.2116110-2-fuad.tabba@linux.dev> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260928152507.2116110-1-fuad.tabba@linux.dev> References: <20260928152507.2116110-1-fuad.tabba@linux.dev> 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 first time userspace sets an SMCCC filter, kvm_smccc_set_filter() inserts the reserved architecture ranges into the maple tree and WARNs if that fails. The tree is empty and config_lock is held, so the only way it can fail is -ENOMEM. The allocation is GFP_KERNEL_ACCOUNT, so a memory cgroup limit is enough to hit the WARN from userspace. The WARN goes back to when the ranges were inserted at VM creation and the error was dropped. Since commit d34b76489ea0c ("KVM: arm64: Only insert reserved ranges when SMCCC filter is used") the tree is emptied on failure and the error reaches userspace. Drop the WARN. Fixes: d34b76489ea0c ("KVM: arm64: Only insert reserved ranges when SMCCC filter is used") Reported-by: Sashiko Closes: https://lore.kernel.org/all/20260829055809.29AD31F000E9@smtp.kernel.org/ Signed-off-by: Fuad Tabba --- arch/arm64/kvm/hypercalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/hypercalls.c b/arch/arm64/kvm/hypercalls.c index b11b8821c9fbc..210a496733d0e 100644 --- a/arch/arm64/kvm/hypercalls.c +++ b/arch/arm64/kvm/hypercalls.c @@ -197,7 +197,7 @@ static int kvm_smccc_set_filter(struct kvm *kvm, struct kvm_smccc_filter __user if (!kvm_smccc_filter_configured(kvm)) { r = kvm_smccc_filter_insert_reserved(kvm); - if (WARN_ON_ONCE(r)) + if (r) goto out_unlock; } -- 2.39.5