From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 38C763F4DC3 for ; Thu, 30 Jul 2026 11:13:24 +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=1785410006; cv=none; b=QPxbg5jaCLYO1IW8hOJ/tz4hk2BkSKDd04IT+Yzaks2hdUIrrKGFzWtLlrA+gmI/lFVAUeSTqLAcVo8gsBv2bIT/xMVD/uegfv5zmziytFGiB6/hZuTulpnFvCIUZ0SJJ7X6IE3Ruc30VkjUGjzU8GH+FmyZHz99X2LHEflgz3U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785410006; c=relaxed/simple; bh=siswb1VIjNMcs3WAY9OSRe0PlrFgkHZqmUiQfrM14Ac=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d9WDGzzGgygVkHv2UXB5KB/5SmKX3OQT9XnIGPm02cxfW/J5vPm7pb1dMRkI1DN1S3T8R0guudRa6kZmPaz1AwbNcEUYFfuo4XJoW5lIzT5qQ5M41oZPVqx4ZazDtDVuQ98qR06S5RwxnsXHIsDSMDwOlRKzbvs2oSsJTYj4c0E= 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; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=FzUHTIpr; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="FzUHTIpr" 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 935F61684; Thu, 30 Jul 2026 04:13:19 -0700 (PDT) Received: from e142334-100.cambridge.arm.com (e142334-100.cambridge.arm.com [10.2.198.93]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id EAA423F763; Thu, 30 Jul 2026 04:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785410003; bh=siswb1VIjNMcs3WAY9OSRe0PlrFgkHZqmUiQfrM14Ac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FzUHTIpr+zi8VItxyiIU1BfYQklI9nc2dgWYgcIZfD4whuHEjQ/Swm4qJfVS5FkQ4 WvLOJmyC7ylFfw/sFt7+itVcC6DdHVy6tEv07TqYp9VnG6txiyhqICVCBohde/kLt5 9MgSkx3Wpp3LQ5etd4FgJ3TUHMIROKEwjBWWPFFE= From: Muhammad Usama Anjum To: Dimitri Sivanich , Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: Muhammad Usama Anjum Subject: [PATCH 3/3] misc: sgi-gru: inline the user CBR status update Date: Thu, 30 Jul 2026 12:12:52 +0100 Message-ID: <20260730111316.3672672-4-usama.anjum@arm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260730111316.3672672-1-usama.anjum@arm.com> References: <20260730111316.3672672-1-usama.anjum@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 process-context fault path always has a valid user CBR pointer. Inline the one-use status helper and remove its obsolete NULL check. No functional change. Signed-off-by: Muhammad Usama Anjum --- drivers/misc/sgi-gru/grufault.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c index e43fdea01cb6f..6b7e7dc37eacd 100644 --- a/drivers/misc/sgi-gru/grufault.c +++ b/drivers/misc/sgi-gru/grufault.c @@ -111,21 +111,6 @@ static void gru_unlock_gts(struct gru_thread_state *gts) mmap_read_unlock(current->mm); } -/* - * Set a CB.istatus to active using a user virtual address. This must be done - * just prior to a TFH RESTART. The new cb.istatus is an in-cache status ONLY. - * If the line is evicted, the status may be lost. The in-cache update - * is necessary to prevent the user from seeing a stale cb.istatus that will - * change as soon as the TFH restart is complete. Races may cause an - * occasional failure to clear the cb.istatus, but that is ok. - */ -static void gru_cb_set_istatus_active(struct gru_instruction_bits *cbk) -{ - if (cbk) { - cbk->istatus = CBS_ACTIVE; - } -} - /* * Read & clear a TFM * @@ -354,7 +339,12 @@ static int gru_try_dropin(struct gru_state *gru, gru_flush_cache_cbe(cbe); } - gru_cb_set_istatus_active(cbk); + /* + * Set CB.istatus active in cache before restarting the TFH to avoid + * exposing stale pre-restart status. Cacheline eviction may lose the + * update, but an occasional stale status is harmless. + */ + cbk->istatus = CBS_ACTIVE; gts->ustats.tlbdropin++; tfh_write_restart(tfh, gpa, GAA_RAM, vaddr, asid, write, GRU_PAGESIZE(pageshift)); -- 2.47.3