Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F733C433ED for ; Thu, 13 May 2021 17:55:53 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B1820611CE for ; Thu, 13 May 2021 17:55:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B1820611CE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.127023.238669 (Exim 4.92) (envelope-from ) id 1lhFYY-0002Zg-3y; Thu, 13 May 2021 17:55:30 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 127023.238669; Thu, 13 May 2021 17:55:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lhFYY-0002ZZ-17; Thu, 13 May 2021 17:55:30 +0000 Received: by outflank-mailman (input) for mailman id 127023; Thu, 13 May 2021 17:55:29 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lhFYX-0002ZT-8j for xen-devel@lists.xenproject.org; Thu, 13 May 2021 17:55:29 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lhFYV-0007mi-Nt; Thu, 13 May 2021 17:55:27 +0000 Received: from [54.239.6.186] (helo=a483e7b01a66.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lhFYV-0003tR-HY; Thu, 13 May 2021 17:55:27 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=83YPJzuVB7giuX9ioaeST6gflKL5uVIQXnDpdoZ07PQ=; b=j4YGJHFiJ7UU629Eeg35Y0Fedt DMSm5R+bG+gKy6ox79i23e5GZ6ABo3J9+Xgw/t7JHnAuf+GbTjV1aO80rZGt7bF9JokE8iOq4IRWM 1UYuJRhPgSgWjk2xLeF9c1PXSsCzi0ZJHNq6QkEf51qVcd7/4rGT21GX7ZOJjtQVnbmw=; Subject: Re: [PATCH RFCv2 09/15] xen/arm32: mm: Re-implement setup_xenheap_mappings() using map_pages_to_xen() To: Stefano Stabellini Cc: xen-devel@lists.xenproject.org, Wei.Chen@arm.com, Henry.Wang@arm.com, Penny.Zheng@arm.com, Bertrand.Marquis@arm.com, Julien Grall , Volodymyr Babchuk References: <20210425201318.15447-1-julien@xen.org> <20210425201318.15447-10-julien@xen.org> From: Julien Grall Message-ID: Date: Thu, 13 May 2021 18:55:25 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Hi Stefano, On 12/05/2021 23:07, Stefano Stabellini wrote: > On Sun, 25 Apr 2021, Julien Grall wrote: >> From: Julien Grall >> >> Now that map_pages_to_xen() has been extended to support 2MB mappings, >> we can replace the create_mappings() call by map_pages_to_xen() call. >> >> Signed-off-by: Julien Grall >> >> --- >> Changes in v2: >> - New patch >> >> TODOs: >> - add support for contiguous mapping >> --- >> xen/arch/arm/mm.c | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c >> index 5c17cafff847..19ecf73542ce 100644 >> --- a/xen/arch/arm/mm.c >> +++ b/xen/arch/arm/mm.c >> @@ -806,7 +806,12 @@ void mmu_init_secondary_cpu(void) >> void __init setup_xenheap_mappings(unsigned long base_mfn, >> unsigned long nr_mfns) >> { >> - create_mappings(xen_second, XENHEAP_VIRT_START, base_mfn, nr_mfns, MB(32)); >> + int rc; >> + >> + rc = map_pages_to_xen(XENHEAP_VIRT_START, base_mfn, nr_mfns, >> + PAGE_HYPERVISOR_RW | _PAGE_BLOCK); >> + if ( rc ) >> + panic("Unable to setup the xenheap mappings.\n"); >> >> /* Record where the xenheap is, for translation routines. */ >> xenheap_virt_end = XENHEAP_VIRT_START + nr_mfns * PAGE_SIZE; > > I get the following build error: > > mm.c: In function ‘setup_xenheap_mappings’: > mm.c:811:47: error: incompatible type for argument 2 of ‘map_pages_to_xen’ > rc = map_pages_to_xen(XENHEAP_VIRT_START, base_mfn, nr_mfns, > ^~~~~~~~ > In file included from mm.c:24:0: > /local/repos/xen-upstream/xen/include/xen/mm.h:89:5: note: expected ‘mfn_t {aka struct }’ but argument is of type ‘long unsigned int’ > int map_pages_to_xen( > ^~~~~~~~~~~~~~~~ > > I think base_mfn needs to be converted to mfn_t You are right. I think my scripts are build testing arm32 with debug=n. I will fix it and respin. Cheers, -- Julien Grall