From patchwork Sun May 28 17:12:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 9752575 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 44547602F0 for ; Sun, 28 May 2017 17:15:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28D2B27E63 for ; Sun, 28 May 2017 17:15:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A20026E4E; Sun, 28 May 2017 17:15:03 +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 63FDD26E4E for ; Sun, 28 May 2017 17:15:02 +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 1dF1js-0002ha-HI; Sun, 28 May 2017 17:12:24 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dF1js-0002hU-7A for xen-devel@lists.xenproject.org; Sun, 28 May 2017 17:12:24 +0000 Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id A5/F4-19466-7F40B295; Sun, 28 May 2017 17:12:23 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAIsWRWlGSWpSXmKPExsVysyfVTfcbi3a kwcEuTYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNeNMayNLwSzpit8PTBsYt4l2MXJxCAlsYpRY t/0YG4Szj1Fizec5zF2MnBzCAuYSv+c9YOli5OAQEZCWWDpPE6JmD5PE0VOHWUAcZoEeRomXr a9YQRrYBDQl7nz+xARi8wpYSdy79oUdxGYRUJXoPrILbKioQLjE28YjLBA1ghInZz4BszkFAi WeHjsHZjMLqEv8mXeJGcKWl9j+dg7zBEa+WUhaZiEpm4WkbAEj8ypG9eLUorLUIl1LvaSizPS MktzEzBxdQwNTvdzU4uLE9NScxKRiveT83E2MwHBjAIIdjGtbnQ8xSnIwKYnyKt7XihTiS8pP qcxILM6ILyrNSS0+xCjDwaEkwdvLrB0pJFiUmp5akZaZAwx8mLQEB4+SCG85SJq3uCAxtzgzH SJ1itGYY8Pq9V+YOO70bfjCJMSSl5+XKiXO2wVSKgBSmlGaBzcIFpGXGGWlhHkZgU4T4ilILc rNLEGVf8UozsGoJMy7CGQKT2ZeCdy+V0CnMAGd4ntOHeSUkkSElFQDYwXTpr4d1+oWzOopiyt mu2A7y+3O+8sJDed4zhZfkDly5m/3YUv+LVNf1Je97eeQnXxSbp4SV8XObd85Jd04pocFtnVE dopzcKWu2pqy9MS13v/rPqVW1JcslzNapW3xcOWL9tTLqm62E5iEl+yVlVoXl1hlFvlG9HKj/ bUA6SuhqeEWZUaHlFiKMxINtZiLihMBiz/Vq8MCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-10.tower-206.messagelabs.com!1495991542!72217684!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 53884 invoked from network); 28 May 2017 17:12:22 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-10.tower-206.messagelabs.com with SMTP; 28 May 2017 17:12:22 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E06CB344; Sun, 28 May 2017 10:12:20 -0700 (PDT) Received: from [192.168.0.6] (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 669423F41F; Sun, 28 May 2017 10:12:19 -0700 (PDT) To: Feng Kan References: From: Julien Grall Message-ID: <15f6b693-c77a-bc9f-fbb9-b2d23a486211@arm.com> Date: Sun, 28 May 2017 18:12:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Cc: xen-devel@lists.xenproject.org, nd@arm.com, sstabellini@kernel.org, Wei Liu , Ian Jackson Subject: Re: [Xen-devel] xl create failure on arm64 with XEN 4.9rc6 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi, On 05/26/2017 11:22 PM, Feng Kan wrote: > On Fri, May 26, 2017 at 5:40 AM, Julien Grall wrote: >> >> >> On 26/05/17 01:37, Feng Kan wrote: >>> >>> On Thu, May 25, 2017 at 12:56 PM, Julien Grall >>> wrote: >>>> >>>> (CC toolstack maintainers) >>>> >>>> On 25/05/2017 19:58, Feng Kan wrote: >>>>> >>>>> >>>>> Hi All: >>>> >>>> >>>> >>>> Hello, >>>> >>>>> This is not specifically against the XEN 4.9. I am using 4.12rc2 >>>>> kernel on arm64 platform. Started dom0 fine with ACPI enabled, but >>>>> failed when creating the domU guest. Xen is built natively on the >>>>> arm64 platform. Using the same kernel and ramdisk as dom0. Any idea as >>>>> why it is stuck here >>>>> would be greatly appreciated? >>>> >>>> >>>> >>>> The first step would to try a stable release if you can. Also, it would >>>> be >>>> useful if you provide information about the guest (i.e the configuration) >>>> and your .config for the kernel. >>> >>> I am using the default xen_defconfig in the arm64 directory. >> >> >> I am confused. There are no xen_defconfig in the arm64 directory of the >> kernel. So which one are you talking about? > Sorry, my mistake. >> >>> This is >>> very early on >>> in building the domain, would the guest configuration matter? >> >> >> The configuration of DOM0 kernel matters when you want to build the guest. >> That's why I wanted to know what options you enabled. > I see. I am using the default centos 7.2 kernel config plus enabling > the XEN option. (Attached below) Looking at the .config, Linux is using 64KB page granularity. I managed to reproduce the failure (though different error) by using an initramfs > 32MB (smaller works). The patch below should fix the error, can you give it a try? commit c4684b425552a8330f00d7703f3175d721992ab0 Author: Julien Grall Date: Sun May 28 17:50:07 2017 +0100 xen/privcmd: Support correctly 64KB page granularity when mapping memory Commit 5995a68 "xen/privcmd: Add support for Linux 64KB page granularity" did not go far enough to support 64KB in mmap_batch_fn. The variable 'nr' is the number of 4KB chunk to map. However, when Linux is using 64KB page granularity the array of pages (vma->vm_private_data) contain one page per 64KB. Fix it by incrementing st->index correctly. Furthermore, st->va is not correctly incremented as PAGE_SIZE != XEN_PAGE_SIZE. Fixes: 5995a68 ("xen/privcmd: Add support for Linux 64KB page granularity") CC: stable@vger.kernel.org Reported-by: Feng Kan Signed-off-by: Julien Grall Cheers, Tested-by: Feng Kan diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index 7a92a5e..38d9a43 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c @@ -345,7 +345,7 @@ static int mmap_batch_fn(void *data, int nr, void *state) int ret; if (xen_feature(XENFEAT_auto_translated_physmap)) - cur_pages = &pages[st->index]; + cur_pages = &pages[st->index / XEN_PFN_PER_PAGE]; BUG_ON(nr < 0); ret = xen_remap_domain_gfn_array(st->vma, st->va & PAGE_MASK, gfnp, nr, @@ -362,7 +362,7 @@ static int mmap_batch_fn(void *data, int nr, void *state) st->global_error = 1; } } - st->va += PAGE_SIZE * nr; + st->va += XEN_PAGE_SIZE * nr; st->index += nr; return 0;