From patchwork Thu Dec 15 06:13:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 88111 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp619426qgi; Wed, 14 Dec 2016 22:15:26 -0800 (PST) X-Received: by 10.107.176.197 with SMTP id z188mr1089470ioe.7.1481782526789; Wed, 14 Dec 2016 22:15:26 -0800 (PST) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id j9si945621itj.82.2016.12.14.22.15.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Dec 2016 22:15:26 -0800 (PST) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cHPIC-00063Q-9l; Thu, 15 Dec 2016 06:13:24 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cHPIB-00063K-76 for xen-devel@lists.xenproject.org; Thu, 15 Dec 2016 06:13:23 +0000 Received: from [193.109.254.147] by server-5.bemta-6.messagelabs.com id 0F/3C-11476-28432585; Thu, 15 Dec 2016 06:13:22 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphkeJIrShJLcpLzFFi42Lxqg3W1200CYo wWNNrYfF9y2QmB0aPwx+usAQwRrFm5iXlVySwZnzcFlDQKlCx7UlyA+N+3i5GLg4hgRmMEgt2 b2TvYuTkYBFoZ5b4/dgSJCEh8I5FYvmOq0wgCQmBGImNHxexQ9hVEsdvT2MDsYUEtCSOnprNC mG3MEnc/JjfxcjBwSZgIjGrQwIkLCKgJHFv1WSwMcwCoRL/nrWBjREWSJCY8GoSM8ReVYmGpv 1gY3gFvCV6r76GWiUncfNcJ/MERr4FjAyrGDWKU4vKUot0jUz1kooy0zNKchMzc3QNDcz0clO LixPTU3MSk4r1kvNzNzECQ4QBCHYwrloQeIhRkoNJSZT3kFFQhBBfUn5KZUZicUZ8UWlOavEh RhkODiUJ3qvGQDnBotT01Iq0zBxgsMKkJTh4lER4mYABK8RbXJCYW5yZDpE6xajLsaNzzVMmI Za8/LxUKXHeqSAzBECKMkrz4EbAIucSo6yUMC8j0FFCPAWpRbmZJajyrxjFORiVhHkTQKbwZO aVwG16BXQEE9ARokv8QY4oSURISTUwatedy1t54sbtfbMa1D6ctE04FldZnS6o+dLY+cO2wjU HnldOUH/4I3+erOR/2TyLt4ueHy5Vzjn3RqY44NSvAkc+o6LQ6WZt1WwX9r5Q8P+2qkhd/tfK nR7Z8kckJzelzsicrnR6SpHP0+vl1qJMmzNEVRIiym3eTzJozVnypTCvxu/XuUWsSizFGYmGW sxFxYkAIkqniZcCAAA= X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-9.tower-27.messagelabs.com!1481782400!77562182!1 X-Originating-IP: [74.125.83.47] 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 10634 invoked from network); 15 Dec 2016 06:13:21 -0000 Received: from mail-pg0-f47.google.com (HELO mail-pg0-f47.google.com) (74.125.83.47) by server-9.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 15 Dec 2016 06:13:21 -0000 Received: by mail-pg0-f47.google.com with SMTP id p66so16528752pga.2 for ; Wed, 14 Dec 2016 22:13:21 -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=Dw6lRb4PzB9hjB9wPyLvQX1yM5vNI5Ot0OCfaS/pD30=; b=f6QrkFUb4ShqmTSCUDnmyjuy9Z9KiKP0z9vxFhfQj5i2K7m+d8eDqRgw8My7AnmRJF SQ/BEOMf6v1qXlSSDDMUwx+jXGR56vkBF7BSvvQ6Su13VQ4TszwEIjUv571uuvN1lL/1 PR90UrKdGWvyEUPk1meLVq+T26BE4fNU/AHMI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Dw6lRb4PzB9hjB9wPyLvQX1yM5vNI5Ot0OCfaS/pD30=; b=b6Ecyh9oNFZPwE+RzaZH8Zqv7qtO3vgNlIytVd06xUpYVzS+/4w9P0YhrLeLmz7CZr ljQbtsN27MRIeCwIzzlt67laGQLWe5V4nAxTUvegpKh1ZfMT0Pxf+JHK/5tJZYT2q8an FDoFLOz+w3RzCVVghkQLesxLoqsWFA8uJYeDqrHgGacVIWxr/FOeK2ABUjcoyl56EjRh 7d+WnamM80qWa+UbzivmSzSXFPc5o0wZZZUqMBMkKZahS+tMlA5mhlWW8gtScCP2lHq2 pyqF65wo5bD7yt1M3a76kvRWljzPlOJk7Xlotl1fys3yJR4Kfocm4Dw4Bv/Z/EjT7juX GohQ== X-Gm-Message-State: AKaTC00d1Ackgq5vylXM9tSpkjh3zl1v22L5rMevzYwJQ51yM03pCcK36rq348g0hnTedmVW X-Received: by 10.99.99.195 with SMTP id x186mr1311761pgb.100.1481782400446; Wed, 14 Dec 2016 22:13:20 -0800 (PST) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([202.46.23.54]) by smtp.gmail.com with ESMTPSA id 64sm1097985pfu.17.2016.12.14.22.13.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Dec 2016 22:13:19 -0800 (PST) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Thu, 15 Dec 2016 11:43:13 +0530 Message-Id: <1481782394-14285-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" 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 | 5 ++++- xen/arch/arm/setup.c | 2 -- xen/include/asm-arm/p2m.h | 3 --- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index cc5634b..2327509 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1241,7 +1241,7 @@ static spinlock_t vmid_alloc_lock = SPIN_LOCK_UNLOCKED; */ static DECLARE_BITMAP(vmid_mask, MAX_VMID); -void p2m_vmid_allocator_init(void) +static void p2m_vmid_allocator_init(void) { set_bit(INVALID_VMID, vmid_mask); } @@ -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);