From patchwork Fri Dec 16 07:16:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 9477321 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 F1D58601C2 for ; Fri, 16 Dec 2016 07:19:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E700027A98 for ; Fri, 16 Dec 2016 07:19:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA3D228868; Fri, 16 Dec 2016 07:19:15 +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 55EBC27A98 for ; Fri, 16 Dec 2016 07:19: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 1cHmky-0000Pb-7G; Fri, 16 Dec 2016 07:16:40 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cHmkw-0000PV-6S for xen-devel@lists.xenproject.org; Fri, 16 Dec 2016 07:16:38 +0000 Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id 25/65-12823-5D493585; Fri, 16 Dec 2016 07:16:37 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplkeJIrShJLcpLzFFi42Lxqg3W170yJTj CoOeSqcX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmvFxW0BBq0DFtifJDYz7ebsYuTiEBKYxSnw/ v4QZxGERaGeW2HLpHCOIIyHwjkXi2oOdQA4nkBMjcejkOXYIu1Ji4rSpYLaQgJbE0VOzWSFGN TNJNOw6A+RwcLAJmEjM6pAAqRERUJK4t2oyE4jNLBAq8e9ZG1ivsECKxJlpO1hAbBYBVYkf7Z uYQWxeAW+Jm+umMUPskpO4ea6TeQIj3wJGhlWM6sWpRWWpRbqmeklFmekZJbmJmTm6hgbGerm pxcWJ6ak5iUnFesn5uZsYgUFSz8DAuIPx8lenQ4ySHExKorxeucERQnxJ+SmVGYnFGfFFpTmp xYcYZTg4lCR4fSYD5QSLUtNTK9Iyc4DhCpOW4OBREuHdOQEozVtckJhbnJkOkTrFqMuxo3PNU yYhlrz8vFQpcd6FIDMEQIoySvPgRsBi5xKjrJQwLyMDA4MQT0FqUW5mCar8K0ZxDkYlYV4ZkC k8mXklcJteAR3BBHSE6BJ/kCNKEhFSUg2Mx/at2Ja1a9NFXs5r+5Mc9i0KmLyvTvxrhfJjj3u +f06Zce2wN99SPPtV8PSFhzQL87bu3fmYu26Wj++Zfvl/Nh7BRyPuBsy0fbDw6ekHsy7c3iRt G7Zpj3ScSMHxYx8sZaoYOqq7ZLf9lb3p+/27h7jm7rsJqQI735+Q+WQkZu3EpJf2/bboBSWW4 oxEQy3mouJEANwGEROYAgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-12.tower-31.messagelabs.com!1481872595!59625432!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 28058 invoked from network); 16 Dec 2016 07:16:36 -0000 Received: from mail-pg0-f47.google.com (HELO mail-pg0-f47.google.com) (74.125.83.47) by server-12.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 16 Dec 2016 07:16:36 -0000 Received: by mail-pg0-f47.google.com with SMTP id 3so29258262pgd.0 for ; Thu, 15 Dec 2016 23:16:36 -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=e6NzQ6+BNiu7aqlpwWv/VVlqHxARCa90hIq/im12Fb4k2WwPe4JBtx59v43k4jnQeA esu0VlgS9dU9LRlyJn30owRPyebzfCCLk0wAV+yLEyw3PqZxYydRPmOpYgvMrWEcpYll PnfNWDye97/7RZmsanJ+Tl1mqnAua6GM2QM9A= 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=SKRZvzIIKxqlDZlUuGBAOkPaVjtJQ8WqhHr8arFJXu53brz7DqBJDERa3VC+Hwr5wK 6qcK9F1ffooiyxCTXCl/vuwIvnmHTMvzO5GKNDSSQt0pDinYC8Kv+3CcMBJIWlWP2S0E HJqaFfu9zQRN2YN0Su114FwZWtukwX0cB4QF/Gd1k57MxVnv7p574gLaL7IF7YIjFNfc aPulDNONaGQSmjtItrBsFJwwZpHkf+TAMy7FOV2yJqjehvYLujBXAZFLEZ1m9Xub3eXQ PKN0LVF6h0G8wiMuSwUQeIYZRifRCGseuzZZp45tPNo3gyFZ7yCP9LIpQc5XAxfLMCHS xiKQ== X-Gm-Message-State: AKaTC00NO1qpmqauEt2mOPWlykmphDdzCEn3gaR4Dtez4EIF2GfSBR0HkL9zH3u/DFTeADpG X-Received: by 10.84.225.129 with SMTP id u1mr3786594plj.110.1481872595205; Thu, 15 Dec 2016 23:16:35 -0800 (PST) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([202.46.23.54]) by smtp.gmail.com with ESMTPSA id 2sm9198699pgy.27.2016.12.15.23.16.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Dec 2016 23:16:34 -0800 (PST) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Fri, 16 Dec 2016 12:46:27 +0530 Message-Id: <1481872588-10876-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 RESEND v5 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 | 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);