[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





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.

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.

Cheers,

--
Julien Grall



 


Rackspace

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