Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp716234lqp; Thu, 21 Mar 2024 13:19:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMnGC716CNlAkzTSz3YycorqIyDLZOT1MhBT2byvYXpEy1CKG8It586tEyRsAWhTrT0v8K1eLDbAP/D0mLXm5PAZiHngKOQwCaT0+ihA== X-Google-Smtp-Source: AGHT+IFvubNZSUeFAnDgNsWVGYsuCZHCpwN92g2XZ9qtqh0ILCTfMNfZ8ZEZXsantl9Q8XVXYuv0 X-Received: by 2002:ad4:5f08:0:b0:696:48a2:9cd9 with SMTP id fo8-20020ad45f08000000b0069648a29cd9mr233899qvb.33.1711052376330; Thu, 21 Mar 2024 13:19:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711052376; cv=pass; d=google.com; s=arc-20160816; b=C1SqLsgM/p7rK82dmNBVyAnuW18Hs5qX6LfHtUUr0hhMOSDqtoHvjz1KdAiUgtY5C9 BAfvFCX66BCkMwW3Axo0yuJAGGAmAFyHLUlIJvnzlnd8S3eNnveEKf2KL+Q1XwzZN1Vz HPlTV3/vd5TpErwDlVdFcN60wCZUJ3QcCtxft7WFHVku+Bmdmn7J6kK4Oil6k63n/T3C QThvvGVT35RBT2NsOWczY0vy5CqXSYAqh9tz5xYO0YO+XQj7VdDYfmlF3hguQBqjckzS SsiHsTotoNGHz6wSSJYIXMj7q5F9pkOd8mRUwfqA4pc2Wrm5GCpU19hLLBNG1J2XHQFb l9HA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=crUYMPOl/nFJOh+gZdNsIAU1wjH2L9wkVovg4jxZ6Tc=; fh=6cFa3IzDqpcdpBdu9WkmunixBQ+D/8HcU3nQQXDfP9g=; b=rxLM/8UUkC7pkxd8ZUZeXDKzxrJq85bAlsmJ21IX/DRrftD1K4r4BbVA/24jPCc4K+ BylUA8CaAut/1O6+8/bg+/opM7yMevYX6HC++RGu2unaOOgEo8d7+tZCQq19L39kJf7q QHCFkXzzhmfiu5xaxfOXWH3/5aCQt1hcHZE02LtbAr/keYwKfAgA9kILEgfgxscU/Zx/ Rz99UWki4dUdC+E2X14sCHPdZxyQnS9LjFnKEICqEwS0APC834WI3sjfv5CSzRGXbczc OAidKpxXuSnS+QN+SO7BJUVpakLwMV5epHDuCQYI9cg/3h0FywezAxogYyyKyiU0snr9 OABQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=khFV506D; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="ZUi/oE7I"; 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-110634-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110634-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o2-20020ad45c82000000b00690047b0660si657272qvh.21.2024.03.21.13.19.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 13:19:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110634-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=khFV506D; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="ZUi/oE7I"; 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-110634-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110634-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id F36F01C2217E for ; Thu, 21 Mar 2024 20:19:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9878B134CC8; Thu, 21 Mar 2024 20:19:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="khFV506D"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZUi/oE7I" 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 615EAF4FA; Thu, 21 Mar 2024 20:19:28 +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=1711052369; cv=none; b=Htum4848FjNd8kTV3s7TT2tADV9GWoO5z6ibK2muVFQ43zkSKAxpZivbhaRG6xCeYt6QUPimsjnvJ3wIWc9yNaBw6N76BPhJY1Y+WQuR6GBhl+3nRTy/Fk/zVuoj/S5zV5Cu4zT8LGCV8SeezIxfUC3RTln6PIjC1BoFaVX08DU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711052369; c=relaxed/simple; bh=0+7yLupFUJn3tZxnu2lqPHb28Vn9hA0mXxBfuZkl76Y=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=U4roXnPpNHqevaGXVV19yUTgHDiNy2s6SE20bEDfeCq52aiiSfCHGNr7upggiGxFIv0z0YBln8RcR6FJ5MKlsZDnObiSnRr/5nzKXQRngGwfyW9hM9zX/7zg/t7oiV/l1MLX9qEic8OTm8XLsZrMIBayHLJnAWA2avOsjui1Jfw= 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=khFV506D; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ZUi/oE7I; 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 Date: Thu, 21 Mar 2024 20:19:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1711052365; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=crUYMPOl/nFJOh+gZdNsIAU1wjH2L9wkVovg4jxZ6Tc=; b=khFV506D8rWV3Eg9RuSurxyKn23YqfYihQFxyvVVkfDc2xHLF/4g5JnMtjEZvcRr8V1nFF ppmUBkMJqXboGZA580p9dB8QjokvK9fNnXJq9idXzDdYX9PwtzoN3ZJK4t77BYg4OmPCYq 3QsCJ98zoVfGYO7NzA7wAnLBnRPGDlA+aFGGGpegMF9SoGnFaUQOm6sZTjfMNL/Vt5HcyA TqbpTfWXOO54W9JLaPMg0eKETVEXWc1RJdSKabkAe1ySufByftDmwEr8w46MDi4ZKP/8zu 7uyBIbOh08rBqtmEy770b4shN82N2W7cSo1WiAm8ncUJUBIDXQzoYoHwWuok7A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1711052365; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=crUYMPOl/nFJOh+gZdNsIAU1wjH2L9wkVovg4jxZ6Tc=; b=ZUi/oE7IS+ZyqsMIUoep38sKY73vBnGWvtnPDMAT0wSm0u0BZLMqgubMB6I/6FlRWsk9x6 c0aU8dHwXYCwUuBw== From: "tip-bot2 for Borislav Petkov (AMD)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cpu] x86/cpu: Get rid of an unnecessary local variable in get_cpu_address_sizes() Cc: "Borislav Petkov (AMD)" , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240316120706.4352-1-bp@alien8.de> References: <20240316120706.4352-1-bp@alien8.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171105236391.10875.2779822144402584041.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the x86/cpu branch of tip: Commit-ID: 95bfb35269b2e85cff0dd2c957b2d42ebf95ae5f Gitweb: https://git.kernel.org/tip/95bfb35269b2e85cff0dd2c957b2d42ebf95ae5f Author: Borislav Petkov (AMD) AuthorDate: Sat, 16 Mar 2024 13:07:06 +01:00 Committer: Ingo Molnar CommitterDate: Thu, 21 Mar 2024 21:13:56 +01:00 x86/cpu: Get rid of an unnecessary local variable in get_cpu_address_sizes() Drop 'vp_bits_from_cpuid' as it is not really needed. No functional changes. Signed-off-by: Borislav Petkov (AMD) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20240316120706.4352-1-bp@alien8.de --- arch/x86/kernel/cpu/common.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index ba8cf5e..9a34651 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1053,18 +1053,9 @@ void get_cpu_cap(struct cpuinfo_x86 *c) void get_cpu_address_sizes(struct cpuinfo_x86 *c) { u32 eax, ebx, ecx, edx; - bool vp_bits_from_cpuid = true; if (!cpu_has(c, X86_FEATURE_CPUID) || - (c->extended_cpuid_level < 0x80000008)) - vp_bits_from_cpuid = false; - - if (vp_bits_from_cpuid) { - cpuid(0x80000008, &eax, &ebx, &ecx, &edx); - - c->x86_virt_bits = (eax >> 8) & 0xff; - c->x86_phys_bits = eax & 0xff; - } else { + (c->extended_cpuid_level < 0x80000008)) { if (IS_ENABLED(CONFIG_X86_64)) { c->x86_clflush_size = 64; c->x86_phys_bits = 36; @@ -1078,7 +1069,13 @@ void get_cpu_address_sizes(struct cpuinfo_x86 *c) cpu_has(c, X86_FEATURE_PSE36)) c->x86_phys_bits = 36; } + } else { + cpuid(0x80000008, &eax, &ebx, &ecx, &edx); + + c->x86_virt_bits = (eax >> 8) & 0xff; + c->x86_phys_bits = eax & 0xff; } + c->x86_cache_bits = c->x86_phys_bits; c->x86_cache_alignment = c->x86_clflush_size; }