From nobody Sat Apr 18 09:09:45 2026 Received: from sender4-op-o15.zoho.com (sender4-op-o15.zoho.com [136.143.188.15]) (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 24C813A3504; Sat, 28 Feb 2026 17:37:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772300266; cv=pass; b=UWhVEBPAoIordrQ57sZUDE7iLHQVuXBdqxlIe4j26KLcxRk1YfnrkgE+olYyZZqRtDIpy5GMIAMQNKNv0UoCqwqvK32c/VnHLzbrBBcYqL4MEZ3d4r91Cq251CI/RP53O+tNxsWlDyyGZatGkP635sEovBSpI3qai2tC3hfWLWM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772300266; c=relaxed/simple; bh=1BJMdPqUAZ4ILPIPkmlYmVhrSric75D5wmL38+wWBLA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=p0AVSxgBzgmHKC3DbybKI4+UUyNfxp5jy92oagTiPskfkE2OFQK1pMrB1ewXP1Nlp3D3eFFc1DPrF15/jMdzp5Ml/LvDJHl2T2rXLH9DtzeamzU/t9Kkax0pB05vJoVs0m27VKfATYf3sjegFkg8ISwP7p45vtNNeYpn8d4MS9I= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ziyao.cc; spf=pass smtp.mailfrom=ziyao.cc; dkim=pass (1024-bit key) header.d=ziyao.cc header.i=me@ziyao.cc header.b=EYCmKYb8; arc=pass smtp.client-ip=136.143.188.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ziyao.cc Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziyao.cc Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ziyao.cc header.i=me@ziyao.cc header.b="EYCmKYb8" ARC-Seal: i=1; a=rsa-sha256; t=1772300246; cv=none; d=zohomail.com; s=zohoarc; b=hh0lCz+wccDqhmVMWqN8vv7siQVDwraFYbKp/1v80G0w/4mY1VHrE+h2mkO3f7REohjzlHK7gZuCmbWi/nRqsIoDs0ny0nhML3jSCc62iakej3kMtKjvQHNVNUD86oImY2lL1xHSCjLAJgqxtl13T/LlD+XXpkY9/zI0six66ME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772300246; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=V0iAzLvH235YmaKmJafhDbAzj392OrkWanaiH+LgkYU=; b=e1CvowAq/MvE8lxLCi58gS97yFi90QOjNxdHNpFXl/N0bve8hKLpQmIYLD1d23vNGeaB61GhrtLziPHqlKY7YlfxI2zpTuy1e87s0zWvqY1kTjUfG9b7Be/nQm3n92x/hj2gyvlGNxQpuDHbY8hlIlmSyffo7j+STpywcndU3Dw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=ziyao.cc; spf=pass smtp.mailfrom=me@ziyao.cc; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1772300246; s=zmail; d=ziyao.cc; i=me@ziyao.cc; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=V0iAzLvH235YmaKmJafhDbAzj392OrkWanaiH+LgkYU=; b=EYCmKYb8XL1SNTY03vjsTnS5EKl6aUDLeLN2d786oYOoUs83KxaaDQUz2eZaSQ8Z 5KosPeMBtZyYqWi0/ZWiyDcg9vyY/FfinjkwbwPhf9MfzqP5DWIX3oqJh3SkAw9AB2B eF/mAObSDMU62P/E94kIvdDhVP1w97MRtU/C3wns= Received: by mx.zohomail.com with SMTPS id 1772300243723849.1494629034747; Sat, 28 Feb 2026 09:37:23 -0800 (PST) From: Yao Zi To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Andrew Cooper , "H. Peter Anvin" Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Yao Zi , stable@vger.kernel.org Subject: [PATCH] x86/cpu/centaur: Disable X86_FEATURE_FSGSBASE on Zhaoxin C4600 Date: Sat, 28 Feb 2026 17:37:04 +0000 Message-ID: <20260228173704.62460-1-me@ziyao.cc> X-Mailer: git-send-email 2.53.0 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" Zhaoxin C4600, which names itself as CentaurHauls, claims X86_FEATURE_FSGSBASE support in CPUID, while execution of fsgsbase- related instructions fails with #UD exception. This will cause kernel to crash early in current_save_fsgs(). Let's disable the feature on this problematic CPU and warn the user about the quirk. x86_model_id is used to match the platform to avoid unexpectedly breaking other CentaurHauls cores with conflicting family/model ID. Cc: stable@vger.kernel.org Signed-off-by: Yao Zi --- arch/x86/kernel/cpu/centaur.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c index 81695da9c524..3773784ba6a9 100644 --- a/arch/x86/kernel/cpu/centaur.c +++ b/arch/x86/kernel/cpu/centaur.c @@ -108,6 +108,29 @@ static void early_init_centaur(struct cpuinfo_x86 *c) } } =20 +/* + * Zhaoxin C4600 (family 6, model 15) names itself as CentaurHauls, it cla= ims + * X86_FEATURE_FSGSBASE support in CPUID, while executing any fsgsbase-rel= ated + * instructions on it results in #UD. + */ +static void fixup_zhaoxin_fsgsbase(struct cpuinfo_x86 *c) +{ + const char *name, *model_names[] =3D { + "C-QuadCore C4600" + }; + int i; + + for (i =3D 0; i < ARRAY_SIZE(model_names); i++) { + name =3D model_names[i]; + + if (!strncmp(c->x86_model_id, name, strlen(name))) { + pr_warn_once("CPU has broken FSGSBASE support\n"); + setup_clear_cpu_cap(X86_FEATURE_FSGSBASE); + return; + } + } +} + static void init_centaur(struct cpuinfo_x86 *c) { #ifdef CONFIG_X86_32 @@ -201,6 +224,8 @@ static void init_centaur(struct cpuinfo_x86 *c) set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC); #endif =20 + fixup_zhaoxin_fsgsbase(c); + init_ia32_feat_ctl(c); } =20 --=20 2.53.0