Skip to contentSkip to conversation

powerpc/epapr: add "memory" as a clobber to all hypercalls

PATCH Applied Timur Tabi 2 participants 2 messages Mar 15, 2012 – Mar 21, 2012 PowerPC

lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH 1/1 powerpc/epapr: add "memory" as a clobber to all hypercalls

The "memory" clobber tells the compiler to ensure that all writes to memory are committed before the hypercall is made.

"memory" is only necessary for hcalls where the Hypervisor will read or write guest memory. However, we add it to all hcalls because the impact is minimal, and we want to ensure that it's present for the hcalls that need it.

---
 arch/powerpc/include/asm/epapr_hcalls.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
arch/powerpc/include/asm/epapr_hcalls.h +6 -1
index f3b0c2c..976835d 100644
@@ -134,10 +134,15 @@
  * whether they will be clobbered.
  *
  * Note that r11 can be used as an output parameter.
+ *
+ * The "memory" clobber is only necessary for hcalls where the Hypervisor
+ * will read or write guest memory. However, we add it to all hcalls because
+ * the impact is minimal, and we want to ensure that it's present for the
+ * hcalls that need it.
 */
 
 /* List of common clobbered registers.  Do not use this macro. */
-#define EV_HCALL_CLOBBERS "r0", "r12", "xer", "ctr", "lr", "cc"
+#define EV_HCALL_CLOBBERS "r0", "r12", "xer", "ctr", "lr", "cc", "memory"
 
 #define EV_HCALL_CLOBBERS8 EV_HCALL_CLOBBERS
 #define EV_HCALL_CLOBBERS7 EV_HCALL_CLOBBERS8, "r10"
Signature · 1 line
1.7.3.4
Applied
#1 lore raw
Quoted 1 line · Timur Tabi

The "memory" clobber tells the compiler to ensure that all writes to =

memory

Quoted 3 lines

are committed before the hypercall is made.
=20
"memory" is only necessary for hcalls where the Hypervisor will read =

or

Quoted 1 line

write guest memory. However, we add it to all hcalls because the =

impact is

Quoted 1 line

minimal, and we want to ensure that it's present for the hcalls that =

need it.

Quoted 5 lines

=20

---
arch/powerpc/include/asm/epapr_hcalls.h | 7 ++++++-

1 files changed, 6 insertions(+), 1 deletions(-)

applied

- k=