From patchwork Thu Dec 5 10:08:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 22051 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8BDAB202E0 for ; Thu, 5 Dec 2013 10:08:44 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wo20sf54927887obc.9 for ; Thu, 05 Dec 2013 02:08:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=iZ8MvnNOiJ8Bw+bBE61qViYngB039QkpIRAe6B3WR8E=; b=HNDH7POdp/oJyVzSviYmpFCrKKF+S9+WHhm5KC4isDTMJZdL5rq70hSzTc+EVolojA wZKTbSsMlaNQm+QQfq9dca9gllSz5YcWU60esn9TgCZBBl73Y496MjkA9P6Dm1UtnWSQ QbCTqOSCDS5qGSxAYvpqY+JvPoqMA98g/4vKlR1q7hKfbOUAVD8xZo57p3cXVQL7nEKT pDw4QIkzFrDxaaCrnzVtGvHptu4nGfPwjazgurvHhuEIAnlsWQCXxjFjQPegyyR6Rrvm wTxfe2KbwNvuPH9c9JNQZ/iGjNc8QE91TxU+W/qLMyuvVw+Um2352AwEzaGiSJy5lMZj 2xeQ== X-Gm-Message-State: ALoCoQlVbK9xDRp+S/tp9WjonN3bpSD7Vjx9Q6t1Hc9rXwT4PAnefU6wDFbzUrCBXxX8Rht3ojTQ X-Received: by 10.182.126.137 with SMTP id my9mr28008633obb.13.1386238123920; Thu, 05 Dec 2013 02:08:43 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.37.195 with SMTP id a3ls725367qek.88.gmail; Thu, 05 Dec 2013 02:08:43 -0800 (PST) X-Received: by 10.52.106.107 with SMTP id gt11mr34073730vdb.7.1386238123818; Thu, 05 Dec 2013 02:08:43 -0800 (PST) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id e6si1986024vct.25.2013.12.05.02.08.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 02:08:43 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id ia6so12524102vcb.4 for ; Thu, 05 Dec 2013 02:08:43 -0800 (PST) X-Received: by 10.52.230.202 with SMTP id ta10mr621551vdc.41.1386238123635; Thu, 05 Dec 2013 02:08:43 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp2672vcz; Thu, 5 Dec 2013 02:08:43 -0800 (PST) X-Received: by 10.204.117.196 with SMTP id s4mr7903958bkq.40.1386238122532; Thu, 05 Dec 2013 02:08:42 -0800 (PST) Received: from mail-bk0-f49.google.com (mail-bk0-f49.google.com [209.85.214.49]) by mx.google.com with ESMTPS id n5si12293860bkr.88.2013.12.05.02.08.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 02:08:42 -0800 (PST) Received-SPF: neutral (google.com: 209.85.214.49 is neither permitted nor denied by best guess record for domain of andre.przywara@linaro.org) client-ip=209.85.214.49; Received: by mail-bk0-f49.google.com with SMTP id my13so6913866bkb.8 for ; Thu, 05 Dec 2013 02:08:42 -0800 (PST) X-Received: by 10.204.73.5 with SMTP id o5mr7732473bkj.37.1386238121943; Thu, 05 Dec 2013 02:08:41 -0800 (PST) Received: from slackpad.drs.calxeda.com (g224192075.adsl.alicedsl.de. [92.224.192.75]) by mx.google.com with ESMTPSA id xm9sm28206859bkb.1.2013.12.05.02.08.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Dec 2013 02:08:41 -0800 (PST) From: Andre Przywara To: Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com Cc: julien.grall@linaro.org, George.Dunlap@eu.citrix.com, xen-devel@lists.xenproject.org, patches@linaro.org, Andre Przywara Subject: [PATCH v3 2/6] arm: move GIC SGI kicking into separate function Date: Thu, 5 Dec 2013 11:08:08 +0100 Message-Id: <1386238092-22216-3-git-send-email-andre.przywara@linaro.org> X-Mailer: git-send-email 1.7.12.1 In-Reply-To: <1386238092-22216-1-git-send-email-andre.przywara@linaro.org> References: <1386238092-22216-1-git-send-email-andre.przywara@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: andre.przywara@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Currently we unconditionally send SGIs to all cores on SMP bringup. Those SGIs (software generated interrupts) are to push a secondary core through a gate in Xen code to filter the right CPU. With PSCI we can explicitly specify the core to startup, so we don't need the GIC kick here. So we move the GIC kick into a function and call it explicitly from the platforms that need it. This gets us get rid of the empty cpu_up() platform functions in ARM32 and the comment in there. Signed-off-by: Andre Przywara --- xen/arch/arm/arm64/smpboot.c | 2 +- xen/arch/arm/platform.c | 2 +- xen/arch/arm/platforms/exynos5.c | 11 +---------- xen/arch/arm/platforms/omap5.c | 11 +---------- xen/arch/arm/platforms/vexpress.c | 10 +--------- xen/arch/arm/smpboot.c | 15 ++++++++++----- xen/include/asm-arm/smp.h | 2 ++ 7 files changed, 17 insertions(+), 36 deletions(-) diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c index 8696ed6..6a34bd4 100644 --- a/xen/arch/arm/arm64/smpboot.c +++ b/xen/arch/arm/arm64/smpboot.c @@ -38,7 +38,7 @@ static int __init smp_spin_table_cpu_up(int cpu) sev(); - return 0; + return cpu_up_send_sgi(cpu); } static void __init smp_spin_table_init(int cpu, struct dt_device_node *dn) diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c index 5ed8eb2..e13a354 100644 --- a/xen/arch/arm/platform.c +++ b/xen/arch/arm/platform.c @@ -112,7 +112,7 @@ int __init platform_cpu_up(int cpu) if ( platform && platform->cpu_up ) return platform->cpu_up(cpu); - return -EAGAIN; + return -ENODEV; } int __init platform_smp_init(void) diff --git a/xen/arch/arm/platforms/exynos5.c b/xen/arch/arm/platforms/exynos5.c index fa6b465..65e584f 100644 --- a/xen/arch/arm/platforms/exynos5.c +++ b/xen/arch/arm/platforms/exynos5.c @@ -85,15 +85,6 @@ static int __init exynos5_smp_init(void) return 0; } -static int __init exynos5_cpu_up(int cpu) -{ - /* Nothing to do here, the generic sev() will suffice to kick CPUs - * out of either the firmware or our own smp_up_cpu gate, - * depending on where they have ended up. */ - - return 0; -} - static void exynos5_reset(void) { void __iomem *pmu; @@ -132,7 +123,7 @@ PLATFORM_START(exynos5, "SAMSUNG EXYNOS5") .init_time = exynos5_init_time, .specific_mapping = exynos5_specific_mapping, .smp_init = exynos5_smp_init, - .cpu_up = exynos5_cpu_up, + .cpu_up = cpu_up_send_sgi, .reset = exynos5_reset, .blacklist_dev = exynos5_blacklist_dev, PLATFORM_END diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c index 3a3b16b..423d11b 100644 --- a/xen/arch/arm/platforms/omap5.c +++ b/xen/arch/arm/platforms/omap5.c @@ -144,15 +144,6 @@ static int __init omap5_smp_init(void) return 0; } -static int __init omap5_cpu_up(int cpu) -{ - /* Nothing to do here, the generic sev() will suffice to kick CPUs - * out of either the firmware or our own smp_up_cpu gate, - * depending on where they have ended up. */ - - return 0; -} - static const char const *omap5_dt_compat[] __initconst = { "ti,omap5", @@ -164,7 +155,7 @@ PLATFORM_START(omap5, "TI OMAP5") .init_time = omap5_init_time, .specific_mapping = omap5_specific_mapping, .smp_init = omap5_smp_init, - .cpu_up = omap5_cpu_up, + .cpu_up = cpu_up_send_sgi, PLATFORM_END /* diff --git a/xen/arch/arm/platforms/vexpress.c b/xen/arch/arm/platforms/vexpress.c index 9056366..6132056 100644 --- a/xen/arch/arm/platforms/vexpress.c +++ b/xen/arch/arm/platforms/vexpress.c @@ -144,14 +144,6 @@ static int __init vexpress_smp_init(void) return 0; } -static int __init vexpress_cpu_up(int cpu) -{ - /* Nothing to do here, the generic sev() will suffice to kick CPUs - * out of either the firmware or our own smp_up_cpu gate, - * depending on where they have ended up. */ - - return 0; -} #endif static const char * const vexpress_dt_compat[] __initconst = @@ -180,7 +172,7 @@ PLATFORM_START(vexpress, "VERSATILE EXPRESS") .compatible = vexpress_dt_compat, #ifdef CONFIG_ARM_32 .smp_init = vexpress_smp_init, - .cpu_up = vexpress_cpu_up, + .cpu_up = cpu_up_send_sgi, #endif .reset = vexpress_reset, .blacklist_dev = vexpress_blacklist_dev, diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index bd76d14..8d96c17 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -343,6 +343,16 @@ void stop_cpu(void) wfi(); } +int __init cpu_up_send_sgi(int cpu) +{ + /* We don't know the GIC ID of the CPU until it has woken up, so just + * signal everyone and rely on our own smp_up_cpu gate to ensure only + * the one we want gets through. */ + send_SGI_allbutself(GIC_SGI_EVENT_CHECK); + + return 0; +} + /* Bring up a remote CPU */ int __cpu_up(unsigned int cpu) { @@ -376,11 +386,6 @@ int __cpu_up(unsigned int cpu) return rc; } - /* We don't know the GIC ID of the CPU until it has woken up, so just signal - * everyone and rely on our own smp_up_cpu gate to ensure only the one we - * want gets through. */ - send_SGI_allbutself(GIC_SGI_EVENT_CHECK); - while ( !cpu_online(cpu) ) { cpu_relax(); diff --git a/xen/include/asm-arm/smp.h b/xen/include/asm-arm/smp.h index 1485cc6..a1de03c 100644 --- a/xen/include/asm-arm/smp.h +++ b/xen/include/asm-arm/smp.h @@ -21,6 +21,8 @@ extern int arch_smp_init(void); extern int arch_cpu_init(int cpu, struct dt_device_node *dn); extern int arch_cpu_up(int cpu); +int cpu_up_send_sgi(int cpu); + /* Secondary CPU entry point */ extern void init_secondary(void);