aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2014-04-14 19:52:28 +1000
committerWang Sen <wangsen@linux.vnet.ibm.com>2014-04-16 11:15:21 +0800
commitf6e9174d34a5af087b0510a41e9da2ddc4afef69 (patch)
tree640f0e879571140943107c5f63962bce1617d0c4
parent846274db638806ae00a048339f345c4779e92b1e (diff)
downloadpowerkvm-f6e9174d34a5af087b0510a41e9da2ddc4afef69.tar.gz
KVM: PPC: Book3S PR: Handle facility-unavailable interrupts gracefully
At present, if a PR guest on a POWER8 machine tries to access some disabled functionality such as transactional memory, the result is a facility-unavailable interrupt, which isn't handled in kvmppc_handle_exit_pr(), resulting in a call to BUG(), crashing the PR host kernel. This adds code to handle the facility-unavailable interrupts and give the guest an illegal instruction interrupt, instead of crashing the PR host. Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/include/asm/kvm_asm.h1
-rw-r--r--arch/powerpc/kvm/book3s_pr.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kvm_asm.h b/arch/powerpc/include/asm/kvm_asm.h
index 8337c33c2eb346..fb3d04cbc76970 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -101,6 +101,7 @@
#define BOOK3S_INTERRUPT_PERFMON 0xf00
#define BOOK3S_INTERRUPT_ALTIVEC 0xf20
#define BOOK3S_INTERRUPT_VSX 0xf40
+#define BOOK3S_INTERRUPT_FAC_UNAVAIL 0xf60
#define BOOK3S_INTERRUPT_H_FAC_UNAVAIL 0xf80
#define BOOK3S_IRQPRIO_SYSTEM_RESET 0
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index 955c75ade84bb4..bf3c097249aa75 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -1010,6 +1010,11 @@ program_interrupt:
kvmppc_book3s_queue_irqprio(vcpu, exit_nr);
r = RESUME_GUEST;
break;
+ case BOOK3S_INTERRUPT_FAC_UNAVAIL:
+ case BOOK3S_INTERRUPT_H_FAC_UNAVAIL:
+ kvmppc_core_queue_program(vcpu, SRR1_PROGILL);
+ r = RESUME_GUEST;
+ break;
default:
{
ulong shadow_srr1 = vcpu->arch.shadow_srr1;