Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp277996rdh; Wed, 7 Feb 2024 04:45:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFH9EPE5U921Y/PhaGfTjj+Eu+5BAEOffP0jEPVXir72zy1OpsfW4zOIFjW49UWVUrNkR4j X-Received: by 2002:a05:6830:1381:b0:6dc:b57:812b with SMTP id d1-20020a056830138100b006dc0b57812bmr6038245otq.2.1707309930243; Wed, 07 Feb 2024 04:45:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707309930; cv=pass; d=google.com; s=arc-20160816; b=ZXXvObjVqTHmfA2lu4eSP7MjVc6N2KStns6PIOJfJ2vedfxQ9RA2zq/Al0BfF3FHxp BxIBhJKwwc6k7zcYzzrPWCxgoZ9KZgqagqOaKT3fHy05QiSpnDFR6nulgUbVo//vTORj DRixIpY9P3VWbNBVeuJyzc39+toIAib2/b+Fe20X5oVx5cJpuddcNfIyiCj0DadRZ17R s+bedew+06OHSKbUFu2wAugnW6HjHGNmCNloMr7Jn7I1LJiivWsT2JdZv6f6qjUR+INv SyFjsJeE6wVU/udm5+Ufq5fqkufOEMCraruYAMpRsbmO7a8b1WU6aSRWk3FnY+JggfU3 YFUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=OVIbUHMqVVyjB7JP4FhbkXQA5ZZ35lu5Vq3yQdkzZaE=; fh=faJwnYsB+pXYoFgBThO6ylSYu2mDm6SacfUQT1iEJKs=; b=eJ28qGTJDov3KWF5T52eBHYl4Hxb6iMzY3c+X0kccI7YFgieTMt3Gki8KyRVNDs0fN nvsmxoKWDS1pbHZF1OWXcpwXU+sZdqobuv6FEdkrYsvPHezcZoI0FVerkPfMdxte3bUu En5F4BZ4Sgowc7I1S6M/Cj+5FltexTZIe2/LvtzaEzQbGXzi4z4VTX6Vjx/e7xhGLE5k U0+O/aH6he6zaYTuGGDzVzJZv32ku2xdG0y2Vz49vVi0qTL6yf8T+wJ7YBBGgTHX+HiA uwTK7SNqtXWYDdSYZVTwHb5xedXyL8yL3L5VX4kOyB04qoGgUXLBAZT+uHRQNV5vLTs0 7VTg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Uubl5FkQ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-56493-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56493-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=2; AJvYcCUPH9CgDx8/BJAEEwTQFJwdiovGN3/G1XzVt1nYGtN4tRClEzKfdo5LxJreYAgSYxa0Q63pv8i5vwFzr4jZA9OUqynN2XqoFeNeJoVvqw== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h18-20020a633852000000b005ce021f4418si1426398pgn.524.2024.02.07.04.45.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 04:45:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56493-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Uubl5FkQ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-56493-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56493-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9A332B27995 for ; Wed, 7 Feb 2024 12:41:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C280276904; Wed, 7 Feb 2024 12:41:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Uubl5FkQ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="uYII8niw" 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 81E7D1D689 for ; Wed, 7 Feb 2024 12:41:38 +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=1707309700; cv=none; b=VSNtvKeJtip8vV3W+SVezyIaY+TqNqik0WcwC8VLFzwP/rX0AFotvDkkyKgueeTIU/J6hvEZ3MvvyvXXlM6dNMaVJcY2JDZUDhHjTSdBkFHLU68W7kYBAEsPj3YfDJboE77TS4jnL86kXfeQQXJp9No/brb0nQTWxw0OQb9Cmk8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707309700; c=relaxed/simple; bh=lWGBGQc+QfecZW51XPazX31oQlJerXe3Pe9pVPK1NGA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=hFGqxl1ALvwvL2ydPHxgSDy7wBYN9aJbhQzWOEIwomjByajO9uhCiERj89Wpk3RBJ4yFMEzXvkWeQX7mTZBUl1nQmlCD1U4OprWcAlWwBri2rf1R+W46DKCySVufPZloDV1pGHJAWtMo+C1w88GrPLN3w88/GbUjmainINyomlA= 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=Uubl5FkQ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=uYII8niw; 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 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1707309696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OVIbUHMqVVyjB7JP4FhbkXQA5ZZ35lu5Vq3yQdkzZaE=; b=Uubl5FkQbWU1XFY82rYhYvDfKKPQuj4pBr79SX5lA8WK4TZDqz1TcOtj8DsKJ0HYXiWS95 ZewqpseUxXuzCZKalPb++Xk02ZH1RPHZ3z2WXVfKTTTgsgEhfXFGcWzUVEUD5hTu/RJK2L j5+GlwtWwVlZkQIcSCzV3wrXNb8oXjvRphOz5Sc2GwDir267mNIu097ilQzunbtTgiz82G JWlbt6l8x/naiPir6TB8CjkpOFyO/lp994PvLShu7gwinUK5Agy81HAJct97+jtwCdUl68 1JXer2O5USvlIFqNTXOwbulMqAXiyCTaiIXVaW6JqhvUA1N05MWfGc3c20TKuA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1707309696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OVIbUHMqVVyjB7JP4FhbkXQA5ZZ35lu5Vq3yQdkzZaE=; b=uYII8niwrzn+/M6AutzBDHcIUQKnxcVwAfbusupkjSA3uAB0Z3MDRnmFihAF7LHMkoOQ3v VXImjdpT+e6P3JBw== To: Marcelo Tosatti , linux-kernel@vger.kernel.org Cc: Daniel Bristot de Oliveira , Juri Lelli , Valentin Schneider , Frederic Weisbecker , Leonardo Bras , Peter Zijlstra , Marcelo Tosatti Subject: Re: [patch 12/12] x86/cacheinfo.c: check for block interference CPUs In-Reply-To: <20240206185710.142514323@redhat.com> References: <20240206184911.248214633@redhat.com> <20240206185710.142514323@redhat.com> Date: Wed, 07 Feb 2024 13:41:36 +0100 Message-ID: <87eddomoov.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Tue, Feb 06 2024 at 15:49, Marcelo Tosatti wrote: > @@ -396,6 +397,7 @@ static void amd_l3_disable_index(struct > * disable index in all 4 subcaches > */ > for (i = 0; i < 4; i++) { > + int ret; > u32 reg = idx | (i << 20); > > if (!nb->l3_cache.subcaches[i]) > @@ -409,6 +411,7 @@ static void amd_l3_disable_index(struct > * is not sufficient. > */ > ret = wbinvd_on_cpu(cpu); > + WARN_ON(ret == -EPERM); What? You create inconsistent state here. > - amd_l3_disable_index(nb, cpu, slot, index); > + ret = 0; > + idx = block_interf_srcu_read_lock(); > + > + if (block_interf_cpu(cpu)) > + ret = -EPERM; > + else > + amd_l3_disable_index(nb, cpu, slot, index); > + > + block_interf_srcu_read_unlock(idx); Again. This is a root only operation. This whole patch series is just voodoo programming with zero justification for the mess it creates. Thanks, tglx .