linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave@sr71.net>
To: linux-kernel@vger.kernel.org
Cc: bp@alien8.de, x86@kernel.org, hpa@zytor.com
Subject: Re: [RFC][PATCH 1/3] x86: introduce disabled-features
Date: Fri, 20 Jun 2014 13:40:12 -0700	[thread overview]
Message-ID: <53A49C2C.6030303@sr71.net> (raw)
In-Reply-To: <20140620161736.D6AC16FD@viggo.jf.intel.com>

On 06/20/2014 09:17 AM, Dave Hansen wrote:
> +/* These features, although they might be available in a CPU
> + * will not be used because the compile options to support
> + * them are not present.
> + *
> + * This code allows them to be checked and disabled at
> + * compile time withut an explicit #ifdef.  Simply call
> + * cpu_has() or this_cpu_has().
> + * */
> +
> +#ifdef CONFIG_X86_INTEL_MPX
> +# define HAVE_MPX	(1<<(X86_FEATURE_MPX & 31))
> +#else
> +# define HAVE_MPX	0
> +#endif

Urg.  arch/x86/kvm/vmx.c has:

        if (boot_cpu_has(X86_FEATURE_MPX))
                rdmsrl(MSR_IA32_BNDCFGS, vmx->host_state.msr_host_...

And in that case we really _do_ want to test the actual CPU bit, despite
how we've configured MPX in the host kernel.  We can call test_cpu_cap()
directly, I guess.  But, all these interfaces are getting confusing. :(

      parent reply	other threads:[~2014-06-20 20:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20 16:17 [RFC][PATCH 1/3] x86: introduce disabled-features Dave Hansen
2014-06-20 16:17 ` [RFC][PATCH 2/3] x86: add more disabled features Dave Hansen
2014-06-20 16:17 ` [RFC][PATCH 3/3] x86: make MP a required-feature on 64-bit Dave Hansen
2014-06-20 16:23   ` H. Peter Anvin
2014-06-20 16:30     ` Dave Hansen
2014-06-20 16:37       ` H. Peter Anvin
2014-06-20 17:43         ` Borislav Petkov
2014-06-20 17:47           ` H. Peter Anvin
2014-06-20 18:05             ` Borislav Petkov
2014-06-20 18:16               ` Dave Jones
2014-06-20 18:48                 ` Borislav Petkov
2014-06-20 18:54               ` H. Peter Anvin
2014-06-20 20:00                 ` Borislav Petkov
2014-06-20 20:22                   ` H. Peter Anvin
2014-06-20 20:35                     ` Borislav Petkov
2014-06-20 17:50           ` H. Peter Anvin
2014-06-20 18:15             ` Borislav Petkov
2014-06-20 18:57               ` H. Peter Anvin
2014-06-20 20:37                 ` Borislav Petkov
2014-06-23  6:11         ` Andi Kleen
2014-06-20 16:20 ` [RFC][PATCH 1/3] x86: introduce disabled-features H. Peter Anvin
2014-06-20 17:20   ` Dave Hansen
2014-06-20 20:40 ` Dave Hansen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53A49C2C.6030303@sr71.net \
    --to=dave@sr71.net \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).