From patchwork Wed Jun 8 06:54:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiandi An X-Patchwork-Id: 9163435 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 A6C3260467 for ; Wed, 8 Jun 2016 06:57:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 735FC2810E for ; Wed, 8 Jun 2016 06:57:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6491E2838D; Wed, 8 Jun 2016 06:57:16 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 C98C32810E for ; Wed, 8 Jun 2016 06:57:15 +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 1bAXOP-0003Sc-SM; Wed, 08 Jun 2016 06:55:09 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bAXOO-0003SW-GA for xen-devel@lists.xen.org; Wed, 08 Jun 2016 06:55:08 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id 53/06-21858-B41C7575; Wed, 08 Jun 2016 06:55:07 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPLMWRWlGSWpSXmKPExsVybKJsgq73wfB wg3MbhS2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oy1R64yFsznr9ixOLuB8R5PFyMnh5BAkcSn RWtYQGwJgWiJdRuOsUPYfBIXX/xggrBrJR6efsrYxcgFVH+dSeLCystgRWwCmhLHls0Gs0UEp CWufb7MCGIzC6RK7L5/lBXEFhaIkDj47QZbFyMHB4uAqsTH5ZwgYV4BN4lts7czQ8xXkDi+fR vjBEaeBYwMqxjVi1OLylKLdA31kooy0zNKchMzc3QNDYz1clOLixPTU3MSk4r1kvNzNzECPc4 ABDsYl390OsQoycGkJMqr6B4eLsSXlJ9SmZFYnBFfVJqTWnyIUYaDQ0mCt/wAUE6wKDU9tSIt MwcYejBpCQ4eJRFef5A0b3FBYm5xZjpE6hSjopQ478/9QAkBkERGaR5cGyzcLzHKSgnzMgIdI sRTkFqUm1mCKv+KUZyDUUmYNxpkPE9mXgnc9FdAi5mAFrN8DQNZXJKIkJJqYOQobpbYnlvguX XxjGfLbk9mut76r3/tl1DdCb2fw22cMyyUuTZ3vXmfdmrmbbU2GTXld5Y1Z62Ygy//Oaq9miP 3Z+uGY8293UanHyaVztF383X5HL/BOkrxaF37Cq/Xi/WVHzCo/i2cYds2Pbdpyb7XORLP4x2U eG2m/vC+eUvn5v8HBl9d+5RYijMSDbWYi4oTAVH639JyAgAA X-Env-Sender: anjiandi@codeaurora.org X-Msg-Ref: server-3.tower-31.messagelabs.com!1465368905!44278821!1 X-Originating-IP: [198.145.29.96] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 51845 invoked from network); 8 Jun 2016 06:55:07 -0000 Received: from smtp.codeaurora.org (HELO smtp.codeaurora.org) (198.145.29.96) by server-3.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 8 Jun 2016 06:55:07 -0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E71D061386; Wed, 8 Jun 2016 06:55:04 +0000 (UTC) Received: from anjiandi-ubuntu.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: anjiandi@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id DB0716121B; Wed, 8 Jun 2016 06:55:03 +0000 (UTC) From: Jiandi An To: xen-devel@lists.xen.org Date: Wed, 8 Jun 2016 01:54:59 -0500 Message-Id: <1465368899-7127-1-git-send-email-anjiandi@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 Cc: julien.grall@arm.com, sstabellini@kernel.org, anjiandi@codeaurora.org, shankerd@codeaurora.org Subject: [Xen-devel] [PATCH] arm/domain: allocate pages according to the order of struct domain size 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 As the number of CPUs supported on the system grows, number of GIC redistributors and mmio handlers increase. We need to increase MAX_RDIST_COUNT and MAX_IO_HANDLER which makes size of struct domain bigger than one page. Remove the BUILD_BUG_ON check for if size of struct domain is greater than PAGE_SIZE. And allocate xenheap pages according to the order of the size of struct domain. Signed-off-by: Jiandi An --- xen/arch/arm/domain.c | 5 +++-- xen/include/asm-arm/gic.h | 2 +- xen/include/asm-arm/mmio.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 1365b4a..7f69236 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -438,8 +438,9 @@ void startup_cpu_idle_loop(void) struct domain *alloc_domain_struct(void) { struct domain *d; - BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE); - d = alloc_xenheap_pages(0, 0); + unsigned int order = get_order_from_bytes(sizeof(*d)); + + d = alloc_xenheap_pages(order, 0); if ( d == NULL ) return NULL; diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h index cd97bb2..8165de6 100644 --- a/xen/include/asm-arm/gic.h +++ b/xen/include/asm-arm/gic.h @@ -20,7 +20,7 @@ #define NR_GIC_LOCAL_IRQS NR_LOCAL_IRQS #define NR_GIC_SGI 16 -#define MAX_RDIST_COUNT 4 +#define MAX_RDIST_COUNT 64 #define GICD_CTLR (0x000) #define GICD_TYPER (0x004) diff --git a/xen/include/asm-arm/mmio.h b/xen/include/asm-arm/mmio.h index da1cc2e..798d373 100644 --- a/xen/include/asm-arm/mmio.h +++ b/xen/include/asm-arm/mmio.h @@ -23,7 +23,7 @@ #include #include -#define MAX_IO_HANDLER 16 +#define MAX_IO_HANDLER 32 typedef struct {