From patchwork Mon Dec 12 07:26:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 9470099 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 214CA60573 for ; Mon, 12 Dec 2016 07:28:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13E8228454 for ; Mon, 12 Dec 2016 07:28:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08E3F2845A; Mon, 12 Dec 2016 07:28:55 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 7C67328454 for ; Mon, 12 Dec 2016 07:28:54 +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 1cGL0a-0003nO-0n; Mon, 12 Dec 2016 07:26:48 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGL0Z-0003n6-0t for xen-devel@lists.xenproject.org; Mon, 12 Dec 2016 07:26:47 +0000 Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id 22/44-09407-6315E485; Mon, 12 Dec 2016 07:26:46 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplkeJIrShJLcpLzFFi42K5GHpgja5poF+ Ewd99mhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bRY51sBVd4K671TWBvYNzC3cXIxSEkMINR 4vCmFnYQh0WgnVli1vE+NhBHQuAdi8S65y+Yuxg5gZwYifd/fzJC2DUSW6a9BYsLCWhJHD01m xViVCOTxNZdq4G6OTjYBEwkZnVIgNSICChJ3Fs1mQnEZhYIlfj3rI0dxBYWSJCY8GoS2BwWAV WJ731n2UFaeQW8Jd7cF4ZYJSdx81wn8wRGvgWMDKsYNYpTi8pSi3QNLfSSijLTM0pyEzNzdA0 NTPVyU4uLE9NTcxKTivWS83M3MQIDhQEIdjA2bfc8xCjJwaQkyvvD2y9CiC8pP6UyI7E4I76o NCe1+BCjDAeHkgTvogCgnGBRanpqRVpmDjBkYdISHDxKIryxIGne4oLE3OLMdIjUKUZjjmOzF j9l4tjVueYpkxBLXn5eqpQ4706QUgGQ0ozSPLhBsFi6xCgrJczLCHSaEE9BalFuZgmq/CtGcQ 5GJWHeLJApPJl5JXD7XgGdwgR0yvN93iCnlCQipKQaGHcHxyg2pFz3PvWjIrfPXWZ7FFeo6JW jvHtvK1Zxrf9Ud/LG0ub3qj92XNOYtGT/9ENTX1vExzTl2Nd83vtM5N37nvsccmp8zfrTTVTd i4z+vZ5zyqD7NCNHvkLXq5M8zuI3Lcy4T52IeyjyVq+/k5Hrv5JKuvF86e3JPO1LJb0jDARUG h+/U2Ipzkg01GIuKk4EABWrC6GgAgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-9.tower-206.messagelabs.com!1481527603!75007439!1 X-Originating-IP: [209.85.192.172] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 36917 invoked from network); 12 Dec 2016 07:26:44 -0000 Received: from mail-pf0-f172.google.com (HELO mail-pf0-f172.google.com) (209.85.192.172) by server-9.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 12 Dec 2016 07:26:44 -0000 Received: by mail-pf0-f172.google.com with SMTP id c4so11641607pfb.1 for ; Sun, 11 Dec 2016 23:26:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=q0VMzQMh6/Tqes8K3+TGHkFtyRrzixxssY/p1gorA1w=; b=L08wx19/L6Xb/d2eUPQ455dHsVo5u9DJAjRb5edo3gksW60WlDtFpsJlsjLbRonCI3 DEaLbl9jYzEr0u54YS0ND5NzHXWsk8y1ZQjPkeDIFyTNDYR/eigPc+RVw4SnLBraoXr7 CI6upkVAVoDdJbzj7RTYaLHWNcgvWjOn0SW80= 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; bh=q0VMzQMh6/Tqes8K3+TGHkFtyRrzixxssY/p1gorA1w=; b=dZQ0DK+7RtI8WSdRtojufAX9vovw9LPrGyKOGk5J4nk+oVNKYb1mL0iWOPQGpn5l91 al5DZz1uWMht/ksOPd/YkDbdfNrdeM5v0mMoLIAKNfF8TQH8sk4kQ+u7nghEbrhh8/k8 J1ju5baSdvgV6gKjg+MWOeFm2P/tuu8z1L3rDOEnFgngDiSFL/g6LR5x7eQjuj805rZW gTYTnjcvTAki3M0qQ8pjzcPDw0Pvn/BLTZjz38dAJflb9CsbeSBF/3got2xpxO2uNe1a +qXaQuq5UwdWkNC+hrcPu0FZj4st8QuwNsT63XgXxFo2TKnoLowMWMThSHh8ENr4W223 p2Qg== X-Gm-Message-State: AKaTC03862vcMzZrkTdWKapzjDD7ZWrJkJy4XhtfGZpO4shll4kOGa85gzbJ22tcPitVaDry X-Received: by 10.84.217.216 with SMTP id d24mr183129829plj.101.1481527604081; Sun, 11 Dec 2016 23:26:44 -0800 (PST) Received: from blr-ubuntu-linaro.qualcomm.com ([202.46.23.61]) by smtp.gmail.com with ESMTPSA id y89sm73927696pfk.83.2016.12.11.23.26.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 11 Dec 2016 23:26:42 -0800 (PST) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 12 Dec 2016 12:56:37 +0530 Message-Id: <1481527598-15423-1-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 Cc: Julien Grall , Stefano Stabellini Subject: [Xen-devel] [XEN VMID PATCH 1/2] xen/arm: Move p2m_vmid_allocator_init() inside setup_virt_paging() 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 Since VMIDs are related to 2nd stage address translation, it makes more sense to move the call to p2m_vmid_allocator_init(), which initializes the vmid allocation bitmap, inside setup_virt_paging(), where 2nd stage address translation is set up. Signed-off-by: Bhupinder Thakur Reviewed-by: Julien Grall --- xen/arch/arm/p2m.c | 3 +++ xen/arch/arm/setup.c | 2 -- xen/include/asm-arm/p2m.h | 3 --- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index cc5634b..d155c1d 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1659,6 +1659,9 @@ void __init setup_virt_paging(void) #endif printk("P2M: %d levels with order-%d root, VTCR 0x%lx\n", 4 - P2M_ROOT_LEVEL, P2M_ROOT_ORDER, val); + + p2m_vmid_allocator_init(); + /* It is not allowed to concatenate a level zero root */ BUG_ON( P2M_ROOT_LEVEL == 0 && P2M_ROOT_ORDER > 0 ); setup_virt_paging_one((void *)val); diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 38eb888..ac49515 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -789,8 +789,6 @@ void __init start_xen(unsigned long boot_phys_offset, gic_init(); - p2m_vmid_allocator_init(); - softirq_init(); tasklet_subsys_init(); diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h index fdb6b47..0987be2 100644 --- a/xen/include/asm-arm/p2m.h +++ b/xen/include/asm-arm/p2m.h @@ -152,9 +152,6 @@ void p2m_altp2m_check(struct vcpu *v, uint16_t idx) /* Not supported on ARM. */ } -/* Initialise vmid allocator */ -void p2m_vmid_allocator_init(void); - /* Second stage paging setup, to be called on all CPUs */ void setup_virt_paging(void);