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

RE: static-mem preventing dom0 from booting


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Mon, 8 Nov 2021 06:32:16 +0000
  • Accept-language: 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=+TvlC+Qf5fMHZA2wsrLTQs85mXKNK4nPuyn+1eu5GaE=; b=QI/nPpMrWj9QbWgoidtkJtoHVUPw1tlTRr58jl+eYrIT4vNjrVzwj8fqiKrtOMEoZ23hoyTXTkp2A+FbIuabOgTO88VWpwQZS6pQXicDkL9WMRIgGVCAAglmzUDLGl9xTi26nwjoS2STjj2mWYcvP50zLuQ2SHSyPIiMu8uQPcauf8OLH2r9rbwALt/PEg2ty5AyOW7/ia8imHKi1zuKP3v1Nz7i7BdFHIioSfkssnqIM6cEqJtn+31x8WbBh+2JlYZprjJ7YyObGXXt1LTUM5/BJDiLWLNLs3mYKxklK8OsGZP6qVqI5fkNVCZT5LtRsqiSJnTvzGF3mTRcYO5hMw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BNKlZYsSJ+TZD2bAWaq/J+anSUcbZcmUcqdarmNeXeQDA51wvkTtublcM60wMRQ6WX3qQEHsKOboKLOzwopsF7WJd4BLPbxXL37qWYxnnl36NG6xHSBvUfvkjaMELafCw3vKveiSz/k6pUkiN9EHyEhv/UsODOwtzuFb5VoKoOYdxY7C4HG2y/GN1DmLBrYaPUjbnKJHkfcnQBoQl5YtIUHbbdU8z9aErEcU6holkmXFl1uBfync2OeQSoQNlW9NtlDx3GSVGG2OyO2cVAMkcFbAAvgqZS6EQHkTlrPG8l5J6Ug8PcfF6vVzya+uaXrW8k9Xa6ndxAJdVxqUOuk2SA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Mon, 08 Nov 2021 06:32:59 +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: AQHX0eWC7qpRq+VAt0Cu1/k92WugAqv0ODjwgABBVXCAAJnMgIAAe3eAgAOZYsA=
  • Thread-topic: static-mem preventing dom0 from booting

Hi Stefano

> -----Original Message-----
> From: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> Sent: Saturday, November 6, 2021 7:03 AM
> To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> Cc: Penny Zheng <Penny.Zheng@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx;
> Wei Chen <Wei.Chen@xxxxxxx>; Bertrand Marquis
> <Bertrand.Marquis@xxxxxxx>
> Subject: RE: static-mem preventing dom0 from booting
> 
> On Fri, 5 Nov 2021, Stefano Stabellini wrote:
> > The scenario is extremely simple; you can see the full device tree
> > configuration in the attachment to my previous email.
> >
> > - dom0
> > - dom0less domU with static-mem
> >
> > That's it! So basically it is just a normal dom0 + dom0less domU
> > configuration, which already works fine, where I added static-mem to
> > the domU and suddenly dom0 (not the domU!) stopped working.
> 

Got it. Sorry, I missed the scenario you are talking about... I simply think 
what dom0less
means that dom0 is absent... ;/
  
> I did some more debugging today and I found the problem. The issue is that
> static-mem regions are added to the list of reserved_mem. However,
> reserved_mem is automatically assigned to Dom0 by default at the bottom of
> xen/arch/arm/domain_build.c:handle_node, see the second call to
> make_memory_node. Really, we shouldn't give to dom0 static-mem ranges
> meant for other domUs. E.g. the following change is sufficient to solve the
> problem:
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 88a79247cb..dc609c4f0e 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -891,6 +891,9 @@ static int __init make_memory_node(const struct
> domain *d,
>          u64 start = mem->bank[i].start;
>          u64 size = mem->bank[i].size;
> 
> +        if ( mem->bank[i].xen_domain )
> +            continue;
> +
>          dt_dprintk("  Bank %d: %#"PRIx64"->%#"PRIx64"\n",
>                     i, start, start + size);
> 
> However, maybe a better fix would be to purge reserved_mem of any
> xen_domain items before calling make_memory_node.
> 
> 
> I found one additional issue regarding is_domain_direct_mapped which
> doesn't return true for static-mem domains. I think we need to add a
> direct_map bool to arch_domain and set it for both dom0 and static-mem
> dom0less domUs, so that we can change the implementation of
> is_domain_direct_mapped to:
> 
> #define is_domain_direct_mapped(d) (d->arch.direct_map)

Yeah, I already pushed a patch serie regarding direct-map to community for 
review, 
and it is also based on your old direct-map serie. 

Today, I may push direct-map version 3 to community for review~~~ If you're 
free, plz take a look.

Cheers,
Penny Zheng



 


Rackspace

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