Skip to contentSkip to conversation

xen/arm64: config: correct VMAP_VIRT_END

PATCH In review Peng Fan 2 participants 3 messages May 27, 2016 – Jun 1, 2016

lore
Share & tools
lore

Peng Fan

author
#0 lore raw

PATCH 1/1 xen/arm64: config: correct VMAP_VIRT_END

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.

Cc Julien Grall <[email protected]>
Cc Stefano Stabellini <[email protected]>

---

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(-)
xen/include/asm-arm/config.h +1 -1
index 2d11b62..f92c0a0 100644
@@ -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)
Signature · 7 lines
2.6.2


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#1 lore raw

Hi Peng,

Quoted 1 line · Peng Fan

To ARM64, we should use '(VMAP_VIRT_START + GB(1))' as VMAP_VIRT_END,

s/To/For/

Quoted 4 lines

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)". "

Quoted 9 lines
Cc Julien Grall <[email protected]>
Cc Stefano Stabellini <[email protected]>

---

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.

Quoted 10 lines
  xen/include/asm-arm/config.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
xen/include/asm-arm/config.h +0 -0
index 2d11b62..f92c0a0 100644

xen/include/asm-arm/config.h line 153

Quoted 8 lines
xen/include/asm-arm/config.h +1 -1
@@ -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,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#2 lore raw

Hi Julien,

Quoted 6 lines · Julien Grall

Hi Peng,

Quoted 1 line · Peng Fan

To ARM64, we should use '(VMAP_VIRT_START + GB(1))' as VMAP_VIRT_END,

s/To/For/

Fix in V2.

Quoted 7 lines
Quoted 5 lines

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 (:

Quoted 6 lines

"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.

Quoted 8 lines

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.

Quoted 28 lines
Quoted 10 lines
Cc Julien Grall <[email protected]>
Cc Stefano Stabellini <[email protected]>

---

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.

Quoted 15 lines
 xen/include/asm-arm/config.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/include/asm-arm/config.h +1 -1
index 2d11b62..f92c0a0 100644
@@ -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))
 
Quoted 8 lines

xen/include/asm-arm/config.h line 153

Quoted 3 lines
xen/include/asm-arm/config.h +0 -0
 #define FRAMETABLE_VIRT_START  GB(32)
 #define FRAMETABLE_SIZE        GB(32)

Regards,

Signature · 1 line
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel