lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrWnkR30m9OpakorHyLJX0RK4kQWA4xyyRVCGunO5dm-EQ@mail.gmail.com>
Date:   Fri, 21 Sep 2018 14:54:43 -0700
From:   Andy Lutomirski <luto@...capital.net>
To:     Matthew Whitehead <tedheadster@...il.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH v2 2/2] x86/cpu: Change query logic so cpuid is enabled
 before testing

On Fri, Sep 21, 2018 at 2:21 PM Matthew Whitehead <tedheadster@...il.com> 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 <luto@...capital.net>

How about Suggested-and-reviewed-by: Andy Lutomirski <luto@...nel.org> 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 <tedheadster@...il.com>
> ---
>  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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ