From patchwork Thu Feb 29 23:21:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 208557 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp741460dyb; Thu, 29 Feb 2024 15:26:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXirDnTGw1GaR1/zA6QzK5puVSUqVWJoOIYQYuTRGTJ8XgtlaMsUCapAkFdHV1ncPMyLHjl7igkSXRgamVK3LBxlyjsqA== X-Google-Smtp-Source: AGHT+IGoxxb7SjzQBzAHTTWyN7cDMWF7Kx+0X/s3cQqLCL93f9Oo1xG9LwVUBxoBZHjV2B/pNoLW X-Received: by 2002:a17:902:e741:b0:1dc:30f1:b8d3 with SMTP id p1-20020a170902e74100b001dc30f1b8d3mr12057plf.18.1709249163178; Thu, 29 Feb 2024 15:26:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709249163; cv=pass; d=google.com; s=arc-20160816; b=zMwV4gH/kSBLx3oEeKpkz4X7S6UChCsVjckdozOauE8rqmgi97aQoiP3I63K4E2rqW EGa7I+0WvScrh3aK07ZkmJs87dzja6FOzMlyPL8bKqMAdUNI2AGjNFO4UFdnK+CRIziG d+EKAux7uRJGJw7ra0QSPSqQQnK9Vs8D5nD9k/pKyVhYjGQQ3feiRAGnj/lb0OUyZBFs Czk2IdywZNEvhtVw+WFZHs1oTRGhYz48GlUgoEHk4zZW19rE4kGJP044RPcFJU7yC4S6 CYZlrv6Dfw8e3N2vZHtl9zx0uBGj/ycE7ow13vTx+n9Uxre1aMZ8dREvT77AGPe+C7vh rmGQ== 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:dkim-signature; bh=4wFLc5gcnBs285NRnicKVmmQVV53EnA/2rANcUM2uCA=; fh=kVMl8kfpA36Ro/3P2bM4CdBKxR/FbbKq3UwoDY1wFDQ=; b=XCvu+k2TIE4Gg6my5BoFQFrygB5eULyiUqjHS3xH0JSbiyd/jdVpoyaNKNIeyYGSLZ 6FdgQBFZ2WZIl6nlRSVyEZFDfKrDidVyMO8TX0g+yFk6nsjlfOj1cGTm5+3I/0DnqrLK t/sHB16CEXSkLECGGgvXYM9CGS41CB7vRXpAtCf0Cc6ePij0/yhqbbtxGYss+hleb4ah IfDWOVELzdei2/TTvWpEoVc5nNNLqHOmG4ypaMt8zlAzxKjApnA5KW4iyP4yKZw9RziO 2XpYrYeigXlnwZjLf+jx0TjFDHd02gBliiOkKXnraAzbKxMIH/Rynu8ku+dWSAwUzpla pHTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=gLPBsPMW; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-87682-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87682-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id p6-20020a170902ebc600b001dcc8769137si2330736plg.598.2024.02.29.15.26.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 15:26:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87682-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=gLPBsPMW; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-87682-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87682-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 2F018B22518 for ; Thu, 29 Feb 2024 23:25:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 81C7B14BD50; Thu, 29 Feb 2024 23:22:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="gLPBsPMW" Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (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 768BC74BFE for ; Thu, 29 Feb 2024 23:22:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709248946; cv=none; b=RrUJKFnjCQTjklwy7TH3bBJCJjy01Vkpie6jHcDiF/8Y0K2gXIWNyrFQuB/pwdFDDgFduBXS3Y9Eur0nXnxAgQ8SJzsZd4KbhFc13Vszf2eMZMuR46DAzdVZ+GgNfRGAfLuD5eB1a5hz7YxpL4sL5DRVtXU70VNfTlou90jSODg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709248946; c=relaxed/simple; bh=G1BXM2z6rQBc5K4wZw4N6I/e+joRY7yH/Z0Jdaxm+no=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DgxFmdpuIO+eFqXlFlrSUm9UHNSJex7e9vw4juT0QICltwsr7BDjKs5yNoYS5OLz1IqdKv0xKYpVpT4pQi1tehIPcNF42xDeymVtnVz2y2+FMVjxvA/OjhpysmOlAV0pTGC3rInMrGshY3K5D/T2bas2w7cg/8LUKca1JV8CRzg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com; spf=pass smtp.mailfrom=sifive.com; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b=gLPBsPMW; arc=none smtp.client-ip=209.85.210.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6e55bb75c9eso1336260b3a.3 for ; Thu, 29 Feb 2024 15:22:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1709248945; x=1709853745; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4wFLc5gcnBs285NRnicKVmmQVV53EnA/2rANcUM2uCA=; b=gLPBsPMW5tbj3NNZa7yyp9h+BFyIBw958P3oU791RdPlMGHM6i9bHaDXg9MjJQwH8h B+9Um0TXzck7yUGL2G6fMNG+GXID+epbq1SDC5PlO0DQpG3scIxABxZIVUI6c90mUd/I HFJ67HfX1QSZgxgDASlbHuVyj6tE6TTpLkhT0KJ9a71tmeLcn2vz5H3xrxj/7Xj/3NBR sON03IgHbXlNJUtrZk+aWESptb5RIbQkPObsJ1tAQHejb2VjaKjO7BV3Swaz8xW2ZjmD YqFkf6jY/GqZDGHyB4r9/9NuwfPKM0ZB0mL84hxVWbZDCgE3nMeIqn8RPA6l6cgIBNm5 jJvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709248945; x=1709853745; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4wFLc5gcnBs285NRnicKVmmQVV53EnA/2rANcUM2uCA=; b=wkfv1j3MkB1ZL3M/nxe2es6ls7VD90/PI56q17aESviCqa3i0mchRBshxw9UbR+2qs XzY1gBCcrbDHjaP7pgySo+1sv5Oi5ZqnGBDg9RsprUlBymVdLgO9RkxTyhS42nXILaQh aFtwpOURs1Nxc4flXQxRUsReoUomnHAb+l+NtDWBm8W5zY4/gnTszQVwK36dgZa5JYpJ 0tom+AWvAK+0u239eiA8X3Zv+tloS4XvFNrZqG2kyeDIQhqROJTbmtuRLrg1+fVzhLrk a5LoUyH7dBgrxENo/FB8bw6Fgl66LgaQ3TirZLckkYkJlCC+3WI4MYf6D3LDkbj7DiUk 7Z1Q== X-Gm-Message-State: AOJu0Yw7QqCzI91rJM+y/6gSXh9HXdGJK4IL4o5Uq6xv2NS+ExRBrt7l 83SLi3+LbsBiS2KcYVxM5aVQ/dYn7jT3ngiE9sdtq9o+0Ggp79Xn2eFtRa9pOHA= X-Received: by 2002:a05:6a00:3d42:b0:6e4:eee0:5798 with SMTP id lp2-20020a056a003d4200b006e4eee05798mr179957pfb.14.1709248944849; Thu, 29 Feb 2024 15:22:24 -0800 (PST) Received: from sw06.internal.sifive.com ([4.53.31.132]) by smtp.gmail.com with ESMTPSA id c6-20020aa78806000000b006e55aa75d6csm1779719pfo.122.2024.02.29.15.22.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 15:22:24 -0800 (PST) From: Samuel Holland To: Palmer Dabbelt , linux-riscv@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexandre Ghiti , Jisheng Zhang , Yunhui Cui , Samuel Holland Subject: [PATCH v5 11/13] riscv: mm: Make asid_bits a local variable Date: Thu, 29 Feb 2024 15:21:52 -0800 Message-ID: <20240229232211.161961-12-samuel.holland@sifive.com> X-Mailer: git-send-email 2.43.1 In-Reply-To: <20240229232211.161961-1-samuel.holland@sifive.com> References: <20240229232211.161961-1-samuel.holland@sifive.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792277650239158898 X-GMAIL-MSGID: 1792277650239158898 This variable is only used inside asids_init(). Reviewed-by: Alexandre Ghiti Signed-off-by: Samuel Holland --- (no changes since v1) arch/riscv/mm/context.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/riscv/mm/context.c b/arch/riscv/mm/context.c index 5315af06cd4d..0bf6d0070a14 100644 --- a/arch/riscv/mm/context.c +++ b/arch/riscv/mm/context.c @@ -20,7 +20,6 @@ DEFINE_STATIC_KEY_FALSE(use_asid_allocator); -static unsigned long asid_bits; static unsigned long num_asids; static atomic_long_t current_version; @@ -226,7 +225,7 @@ static inline void set_mm(struct mm_struct *prev, static int __init asids_init(void) { - unsigned long old; + unsigned long asid_bits, old; /* Figure-out number of ASID bits in HW */ old = csr_read(CSR_SATP);