Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp280874imm; Fri, 21 Sep 2018 14:21:41 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb8Ty9sON0t0PN1bSPD4hOpj/1j2Lt4IlPtdGZ8s1wmwq53lSEsmnL726RAvukmUEwBDyI0 X-Received: by 2002:a63:8c0b:: with SMTP id m11-v6mr42659120pgd.372.1537564901360; Fri, 21 Sep 2018 14:21:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537564901; cv=none; d=google.com; s=arc-20160816; b=ST+HlpJbTkU8wubBTRvlDa84qBsNZQ6TvbEOtMdfS3rxer6fvt0jM6kxLGL1SQMl+u j3Ay0YnmluFu5Sjzo+1fQVDybY6VMvbJ+Cx4WFlNnrm+RxHqtcKJHjjkIIBIiZOH3haa WN78Jk5agn5/RBY2giGIpaWQm4v0+3/v2BuZ/wB9lg0oe6YoxQgsKgcIvZK31PSOs7vm TakdPEEE2GUlg1QhYlMUczW72c7kU9TYZhiMKMeiivaYXOO/b+7rSfDDz8g4ygtPX3UZ LlX++mHUpXwU6eqstIW3/IiEUZEH1k9d9zCQQnCxI+je7NzP0MT/YqWm8PBiwY+P6BkO aSZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=8k0z+neWnT3E0Kj3SIHbyCIj0OoFwbYBzDgipnvG3bw=; b=Ubx7/3gjpcjIcvCUXf6bJF/SFEItnXabONtBEjw2gMijmqGowjxSjN5f9ftGfVqX9J Jsw72F9QZy9RNuhjMjxun5R4hpQzSEb9MpMovdYw8tKttKDTOt7jddhsF+3408qsVWro aR4MqUMlUSUKZ0QAkiNLk4is61ZoRwd4r30XDNNdwws+qAsx9V0o3lD3/jwyqKVAdZyW edAm97+pSJWC+MIsdSeLuLkM3gtFE/WINg6LTCTUZd7fpvWAr/5rSbKKKHbp+LCNHyqd xulgfbuKDzfecnLQBsNi0LRQXp5eN1bX+xwlOBrSRG920AkM57bn4dgue1/BO4Dp+Fhp KRLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UdAu4uRp; 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 l6-v6si7864631pgl.602.2018.09.21.14.21.26; Fri, 21 Sep 2018 14:21:41 -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=UdAu4uRp; 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 S2391577AbeIVDL7 (ORCPT + 99 others); Fri, 21 Sep 2018 23:11:59 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:36927 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391538AbeIVDL6 (ORCPT ); Fri, 21 Sep 2018 23:11:58 -0400 Received: by mail-qk1-f195.google.com with SMTP id c13-v6so8855509qkm.4 for ; Fri, 21 Sep 2018 14:21:17 -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:in-reply-to:references; bh=8k0z+neWnT3E0Kj3SIHbyCIj0OoFwbYBzDgipnvG3bw=; b=UdAu4uRpIFx5/rQGJ9PcBi1kW34OiyEIbptNr0mYYK7s0hDaaTzAAIHyO//YGng61n ete3YeSVgONi4NIEDrZnE6TphkPvp4URZuhFKsQg2dm+lXnRgZh39EvPa2S25ikMIHs8 PvLP0U3mDqEpLK4Gi7xfOl36/KcXVdbVWVfghfLfZmCcWhg6pE34Qu1WqF8N0Ja8yJ8m OIi9yOnpEROamM/V3CFXJoAEZB6Ybd66heckpyXFw6JD+yw7NTwQqsMZNgCj3OmCjIAO AdGRmoGI07HrD/Tzhq1hZkBx1lBXXWgdPb+2s2Ix1dv3O3Vif1RcYskTbO01cPNYcFm8 Okrw== 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:in-reply-to :references; bh=8k0z+neWnT3E0Kj3SIHbyCIj0OoFwbYBzDgipnvG3bw=; b=JpUfl9OGDjA8D+Zv+lLkt9+gQNQQ/ar/Zg4ETE+JCC/rwzrBvSHrHthJQDiNzt5Xq/ u1bbL6dVMstWozOcgbQBmRA8ThIWLnUGOuXkyY3IyqTaPUDIqM9cBbMBvFzqpJNJwXyN KuAR7Bj1GVE3FtybrXXhTAJaB9q/hzfVlpqgZmxQk5DrSZMjQAaqPlqVNKtIXbOic7xo SwiRCNJ9syRb/rUIbhPnLO1roS0jjP1bosgXu25kik+OmFU1LhEvheMmsJ6kkt6NlB6z do9VKw3hoVXjPbb9em3JRpakiHOoXyQJ5LaRqvrdNE5TNrLE9D3HWsbBpfnXlPseh9jk y19Q== X-Gm-Message-State: APzg51CQblhByNJulzw+ScBtZtH5TX1N+zI10mw/b1G+K70OlbQ3F7JG FFI+rkwHtH2+VEOCydN9a94glvo= X-Received: by 2002:ae9:f10c:: with SMTP id k12-v6mr32175816qkg.342.1537564876779; Fri, 21 Sep 2018 14:21:16 -0700 (PDT) Received: from localhost.localdomain ([2603:3003:4107:8d00::5ce6]) by smtp.gmail.com with ESMTPSA id f6-v6sm16740401qke.77.2018.09.21.14.21.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Sep 2018 14:21:15 -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 v2 2/2] x86/cpu: Change query logic so cpuid is enabled before testing Date: Fri, 21 Sep 2018 17:20:41 -0400 Message-Id: <20180921212041.13096-3-tedheadster@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180921212041.13096-1-tedheadster@gmail.com> References: <20180921212041.13096-1-tedheadster@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Presently we check for cpuid to be enabled first. If it is not already enabled, then we next call identify_cpu_without_cpuid() and clear X86_FEATURE_CPUID. Unfortunately, identify_cpu_without_cpuid() is the function where cpuid becomes _enabled_ on Cyrix 6x86/6x86L cpus. So we must reverse the calling sequence so that cpuid is first enabled, and then check a second time to see if the feature has now been activated. Reviewed-by: Andy Lutomirski Signed-off-by: Matthew Whitehead --- arch/x86/kernel/cpu/common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index eb4cb3efd20e..60c7c5ce7e55 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1040,6 +1040,9 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c) memset(&c->x86_capability, 0, sizeof c->x86_capability); c->extended_cpuid_level = 0; + if (!have_cpuid_p()) + identify_cpu_without_cpuid(c); + /* cyrix could have cpuid enabled via c_identify()*/ if (have_cpuid_p()) { cpu_detect(c); @@ -1057,7 +1060,6 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c) if (this_cpu->c_bsp_init) this_cpu->c_bsp_init(c); } else { - identify_cpu_without_cpuid(c); setup_clear_cpu_cap(X86_FEATURE_CPUID); } -- 2.16.4