Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp41167imm; Thu, 20 Sep 2018 13:46:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaIwjMSBJWUmoOZ0DDt3r66nY3OUx7PdKZVgG5ucSrUQi8eflC+vaAjRYkjm4jtAp7OhS3x X-Received: by 2002:a17:902:8ec7:: with SMTP id x7-v6mr41473739plo.336.1537476368274; Thu, 20 Sep 2018 13:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537476368; cv=none; d=google.com; s=arc-20160816; b=OgO2bb4pDe7+U6RpPW/S99jIHyvBoxPTpesCzdgk8MIMoIrMhjFA4fFHEixazFjjNk IVONjKRxXsad/epe6mxcZiHmC5uUzpqrzsTiu2CmqqUM/PfAnznba1hmjRBR9ytjAHts t+ImBFEwF73AggmYyK7usQ8FyXLS6P8pv/nhGiTQ2o8cMb/K6fl3XdaxMH91G54TXXAb +q62sTSaTDCTRtFgq8AFL2p2U+j/Nd5j2dMcOD8b9qFBh0q1eHDuXi/qu/BDYc+zE7HF OVD8vIgw1iq0t5xWlbb4vEju4z23ZBp1PjpNYC9ezAcmo+YsbkByGpJe3VYD499ZMwh0 iR6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=AD+NjC4OILLMNYqw8gBfzMFWrkc1Q+NA4r7e2oixdgo=; b=mz4C28/AfytYd13PxFsxO0EpSzONUeRlHdYVnfgQkaqsv0iKVxOKr3LCLiLZswXsAd gDvS+M77TVis8wikhFtyTikI+NrwOtBwgXVGCuw6qge/aV5Mz/XZYytk47TMuVo8oPXo 9dvJjEvogxgKFg8pn1qka763KAh9ZYdL7T6isW4tjxJuif0uk2c/5jCtZ+4TgfVTvA7O yuBUXf6ZFxdG6C27XeOff1jiqeGgXWl7e0GqZklbMAgriVe2dQZhf6eQqeviBr4vElDW qDwr1kVCvM4So7eJE7b9i7X83DH8tshjQYYmnQWRqlcE2x3JfN0tM/6J7TPUuqZ0hBpE feww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lFuO991U; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z20-v6si25949002pgk.17.2018.09.20.13.45.50; Thu, 20 Sep 2018 13:46:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lFuO991U; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388267AbeIUCa0 (ORCPT + 99 others); Thu, 20 Sep 2018 22:30:26 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:44886 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726128AbeIUCa0 (ORCPT ); Thu, 20 Sep 2018 22:30:26 -0400 Received: by mail-qk1-f193.google.com with SMTP id d131-v6so6630312qke.11 for ; Thu, 20 Sep 2018 13:45:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=AD+NjC4OILLMNYqw8gBfzMFWrkc1Q+NA4r7e2oixdgo=; b=lFuO991UMYfRvJNry30DVUGMYoMXwU6mcizEQtgFJPNsvnXVWEoNgHmDHcjwOMyMB/ LdXQ7oR3ZsE7vGcl9hLbs1UabwUKWEibbn3e9vYyc+9J2kQfQJPkHPkB3hE4z1RTcAaV e9ejXohDVqe/BRVrg4KNgwTQZhVyZhXBei0kK/bPLSzNjaJXu3/gQQzXdhYxoeq5MeI0 bX736GW5FVZX/fJZ1ZSkd4feZ8/aqxZv4JxdxiHep+Rr/IFWyqSAEVakXzgAsHFYTS2h c4oajar/y6WGKAu4CobU+7Cjhw58tO5n4W/kNMJ5uZFbmTmS6Ok0vF/CGeS2Ea8J6yNB DBMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=AD+NjC4OILLMNYqw8gBfzMFWrkc1Q+NA4r7e2oixdgo=; b=W5dYCgP7T+U8ZlzuDAmjYNvHHxb+R+CKHaU6pyCnLCIL8LpTKjhjCN8pREbeLIS9My ahKe6Xf5n8p2eTa0nAVMWByHDpYW+aUD+rlbK0VtTcTwn9D/NqMc2WZYltVYos+mMMoQ dSCiTgXeacIAvtUZmtuU7o59Nh6llw+tGoosjRRmkBs+UDhGZrsGqOdXyrmD/O+c8+bp aKsba6znuBlbyxsfcoax+z4PX6UbrJi+R3tttKF9AR1CQ5klg099N+yXo9eUpe1rDTz6 gS1vZS9FzrNJ5+lQKKeythYf4nnCwz+4cuWhy1PIUkNIFULFe9Rh1JbByrlhUzZdAzz6 SeZw== X-Gm-Message-State: APzg51AVmeGex8MU8UmDREQf4WeeTCNmTK8dL87mG1OMc9hPJQsptuvr 0TKDh2eMx2H1kgWlk4Tg9lWE1cE= X-Received: by 2002:a37:79c5:: with SMTP id u188-v6mr28910848qkc.82.1537476306326; Thu, 20 Sep 2018 13:45:06 -0700 (PDT) Received: from mwhitehe.remote.csb (ip-107-53-162-92.nymnny.spcsdns.net. [107.53.162.92]) by smtp.gmail.com with ESMTPSA id k3-v6sm13768251qtm.12.2018.09.20.13.45.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 13:45:05 -0700 (PDT) From: Matthew Whitehead To: linux-kernel@vger.kernel.org Cc: mingo@kernel.org, tglx@linutronix.de, peterz@infradead.org, luto@amacapital.net, bp@alien8.de, hpa@zytor.com, Matthew Whitehead Subject: [PATCH] x86/cpu: Enable cpuid instruction on Cyrix 6x86/6x86L processors Date: Thu, 20 Sep 2018 16:44:52 -0400 Message-Id: <1537476292-28056-1-git-send-email-tedheadster@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On power up, the cpuid instruction is disabled on Cyrix 6x86 and 6x86L processors and it needs to be enabled. There is code to do this, but it does not work because it uses the broken {set,get}Cx86_old() macros. There are comments in processor-cyrix.h advising you to _not_ make calls using the deprecated macros in this style: setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80); This is because it expands the macro into a non-functioning calling sequence. The new macros fix this problem, so we use them instead. We also need to forcibly enable X86_FEATURE_CPUID. This is because early_identify_cpu() does not know that the call to identify_cpu_without_cpuid() actually enables the cpuid instruction in the odd Cyrix case, and it turns X86_FEATURE_CPUID off after it has just been enabled on the processor. This was tested on actual Cyrix hardware. Signed-off-by: Matthew Whitehead --- arch/x86/kernel/cpu/cyrix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c index 8949b7a..e603cc5 100644 --- a/arch/x86/kernel/cpu/cyrix.c +++ b/arch/x86/kernel/cpu/cyrix.c @@ -437,10 +437,11 @@ static void cyrix_identify(struct cpuinfo_x86 *c) /* enable MAPEN */ setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable cpuid */ - setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80); + setCx86(CX86_CCR4, getCx86(CX86_CCR4) | 0x80); /* disable MAPEN */ setCx86(CX86_CCR3, ccr3); local_irq_restore(flags); + setup_force_cpu_cap(X86_FEATURE_CPUID); } } } -- 1.8.3.1