From nobody Mon Dec 1 22:34:55 2025 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 2A363315D2E for ; Wed, 26 Nov 2025 12:51:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764161514; cv=none; b=E4YfTZy9V21N7mT0J4RHlAsVAiFT/7Ef637J9YL1AgHgruSEZoyGZbvZlkR/HmL32cZaYqeHjgQfT0M4Riqx3rTmrZif8QWQbMuMAILDECq5L7RJJ/EY/7NmHVu9dzHlEcdgMiVAGaZk9beZan8Fltc+zs7ZT73r3VHpfhB8I50= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764161514; c=relaxed/simple; bh=Ce2jPCNI6VdL76QG3hbN8D1t6OGCgfVtbjBOBQi+t3U=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=FTJCSrrsMaZm6ZG6Z43Z1jh7G+M4fLnSWQkIfu+byK4kaigzNy9r5nLR+QP9s98LY9lHOTtD+ed/MXvAaF6GTrqofjxob25uXWzS8ybzP0o02SZT6Ld5Sou266vOQduHft+B66DhiMO4vVRqK1q6zsotS5aJhwmsdKJa3oVikHA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=citrix.com; spf=pass smtp.mailfrom=citrix.com; dkim=pass (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b=Ehlse4jK; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=citrix.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=citrix.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="Ehlse4jK" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-42b3ac40ae4so3786062f8f.0 for ; Wed, 26 Nov 2025 04:51:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1764161510; x=1764766310; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=b1NUU+1UO/6/9cXR/Os2C51pBbD+xd7qojGtfpG42SY=; b=Ehlse4jKItthlicsNu5AyXKGaC6ayBOp9UfMPoAY5xzKPcoJ+yodn45w9rhrwJRsCu b4D3w21LtaZ6ujEwTZUltSdq5vFgqESyC+2Jn1Q/8UMw/WQxp0p0MFuPuwDdFjBOzHH+ D+zHngwILr7RmTaVDr0p/bne942vtqu//OvUs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764161510; x=1764766310; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=b1NUU+1UO/6/9cXR/Os2C51pBbD+xd7qojGtfpG42SY=; b=bytUaOEDzk4j345gNUPfkUrN4SItu+2acQW0hYZjqCY26dblFIM3c7BD/OUf3KEnP4 ndDSHSPOKDSuOa2JJFoDhAz7tzmrP+PO74Y6dApkRQ82BugxA856ruU7wkBS3GlYjP5M hhymTfkbDg/viJnsT+nltqfWToBYDLeT244uHtIl7Fh1QlFHnkWPVRjnRPStHtZG2i3A lEFfZPVev+l42ZDGQu6LmZ+YpvNKZnf3H2rpxdt5XrnI2GsjLC8LTg7nF39Iy1nZHIWv X0ft+UYADKitZHBG0GYoeT37cD17WC97xc8XkS1eDN4osLSdSa4fMZ97vyi+I+jhGz3V fARw== X-Gm-Message-State: AOJu0YzocDku7dm1iS9NOirBCzhR4uR6W+WK5j2R6MXtpimoaG2Mi/zZ hVqh8sN8vzbl234m918XjGRbmwiknwO6HZYhND4zh/HeSNkpz2vLneCSEdzOx+MC/0iKWVlwH/c 1kP66 X-Gm-Gg: ASbGnct4EBAUZVN6YEZYvvl+PCLPRdoqyFZ7SjGB24ESrB2Znw4s5omdaL9HdXTD1/u 80g6ed5BbQhVS6cZiHZhZFKovpBXlq7ekIIQUsYXfOf56I4JfTWDvwolZxlMeHm8sRDOj0/y2L7 CVM/CkTj0zQ3ulR4rWblotQeAvF9NAXZ0zoGxSSjAkz/pHqopArA4saUwuBSSbqi+VAf9sBvh1Y zRAgfOMrgqfgyWCdpyOp98D/DYjx9br7+6hP2G6Uu6LcbeA3eebkEHt1TG2kScbSmPdsMps0xR8 7R4QlBneX8q3agT1oK4wpSHFVR2/LYMlU2tdUhaK3PKEGOnd+1p1nRS020amPXsi05T/3iu1I9D hw9+1qcgwcMCuaG2FMR5yqrd4fAAl7UxLcJ3r8fkZju89DvT3GehenoWjgiq1ggULtbonM8m+7B f/sV7+0c72rM0U3pIX+1LQOe4Y3D2ZPXAZlvP/HqNVB85NSVnCDw7UL7Put8/1EA== X-Google-Smtp-Source: AGHT+IGynv+aI+oaqw9L7NKQ4SDZq+T/z0mvycGrQBvVw8YKwsJyaC3PwfTAzz1x9S9EytCdmGWs5A== X-Received: by 2002:a05:6000:430e:b0:42b:2e94:5a94 with SMTP id ffacd0b85a97d-42cc1cf4540mr19700247f8f.29.1764161510091; Wed, 26 Nov 2025 04:51:50 -0800 (PST) Received: from localhost.localdomain (host-92-29-237-183.as13285.net. [92.29.237.183]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42cb7fd8d97sm39944379f8f.42.2025.11.26.04.51.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Nov 2025 04:51:49 -0800 (PST) From: Andrew Cooper To: LKML Cc: Andrew Cooper , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Pu Wen , "Peter Zijlstra (Intel)" , x86@kernel.org Subject: [PATCH] x86/cpu: Drop vestigial PBE logic in AMD/Hygon/Centaur/Cyrix Date: Wed, 26 Nov 2025 12:51:47 +0000 Message-Id: <20251126125147.880275-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Besides formatting changes, this logic dates back to Linux 2.4.0-test11 in November 2000. Prior to "Massive cleanup of CPU detection and bug handling", c->x86_capability was a single u32 containing cpuid(1).edx, cpuid(0x80000001).edx, or a synthesis thereof. X86_FEATURE_AMD3D was defined as the top bit this single u32. After "Massive cleanup of CPU detection and bug handling", c->x86_capability became an array with AMD's extended feature leaf split away from Intel's basic feature leaf. AMD doc #20734-G states that 3DNow is only enumerated in the extended feature leaf, and that other vendors where using this bit too. i.e. AMD never produced a CPU which set bit 31 in the basic leaf, meaning that there's nothing to clear out in the first place. This logic looks like it was relevant in the pre-"Massive cleanup" world but ought to have been dropped when c->x86_capability was properly split. Signed-off-by: Andrew Cooper --- CC: Thomas Gleixner CC: Ingo Molnar CC: Borislav Petkov CC: Dave Hansen CC: "H. Peter Anvin" CC: Pu Wen (maintainer:HYGON PROCESSOR SUPPORT) CC: "Peter Zijlstra (Intel)" CC: x86@kernel.org CC: linux-kernel@vger.kernel.org I'm not sure how best to represent: https://github.com/schwabe/davej-history/commit/67ad24e6d39c3bc4618e7eb0563= ccde3d76d0a51#diff-ab4c065cef7ebcd6d255c47ed4c3c0a77da8ad3df004dab9a183cc88= 814730ff in the commit message. git://git.kernel.org/pub/scm/linux/kernel/git/davej/history.git doesn't appear to exist any more. In principle this wants a fixes tag to 25 years ago, but I don't think it's important enough to warrant backporting. --- arch/x86/kernel/cpu/amd.c | 6 ------ arch/x86/kernel/cpu/centaur.c | 6 ------ arch/x86/kernel/cpu/cyrix.c | 6 ------ arch/x86/kernel/cpu/hygon.c | 6 ------ 4 files changed, 24 deletions(-) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 505ff37b850c..73d634bc8e98 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -1051,12 +1051,6 @@ static void init_amd(struct cpuinfo_x86 *c) =20 early_init_amd(c); =20 - /* - * Bit 31 in normal CPUID used for nonstandard 3DNow ID; - * 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway - */ - clear_cpu_cap(c, 0*32+31); - if (c->x86 >=3D 0x10) set_cpu_cap(c, X86_FEATURE_REP_GOOD); =20 diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c index a3b55db35c96..c8398940b975 100644 --- a/arch/x86/kernel/cpu/centaur.c +++ b/arch/x86/kernel/cpu/centaur.c @@ -119,12 +119,6 @@ static void init_centaur(struct cpuinfo_x86 *c) u32 fcr_clr =3D 0; u32 lo, hi, newlo; u32 aa, bb, cc, dd; - - /* - * Bit 31 in normal CPUID used for nonstandard 3DNow ID; - * 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway - */ - clear_cpu_cap(c, 0*32+31); #endif early_init_centaur(c); init_intel_cacheinfo(c); diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c index dfec2c61e354..8f22085c4dd2 100644 --- a/arch/x86/kernel/cpu/cyrix.c +++ b/arch/x86/kernel/cpu/cyrix.c @@ -195,12 +195,6 @@ static void init_cyrix(struct cpuinfo_x86 *c) char *buf =3D c->x86_model_id; const char *p =3D NULL; =20 - /* - * Bit 31 in normal CPUID used for nonstandard 3DNow ID; - * 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway - */ - clear_cpu_cap(c, 0*32+31); - /* Cyrix used bit 24 in extended (AMD) CPUID for Cyrix MMX extensions */ if (test_cpu_cap(c, 1*32+24)) { clear_cpu_cap(c, 1*32+24); diff --git a/arch/x86/kernel/cpu/hygon.c b/arch/x86/kernel/cpu/hygon.c index 1fda6c3a2b65..7f95a74e4c65 100644 --- a/arch/x86/kernel/cpu/hygon.c +++ b/arch/x86/kernel/cpu/hygon.c @@ -174,12 +174,6 @@ static void init_hygon(struct cpuinfo_x86 *c) =20 early_init_hygon(c); =20 - /* - * Bit 31 in normal CPUID used for nonstandard 3DNow ID; - * 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway - */ - clear_cpu_cap(c, 0*32+31); - set_cpu_cap(c, X86_FEATURE_REP_GOOD); =20 /* base-commit: ac3fd01e4c1efce8f2c054cdeb2ddd2fc0fb150d --=20 2.39.5