From patchwork Mon Sep 19 02:08:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 9338435 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AD854601C2 for ; Mon, 19 Sep 2016 02:11:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9931128EAB for ; Mon, 19 Sep 2016 02:11:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BBA428EAF; Mon, 19 Sep 2016 02:11:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0F3CC28EAB for ; Mon, 19 Sep 2016 02:11:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blo1Z-0004Gu-SP; Mon, 19 Sep 2016 02:09:37 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blo1Y-0004Fv-H0 for xen-devel@lists.xen.org; Mon, 19 Sep 2016 02:09:36 +0000 Received: from [85.158.143.35] by server-10.bemta-6.messagelabs.com id 4B/7E-27438-FD84FD75; Mon, 19 Sep 2016 02:09:35 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFIsWRWlGSWpSXmKPExsVyMfTAEd37Hvf DDZqvMFss+biYxYHR4+ju30wBjFGsmXlJ+RUJrBn9i7ewFTzgqGid9om5gfENWxcjF4eQwARG iTNH1zCBOCwCL1kkbm7YzAjiSAj0s0pM7mhi7mLkBHJiJCb87YeyyyXe3L3OCGILCahIzN3Uw wgxajqTxJ3Pn1hBEmwC0hJ7LixlhGjQkFh69D4rSJGIQD+jxJvDc8GKmAUsJc5v+MgOYgsL+E pc3NENtoFFQFXi+M3jYDavgIPE1v4l7BCD5CSuz5zOBGJzCjhKTGh4yQ5xhYPEgSO/2ScwCi5 gZFjFqFGcWlSWWqRrZKiXVJSZnlGSm5iZo2toYKaXm1pcnJiempOYVKyXnJ+7iREYdgxAsIPx z7KAQ4ySHExKorw7Su6FC/El5adUZiQWZ8QXleakFh9ilOHgUJLg9XC/Hy4kWJSanlqRlpkDj ACYtAQHj5IIbyxImre4IDG3ODMdInWK0ZJjy+9ra5k4tiy4ASS3Tb23lkmIJS8/L1VKnFccpE EApCGjNA9uHCxKLzHKSgnzMgIdKMRTkFqUm1mCKv+KUZyDUUmYNwhkCk9mXgnc1ldABzEBHbR 61m2Qg0oSEVJSDYyzZ25QybToarAuyVJ7FXdbYDe7KsPxJUsXP7PTVVq43Hh/ZTUvk0DO6nWO b67V8HHMa7pVIM14PFLh0lFz39hd3F0JMgVfqu7yfVn0fWKjgE9h9baWDJVb+Q5Zqal6+y5UO bPs7pz945mNpmS9bpjT5vZ9CWV7WI8oTlO+t6Cdddnu05rb3iuxFGckGmoxFxUnAgB3sjJ4zQ IAAA== X-Env-Sender: van.freenix@gmail.com X-Msg-Ref: server-13.tower-21.messagelabs.com!1474250973!33878176!1 X-Originating-IP: [209.85.192.196] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 24585 invoked from network); 19 Sep 2016 02:09:34 -0000 Received: from mail-pf0-f196.google.com (HELO mail-pf0-f196.google.com) (209.85.192.196) by server-13.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 19 Sep 2016 02:09:34 -0000 Received: by mail-pf0-f196.google.com with SMTP id q2so3812572pfj.0 for ; Sun, 18 Sep 2016 19:09:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=88dL8awCFb6qEwKRXoVkiOnVIUYd1R/COj4m3QoQbzA=; b=FOVlyiUeTmMivfH99p+zjNNJhFF1+42hvdTj9PxC3Yrd/gCRrDvYimPRsNXB7Te5VB 4GEIRMFEAcADqCJ5nkQe3S+BCgiOg1i4bRaMEnI+AD803aP6FpzGGTv3CP06+wlprjQ1 +G4MM+eciIx4R4r5El/odF8Z7reqBc0LYXHqlqrNyyNsCxOPKK05hi+bvMXpySS6ABZo QN4cGp+BDLTEFNoedqyjKhwQ09ZGEFoHKkjRFQSSVqCB8PrmfQQgZ8jKkjRCaRCOeP14 NN6wE8ZOPDnZQ/CAdI/bO3CwkXpIE03+1qLxagH59DTyxUU0VO9BS9v4K7wQgUVNVjb7 LJCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=88dL8awCFb6qEwKRXoVkiOnVIUYd1R/COj4m3QoQbzA=; b=HrLuasr6KBYy46+yrjRJ6eANOPPHL+9vAEPx3AaMnsKUvW909gRVKoTKAmJ+IGQmzx kY6YhAH0Ypd76z5I0M9RiGpsyrsfrsiGxuj6r3H5cxbCrUsq07U2Uf1VaLJQZeCEWKXa /Q5gD/d589FnrCbcy5SkG1oFvtXjTB3bOkwWnB4Ev0tYWWRDmVtJf5sLLe42fels5MRv VroANorqTWGB1VQRSuog4QfqnMh1HRB64+R1d18pz2xUijnD6GSeH9Ok63TkvzvzjsE2 UTKZoLSJ0y68iSohVfKjvUhpnRSK1YchNC/ynw2VGKB7GZ7RozyFG/Zz9UUNdB2btxpJ NNTw== X-Gm-Message-State: AE9vXwPTsW+D0Q0Mcj0Bae3iCsZCTa1e5x4ZBBN4Muh5NnBpxGyydGQ2t4SLa4ZEjefPuQ== X-Received: by 10.98.0.69 with SMTP id 66mr42535895pfa.140.1474250973532; Sun, 18 Sep 2016 19:09:33 -0700 (PDT) Received: from linux-u7w5.ap.freescale.net (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id i68sm66777180pfc.25.2016.09.18.19.09.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Sep 2016 19:09:33 -0700 (PDT) From: van.freenix@gmail.com X-Google-Original-From: peng.fan@nxp.com To: julien.grall@arm.com, sstabellini@kernel.org, jbeulich@suse.com, andrew.cooper3@citrix.com, jgross@suse.com, dario.faggioli@citrix.com Date: Mon, 19 Sep 2016 10:08:56 +0800 Message-Id: <1474250936-27962-6-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.6.6 In-Reply-To: <1474250936-27962-1-git-send-email-peng.fan@nxp.com> References: <1474250936-27962-1-git-send-email-peng.fan@nxp.com> Cc: Peng Fan , xen-devel@lists.xen.org Subject: [Xen-devel] [RFC 5/5] xen/arm: cpupool: implement arch_domain_cpupool_compatible X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Peng Fan When migrating domain between different cpupools, need to check whether the domain is compatible with the cpupool. Signed-off-by: Peng Fan Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/cpupool.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/cpupool.c b/xen/arch/arm/cpupool.c index 74a5ef3..6c1c092 100644 --- a/xen/arch/arm/cpupool.c +++ b/xen/arch/arm/cpupool.c @@ -41,5 +41,20 @@ int arch_cpupool_cpu_add(struct cpupool *c, unsigned int cpu) bool_t arch_domain_cpupool_compatible(struct domain *d, struct cpupool *c) { - return true; + if ( !d->vcpu || !d->vcpu[0] ) + { + /* + * We are in process of domain creation, vcpu not constructed or + * initialiszed, ok to move domain from cpupool0 to other pool + */ + return true; + } + else if ( d->vcpu[0] ) + { + return !!( d->vcpu[0]->arch.vpidr == c->info.midr ); + } + else + { + return false; + } }