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:	Wed, 30 Jul 2008 12:25:49 -0700
From:	Mike Travis <travis@....com>
To:	Dave Jones <davej@...emonkey.org.uk>, Mike Travis <travis@....com>,
	Ingo Molnar <mingo@...e.hu>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"H. Peter Anvin" <hpa@...or.com>, Jack Steiner <steiner@....com>,
	Christoph Lameter <cl@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, Len Brown <len.brown@...el.com>,
	Lennert Buytenhek <kernel@...tstofly.org>,
	Paul Jackson <pj@....com>, Tony Luck <tony.luck@...el.com>,
	Tigran Aivazian <tigran@...azian.fsnet.co.uk>,
	Paul Mackerras <paulus@...ba.org>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Robert Richter <robert.richter@....com>,
	Martin Schwidefsky <schwidefsky@...ibm.com>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	Sam Creasey <sammy@...my.net>, Greg Banks <gnb@....com>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Adrian Bunk <bunk@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Andreas Schwab <schwab@...e.de>,
	Johannes Weiner <hannes@...urebad.de>
Subject: Re: [PATCH 1/1] cpumask: Change cpumask_of_cpu to use	cpumask_of_cpu_map

Dave Jones wrote:
> On Wed, Jul 30, 2008 at 11:37:52AM -0700, Mike Travis wrote:
>  
>  > >> I've lost the plot on what's going on with these cpumask patches.
>  > >> But I just saw this on -rc1.
>  > >>
>  > >> arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c:206:33: error: not addressable
>  > >> arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c:274:32: error: not addressable
>  > >> arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c:352:34: error: not addressable
>  > >>
>  > 
>  > After I recreated linux-next the changes all appear to be there now.
>  > One problem though, is !SMP config does not build (something about
>  > DECLARE_BITMAP with NR_CPUS=1.)  I wasn't sure how to create a constant
>  > "(cpumask_t)1" that worked as an lvalue, so the following patch is
>  > somewhat a kluge, but fulfills the requirements.
>  > 
>  > If anyone has a better suggestion, please let me know.
>  > 
>  > Subject: [PATCH] cpmask: add cpumask_of_cpu(0) for non-SMP
>  > 
>  >   * Fix cpumask_of_cpu(0) when CONFIG_SMP is not set by providing a
>  >     pointer to a cpumask_t with cpu 0 bit set.
> 
> confused.  I saw the error above with a make allyesconfig, which
> sets CONFIG_SMP=y
> 
> 	Dave
> 

Well now the !SMP error is not there, so my "fixup" patch is not needed.
(It might have been because I had a slightly old copy of cpumask.h which had
the troublesome statement expression: "({ *get_cpu_mask(cpu); })" in it.)

But the errors you were seeing are fixed in the latest linux-next.  When
I git-fetched, I got the same errors, but when I built a fresh copy of
linux-next, the correct code appeared.

A quick check...

arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c should have:

static void drv_write(struct drv_cmd *cmd)
{
	cpumask_t saved_mask = current->cpus_allowed;
	unsigned int i;

	for_each_cpu_mask_nr(i, cmd->mask) {
		set_cpus_allowed_ptr(current, &cpumask_of_cpu(i));
		do_drv_write(cmd);
	}

	set_cpus_allowed_ptr(current, &saved_mask);
	return;
}

instead of:

static void drv_write(struct drv_cmd *cmd)
{
	cpumask_t saved_mask = current->cpus_allowed;
	cpumask_of_cpu_ptr_declare(cpu_mask);
	unsigned int i;

	for_each_cpu_mask_nr(i, cmd->mask) {
		cpumask_of_cpu_ptr_next(cpu_mask, i);
		set_cpus_allowed_ptr(current, cpu_mask);
		do_drv_write(cmd);
	}

	set_cpus_allowed_ptr(current, &saved_mask);
	return;
}

Thanks,
Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ