diff mbox

[V2] xen/arm64: config: Correctly define VMAP_VIRT_END

Message ID 1464767466-29835-1-git-send-email-van.freenix@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Peng Fan June 1, 2016, 7:51 a.m. UTC
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>
---

V2:
 Take Julien's better commit message. Thanks.

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

Comments

Julien Grall June 2, 2016, 11:48 a.m. UTC | #1
Hi Peng,

On 01/06/16 08:51, Peng Fan wrote:
> 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>

Reviewed-by: Julien Grall <julien.grall@arm.com>

Regards,
Stefano Stabellini June 2, 2016, 2:51 p.m. UTC | #2
On Thu, 2 Jun 2016, Julien Grall wrote:
> Hi Peng,
> 
> On 01/06/16 08:51, Peng Fan wrote:
> > 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>
> 
> Reviewed-by: Julien Grall <julien.grall@arm.com>

Added to my next-4.8 branch
diff mbox

Patch

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)