Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp304477imm; Fri, 21 Sep 2018 14:55:30 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYqB+6DdMvrnoFW+FF6+X9m4hewe+0KzoJc3PXNgOrjdqqeFiUOaKmdqMCijttzt0mOUXak X-Received: by 2002:a62:1a8f:: with SMTP id a137-v6mr48489275pfa.190.1537566930435; Fri, 21 Sep 2018 14:55:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537566930; cv=none; d=google.com; s=arc-20160816; b=xgKlyzJEFkyxtrqrnkX6ld52gjUnEKHeLReV6tzoH2tMUw8nktMYCTTg1K4emQAVMj QXStr+f3O+GqH0tVn9nFUroATkK0p5jJrxsxMc7Jvif8st2J9UnFyaAaB4pkHCOGZzTC KBedkxxKqj65crqpdWCRU5LYlJQhN7qFGfn73T1EcXiOGTviesQZVc5Vw2RvSwddiP8I CpflXwo1+zz9S5m7hXlJD+ejq9A8DI53cJPDvHoEJU8UVUaRc80eqEat55pRMNYRQCLH u3BHuZ4ASUrEwrg6+/g26vTMn2KFmuMcRI9lyowyyuB5zxF1UuAXWMjMEHHvijI6z/z/ Kppg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=GhAqwxmSlvwG5D/FFRX9XGwLh3Nq4ZzZcJPLMSHQzHU=; b=rUx5O8ruqjVpDf7AlaLBq2lbnQqcJJ5hwDGuUNWqQWpkr6V0hy7IWBYw7QkPHfi4F6 XnDP6ovPfO39UzyFJHigrrE8Wa3taijgPa00LAAge+budAkPwmoBIDQepf4ZDnPoeQ9C W7E7ZHDR1hd6x5tLVEkWLN8JOCt/mJy8NQys4mWPwpJoJLHxff9uuvky8/4JCAjELpXe mH56ABJtOxNaVkYBmgVxh8w6G9AYLqZTQTRE1QgyyTe0jUyzgJAx4UsevGVjB0SHzup2 KsMz67ftflqg25mwDhJtH3gXTJUMT0TLoWxg9+VqQZj7AqkddTl5msKlMPlKSCpnNONA 9k/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=VsIHpR11; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b98-v6si31720132plb.38.2018.09.21.14.55.14; Fri, 21 Sep 2018 14:55:30 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=VsIHpR11; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391467AbeIVDpn (ORCPT + 99 others); Fri, 21 Sep 2018 23:45:43 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44525 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390726AbeIVDpn (ORCPT ); Fri, 21 Sep 2018 23:45:43 -0400 Received: by mail-wr1-f68.google.com with SMTP id v16-v6so14139219wro.11 for ; Fri, 21 Sep 2018 14:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GhAqwxmSlvwG5D/FFRX9XGwLh3Nq4ZzZcJPLMSHQzHU=; b=VsIHpR11yxEiA8P5Ig4Mjdm90VlXlmRduW11Tw7lJqy/psKFHiVjNcih3ETniS/hye srqCf2GNzu9jFzblwMvOcBGWRLo3l7Pg8UOQSM4lkjOSZ0ODQnhUXR3Z6Zd4Yzg/ghjS XgOjk2xKtty7fKZJxQ7dGpRkh9yBT6lj/KE7a9WRLIqMuzvBPSW9O+3GKMNHG85SCNYK 2mQPVPjBnYR82XTdalGUVgIycNJspixj23nvI6EVykRaeHwSKL2WDwK9nHWnfyQlSAg+ 6w+Ln7wcVpA/FKgLEl29J++8R2qhET5rIL82NVHg62o4ymQ0qTPpKcgtSGliaqb7zd2J 9bJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GhAqwxmSlvwG5D/FFRX9XGwLh3Nq4ZzZcJPLMSHQzHU=; b=H2wfCV0OgjZ72T9cA/p1F+CjAxoh6Oczm0m7BKSIvBttkLnD0Lqj+H4HFAu3q6a0pG 7tNzn26oGqEyjSkaFDynFXQlKNZIWz52lqOTeujH1raiQ8GrfHSVjRZffCA+B15Agn7W Cm6Dkwan1m6Ugl4UOP6+HsHAoPmQqOJORD3peB2SKOf+BYhMCsI3OFoiFMY+VeQUUzKT X2MNzQWefn22Wxr6H9/OQZO9lieXBuzrwmaW8svvaNyzbioa9NgPMzV2kmFgzL98mdBy G5rx8DnYKqdd6WEC2DzKplrBqrLGM/AoDpu/6my/906FvjkWfufiWm76dkVPK3hHBXK1 lIQw== X-Gm-Message-State: APzg51AprMrIMm4qnwM0bV+cTMnfm0ESEiZIeW9TAEZ/92XRLfQRZWDw tu9U/LZGVgZEL9gMeVqpHOKpl7Vibkjp+zDsgHbClw== X-Received: by 2002:adf:c98d:: with SMTP id f13-v6mr39964315wrh.148.1537566895717; Fri, 21 Sep 2018 14:54:55 -0700 (PDT) MIME-Version: 1.0 References: <20180921212041.13096-1-tedheadster@gmail.com> <20180921212041.13096-3-tedheadster@gmail.com> In-Reply-To: <20180921212041.13096-3-tedheadster@gmail.com> From: Andy Lutomirski Date: Fri, 21 Sep 2018 14:54:43 -0700 Message-ID: Subject: Re: [PATCH v2 2/2] x86/cpu: Change query logic so cpuid is enabled before testing To: Matthew Whitehead Cc: LKML , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Borislav Petkov , "H. Peter Anvin" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 21, 2018 at 2:21 PM Matthew Whitehead wrote: > > 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 How about Suggested-and-reviewed-by: Andy Lutomirski instead? (No need to resubmit for just that. Ingo or Thomas, if you like these, can you just make that substitution?) > 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 > -- Andy Lutomirski AMA Capital Management, LLC