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, 30 Nov 2010 23:32:04 +0000
From:	Russell King - ARM Linux <linux@....linux.org.uk>
To:	Anton Vorontsov <avorontsov@...sta.com>
Cc:	Kukjin Kim <kgene.kim@...sung.com>,
	Srinidhi Kasagar <srinidhi.kasagar@...ricsson.com>,
	Tony Lindgren <tony@...mide.com>,
	Catalin Marinas <catalin.marinas@....com>,
	Jamie Iles <jamie.iles@...ochip.com>,
	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>, linux-kernel@...r.kernel.org,
	linux-samsung-soc@...r.kernel.org,
	Colin Cross <ccross@...roid.com>, linux-tegra@...r.kernel.org,
	linux-omap@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 1/8] ARM: SCU: Add common routines for secondary CPU
	bootup

On Tue, Nov 30, 2010 at 08:16:58PM +0300, Anton Vorontsov wrote:
> +/*
> + * Initialise the CPU possible map early - this describes the CPUs
> + * which may be present or become present in the system.
> + */
> +void __init scu_init_cpus(void __iomem *scu_base)
> +{
> +	unsigned int ncores = scu_base ? scu_get_core_count(scu_base) : 1;
> +	unsigned int i;
> +
> +	/* sanity check */
> +	if (ncores == 0) {
> +		pr_err("%s: strange CM count of 0? Default to 1\n", __func__);
> +		ncores = 1;
> +	}
> +
> +	if (ncores > NR_CPUS) {
> +		pr_warn("%s: no. of cores (%d) greater than configured "
> +		       "maximum of %d - clipping\n", __func__, ncores, NR_CPUS);
> +		ncores = NR_CPUS;
> +	}
> +
> +	for (i = 0; i < ncores; i++)
> +		set_cpu_possible(i, true);
> +}
> +
> +void __init scu_prepare_cpus(void __iomem *scu_base, unsigned int max_cpus)
> +{
> +	unsigned int ncores = num_possible_cpus();
> +	unsigned int cpu = smp_processor_id();
> +	int i;
> +
> +	smp_store_cpu_info(cpu);
> +
> +	/*
> +	 * are we trying to boot more cores than exist?
> +	 */
> +	if (max_cpus > ncores)
> +		max_cpus = ncores;
> +
> +	/*
> +	 * Initialise the present map, which describes the set of CPUs
> +	 * actually populated at the present time.
> +	 */
> +	for (i = 0; i < max_cpus; i++)
> +		set_cpu_present(i, true);
> +
> +	/*
> +	 * Initialise the SCU if there are more than one CPU and let
> +	 * them know where to start.
> +	 */
> +	if (max_cpus > 1) {
> +		/*
> +		 * Enable the local timer or broadcast device for the
> +		 * boot CPU, but only if we have more than one CPU.
> +		 */
> +		percpu_timer_setup();
> +
> +		scu_enable(scu_base);
> +	}
> +}

Note that I'll go with factoring this out into arch/arm/kernel/smp_scu.c
for the time being, but I'm not convinced about the other parts yet.

> +	sub	r4, r4, r5
> +	add	r6, r6, r4
> +#if __LINUX_ARM_ARCH__ >= 7
> +	dsb
> +#endif

Another question though - probably for Linus though - why is the u8500
code needing this dsb whereas other ARMv7 implementations don't appear
to require it?
--
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