On 05.08.21 01:00, Julien Grall wrote:
On 04/08/2021 21:56, Oleksandr wrote:
Hi Julien, Stefano.
Hi Oleksandr,
Hi, Julien
Thank you for the prompt reply and explanations.
On 02.08.21 22:12, Oleksandr wrote:
I have done some experiments with Xen and toolstack according to the
discussion above. So, I re-used DTB to pass a safe range to the domain.
For the range I borrowed some space from the second RAM bank.
-#define GUEST_RAM1_BASE xen_mk_ullong(0x0200000000) /* 1016GB of RAM
@ 8GB */
-#define GUEST_RAM1_SIZE xen_mk_ullong(0xfe00000000)
+#define GUEST_RAM1_BASE xen_mk_ullong(0x0200000000) /* 888GB of RAM @
8GB */
+#define GUEST_RAM1_SIZE xen_mk_ullong(0xDE00000000)
+
I am a bit split with reducing the amount of RAM. On one hand large guest
is not unheard on the server side (at least in the x86 world). On the
other hand, I am not aware of anyone using Xen on Arm in such setup.
So technically this will be a regression, but it may be OK.
I got it.
Regarding the range, this will be a problem as Xen configure the number of
the IPA bits based on the PA bits. The lowest possible address space ize
on 64-bit is 4GB.
From my understanding, this is because the number of IPA bits supported is
contrained by the PA bits. So the position and the size of the region
would need to depend on the P2M configuration.
Indeed, I missed these bits that IPA bits on Arm64 might be < 40 bit, I
remember, we select p2m_ipa_bits in setup_virt_paging() depending on pabits,
moreover the p2m_ipa_bits might be even restricted by some external entity
(IOMMU, if P2M is shared).
For simplicity, this could be the last few X bytes of the supported
address space.
ok, agree. To summarize, so it sounds like we can't use the fixed safe range
as in my example, it must be variable. Well, I hope, we will be able to
achieve this without reducing the total amount of domain RAM in front
(GUEST_RAM1_SIZE). After all, we know the IPA size and the domain RAM in
advance, so we certainly can choose the start and size of the range. In
case, we won't be able to find a suitable large chunk (for example, when IPA
bits = 32, and domain has a lot of RAM assigned and as the result - almost
all address space below 4GB is in use), we won't expose a safe range to a
domain at all, and domain will just fall back to use real pages instead
(actually, how it currently behaves on Arm).