xen: arm: clarify cacheability requirements of hypercall arguments.
PATCH v2 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.
Do not place any restriction on the outer-cacheability or on the cache fill/flush strategy used.
If use cases arise then we can consider specific exemptions to this rule.
---
v2: Expliclty mention Outer-cacheability and cache allocation strategy.
--- xen/include/public/arch-arm.h | 5 +++++ 1 file changed, 5 insertions(+)
xen/include/public/arch-arm.h +5 -0
@@ -58,6 +58,11 @@* (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. Any +* Inner cache allocation strategy (Write-Back, Write-Through etc) is +* acceptable. There is no restriction on the Outer-cacheability. */ /*
Signature · 1 line
1.7.10.4
Quoted 8 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.
Quoted 6 lines
Do not place any restriction on the outer-cacheability or on the cache fill/flush strategy used.
If use cases arise then we can consider specific exemptions to this rule.
Signed-off-by Ian Campbell <[email protected]>
Quoted 24 lines
v2: Expliclty mention Outer-cacheability and cache allocation strategy.
--- xen/include/public/arch-arm.h | 5 +++++ 1 file changed, 5 insertions(+)xen/include/public/arch-arm.h +5
-0@@ -58,6 +58,11 @@* (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. Any +* Inner cache allocation strategy (Write-Back, Write-Through etc) is +* acceptable. There is no restriction on the Outer-cacheability. */ /* Signature · 1 line
1.7.10.4
Quoted 9 lines · Stefano Stabellini
Quoted 8 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.
Quoted 8 lines
Quoted 6 lines
Do not place any restriction on the outer-cacheability or on the cache fill/flush strategy used.
If use cases arise then we can consider specific exemptions to this rule.
Signed-off-by Ian Campbell <[email protected]>
I don't think this needs a freeze exception. applied, thanks.