From: Mihai Caraman <mihai.caraman@freescale.com>
To: <linuxppc-dev@lists.ozlabs.org>
Cc: Mihai Caraman <mihai.caraman@freescale.com>,
kvm@vger.kernel.org, kvm-ppc@vger.kernel.org
Subject: [PATCH 6/6] powerpc/booke64: restore VDSO information on critical exception
Date: Mon, 6 Aug 2012 16:27:08 +0300 [thread overview]
Message-ID: <1344259628-31161-7-git-send-email-mihai.caraman@freescale.com> (raw)
In-Reply-To: <1344259628-31161-1-git-send-email-mihai.caraman@freescale.com>
Critical exception handler on 64-bit booke uses user-visible SPRG3 as scratch.
Restore VDSO information in SPRG3 on exception prolog.
Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
---
arch/powerpc/include/asm/paca.h | 3 +++
arch/powerpc/kernel/asm-offsets.c | 1 +
arch/powerpc/kernel/exceptions-64e.S | 4 +++-
arch/powerpc/kernel/vdso.c | 2 ++
4 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index daf813f..6b98ad4 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -118,6 +118,9 @@ struct paca_struct {
void *mc_kstack;
void *crit_kstack;
void *dbg_kstack;
+
+ /* User-visible sprg information */
+ ulong sprg3;
#endif /* CONFIG_PPC_BOOK3E */
mm_context_t context;
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 85b05c4..8ca338d 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -168,6 +168,7 @@ int main(void)
DEFINE(PACA_MC_STACK, offsetof(struct paca_struct, mc_kstack));
DEFINE(PACA_CRIT_STACK, offsetof(struct paca_struct, crit_kstack));
DEFINE(PACA_DBG_STACK, offsetof(struct paca_struct, dbg_kstack));
+ DEFINE(PACA_SPRG3, offsetof(struct paca_struct, sprg3));
#endif /* CONFIG_PPC_BOOK3E */
#ifdef CONFIG_PPC_STD_MMU_64
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
index 7476b0a..87a82fb 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -110,7 +110,9 @@
#define PROLOG_STORE_RESTORE_SCRATCH_CRIT \
mfspr r10,SPRN_SPRG_CRIT_SCRATCH; /* get r13 */ \
- std r10,PACA_EXCRIT+EX_R13(r13)
+ std r10,PACA_EXCRIT+EX_R13(r13); \
+ ld r11,PACA_SPRG3(r13); \
+ mtspr SPRN_SPRG_CRIT_SCRATCH,r11;
/* Variants of the "addition" argument for the prolog
*/
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index b67db22..a0b0d08 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -725,6 +725,8 @@ int __cpuinit vdso_getcpu_init(void)
mtspr(SPRN_SPRG3, val);
#ifdef CONFIG_KVM_BOOK3S_HANDLER
get_paca()->kvm_hstate.sprg3 = val;
+#elif CONFIG_PPC_BOOK3E
+ get_paca()->sprg3 = val;
#endif
put_cpu();
--
1.7.4.1
next prev parent reply other threads:[~2012-08-06 13:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-06 13:27 [PATCH 0/6] powerpc/booke64: add core support for KVM Mihai Caraman
2012-08-06 13:27 ` [PATCH 1/6] powerpc/booke64: fix machine check handler to use the right prolog Mihai Caraman
2012-08-06 13:27 ` [PATCH 2/6] powerpc/booke64: use GSRR registers in Guest Doorbell interrupts Mihai Caraman
2012-08-06 13:27 ` [PATCH 3/6] powerpc/booke64: add DO_KVM kernel hooks Mihai Caraman
2012-08-06 13:27 ` [PATCH 4/6] powerpc/booke64: remove mfspr srr1 duplicate in exception prolog Mihai Caraman
2012-08-06 13:27 ` [PATCH 5/6] powerpc/booke64: use SPRG0/3 scratch for bolted TLB miss & crit int Mihai Caraman
2012-08-06 13:27 ` Mihai Caraman [this message]
2012-09-05 5:38 ` [PATCH 6/6] powerpc/booke64: restore VDSO information on critical exception Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1344259628-31161-7-git-send-email-mihai.caraman@freescale.com \
--to=mihai.caraman@freescale.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).