From patchwork Wed Mar 27 17:10:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 2352111 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id C1B463FC8C for ; Wed, 27 Mar 2013 17:13:59 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UKtru-0008QL-Hq; Wed, 27 Mar 2013 17:10:34 +0000 Received: from smtp02.citrix.com ([66.165.176.63]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UKtrr-0008PM-QA for linux-arm-kernel@lists.infradead.org; Wed, 27 Mar 2013 17:10:32 +0000 X-IronPort-AV: E=Sophos;i="4.84,920,1355097600"; d="scan'208";a="15200071" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA; 27 Mar 2013 17:10:30 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.2.342.3; Wed, 27 Mar 2013 13:10:30 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1UKtrp-0004FQ-KP; Wed, 27 Mar 2013 17:10:29 +0000 Date: Wed, 27 Mar 2013 17:10:26 +0000 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: Rob Herring Subject: Re: [PATCH v3] [RFC] arm: use PSCI if available In-Reply-To: <51531FE3.8010905@gmail.com> Message-ID: References: <1364388639-11210-1-git-send-email-stefano.stabellini@eu.citrix.com> <20130327133811.GE18429@mudshark.cambridge.arm.com> <51531FE3.8010905@gmail.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130327_131032_013240_22242ABA X-CRM114-Status: GOOD ( 16.30 ) X-Spam-Score: -3.9 (---) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-3.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [66.165.176.63 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -1.3 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: "xen-devel@lists.xensource.com" , "linux@arm.linux.org.uk" , "arnd@arndb.de" , Stefano Stabellini , Marc Zyngier , "nico@linaro.org" , Will Deacon , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Wed, 27 Mar 2013, Rob Herring wrote: > On 03/27/2013 11:23 AM, Stefano Stabellini wrote: > > Would you agree on a patch that moves virt_smp_ops out of mach-virt and > > renames them to psci_smp_ops (maybe to arch/arm/kernel/psci_smp_ops.c)? > > > > Would you agree on initializing psci from setup_arch, right after the > > call to arm_dt_init_cpu_maps()? > > > > Finally the most controversial point: would you agree on using > > psci_smp_ops by default if they are available? > > If not, would you at least agree on letting Xen overwrite the default > > machine smp_ops? > > We need one or the other for dom0 support. > > It should not be *always* use PSCI smp ops if available, but use them > only if the platform does not define its own smp ops. Well, that is the one additional problem that we have on Xen. On x86 Xen replaces a lot of core native function calls with its own implementations (see paravirt_ops). On ARM we only need *one* set of calls: the smp_ops calls. So if we don't want to give priority to PSCI over the platform smp_ops, then we need a simple workaround just for Xen in common code like the one appended below. Not pretty, but at least small: diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 3f6cbb2..08cf7e0 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -43,6 +43,8 @@ #include #include #include +#include +#include #include #include @@ -766,9 +768,13 @@ void __init setup_arch(char **cmdline_p) unflatten_device_tree(); arm_dt_init_cpu_maps(); + xen_early_init(); #ifdef CONFIG_SMP if (is_smp()) { - smp_set_ops(mdesc->smp); + if (xen_domain()) + smp_set_ops(&xen_smp_ops); + else + smp_set_ops(mdesc->smp); smp_init_cpus(); } #endif