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]
Date:   Tue, 13 Sep 2016 16:00:27 -0700
From:   Dave Hansen <dave.hansen@...el.com>
To:     "Luck, Tony" <tony.luck@...el.com>
Cc:     Fenghua Yu <fenghua.yu@...el.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        "H. Peter Anvin" <h.peter.anvin@...el.com>,
        Ingo Molnar <mingo@...e.hu>,
        Peter Zijlstra <peterz@...radead.org>,
        Tejun Heo <tj@...nel.org>, Borislav Petkov <bp@...e.de>,
        Stephane Eranian <eranian@...gle.com>,
        Marcelo Tosatti <mtosatti@...hat.com>,
        David Carrillo-Cisneros <davidcc@...gle.com>,
        Shaohua Li <shli@...com>,
        Ravi V Shankar <ravi.v.shankar@...el.com>,
        Vikas Shivappa <vikas.shivappa@...ux.intel.com>,
        Sai Prakhya <sai.praneeth.prakhya@...el.com>,
        linux-kernel <linux-kernel@...r.kernel.org>, x86 <x86@...nel.org>
Subject: Re: [PATCH v2 07/33] x86/intel_rdt: Add support for Cache Allocation
 detection

On 09/13/2016 03:52 PM, Luck, Tony wrote:
> On Tue, Sep 13, 2016 at 03:40:18PM -0700, Dave Hansen wrote:
>> Are you sure you don't want to add RDT to disabled-features.h?  You have
>> a config option for it, so it seems like you should also be able to
>> optimize some of these checks away when the config option is off.
> 
> Makefile looks like this:
> 
> obj-$(CONFIG_INTEL_RDT)        += intel_rdt.o intel_rdt_rdtgroup.o intel_rdt_schemata.o
> 
> which seems to skip compiling all our code when the CONFIG
> option is off.
> 
> Our hooks to generic code look like:
> 
> +#ifdef CONFIG_INTEL_RDT
> +extern void rdtgroup_fork(struct task_struct *child);
> +extern void rdtgroup_exit(struct task_struct *tsk);
> +#else
> +static inline void rdtgroup_fork(struct task_struct *child) {}
> +static inline void rdtgroup_exit(struct task_struct *tsk) {}
> +#endif /* CONFIG_INTEL_RDT */
> 
> Does this disabled-features.h thing do something more?

If you have cpuid checks in common code, disabled-features.h can compile
them out if the config options are turned off.  For instance:

	if (cpu_feature_enabled(X86_FEATURE_PKU))
		foo();

is equivalent to:

#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
	if (boot_cpu_has(X86_FEATURE_PKU))
		foo();
#endif

But, if all the cpu_has(c, X86_FEATURE_CAT_L3) checks are confined to
files only compiled under CONFIG_INTEL_RDT then it won't do you much
good.  But, it's pretty simple to add things, and would help you out if
checks spread beyond intel_rdt*.c.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ