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] [day] [month] [year] [list]
Date:   Tue, 29 Nov 2022 16:50:24 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     Kim Phillips <kim.phillips@....com>
Cc:     x86@...nel.org, Babu Moger <Babu.Moger@....com>,
        Borislav Petkov <bp@...e.de>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
        Joao Martins <joao.m.martins@...cle.com>,
        Jonathan Corbet <corbet@....net>,
        Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Sean Christopherson <seanjc@...gle.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        David Woodhouse <dwmw@...zon.co.uk>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Juergen Gross <jgross@...e.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Tony Luck <tony.luck@...el.com>,
        Tom Lendacky <thomas.lendacky@....com>, kvm@...r.kernel.org,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] x86/cpu, kvm: Use CPU capabilities for
 CPUID[0x80000021].EAX

On Mon, Nov 28, 2022 at 05:00:43PM -0600, Kim Phillips wrote:
> > verify_tags: WARNING: Co-developed-by Babu Moger <Babu.Moger@....com> hasn't signed off on the patch!
> 
> OK, I'll add his signed-off-by.

You can't just add his SOB - he needs to give it himself.

"Certificate of Origin" in Documentation/process/submitting-patches.rst
needs brushing up on, it seems.

> Not sure I follow.  That code (originally from commit f144c49e8c39
> ("KVM: x86: synthesize CPUID leaf 0x80000021h if useful") doesn't
> negate that: the code is saying that if we don't have the bug, then
> set the feature bit that says we don't have the bug.

I was thinking of the case described here:

415de4407664 ("x86/cpu: Fix migration safety with X86_BUG_NULL_SEL")

but I guess we can do that on the host.

> > Which means, you'd have to update check_null_seg_clears_base() too.
> 
> Like this?:
> 
> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
> index 73cc546e024d..bbe96d71ff5e 100644
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
> @@ -1682,11 +1682,6 @@ void check_null_seg_clears_base(struct cpuinfo_x86 *c)
>         if (!IS_ENABLED(CONFIG_X86_64))
>                 return;
> 
> -       /* Zen3 CPUs advertise Null Selector Clears Base in CPUID. */
> -       if (c->extended_cpuid_level >= 0x80000021 &&
> -           cpuid_eax(0x80000021) & BIT(6))
> -               return;
> -

No, not like this. The above you've removed needs to be

	if (cpu_has(c, X86_FEATURE_NULL_SEL_CLR_BASE))
		return;

so that you exit early.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ