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]
Message-ID: <20120103173254.GB25541@mudshark.cambridge.arm.com>
Date:	Tue, 3 Jan 2012 17:32:54 +0000
From:	Will Deacon <will.deacon@....com>
To:	Marc Zyngier <Marc.Zyngier@....com>
Cc:	Rob Herring <robherring2@...il.com>, Yang Bai <hamo.by@...il.com>,
	Joerg Roedel <joerg.roedel@....com>,
	Russell King <linux@....linux.org.uk>,
	Thomas Gleixner <tglx@...utronix.de>,
	Santosh Shilimkar <santosh.shilimkar@...com>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] arm: Fix linux-next compile error in
 arch/arm/common/gic.c

On Tue, Jan 03, 2012 at 02:05:40PM +0000, Marc Zyngier wrote:
> On 03/01/12 13:53, Rob Herring wrote:
> >>> On Tue, Jan 3, 2012 at 12:33 AM, Joerg Roedel <joerg.roedel@....com> wrote:
> >>>> With CONFIG_SMP=n the following compile error occurs:
> >>>>
> >>>>  CC      arch/arm/common/gic.o
> >>>> arch/arm/common/gic.c: In function 'gic_init_bases':
> >>>> arch/arm/common/gic.c:679:4: error: implicit declaration of function 'cpu_logical_map' [-Werror=implicit-function-declaration]
> >>>> cc1: some warnings being treated as errors

[...]

> > IIRC, part of the problem is asm/smp.h is only included by linux/smp.h
> > for CONFIG_SMP, so this would have to change. Doing that could easily
> > break other arches.
> 
> Ah... good point.

We could probably move smp_setup_processor_id out of smp.c if we need to as
it seems as though you can provide a definition of that function even when
!CONFIG_SMP.

> >>
> >> Well, both patches are wrong. In the UP case (and assuming we're running
> >> on physical CPU 0), offset should be 0.
> >>
> >> The second patch would be my favorite approach, except that
> >> cpu_logical_map(x) should return either "x" or 0. And I'm not sure how
> >> to handle the (unlikely?) case of running a UP kernel on a secondary CPU...
> > 
> > Wouldn't this be the case with 2 AMP instances of Linux running?

In this configuration, I think returning 0 would probably be the right thing
to do. If it's anything else, there's the implication that both of your
kernels are hanging off the same GIC distributor / SCU / L2 Cache etc. and
so you would need a single SMP kernel (or some funky message passing that we
don't yet have).

The bit we're currently missing is the notion of a cluster ID, but both CPU IDs
should be 0 for AMP.

> Yes, or kexec-ing a UP kernel on a secondary CPU. It really looks like
> we ought to make this cpu_logical_map() independent from CONFIG_SMP.

We could always prevent this from happening by hacking kexec / kexec-tools
but I think that booting a UP kernel on a CPU other than 0 is rather silly :)

So I'd be inclined to simply move the existing smp_setup_processor_id
implementation (and the map declaration) into somewhere like kernel/setup.c
and I think things should work.

Will
--
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