Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-18 Thread Julien Grall
On 12/18/18 12:09 PM, Andrii Anisov wrote: Hello Julien, Hi, On 17.12.18 19:34, Andrii Anisov wrote: I see something like following as a quick WA (not even build tested): diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index d2c63a8..bf72ba9 100644 ---

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-18 Thread Andrii Anisov
Hello Julien, On 17.12.18 19:34, Andrii Anisov wrote: I see something like following as a quick WA (not even build tested): diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index d2c63a8..bf72ba9 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-17 Thread Julien Grall
Hi, On 17/12/2018 17:57, Stefano Stabellini wrote: On Mon, 17 Dec 2018, Julien Grall wrote: Hi, On 14/12/2018 17:48, Julien Grall wrote: On 14/12/2018 17:24, Andrii Anisov wrote: On 14.12.18 18:26, Julien Grall wrote: I don't understand how you came up with the conclusion that 128MB will

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-17 Thread Stefano Stabellini
On Mon, 17 Dec 2018, Julien Grall wrote: > Hi, > > On 14/12/2018 17:48, Julien Grall wrote: > > On 14/12/2018 17:24, Andrii Anisov wrote: > > > On 14.12.18 18:26, Julien Grall wrote: > > > > I don't understand how you came up with the conclusion that 128MB will > > > > be > > > > removed from

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-17 Thread Andrii Anisov
On 17.12.18 19:02, Julien Grall wrote: I didn't get you wrong. We are saying the same things :). Great! Similarly, some version on Linux (i.e prior to 4.2) requires the DTB to within 512MB from the kernel. I've seen that restriction in the Linux for ARM64 documentation. in

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-17 Thread Julien Grall
Hi Andrii, On 17/12/2018 15:54, Andrii Anisov wrote: On 14.12.18 20:04, Julien Grall wrote: Then the code needs to be fixed... It would be nice to get some helps here as I can't scale. I can take this. Thank you. But I would like to align on the algorithm first. It is probably worth to

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-17 Thread Julien Grall
Hi, On 17/12/2018 15:55, Andrii Anisov wrote: On 17.12.18 15:38, Julien Grall wrote: So technically allocating the RAM using a 2MB alignment should be enough. For 64-bit and, maybe, raw 32-bit Linux kernel images. For 32-bit compressed Linux kernel - still 128MB aligned first bank is

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-17 Thread Julien Grall
Hi Andrii, On 17/12/2018 16:02, Andrii Anisov wrote: On 17.12.18 13:11, Julien Grall wrote: So, to be honest, I think this is a non-issue. I am not saying this should not be fixed. I am saying that the price is minimal compare to allow Xen booting on platform such as the Hikey and bringing

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-17 Thread Andrii Anisov
On 17.12.18 13:11, Julien Grall wrote: So, to be honest, I think this is a non-issue. I am not saying this should not be fixed. I am saying that the price is minimal compare to allow Xen booting on platform such as the Hikey and bringing more compliance with the Arm Arm. BTW, I hope you

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-17 Thread Andrii Anisov
On 17.12.18 15:38, Julien Grall wrote: So technically allocating the RAM using a 2MB alignment should be enough. For 64-bit and, maybe, raw 32-bit Linux kernel images. For 32-bit compressed Linux kernel - still 128MB aligned first bank is required. It can be changed on kernel side by setting

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-17 Thread Andrii Anisov
On 14.12.18 20:04, Julien Grall wrote: Then the code needs to be fixed... It would be nice to get some helps here as I can't scale. I can take this. But I would like to align on the algorithm first. -- Sincerely, Andrii Anisov. ___ Xen-devel

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-17 Thread Julien Grall
Hi, On 17/12/2018 13:14, Andrii Anisov wrote: On 14.12.18 19:48, Julien Grall wrote: Please try to reference the documentation (or code if lack of documentation) when making such statement. Ah, yes, sure. AFAICT, Linux 32-bit [1] imposes the kernel to be loaded in the first 128MB of RAM.

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-17 Thread Andrii Anisov
On 14.12.18 19:48, Julien Grall wrote: Please try to reference the documentation (or code if lack of documentation) when making such statement. Ah, yes, sure. AFAICT, Linux 32-bit [1] imposes the kernel to be loaded in the first 128MB of RAM. Nothing about the 128MB aligned RAM. Right,

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-17 Thread Julien Grall
Hi, On 14/12/2018 17:48, Julien Grall wrote: On 14/12/2018 17:24, Andrii Anisov wrote: On 14.12.18 18:26, Julien Grall wrote: I don't understand how you came up with the conclusion that 128MB will be removed from Dom0. We only have the requirement that the first bank is at least 128MB. So can

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-14 Thread Julien Grall
Hi, On 14/12/2018 17:46, Andrii Anisov wrote: How were you switching between the page-tables? A proper solution would require to switch between page-tables using an identify mappings. This is far more complicate than what is worth here. Sorry for my ignorance, what "identify mappings" stands

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-14 Thread Julien Grall
Hi, On 14/12/2018 17:24, Andrii Anisov wrote: On 14.12.18 18:26, Julien Grall wrote: I don't understand how you came up with the conclusion that 128MB will be removed from Dom0. We only have the requirement that the first bank is at least 128MB. So can you expand it? IIRC Linux kernel

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-14 Thread Andrii Anisov
On 14.12.18 18:26, Julien Grall wrote: Are you using arm64 or arm32? I'm using arm64. But also speak about arm32. I don't understand what you mean. Looking at your log, Xen is relocated at the end of the last bank. This is the expected behavior in unstable. Yes, I miscounted zeroes, and

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-14 Thread Andrii Anisov
On 14.12.18 18:26, Julien Grall wrote: I don't understand how you came up with the conclusion that 128MB will be removed from Dom0. We only have the requirement that the first bank is at least 128MB. So can you expand it? IIRC Linux kernel requires that the machine RAM start must be 128MB

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-14 Thread Julien Grall
On 12/14/18 3:52 PM, Andrii Anisov wrote: > Hello Julien, Hi, > > Let me speculate a bit about the topic. > > On 14.12.18 13:44, Julien Grall wrote: >> At the moment, Xen is relocated towards the end of the memory. > This statement is not really true. Some time ago, XEN was relocated > toward

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-14 Thread Andrii Anisov
On 14.12.18 13:44, Julien Grall wrote: At the moment, Xen is relocated towards the end of the memory. While this has the advantage to free space in low memory, the code is not compliant with the break-before-make because it requires to switch between two sets of page-table. This is not entirely

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-14 Thread Andrii Anisov
On 14.12.18 17:52, Andrii Anisov wrote: Hello Julien, Let me speculate a bit about the topic. On 14.12.18 13:44, Julien Grall wrote: At the moment, Xen is relocated towards the end of the memory. This statement is not really true. Some time ago, XEN was relocated toward the end of the low

Re: [Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-14 Thread Andrii Anisov
Hello Julien, Let me speculate a bit about the topic. On 14.12.18 13:44, Julien Grall wrote: At the moment, Xen is relocated towards the end of the memory. This statement is not really true. Some time ago, XEN was relocated toward the end of the low memory (under 4 GB). Currently, on my

[Xen-devel] [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen

2018-12-14 Thread Julien Grall
At the moment, Xen is relocated towards the end of the memory. While this has the advantage to free space in low memory, the code is not compliant with the break-before-make because it requires to switch between two sets of page-table. This is not entirely trivial to fix as it would require us to