Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp524115rdb; Thu, 22 Feb 2024 10:43:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXu/Lj8JErCREK80H71apUAHehZ9UO7ilZI5LMtj3CccZyUSjcQiOzT06hB8pParhN5PfiwCtYR5eOIBfJFxIyBLmIsTWae5SCtKQqbkw== X-Google-Smtp-Source: AGHT+IHmE5LdFLHSPFlu1eAH0aj0hO9LNdtW7zE7nQ6jQGVJSKWB4+aGTRDVxC+NikI1Cr7QDkKV X-Received: by 2002:a17:906:35da:b0:a3f:2b6f:6d57 with SMTP id p26-20020a17090635da00b00a3f2b6f6d57mr4205054ejb.29.1708627431029; Thu, 22 Feb 2024 10:43:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708627431; cv=pass; d=google.com; s=arc-20160816; b=JZSFZ8No98kbwBMHOGALjKTE2fAdO+t/5lRP3ASeTT8o6B9eu+/9b9pnLDn/vCw402 wz1nUtYdYie0s4H+zjl/nN8mOwID7QRh0f1a68jv6B55MXKJtdcL8H5GsrV13W/Ihzai wwh/L2tGVtn0vTgaNW4HIHDFUsE4s8r78beg3g/ISttl5TY+51HtCMINfB2yVEPx2+ON btOdhgH9mjH3+/m9mbzSpdHsqOTjlUx/7P+SnZQPkPwiDzpy56kFDJWs99swO5jXXE2j VzgQaGzGTJsrZHBheVtCYUbXS0mx7OWZIx/BWtSJVb+lrSvBMoIN8HB4WV6QlRIAy9qq 7fOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id :in-reply-to:references:date:from:cc:to:subject:dkim-signature; bh=74A8zq/rmtnQliyT5PClq5K782LGzRAIYblFfL3VNJM=; fh=HUgOPOMLUPcroonsK10/uEWpbBCP57e0QFUoVmMwghQ=; b=G2TkzfDqXtn+9wpi7dkRbwsgwFjPgikD6LaW6sXjOpE7+1es7VSqN3EEUF+AKbFIx1 znzMJAm5Cyg14Nyq/YMEF1DhhUn8TEi6cFzKJNzuZS3dg6QVLFqvpfPdEvb7KN5/7Lgi C9broC7zYVcVHRRzKJdbnUmJP+eUGUERhSOzazQiEgUONEYjgHU9eBED6N53Kpo/m49w Eae6hku1l/7P6eaF3vQVnw/kw56MblNtQCZyZ378XoM21rF/EyvbA8VI7+3/lmuQWEif pZHqg0v2I8vDu4URDLUxaqupyjoP2ePgX6Ua+L0FcFdKjqHKpjwMdhNnm6WUjEYZ6ksC pjBQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Z4S1+zlp; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-77159-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77159-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id w15-20020a17090652cf00b00a3ea736fe61si3720644ejn.357.2024.02.22.10.43.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:43:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77159-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Z4S1+zlp; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-77159-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77159-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id BDA711F28327 for ; Thu, 22 Feb 2024 18:43:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 205556E5F9; Thu, 22 Feb 2024 18:39:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Z4S1+zlp" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 ADD816AFAA for ; Thu, 22 Feb 2024 18:39:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627175; cv=none; b=Bl83jQofFexjUd+mMP0iZsx8Ls/47PAuXK7lSr4idH0pu8yQZYlwP8+Wn6gdJiNt554hvj19jSjG+bnMgGS8vwq/Wt+6PRzegwxEq5PFpC/E8npTCFh9vnjAvZpxaokZ5L4EmMBpk4aaNZS36buuSo4TUl6QArTQ3WDxcFovuKU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627175; c=relaxed/simple; bh=X3vgXtdWjBUY02JYo3ZQjlayem/luTu4o10k7E40aB4=; h=Subject:To:Cc:From:Date:References:In-Reply-To:Message-Id; b=dNYWqd2LqRb+XLiEs+6la4XBil+ehH34lWW+jpJXEGnj8TJTFaJ1p9LypkxAznOjPSozs1U8pel+599cxG7EsFBLkN1uAJUVUayDxv4DtlH8sYZazZviKnIa+GvWGPkJ3+WmVKCft/USXW3zBcdtD3xZodw+4cG2H1OC3eNyDUM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Z4S1+zlp; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708627174; x=1740163174; h=subject:to:cc:from:date:references:in-reply-to: message-id; bh=X3vgXtdWjBUY02JYo3ZQjlayem/luTu4o10k7E40aB4=; b=Z4S1+zlpZZOg/0Gv+EfBiTMWjbrP2W7s4zbrNcIQHr/cBPyV9VVocmw4 Mby7WOVDoz7BqdjV1p7GfjkGgP2Al/hvLSKnCvvAMsNP5xeGEWv7wZgch dPl6+W+3HT4LmEtnO2LE0uys2BlYQDnGBrMAjXundvxfz00SSCx1l4TaA vpwmodebCuzDJAYZp1JmqLll1Uv4q1V3UWZkUwG6RsHNyzW7hhVeWyzfw NepY7uj2WeTz/DFYtveaNAJrQxVIey2zm1VwJPUTmWR3kICssj2PDBqHE xFMTtHjNAq0YdHJvj13Y/lE3qG0nKLP6rxh3frSCg3zs95fumjSVI4fmL g==; X-IronPort-AV: E=McAfee;i="6600,9927,10992"; a="3031716" X-IronPort-AV: E=Sophos;i="6.06,179,1705392000"; d="scan'208";a="3031716" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2024 10:39:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,179,1705392000"; d="scan'208";a="5975409" Received: from davehans-spike.ostc.intel.com (HELO localhost.localdomain) ([10.165.164.11]) by orviesa008.jf.intel.com with ESMTP; 22 Feb 2024 10:39:34 -0800 Subject: [RFC][PATCH 05/34] x86/cpu: Move /proc per-cpu ->x86_phys_bits reference to global one To: linux-kernel@vger.kernel.org Cc: kirill.shutemov@linux.intel.com,pbonzini@redhat.com,tglx@linutronix.de,x86@kernel.org,bp@alien8.de,Dave Hansen From: Dave Hansen Date: Thu, 22 Feb 2024 10:39:33 -0800 References: <20240222183926.517AFCD2@davehans-spike.ostc.intel.com> In-Reply-To: <20240222183926.517AFCD2@davehans-spike.ostc.intel.com> Message-Id: <20240222183933.953C8BFF@davehans-spike.ostc.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: From: Dave Hansen This is one of the few references to the per-cpu version of ->x86_phys_bits. It is theoretically possible to have this value vary from CPU to CPU. But in practice nobody builds systems that way. Continue outputting the value in /proc, but read it from the global configuration. Signed-off-by: Dave Hansen --- b/arch/x86/kernel/cpu/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN arch/x86/kernel/cpu/proc.c~proc-global-x86-phys-bits arch/x86/kernel/cpu/proc.c --- a/arch/x86/kernel/cpu/proc.c~proc-global-x86-phys-bits 2024-02-22 10:08:50.584536732 -0800 +++ b/arch/x86/kernel/cpu/proc.c 2024-02-22 10:08:50.584536732 -0800 @@ -133,7 +133,7 @@ static int show_cpuinfo(struct seq_file seq_printf(m, "clflush size\t: %u\n", c->x86_clflush_size); seq_printf(m, "cache_alignment\t: %d\n", c->x86_cache_alignment); seq_printf(m, "address sizes\t: %u bits physical, %u bits virtual\n", - c->x86_phys_bits, c->x86_virt_bits); + x86_phys_bits(), c->x86_virt_bits); seq_puts(m, "power management:"); for (i = 0; i < 32; i++) { _