[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v6 09/13] xen/arm: Extract MMU-specific MM code


  • To: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Fri, 8 Sep 2023 01:31:36 +0000
  • Accept-language: zh-CN, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qDCzTR6VZpEex9RTkrfVlKNgQl7EGmki4x9mvdIiwMo=; b=YJXjefscVxgPW57TA3vKxOLqu1moDXRLToba06Xos3/seRpYcbJPPrRz45ghjQf2OI3MOfXl9xwK0xzklejp7vhnF79qVnxK/ZruklezBW3jlbbpNXww4J4RowZKwSvrJUf8TEzhczR4+ZwRhkM+OussgrIKB24WNUEVR0cxkn/qqsaHaidPnnk+s4INzdKPrHPy5h8LRafdn0+pEPCe1oW0F54Mt9Hf4E9S+RPv2RdSUbJeHq9FSbpflnandq031cAHgfEyLE2DZwBtRucYOxY+1c9+O4KS/f0Rq+e4TeJ4U/ZBe02xfRRxTWi2UYbr9YwQ1t2tz9yoOW4Ug18SBA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iuUeeGY3YwOxIBNgztISkLkRATbhT/Fe3xwvLvy6pyFQUotcz827fXIq0UFZam8hizIJjMHrQA/Dm/NGwW+CXinQTH0H1mG2Isa0DYFStVoDUN9zUc98oPC+usp7qCha370pmWLDNwbr8DopB4I0b3IOMOpuKma4HjOB/rMBTIXDplnPsuRM48PGN3m2MtQ7yDBrPhRVEqjS2kd+HLna4XOfBPTJYV8BMSQb5RbYPyRu4zHvEJi6C7ebGbg0thdE6MnNOeWC+/zb70tm48TdBdBG7SSTsJvsOfX9cLmCwdTMVNIKTjv2LHdrZ5C8SIIzl9BfDI/Isrt6vkwuNzO2XQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>
  • Delivery-date: Fri, 08 Sep 2023 01:32:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZ2U+mi6GEY8HiTE22n7xoslprBrAPS/YAgADpx4A=
  • Thread-topic: [PATCH v6 09/13] xen/arm: Extract MMU-specific MM code

Hi Ayan,

> On Sep 7, 2023, at 19:34, Ayan Kumar Halder <ayankuma@xxxxxxx> wrote:
> 
> Hi Henry,
> 
>> +
>> +extern mfn_t directmap_mfn_start, directmap_mfn_end;
> 
> As you are declaring them for MMU specific , you also need this change :-
> 
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index 89ecb54be2..19b60c5d1b 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -670,7 +670,7 @@ void __init populate_boot_allocator(void)
> 
>              s = bootinfo.reserved_mem.bank[i].start;
>              e = s + bootinfo.reserved_mem.bank[i].size;
> -#ifdef CONFIG_ARM_32
> +#if (CONFIG_ARM_32 && CONFIG_MMU)
>              /* Avoid the xenheap, note that the xenheap cannot across a bank 
> */
>              if ( s <= mfn_to_maddr(directmap_mfn_start) &&
>                   e >= mfn_to_maddr(directmap_mfn_end) )
> @@ -708,7 +708,7 @@ void __init populate_boot_allocator(void)
>              if ( e > bank_end )
>                  e = bank_end;
> 
> -#ifdef CONFIG_ARM_32
> +#if (CONFIG_ARM_32 && CONFIG_MMU)
>              /* Avoid the xenheap */
>              if ( s < mfn_to_maddr(directmap_mfn_end) &&
>                   mfn_to_maddr(directmap_mfn_start) < e )
> 
> So that directmap_mfn_end and directmap_mfn_start is used only when MMU is 
> enabled.

I am not 100% sure on this, because currently there is no MPU code at
all, indicating all setup.c is MMU specific. In this case adding “&& CONFIG_MMU”
seems a little bit redundant to me. But I agree you made a point and it is 
correct
that when the MPU code is in, these “directmap” part should be gated with
CONFIG_MMU (or maybe split the code between arm32/arm64 to different helpers
to avoid #ifdef). Hence I would prefer doing these change when the MPU code is 
added.

Let’s see what maintainers will say. I am happy to do the change once we have
an agreement.

Kind regards,
Henry

> 
> - Ayan


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.