All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/arm64: config: correct VMAP_VIRT_END
@ 2016-05-27 10:23 Peng Fan
  2016-05-31 11:07 ` Julien Grall
  0 siblings, 1 reply; 3+ messages in thread
From: Peng Fan @ 2016-05-27 10:23 UTC (permalink / raw)
  To: julien.grall, sstabellini; +Cc: van.freenix, xen-devel

To ARM64, we should use '(VMAP_VIRT_START + GB(1))' as VMAP_VIRT_END,
but not '(VMAP_VIRT_START + GB(1) - 1)'.

Seeing 'vm_end[type] = PFN_DOWN(end - start);' in vm_init_type,
if not correct VMAP_VIRT_END, one page is wasted.

Signed-off-by: Peng Fan <van.freenix@gmail.com>
Cc: Julien Grall <julien.grall@arm.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
---

I found X86 use '(VMAP_VIRT_START + GB(64))' and ARM32 use XENHEAP_VIRT_START,
both are aligned address. So, I think ARM64 may also need to use aligned
address. I am not very sure (:

 xen/include/asm-arm/config.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 2d11b62..f92c0a0 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -147,7 +147,7 @@
 #define SLOT0_ENTRY_SIZE  SLOT0(1)
 
 #define VMAP_VIRT_START  GB(1)
-#define VMAP_VIRT_END    (VMAP_VIRT_START + GB(1) - 1)
+#define VMAP_VIRT_END    (VMAP_VIRT_START + GB(1))
 
 #define FRAMETABLE_VIRT_START  GB(32)
 #define FRAMETABLE_SIZE        GB(32)
-- 
2.6.2


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen/arm64: config: correct VMAP_VIRT_END
  2016-05-27 10:23 [PATCH] xen/arm64: config: correct VMAP_VIRT_END Peng Fan
@ 2016-05-31 11:07 ` Julien Grall
  2016-06-01  7:24   ` Peng Fan
  0 siblings, 1 reply; 3+ messages in thread
From: Julien Grall @ 2016-05-31 11:07 UTC (permalink / raw)
  To: Peng Fan, sstabellini; +Cc: xen-devel

Hi Peng,

On 27/05/16 11:23, Peng Fan wrote:
> To ARM64, we should use '(VMAP_VIRT_START + GB(1))' as VMAP_VIRT_END,

s/To/For/

> but not '(VMAP_VIRT_START + GB(1) - 1)'.
>
> Seeing 'vm_end[type] = PFN_DOWN(end - start);' in vm_init_type,
> if not correct VMAP_VIRT_END, one page is wasted.

I find difficult to parse the commit message. How about:

"xen/arm64: config: Correctly define VMAP_VIRT_END

The vmap initialization code (vm_init_type) will round down the end of 
the region to a page-aligned address.

On ARM64, the default vmap region is located between 1G and 2G. Based on 
the initialization code, the end address is excluded of the region.

Therefore the current definition of VMAP_VIRT_END will lead the vmap 
code to not use the last 4K of the region.

Fix it by defining VMAP_VIRT_END as "VMAP_VIRT_START + GB(1)".
"

>
> Signed-off-by: Peng Fan <van.freenix@gmail.com>
> Cc: Julien Grall <julien.grall@arm.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> ---
>
> I found X86 use '(VMAP_VIRT_START + GB(64))' and ARM32 use XENHEAP_VIRT_START,
> both are aligned address. So, I think ARM64 may also need to use aligned
> address. I am not very sure (:

Correct, this should be aligned to avoid wasting a page.

>
>   xen/include/asm-arm/config.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
> index 2d11b62..f92c0a0 100644
> --- a/xen/include/asm-arm/config.h
> +++ b/xen/include/asm-arm/config.h
> @@ -147,7 +147,7 @@
>   #define SLOT0_ENTRY_SIZE  SLOT0(1)
>
>   #define VMAP_VIRT_START  GB(1)
> -#define VMAP_VIRT_END    (VMAP_VIRT_START + GB(1) - 1)
> +#define VMAP_VIRT_END    (VMAP_VIRT_START + GB(1))
>
>   #define FRAMETABLE_VIRT_START  GB(32)
>   #define FRAMETABLE_SIZE        GB(32)
>

Regards,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen/arm64: config: correct VMAP_VIRT_END
  2016-05-31 11:07 ` Julien Grall
@ 2016-06-01  7:24   ` Peng Fan
  0 siblings, 0 replies; 3+ messages in thread
From: Peng Fan @ 2016-06-01  7:24 UTC (permalink / raw)
  To: Julien Grall; +Cc: sstabellini, xen-devel

Hi Julien,

On Tue, May 31, 2016 at 12:07:58PM +0100, Julien Grall wrote:
>Hi Peng,
>
>On 27/05/16 11:23, Peng Fan wrote:
>>To ARM64, we should use '(VMAP_VIRT_START + GB(1))' as VMAP_VIRT_END,
>
>s/To/For/

Fix in V2.

>
>>but not '(VMAP_VIRT_START + GB(1) - 1)'.
>>
>>Seeing 'vm_end[type] = PFN_DOWN(end - start);' in vm_init_type,
>>if not correct VMAP_VIRT_END, one page is wasted.
>
>I find difficult to parse the commit message. How about:

Sorry (:

>
>"xen/arm64: config: Correctly define VMAP_VIRT_END
>
>The vmap initialization code (vm_init_type) will round down the end of the
>region to a page-aligned address.
>
>On ARM64, the default vmap region is located between 1G and 2G. Based on the
>initialization code, the end address is excluded of the region.
>
>Therefore the current definition of VMAP_VIRT_END will lead the vmap code to
>not use the last 4K of the region.
>
>Fix it by defining VMAP_VIRT_END as "VMAP_VIRT_START + GB(1)".
>"

Thanks for your good description.

Thanks,
Peng.

>
>>
>>Signed-off-by: Peng Fan <van.freenix@gmail.com>
>>Cc: Julien Grall <julien.grall@arm.com>
>>Cc: Stefano Stabellini <sstabellini@kernel.org>
>>---
>>
>>I found X86 use '(VMAP_VIRT_START + GB(64))' and ARM32 use XENHEAP_VIRT_START,
>>both are aligned address. So, I think ARM64 may also need to use aligned
>>address. I am not very sure (:
>
>Correct, this should be aligned to avoid wasting a page.
>
>>
>>  xen/include/asm-arm/config.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>>diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
>>index 2d11b62..f92c0a0 100644
>>--- a/xen/include/asm-arm/config.h
>>+++ b/xen/include/asm-arm/config.h
>>@@ -147,7 +147,7 @@
>>  #define SLOT0_ENTRY_SIZE  SLOT0(1)
>>
>>  #define VMAP_VIRT_START  GB(1)
>>-#define VMAP_VIRT_END    (VMAP_VIRT_START + GB(1) - 1)
>>+#define VMAP_VIRT_END    (VMAP_VIRT_START + GB(1))
>>
>>  #define FRAMETABLE_VIRT_START  GB(32)
>>  #define FRAMETABLE_SIZE        GB(32)
>>
>
>Regards,
>
>-- 
>Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-01  7:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-27 10:23 [PATCH] xen/arm64: config: correct VMAP_VIRT_END Peng Fan
2016-05-31 11:07 ` Julien Grall
2016-06-01  7:24   ` Peng Fan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.