All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: KVM list <kvm@vger.kernel.org>
Cc: kvm-ppc@vger.kernel.org, Avi Kivity <avi@redhat.com>,
	Marcelo Tossati <mtosatti@redhat.com>,
	Bharat Bhushan <r65777@freescale.com>,
	Bharat Bhushan <bharat.bhushan@freescale.com>
Subject: [PATCH 2/9] booke/bookehv: Add host crit-watchdog exception support
Date: Wed, 11 Jul 2012 02:56:37 +0200	[thread overview]
Message-ID: <1341968204-6756-3-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1341968204-6756-1-git-send-email-agraf@suse.de>

From: Bharat Bhushan <r65777@freescale.com>

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/include/asm/hw_irq.h |    2 ++
 arch/powerpc/kvm/booke.c          |   21 +++++++++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index c9aac24..2aadb47 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -34,6 +34,8 @@ extern void __replay_interrupt(unsigned int vector);
 
 extern void timer_interrupt(struct pt_regs *);
 extern void performance_monitor_exception(struct pt_regs *regs);
+extern void WatchdogException(struct pt_regs *regs);
+extern void unknown_exception(struct pt_regs *regs);
 
 #ifdef CONFIG_PPC64
 #include <asm/paca.h>
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 86681ee..d25a097 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -612,6 +612,12 @@ static void kvmppc_fill_pt_regs(struct pt_regs *regs)
 	regs->link = lr;
 }
 
+/*
+ * For interrupts needed to be handled by host interrupt handlers,
+ * corresponding host handler are called from here in similar way
+ * (but not exact) as they are called from low level handler
+ * (such as from arch/powerpc/kernel/head_fsl_booke.S).
+ */
 static void kvmppc_restart_interrupt(struct kvm_vcpu *vcpu,
 				     unsigned int exit_nr)
 {
@@ -639,6 +645,17 @@ static void kvmppc_restart_interrupt(struct kvm_vcpu *vcpu,
 		kvmppc_fill_pt_regs(&regs);
 		performance_monitor_exception(&regs);
 		break;
+	case BOOKE_INTERRUPT_WATCHDOG:
+		kvmppc_fill_pt_regs(&regs);
+#ifdef CONFIG_BOOKE_WDT
+		WatchdogException(&regs);
+#else
+		unknown_exception(&regs);
+#endif
+		break;
+	case BOOKE_INTERRUPT_CRITICAL:
+		unknown_exception(&regs);
+		break;
 	}
 }
 
@@ -683,6 +700,10 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
 		r = RESUME_GUEST;
 		break;
 
+	case BOOKE_INTERRUPT_WATCHDOG:
+		r = RESUME_GUEST;
+		break;
+
 	case BOOKE_INTERRUPT_DOORBELL:
 		kvmppc_account_exit(vcpu, DBELL_EXITS);
 		r = RESUME_GUEST;
-- 
1.6.0.2


WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: KVM list <kvm@vger.kernel.org>
Cc: kvm-ppc@vger.kernel.org, Avi Kivity <avi@redhat.com>,
	Marcelo Tossati <mtosatti@redhat.com>,
	Bharat Bhushan <r65777@freescale.com>,
	Bharat Bhushan <bharat.bhushan@freescale.com>
Subject: [PATCH 2/9] booke/bookehv: Add host crit-watchdog exception support
Date: Wed, 11 Jul 2012 00:56:37 +0000	[thread overview]
Message-ID: <1341968204-6756-3-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1341968204-6756-1-git-send-email-agraf@suse.de>

From: Bharat Bhushan <r65777@freescale.com>

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/include/asm/hw_irq.h |    2 ++
 arch/powerpc/kvm/booke.c          |   21 +++++++++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index c9aac24..2aadb47 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -34,6 +34,8 @@ extern void __replay_interrupt(unsigned int vector);
 
 extern void timer_interrupt(struct pt_regs *);
 extern void performance_monitor_exception(struct pt_regs *regs);
+extern void WatchdogException(struct pt_regs *regs);
+extern void unknown_exception(struct pt_regs *regs);
 
 #ifdef CONFIG_PPC64
 #include <asm/paca.h>
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 86681ee..d25a097 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -612,6 +612,12 @@ static void kvmppc_fill_pt_regs(struct pt_regs *regs)
 	regs->link = lr;
 }
 
+/*
+ * For interrupts needed to be handled by host interrupt handlers,
+ * corresponding host handler are called from here in similar way
+ * (but not exact) as they are called from low level handler
+ * (such as from arch/powerpc/kernel/head_fsl_booke.S).
+ */
 static void kvmppc_restart_interrupt(struct kvm_vcpu *vcpu,
 				     unsigned int exit_nr)
 {
@@ -639,6 +645,17 @@ static void kvmppc_restart_interrupt(struct kvm_vcpu *vcpu,
 		kvmppc_fill_pt_regs(&regs);
 		performance_monitor_exception(&regs);
 		break;
+	case BOOKE_INTERRUPT_WATCHDOG:
+		kvmppc_fill_pt_regs(&regs);
+#ifdef CONFIG_BOOKE_WDT
+		WatchdogException(&regs);
+#else
+		unknown_exception(&regs);
+#endif
+		break;
+	case BOOKE_INTERRUPT_CRITICAL:
+		unknown_exception(&regs);
+		break;
 	}
 }
 
@@ -683,6 +700,10 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
 		r = RESUME_GUEST;
 		break;
 
+	case BOOKE_INTERRUPT_WATCHDOG:
+		r = RESUME_GUEST;
+		break;
+
 	case BOOKE_INTERRUPT_DOORBELL:
 		kvmppc_account_exit(vcpu, DBELL_EXITS);
 		r = RESUME_GUEST;
-- 
1.6.0.2


  parent reply	other threads:[~2012-07-11  0:56 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11  0:56 [PULL 0/9] ppc patch queue 2012-07-11 Alexander Graf
2012-07-11  0:56 ` Alexander Graf
2012-07-11  0:56 ` [PATCH 1/9] KVM: PPC: Book3S HV: Drop locks around call to kvmppc_pin_guest_page Alexander Graf
2012-07-11  0:56   ` Alexander Graf
2012-07-11  0:56 ` Alexander Graf [this message]
2012-07-11  0:56   ` [PATCH 2/9] booke/bookehv: Add host crit-watchdog exception support Alexander Graf
2012-07-11  0:56 ` [PATCH 3/9] booke: Added crit/mc exception handler for e500v2 Alexander Graf
2012-07-11  0:56   ` Alexander Graf
2012-07-11  0:56 ` [PATCH 4/9] KVM: PPC: bookehv64: Add support for std/ld emulation Alexander Graf
2012-07-11  0:56   ` Alexander Graf
2012-07-11  0:56 ` [PATCH 5/9] KVM: PPC: bookehv: Add ESR flag to Data Storage Interrupt Alexander Graf
2012-07-11  0:56   ` Alexander Graf
2012-07-11  0:56 ` [PATCH 6/9] KVM: PPC64: booke: Set interrupt computation mode for 64-bit host Alexander Graf
2012-07-11  0:56   ` Alexander Graf
2012-07-11  0:56 ` [PATCH 7/9] KVM: PPC: e500mc: Fix tlbilx emulation for 64-bit guests Alexander Graf
2012-07-11  0:56   ` Alexander Graf
2012-07-11  0:56 ` [PATCH 8/9] KVM: PPC: Critical interrupt emulation support Alexander Graf
2012-07-11  0:56   ` Alexander Graf
2012-07-11  0:56 ` [PATCH 9/9] powerpc/kvm: Fix "PR" KVM implementation of H_CEDE Alexander Graf
2012-07-11  0:56   ` Alexander Graf
2012-07-11  8:37 ` [PULL 0/9] ppc patch queue 2012-07-11 Avi Kivity
2012-07-11  8:37   ` Avi Kivity
2012-07-11  8:38 ` Avi Kivity
2012-07-11  8:38   ` Avi Kivity
2012-07-15  9:43 ` Avi Kivity
2012-07-15  9:43   ` Avi Kivity

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=1341968204-6756-3-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=bharat.bhushan@freescale.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=r65777@freescale.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.