linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: Fix definition of SIAR register
@ 2016-04-08 15:54 Thomas Huth
  2016-04-25  6:50 ` Thomas Huth
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Thomas Huth @ 2016-04-08 15:54 UTC (permalink / raw)
  To: Michael Ellerman, Paul Mackerras, linuxppc-dev
  Cc: Benjamin Herrenschmidt, kvm-ppc

The SIAR register is available twice, one time as SPR 780 (unprivileged,
but read-only), and one time as SPR 796 (privileged, but read and write).
The Linux kernel code currently uses SPR 780 - and while this is OK for
reading, writing to that register of course does not work.
Since the KVM code tries to write to this register, too (see the mtspr
in book3s_hv_rmhandlers.S), the contents of this register sometimes get
lost for the guests, e.g. during migration of a VM.
To fix this issue, simply switch to the other SPR numer 796 instead.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 Note: The perf code in core-book3s.c also seems to write to the SIAR
       SPR, so that might be affected by this issue, too - but I did
       not test the perf code, so I'm not sure about that part.

 arch/powerpc/include/asm/reg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index f5f4c66..6630420 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -752,13 +752,13 @@
 #define SPRN_PMC6	792
 #define SPRN_PMC7	793
 #define SPRN_PMC8	794
-#define SPRN_SIAR	780
 #define SPRN_SDAR	781
 #define SPRN_SIER	784
 #define   SIER_SIPR		0x2000000	/* Sampled MSR_PR */
 #define   SIER_SIHV		0x1000000	/* Sampled MSR_HV */
 #define   SIER_SIAR_VALID	0x0400000	/* SIAR contents valid */
 #define   SIER_SDAR_VALID	0x0200000	/* SDAR contents valid */
+#define SPRN_SIAR	796
 #define SPRN_TACR	888
 #define SPRN_TCSCR	889
 #define SPRN_CSIGR	890
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-05-12 10:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-08 15:54 [PATCH] powerpc: Fix definition of SIAR register Thomas Huth
2016-04-25  6:50 ` Thomas Huth
2016-04-25  8:08 ` Madhavan Srinivasan
2016-04-25  8:15   ` Alexander Graf
2016-04-25  9:16     ` Thomas Huth
2016-04-25  9:31       ` Alexander Graf
2016-04-25 11:15     ` Madhavan Srinivasan
2016-05-12  4:57     ` Paul Mackerras
2016-05-12  7:27       ` Thomas Huth
2016-05-12 10:40         ` Paul Mackerras
2016-05-12  4:51 ` Paul Mackerras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).