Skip to contentSkip to conversation

xen/arm: define PAGE_HYPERVISOR as BUFFERABLE

PATCH In review Stefano Stabellini 2 participants 6 messages May 10, 2013 – Jun 4, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: define PAGE_HYPERVISOR as BUFFERABLE

Use stage 1 attribute indexes for PAGE_HYPERVISOR, the appriopriate one for normal memory hypervisor mappings would be BUFFERABLE.

xen/include/asm-arm/page.h +1 -1
index fd6946e..13f76fc 100644
@@ -58,7 +58,7 @@
 #define DEV_WC        BUFFERABLE
 #define DEV_CACHED    WRITEBACK
 
-#define PAGE_HYPERVISOR         (MATTR_MEM)
+#define PAGE_HYPERVISOR         (BUFFERABLE)
 #define MAP_SMALL_PAGES         PAGE_HYPERVISOR
 
 /*
#1 lore raw
Quoted 10 lines · Stefano Stabellini

Use stage 1 attribute indexes for PAGE_HYPERVISOR, the appriopriate one for normal memory hypervisor mappings would be BUFFERABLE.

xen/include/asm-arm/page.h +0 -0
index fd6946e..13f76fc 100644

xen/include/asm-arm/page.h line 64

Quoted 8 lines
xen/include/asm-arm/page.h +1 -1
@@ -58,7 +58,7 @@
 #define DEV_WC        BUFFERABLE
 #define DEV_CACHED    WRITEBACK
 
-#define PAGE_HYPERVISOR         (MATTR_MEM)
+#define PAGE_HYPERVISOR         (BUFFERABLE)
 #define MAP_SMALL_PAGES         PAGE_HYPERVISOR
 
 /*

This patch is completely wrong, fortunately it hasn't been applied.

Despite the name, BUFFERABLE means non-cacheable. Mapping a guest page non-cacheable in the hypervisor would cause mismatch in memory attributes.

We should map the guest page as "normal memory", that is WRITEBACK.

xen/include/asm-arm/page.h +1 -1
index fd6946e..13f76fc 100644
@@ -58,7 +58,7 @@
 #define DEV_WC        BUFFERABLE
 #define DEV_CACHED    WRITEBACK
 
-#define PAGE_HYPERVISOR         (MATTR_MEM)
+#define PAGE_HYPERVISOR         (WRITEBACK)
 #define MAP_SMALL_PAGES         PAGE_HYPERVISOR
 
 /*
#2 lore raw
Quoted 14 lines · Stefano Stabellini
Quoted 13 lines · Stefano Stabellini

Use stage 1 attribute indexes for PAGE_HYPERVISOR, the appriopriate one for normal memory hypervisor mappings would be BUFFERABLE.

xen/include/asm-arm/page.h +0 -0
index fd6946e..13f76fc 100644
@@ -58,7 +58,7 @@
 #define DEV_WC        BUFFERABLE
 #define DEV_CACHED    WRITEBACK
 
Quoted 7 lines

xen/include/asm-arm/page.h line 64

Quoted 5 lines
xen/include/asm-arm/page.h +1 -1
-#define PAGE_HYPERVISOR         (MATTR_MEM)
+#define PAGE_HYPERVISOR         (BUFFERABLE)
 #define MAP_SMALL_PAGES         PAGE_HYPERVISOR
 
 /*

This patch is completely wrong, fortunately it hasn't been applied.

Yes, it appears to have slipped through my net, sorry. (But good in this case!)

Quoted 6 lines

Despite the name, BUFFERABLE means non-cacheable. Mapping a guest page non-cacheable in the hypervisor would cause mismatch in memory attributes.

We should map the guest page as "normal memory", that is WRITEBACK.

The hypervisor's own memory mappings are using WRITEALLOC not WRITEBACK (see mfn_to_xen_entry). Is one or the other wrong?

Quoted 13 lines
xen/include/asm-arm/page.h +1 -1
index fd6946e..13f76fc 100644
@@ -58,7 +58,7 @@
 #define DEV_WC        BUFFERABLE
 #define DEV_CACHED    WRITEBACK
 
-#define PAGE_HYPERVISOR         (MATTR_MEM)
+#define PAGE_HYPERVISOR         (WRITEBACK)
 #define MAP_SMALL_PAGES         PAGE_HYPERVISOR
 
 /*
#3 lore raw
Quoted 27 lines · Ian Campbell
Quoted 14 lines · Stefano Stabellini
Quoted 13 lines · Stefano Stabellini

Use stage 1 attribute indexes for PAGE_HYPERVISOR, the appriopriate one for normal memory hypervisor mappings would be BUFFERABLE.

xen/include/asm-arm/page.h +0 -0
index fd6946e..13f76fc 100644
@@ -58,7 +58,7 @@
 #define DEV_WC        BUFFERABLE
 #define DEV_CACHED    WRITEBACK
 
Quoted 7 lines

xen/include/asm-arm/page.h line 64

Quoted 5 lines
xen/include/asm-arm/page.h +1 -1
-#define PAGE_HYPERVISOR         (MATTR_MEM)
+#define PAGE_HYPERVISOR         (BUFFERABLE)
 #define MAP_SMALL_PAGES         PAGE_HYPERVISOR
 
 /*

This patch is completely wrong, fortunately it hasn't been applied.

Yes, it appears to have slipped through my net, sorry. (But good in this case!)

Quoted 1 line
Quoted 8 lines
Quoted 5 lines

Despite the name, BUFFERABLE means non-cacheable. Mapping a guest page non-cacheable in the hypervisor would cause mismatch in memory attributes.

We should map the guest page as "normal memory", that is WRITEBACK.

The hypervisor's own memory mappings are using WRITEALLOC not WRITEBACK (see mfn_to_xen_entry). Is one or the other wrong?

They are both appropriate. BTW WRITEALLOC is effectively what we have now (MATTR_MEM is truncated to 0x7 that is WRITEALLOC).

Quoted 11 lines
Quoted 11 lines
xen/include/asm-arm/page.h +1 -1
index fd6946e..13f76fc 100644
@@ -58,7 +58,7 @@
 #define DEV_WC        BUFFERABLE
 #define DEV_CACHED    WRITEBACK
 
-#define PAGE_HYPERVISOR         (MATTR_MEM)
+#define PAGE_HYPERVISOR         (WRITEBACK)
 #define MAP_SMALL_PAGES         PAGE_HYPERVISOR
#4 lore raw
Quoted 32 lines · Stefano Stabellini
Quoted 31 lines · Ian Campbell
Quoted 14 lines · Stefano Stabellini
Quoted 13 lines · Stefano Stabellini

Use stage 1 attribute indexes for PAGE_HYPERVISOR, the appriopriate one for normal memory hypervisor mappings would be BUFFERABLE.

xen/include/asm-arm/page.h +0 -0
index fd6946e..13f76fc 100644
@@ -58,7 +58,7 @@
 #define DEV_WC        BUFFERABLE
 #define DEV_CACHED    WRITEBACK
 
Quoted 7 lines

xen/include/asm-arm/page.h line 64

Quoted 5 lines
xen/include/asm-arm/page.h +1 -1
-#define PAGE_HYPERVISOR         (MATTR_MEM)
+#define PAGE_HYPERVISOR         (BUFFERABLE)
 #define MAP_SMALL_PAGES         PAGE_HYPERVISOR
 
 /*

This patch is completely wrong, fortunately it hasn't been applied.

Yes, it appears to have slipped through my net, sorry. (But good in this case!)

Quoted 5 lines

Despite the name, BUFFERABLE means non-cacheable. Mapping a guest page non-cacheable in the hypervisor would cause mismatch in memory attributes.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

We should map the guest page as "normal memory", that is WRITEBACK.

The hypervisor's own memory mappings are using WRITEALLOC not WRITEBACK (see mfn_to_xen_entry). Is one or the other wrong?

They are both appropriate. BTW WRITEALLOC is effectively what we have now (MATTR_MEM is truncated to 0x7 that is WRITEALLOC).

OK. So should we switch to WRITEALLOC explicitly or would you make an argument for switching to WRITEBACK?

Can we get all that in an update changelog with an S-o-b etc please.

Ian.

Quoted 14 lines
Quoted 13 lines
Quoted 13 lines
xen/include/asm-arm/page.h +1 -1
index fd6946e..13f76fc 100644
@@ -58,7 +58,7 @@
 #define DEV_WC        BUFFERABLE
 #define DEV_CACHED    WRITEBACK
 
-#define PAGE_HYPERVISOR         (MATTR_MEM)
+#define PAGE_HYPERVISOR         (WRITEBACK)
 #define MAP_SMALL_PAGES         PAGE_HYPERVISOR
#5 lore raw
Quoted 35 lines · Ian Campbell
Quoted 34 lines · Stefano Stabellini
Quoted 33 lines · Ian Campbell
Quoted 14 lines · Stefano Stabellini
Quoted 13 lines · Stefano Stabellini

Use stage 1 attribute indexes for PAGE_HYPERVISOR, the appriopriate one for normal memory hypervisor mappings would be BUFFERABLE.

xen/include/asm-arm/page.h +0 -0
index fd6946e..13f76fc 100644
@@ -58,7 +58,7 @@
 #define DEV_WC        BUFFERABLE
 #define DEV_CACHED    WRITEBACK
 
Quoted 7 lines

xen/include/asm-arm/page.h line 64

Quoted 5 lines
xen/include/asm-arm/page.h +1 -1
-#define PAGE_HYPERVISOR         (MATTR_MEM)
+#define PAGE_HYPERVISOR         (BUFFERABLE)
 #define MAP_SMALL_PAGES         PAGE_HYPERVISOR
 
 /*

This patch is completely wrong, fortunately it hasn't been applied.

Yes, it appears to have slipped through my net, sorry. (But good in this case!)

Quoted 6 lines

Despite the name, BUFFERABLE means non-cacheable. Mapping a guest page non-cacheable in the hypervisor would cause mismatch in memory attributes.

We should map the guest page as "normal memory", that is WRITEBACK.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

The hypervisor's own memory mappings are using WRITEALLOC not WRITEBACK (see mfn_to_xen_entry). Is one or the other wrong?

They are both appropriate. BTW WRITEALLOC is effectively what we have now (MATTR_MEM is truncated to 0x7 that is WRITEALLOC).

OK. So should we switch to WRITEALLOC explicitly or would you make an argument for switching to WRITEBACK?

The only argument for using WRITEBACK instead of WRITEALLOC would be to match Linux cache policy, but it's not a very good argument.

Quoted 1 line

Can we get all that in an update changelog with an S-o-b etc please.

OK