Skip to contentSkip to conversation

xen: arm: clarify cacheability requirements of hypercall arguments.

PATCH Superseded Ian Campbell 2 participants 4 messages Dec 17, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: arm: clarify cacheability requirements of hypercall arguments.

Accepting hypercall arguments which are either consistently in cached or uncached is tricky and/or potentially slow, requiring a guest mapping lookup to determine whether/when to do a cache clean or invalidate.

There are very few reasons, and no current use cases in practice, for a guest to use uncached memory for their hypercall arguments. Therefore mandate that all hypercall arguments must be mapped inner-cacheable.

If use cases arise then we can consider specific exemptions to this rule.

---
 xen/include/public/arch-arm.h |    3 +++
 1 file changed, 3 insertions(+)
xen/include/public/arch-arm.h +3 -0
index 475cb4a..7b95237 100644
@@ -58,6 +58,9 @@
  * (AAPCS64). Where there is a conflict the 64-bit standard should be
  * used regardless of guest type. Structures which are passed as
  * hypercall arguments are always little endian.
+ *
+ * All hypercall arguments passed via a pointer to guest memory must
+ * reside in memory which is mapped as Normal Inner-cacheable.
  */
 
 /*
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 20 lines · Ian Campbell

Accepting hypercall arguments which are either consistently in cached or uncached is tricky and/or potentially slow, requiring a guest mapping lookup to determine whether/when to do a cache clean or invalidate.

There are very few reasons, and no current use cases in practice, for a guest to use uncached memory for their hypercall arguments. Therefore mandate that all hypercall arguments must be mapped inner-cacheable.

If use cases arise then we can consider specific exemptions to this rule.

 xen/include/public/arch-arm.h |    3 +++
 1 file changed, 3 insertions(+)
xen/include/public/arch-arm.h +0 -0
index 475cb4a..7b95237 100644

xen/include/public/arch-arm.h line 63

Quoted 6 lines
xen/include/public/arch-arm.h +3 -0
@@ -58,6 +58,9 @@
  * (AAPCS64). Where there is a conflict the 64-bit standard should be
  * used regardless of guest type. Structures which are passed as
  * hypercall arguments are always little endian.
+ *
+ * All hypercall arguments passed via a pointer to guest memory must
+ * reside in memory which is mapped as Normal Inner-cacheable.

Maybe it is good to be pedantic: should we write "Inner or Outer and Inner" cacheable?
Should we mention explicitly that "Write-Back", "Write-Through" or "Write-Back Write-Allocate" are all supported?

#2 lore raw
Quoted 16 lines · Stefano Stabellini
Quoted 15 lines · Ian Campbell

Accepting hypercall arguments which are either consistently in cached or uncached is tricky and/or potentially slow, requiring a guest mapping lookup to determine whether/when to do a cache clean or invalidate.

There are very few reasons, and no current use cases in practice, for a guest to use uncached memory for their hypercall arguments. Therefore mandate that all hypercall arguments must be mapped inner-cacheable.

If use cases arise then we can consider specific exemptions to this rule.

 xen/include/public/arch-arm.h |    3 +++
 1 file changed, 3 insertions(+)
Quoted 14 lines

xen/include/public/arch-arm.h line 63

Quoted 11 lines
xen/include/public/arch-arm.h +3 -0
index 475cb4a..7b95237 100644
@@ -58,6 +58,9 @@
  * (AAPCS64). Where there is a conflict the 64-bit standard should be
  * used regardless of guest type. Structures which are passed as
  * hypercall arguments are always little endian.
+ *
+ * All hypercall arguments passed via a pointer to guest memory must
+ * reside in memory which is mapped as Normal Inner-cacheable.

Maybe it is good to be pedantic: should we write "Inner or Outer and Inner" cacheable?

I think it only matters that it is inner cacheable, since that is where Xen's accesses will hit. Whether or not it is outercacheable doesn't matter to us, does it?

Quoted 2 lines

Should we mention explicitly that "Write-Back", "Write-Through" or "Write-Back Write-Allocate" are all supported?

I think we don't care strategy is used, do we?

Ian.

#3 lore raw
Quoted 32 lines · Ian Campbell
Quoted 16 lines · Stefano Stabellini
Quoted 15 lines · Ian Campbell

Accepting hypercall arguments which are either consistently in cached or uncached is tricky and/or potentially slow, requiring a guest mapping lookup to determine whether/when to do a cache clean or invalidate.

There are very few reasons, and no current use cases in practice, for a guest to use uncached memory for their hypercall arguments. Therefore mandate that all hypercall arguments must be mapped inner-cacheable.

If use cases arise then we can consider specific exemptions to this rule.

 xen/include/public/arch-arm.h |    3 +++
 1 file changed, 3 insertions(+)
Quoted 14 lines

xen/include/public/arch-arm.h line 63

Quoted 11 lines
xen/include/public/arch-arm.h +3 -0
index 475cb4a..7b95237 100644
@@ -58,6 +58,9 @@
  * (AAPCS64). Where there is a conflict the 64-bit standard should be
  * used regardless of guest type. Structures which are passed as
  * hypercall arguments are always little endian.
+ *
+ * All hypercall arguments passed via a pointer to guest memory must
+ * reside in memory which is mapped as Normal Inner-cacheable.

Maybe it is good to be pedantic: should we write "Inner or Outer and Inner" cacheable?

Quoted 3 lines

I think it only matters that it is inner cacheable, since that is where Xen's accesses will hit. Whether or not it is outercacheable doesn't matter to us, does it?

I agree, I don't think that outer cacheable matters to us, I was just pointing out that we should probably write that down to avoid any confusion.

Quoted 4 lines
Quoted 2 lines

Should we mention explicitly that "Write-Back", "Write-Through" or "Write-Back Write-Allocate" are all supported?

I think we don't care strategy is used, do we?

Same as above.
I think we should write down that the cache strategy doesn't matter (or a list of cache strategies that we intend to support).