Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp586076rdb; Thu, 22 Feb 2024 12:49:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUqqKZPJYCePK4v+IqK7cuiKsfN/SAVeEUSZoxcGj6/xiH8c/CU2E/VKMsfdu7SqwN89CWVJZRyTt7XwaLz5fLZzZl3p0QwZqg7VDdVmg== X-Google-Smtp-Source: AGHT+IFJf8L5TlUzghN/w4vTZ4SGoV4NvGTzrIZgRjfSd1qlj4YDqZ35GWXqhg+yZsV2qT3GxsYg X-Received: by 2002:a05:6a20:9396:b0:19e:9f2d:9825 with SMTP id x22-20020a056a20939600b0019e9f2d9825mr32686625pzh.49.1708634945057; Thu, 22 Feb 2024 12:49:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708634945; cv=pass; d=google.com; s=arc-20160816; b=cbdcqv4gywcbhjLiFa8JR3QG+iDXSBzX8+NzyH80VXo6xA8o/6bXM8N4+Ji0knpYtg XsG/uZUn49QKa0um2DwU9YWcJXGRJXZumnyHwo4Y2emGhcGp18WaKDq7gk6fjMQQuPF/ HU1TzcTb1fg8IVc+MyUVMX3M9QfeT/M4hiLlH9SU/Wy6EuzY7b+7GooBiPbmh2fcV6Up micxLV+9yRTxt/yf1n1YyK7f/dYdH8wzi2GoVn6R2n1MiHmL+QhRq+PeTwt1hG8WVYaq D8+i1hKb67sBDsYPl6BiR0oZoz56jPxCs9IcQ3EGkw49bdfVPHFa9tBq6Bf+q4XbdTjw iwog== 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=Omfco2XE1bingxHSv1DlDZNE+xYyk4VOqXBCKicVeL0=; fh=HUgOPOMLUPcroonsK10/uEWpbBCP57e0QFUoVmMwghQ=; b=PMCCCn8kkdbC8V1+zMIO0rGnOdgk2m3NSmtTgvxjpqpo4b194HZf6N4McfxQIdeSTQ SsxD1j7qf9zbvkC39tjGCUwLgq1n404m8FjOXDbHSlGMPSDYDvBHF1gMRPP+0gMkiqbc 7v5ZMsJqD984PzhjtBegt2xPhC6jmis5NzaCozOalJ+38gnRWbVm5q2qWyk+TFgeyMos ecR8PXuSmVPTpOoVhPUmkZs7b6BXYpEn011NKBSEDXfzwL2aoYCq5LfISUS59P/P4Mym b70KkZVW0EoN9WQf/k5jZA2bva2tOH3bsd8g9vH/if6KElbCAdfcCBr5vLAVeoXwARr6 QTjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HAqOVzGt; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-77166-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77166-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id k63-20020a638442000000b005df433fcb8fsi10380310pgd.133.2024.02.22.12.49.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 12:49:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77166-linux.lists.archive=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=@intel.com header.s=Intel header.b=HAqOVzGt; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-77166-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77166-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 02A49B212E6 for ; Thu, 22 Feb 2024 18:45:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3217112D21B; Thu, 22 Feb 2024 18:39:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HAqOVzGt" 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 3794A73F3C for ; Thu, 22 Feb 2024 18:39:43 +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=1708627185; cv=none; b=lnQ3ZPBnYR2RpXLBNATqzD+4pNxObM2soATyInsBCyojF8YloI4l+K0SeFBgK8rReqJdEHf8wkFqITwsV0rXNSj1+kihnc3WXCBSFJl9+VN5GhugQSSY5Z3KhmQeilovy0l/46GpoDL6Bo0/xjrU7pkSXv1WW8wtxrsdZzpvBGU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627185; c=relaxed/simple; bh=NH8Lr4ZEp+LyLCUOWjofEDWwYXC0tbCz8QJ2z7udv3U=; h=Subject:To:Cc:From:Date:References:In-Reply-To:Message-Id; b=tcMTAyF8soO31/ZJpyO6pNQRxLz8LOXACn04cb3BNLqZ52eXPiB1xN1zD5YCZqZHVMeiUf03l4sYAgI8khHn+DLTKMUaYvJ+BN16NmsT3p7LmxVpoao9YpJYMAhRupOa/M5LWbblVllL7CLVeMBtVc4kOSJjNHbcFO9TdVDRV40= 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=HAqOVzGt; 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=1708627184; x=1740163184; h=subject:to:cc:from:date:references:in-reply-to: message-id; bh=NH8Lr4ZEp+LyLCUOWjofEDWwYXC0tbCz8QJ2z7udv3U=; b=HAqOVzGt0q7bY+FM0ixHEfzeUWWvDh075m1sFdIf+Ay4ZOgRIaQJQqez 6SY/fovWJToKhYYeAlmOe6fWiQyajQoXw2zox0e4c+L5IptgYcKvqlzEZ 3kNRSSznld9cznk9MryrTIPNFcgkajDoV4svxBhZUzyBMm9EZ74LyYP0G x2Xv2WuyN7XFHFAybviadUS1oNZMaE18SlJbZjcTIeY8JLQsKpK4h+AY6 HNJLoYnuOO7pFIKPUZEOlzMzXtzntTx5goEc2x1Ueh/e9Y34G0f3+rhDk gWhLOYSroPrTj02O/UwY+aAA0w+ZykL6nPrsJC0BkRnnK7Z7uN895/HB3 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10992"; a="3031777" X-IronPort-AV: E=Sophos;i="6.06,179,1705392000"; d="scan'208";a="3031777" 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:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,179,1705392000"; d="scan'208";a="5975494" 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:43 -0800 Subject: [RFC][PATCH 12/34] x86/cpu/intel: Actually use "address configuration" infrastructure for MKTME 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:42 -0800 References: <20240222183926.517AFCD2@davehans-spike.ostc.intel.com> In-Reply-To: <20240222183926.517AFCD2@davehans-spike.ostc.intel.com> Message-Id: <20240222183942.601EE2E5@davehans-spike.ostc.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: From: Dave Hansen Now that the TME detection is only called once at boot, stop twiddling 'boot_cpu_data' directly and move over to 'bsp_addr_config'. Signed-off-by: Dave Hansen --- b/arch/x86/kernel/cpu/intel.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff -puN arch/x86/kernel/cpu/intel.c~intel-addr-reduce arch/x86/kernel/cpu/intel.c --- a/arch/x86/kernel/cpu/intel.c~intel-addr-reduce 2024-02-22 10:08:54.296682462 -0800 +++ b/arch/x86/kernel/cpu/intel.c 2024-02-22 10:08:54.296682462 -0800 @@ -401,11 +401,8 @@ detect_keyid_bits: mktme_status = MKTME_ENABLED; } - /* - * KeyID bits effectively lower the number of physical address - * bits. Update cpuinfo_x86::x86_phys_bits accordingly. - */ - c->x86_phys_bits -= keyid_bits; + /* KeyID bits effectively lower the number of physical address bits */ + bsp_addr_config.phys_addr_reduction_bits = keyid_bits; } static void bsp_init_intel(struct cpuinfo_x86 *c) _