aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2014-01-08 05:25:26 -0500
committerAlexander Graf <agraf@suse.de>2014-01-27 10:01:10 -0500
commitaa31e843225769735b79795c955426c9479046a5 (patch)
tree7a8847ba69f434e757339bad40d628a3af4b08ec /arch/powerpc
parente3bbbbfa13ea2901050a58b2cb382df7974e7373 (diff)
KVM: PPC: Book3S HV: Handle guest using doorbells for IPIs
* SRR1 wake reason field for system reset interrupt on wakeup from nap is now a 4-bit field on P8, compared to 3 bits on P7. * Set PECEDP in LPCR when napping because of H_CEDE so guest doorbells will wake us up. * Waking up from nap because of a guest doorbell interrupt is not a reason to exit the guest. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/include/asm/reg.h4
-rw-r--r--arch/powerpc/kvm/book3s_hv_rmhandlers.S19
2 files changed, 18 insertions, 5 deletions
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 5a9983147683..1248b40107ea 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -307,7 +307,9 @@
307#define LPCR_ILE 0x02000000 /* !HV irqs set MSR:LE */ 307#define LPCR_ILE 0x02000000 /* !HV irqs set MSR:LE */
308#define LPCR_AIL_0 0x00000000 /* MMU off exception offset 0x0 */ 308#define LPCR_AIL_0 0x00000000 /* MMU off exception offset 0x0 */
309#define LPCR_AIL_3 0x01800000 /* MMU on exception offset 0xc00...4xxx */ 309#define LPCR_AIL_3 0x01800000 /* MMU on exception offset 0xc00...4xxx */
310#define LPCR_PECE 0x00007000 /* powersave exit cause enable */ 310#define LPCR_PECE 0x0001f000 /* powersave exit cause enable */
311#define LPCR_PECEDP 0x00010000 /* directed priv dbells cause exit */
312#define LPCR_PECEDH 0x00008000 /* directed hyp dbells cause exit */
311#define LPCR_PECE0 0x00004000 /* ext. exceptions can cause exit */ 313#define LPCR_PECE0 0x00004000 /* ext. exceptions can cause exit */
312#define LPCR_PECE1 0x00002000 /* decrementer can cause exit */ 314#define LPCR_PECE1 0x00002000 /* decrementer can cause exit */
313#define LPCR_PECE2 0x00001000 /* machine check etc can cause exit */ 315#define LPCR_PECE2 0x00001000 /* machine check etc can cause exit */
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
index 386e141dbf16..9e89c7577b4a 100644
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -1857,13 +1857,16 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_206)
1857 bl kvmppc_save_fp 1857 bl kvmppc_save_fp
1858 1858
1859 /* 1859 /*
1860 * Take a nap until a decrementer or external interrupt occurs, 1860 * Take a nap until a decrementer or external or doobell interrupt
1861 * with PECE1 (wake on decr) and PECE0 (wake on external) set in LPCR 1861 * occurs, with PECE1, PECE0 and PECEDP set in LPCR
1862 */ 1862 */
1863 li r0,1 1863 li r0,1
1864 stb r0,HSTATE_HWTHREAD_REQ(r13) 1864 stb r0,HSTATE_HWTHREAD_REQ(r13)
1865 mfspr r5,SPRN_LPCR 1865 mfspr r5,SPRN_LPCR
1866 ori r5,r5,LPCR_PECE0 | LPCR_PECE1 1866 ori r5,r5,LPCR_PECE0 | LPCR_PECE1
1867BEGIN_FTR_SECTION
1868 oris r5,r5,LPCR_PECEDP@h
1869END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
1867 mtspr SPRN_LPCR,r5 1870 mtspr SPRN_LPCR,r5
1868 isync 1871 isync
1869 li r0, 0 1872 li r0, 0
@@ -1979,14 +1982,22 @@ machine_check_realmode:
1979 */ 1982 */
1980kvmppc_check_wake_reason: 1983kvmppc_check_wake_reason:
1981 mfspr r6, SPRN_SRR1 1984 mfspr r6, SPRN_SRR1
1982 rlwinm r6, r6, 44-31, 0x7 /* extract wake reason field */ 1985BEGIN_FTR_SECTION
1983 cmpwi r6, 4 /* was it an external interrupt? */ 1986 rlwinm r6, r6, 45-31, 0xf /* extract wake reason field (P8) */
1987FTR_SECTION_ELSE
1988 rlwinm r6, r6, 45-31, 0xe /* P7 wake reason field is 3 bits */
1989ALT_FTR_SECTION_END_IFSET(CPU_FTR_ARCH_207S)
1990 cmpwi r6, 8 /* was it an external interrupt? */
1984 li r12, BOOK3S_INTERRUPT_EXTERNAL 1991 li r12, BOOK3S_INTERRUPT_EXTERNAL
1985 beq kvmppc_read_intr /* if so, see what it was */ 1992 beq kvmppc_read_intr /* if so, see what it was */
1986 li r3, 0 1993 li r3, 0
1987 li r12, 0 1994 li r12, 0
1988 cmpwi r6, 6 /* was it the decrementer? */ 1995 cmpwi r6, 6 /* was it the decrementer? */
1989 beq 0f 1996 beq 0f
1997BEGIN_FTR_SECTION
1998 cmpwi r6, 5 /* privileged doorbell? */
1999 beq 0f
2000END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
1990 li r3, 1 /* anything else, return 1 */ 2001 li r3, 1 /* anything else, return 1 */
19910: blr 20020: blr
1992 2003