From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9094A438475; Mon, 27 Jul 2026 18:33:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785177222; cv=none; b=XFNOt4epOsAfp7+/ZpPYwNZVbDkK/OGeMOyTY6km9sSIjgfWVwjGWo/BlxP7D0JsTBg8mpToIM3Im6zJfuRdAqNLTMfLQkWeCsMD7g+MJE7rDRLrpQwrdCJ5dw7U0VdhOmGgQ3vED5Xvt8VWrZLdICZ1GMK28/ce3SIgJY+p1nM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785177222; c=relaxed/simple; bh=D2lauVqLzZML/aaSe9vWTQzVNlR+Yke26Jy53xrJ/Vk=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=RYbzZv7XkTB0cmyquyWyBBDm73up9qi/3xPP5TKqEwAz0biMoI8M4CyQ+YPw0eyALKh/TzEHMtZfcUnQQoZZX8UflqMGv0+EXPX87P6W8PTkImOtb4ytiszsVmxQcozVBtZvCIKcuN8LZhlBFGPqUdBzukfLlkDwR6EbwmJbyM4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Redhr8Hy; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=h9l0qeX2; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Redhr8Hy"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="h9l0qeX2" Date: Mon, 27 Jul 2026 18:33:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1785177215; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xF1NT2k1ZzMXTQ1wMWZx7GFtODugPZR9G/G3df7aGAI=; b=Redhr8HyL8PpZRHSwzO7PylMVZWTpe5emy2mfXa8wzHLGFtjVQrBllnXbmgRsjfGf02gt5 XZqXEkCxW5ip6u7Ih3WjTfUd3GaXBIxEGy6dmwSGhX4HCqzVboEEQY4WnpRDrI6wts8PJe wIGAfCdszOUpvPgIm7sKxOnem9WFniEb+bzG3pjec1Ek3m1s0MWyEzKQEmQCG3GNqGXRth wS4ySLHCD/V2e2hZThD0E6yzE8XV6Aj0ARAde2LEFLa9Shbxws9BLB7luQaUV2HDPHtm4k fGc+7vtA8mlghKgMMQG9ZV/LtNv7mAWuXiEBmfqFp9i2MbNP2DEPAnqLEHk+qg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1785177215; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xF1NT2k1ZzMXTQ1wMWZx7GFtODugPZR9G/G3df7aGAI=; b=h9l0qeX2O+hpx5ONjQZ8IYWrqgFRv9Hy3DDWo1rs4LKa9mDxCOSv173q6NaEsP521jfuNS VM6FH/MGKUyoq7Bw== From: "tip-bot2 for Reinette Chatre" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cache] fs/resctrl: Pass error reading event through to user space Cc: Reinette Chatre , "Borislav Petkov (AMD)" , Ben Horgan , Tony Luck , Babu Moger , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: =?utf-8?q?=3C6b3c66a49788828bd8c04a6911bd74c91ccd56f3=2E1782857?= =?utf-8?q?711=2Egit=2Ereinette=2Echatre=40intel=2Ecom=3E?= References: =?utf-8?q?=3C6b3c66a49788828bd8c04a6911bd74c91ccd56f3=2E17828577?= =?utf-8?q?11=2Egit=2Ereinette=2Echatre=40intel=2Ecom=3E?= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178517721395.112641.6512321870049446495.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/cache branch of tip: Commit-ID: cc2ca4296f72519686a9f949e725275f497f90ae Gitweb: https://git.kernel.org/tip/cc2ca4296f72519686a9f949e725275f497= f90ae Author: Reinette Chatre AuthorDate: Tue, 30 Jun 2026 21:27:05 -07:00 Committer: Borislav Petkov (AMD) CommitterDate: Thu, 23 Jul 2026 13:13:49 -07:00 fs/resctrl: Pass error reading event through to user space Reading of event data is managed through populating a struct rmid_read with properties of event needing to be read. This data is dispatched to an appropriate CPU and upon completion any error can be found in rmid_read::err, or on success the event data will be in rmid_read::val. rmid_read::err is not updated in the unlikely scenario that the reading of the event was dispatched to a wrong CPU. If this ever occurs due to a bug in resctrl the user space read will return "success" but the data reported will be invalid. Ensure accurate error reporting so that if there may be an issue with how resctrl picks a CPU it could be learned with an error to user space instead of silent failure. Signed-off-by: Reinette Chatre Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Ben Horgan Reviewed-by: Tony Luck Tested-by: Babu Moger Link: https://patch.msgid.link/6b3c66a49788828bd8c04a6911bd74c91ccd56f3.17828= 57711.git.reinette.chatre@intel.com --- fs/resctrl/monitor.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c index 29b13a6..7f3fe05 100644 --- a/fs/resctrl/monitor.c +++ b/fs/resctrl/monitor.c @@ -458,8 +458,10 @@ static int __l3_mon_event_count(struct rdtgroup *rdtgrp,= struct rmid_read *rr) } =20 /* Reading a single domain, must be on a CPU in that domain. */ - if (!cpumask_test_cpu(cpu, &d->hdr.cpu_mask)) + if (!cpumask_test_cpu(cpu, &d->hdr.cpu_mask)) { + rr->err =3D -EIO; return -EINVAL; + } if (rr->is_mbm_cntr) rr->err =3D resctrl_arch_cntr_read(rr->r, d, closid, rmid, cntr_id, rr->evt->evtid, &tval); @@ -496,8 +498,10 @@ static int __l3_mon_event_count_sum(struct rdtgroup *rdt= grp, struct rmid_read *r } =20 /* Summing domains that share a cache, must be on a CPU for that cache. */ - if (!cpumask_test_cpu(cpu, &rr->ci->shared_cpu_map)) + if (!cpumask_test_cpu(cpu, &rr->ci->shared_cpu_map)) { + rr->err =3D -EIO; return -EINVAL; + } =20 /* * Legacy files must report the sum of an event across all