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

RE: [PATCH v6 08/11] xen/arm64: move MMU related code from head.S to head_mmu.S


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Mon, 14 Nov 2022 05:36:58 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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=2; 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=bAkquCMnSf9NUHtJdbRks7IaTcn+PKulVs5WYvkH5yU=; b=ZYj1sGvBd5YEHb/XMzc5JAeP4nI0tgUeczOkMHG0OMvlduN2nLf7EbvsvS4D0n/LvX+UAq6HYnxOhru+Fkm4IXOfQmezR8mmq7IxGHmGlL6TQ3bGzfn0qpNtweUGV2I/BXNFn6PcjJxsSvbGkdAKgmxX/LJxrtd7wCYRvW6ZiBryupltCFcElPEm2oghWsNFqYj4vTKx3elYXEWRsV5REWr+VcGz/1H7T7i3tVZnBN/uJvBALBfAnBypZhj36xtJEQKCqHwAZWvkfhNZeNdgEYn5l/hZvmBwwKvmH3uZdKIKAJaRbSkCHdGsa8RC09YWsKs4SBSSVRQ4ClHqb8f6Rg==
  • 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=bAkquCMnSf9NUHtJdbRks7IaTcn+PKulVs5WYvkH5yU=; b=UuwU0ozDci/t944A4icqIT19axMhJPlVIYJhAJrIcZwWn58pjLS43ENCo5lj/9LUe2Zbl3eaHPYBgEOLvBjZa2No09FK6j7WiIAjXunii4Jnioqz3A4sLh7RMP8HgBkGrd2N89kMRLf44xUmbVIredHM+bDBXk3RkUPAHcNSAOVYF6yosQ1Hq/kk8NeL99JlDL0257WcWapziaSSQeXPku1Y3ne63fV3eafd0aywNjzWrJi2VoWo9T5AkkmhDqRVvHZK8AQgnaWwRwtC0iRmBdS6kxNgy1Z5fX6d4OlBfLufPvcAZp+Nndvc7QevB5pIRSDrFIdFlKLMWPV2Hefv6Q==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=XcOVKeudHohIxCx+wwN6dFhd1ba4C+jLykpJJXE+ddVcY4CNf69HvModXTrer0VaaYris06zOKMYF7i/EHzHAT82Ni5fvw1Joh68YOp2Zrwda8hKnpMz7C1fbNTuaURFGpOSYsgIRMSNAccpr+9ccz/k4+JuI8g14t09Vd6cpKP56B4WB9D9q3ZGCTePAOWbiP8wIWXRc4xoch6elc0LFukOVosOIWRd/7Str0JOsnwvh0UI/rBpXNjoh6eEY8dmrJFevQgn4WuKUtb3Ws59sH+bic7MvWDn2GPo8FV4/+T57a6zNOEq7re2hFZUl2JBvdDofCac84zbQrQt60xnew==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GnYABCFwzrUUpUTYiEqyTwCOQZJdpA79/pdtSFxUqiNnYoJealtzcpQVrSWdhrKIbsjTOyMaypdCyQH7eciFVanuhuZuJbSGw/LNTh9CZxEmqoani8+9TGx7rR4tznFgverQ8NGpSynV3HwgcU5ywYS3ZcSGiz7hqD0CfP/CiGEmbW+vXHUfPSIaza8J/zSprY2bLjIJTdsXHs5iK0JVfXGxwOq9t57vfFSwC0zshB7sS8LbOf+HLh2CVfgKoPBHVwqBwMJBGZCJcsGS0HBU7Onn+HZcAS6tIlXOMQju248Opxj7zH0aw0i4jLKUbbp2az7b4V2it9tiCr0PbkYd8Q==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: nd <nd@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>
  • Delivery-date: Mon, 14 Nov 2022 05:37:31 +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: AQHY8DVrMB29cZJCrk+wAkCu80OmKq4yVgCAgAPeDBCABz1OAIAAUxAg
  • Thread-topic: [PATCH v6 08/11] xen/arm64: move MMU related code from head.S to head_mmu.S

Hi Julien,

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: 2022年11月14日 5:43
> To: Wei Chen <Wei.Chen@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: nd <nd@xxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>; Bertrand
> Marquis <Bertrand.Marquis@xxxxxxx>; Volodymyr Babchuk
> <Volodymyr_Babchuk@xxxxxxxx>; Henry Wang <Henry.Wang@xxxxxxx>
> Subject: Re: [PATCH v6 08/11] xen/arm64: move MMU related code from head.S
> to head_mmu.S
> 
> 
> 
> On 09/11/2022 07:36, Wei Chen wrote:
> > Hi Julien,
> 
> Hi Wei,
> 
> >
> >> -----Original Message-----
> >> From: Julien Grall <julien@xxxxxxx>
> >> Sent: 2022年11月7日 4:06
> >> To: Wei Chen <Wei.Chen@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> >> Cc: nd <nd@xxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>;
> Bertrand
> >> Marquis <Bertrand.Marquis@xxxxxxx>; Volodymyr Babchuk
> >> <Volodymyr_Babchuk@xxxxxxxx>; Henry Wang <Henry.Wang@xxxxxxx>
> >> Subject: Re: [PATCH v6 08/11] xen/arm64: move MMU related code from
> head.S
> >> to head_mmu.S
> >>
> >> Hi Wei,
> >>
> >> On 04/11/2022 10:07, Wei Chen wrote:
> >>> There are lots of MMU specific code in head.S. This code will not
> >>> be used in MPU systems. If we use #ifdef to gate them, the code
> >>> will become messy and hard to maintain. So we move MMU related
> >>> code to head_mmu.S, and keep common code still in head.S.
> >>
> >> I am afraid that you can't simply move the MMU code out of head.S
> >> because this will break Xen when running using the identity map.
> >>
> >> This is because we only map the first 4KB of Xen with PA == VA. At the
> >> moment, we guarantee it by having everything that needs to be used in
> >> the identity mapping before _end_boot and checking at link time if this
> >> fits in 4KB.
> >>
> >> Now that you moved the MMU code outside of head.S. We need to find a
> >> different way to guarantee it. One way to do it would be to create a
> >> section that would be used for everything that needs to be identity
> mapped.
> >>
> >
> > Quote from next email
> > "
> > Looking at the code this morning, I noticed that we already have the
> > section ".text.header". For now, that should do the job. So we just need
> > to check the size of .text.header.
> >
> > Ideally, checking the size should be done in a separate pre-patch so it
> > is easier to review.
> > "
> >
> > OK. We will create a patch to check the size, and place it in the
> > head of the series.
> 
> I thought a bit more about what I wrote. Xen binary should always start
> with the Image/Zimage header. At the moment, this is guaranteed because
> there is only one object using the section .text.header.
> 
> With the change introduced in this patch, there will be multiple objects
> using with the sections .text.header. This means we are relying on the
> compiler to always put the content of head.S first.
> 

Yes, now it depends on the objects' order in Makefile. This should be
a risk.

> This is basically reverting to the behavior before commit 4267a33b19d
> ("xen/build: put image header into a separate section").
> 
> Therefore we do need a separate section to be used for head_*.S and
> maybe part of head.S. This new section could be called text.idmap so we
> know what the section is used for.
> 

Yes, we might place this new section after text.header.

Cheers,
Wei Chen

> Cheers,
> 
> --
> Julien Grall

 


Rackspace

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