From: Alexander Graf <agraf@suse.de>
To: "kvm@vger.kernel.org list" <kvm@vger.kernel.org>
Cc: Avi Kivity <avi@redhat.com>,
kvm-ppc@vger.kernel.org, Paul Mackerras <paulus@samba.org>
Subject: [PATCH 05/17] KVM: PPC: Deliver program interrupts right away instead of queueing them
Date: Mon, 4 Jul 2011 16:12:42 +0200 [thread overview]
Message-ID: <1309788774-13644-6-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1309788774-13644-1-git-send-email-agraf@suse.de>
From: Paul Mackerras <paulus@samba.org>
Doing so means that we don't have to save the flags anywhere and gets
rid of the last reference to to_book3s(vcpu) in arch/powerpc/kvm/book3s.c.
Doing so is OK because a program interrupt won't be generated at the
same time as any other synchronous interrupt. If a program interrupt
and an asynchronous interrupt (external or decrementer) are generated
at the same time, the program interrupt will be delivered, which is
correct because it has a higher priority, and then the asynchronous
interrupt will be masked.
We don't ever generate system reset or machine check interrupts to the
guest, but if we did, then we would need to make sure they got delivered
rather than the program interrupt. The current code would be wrong in
this situation anyway since it would deliver the program interrupt as
well as the reset/machine check interrupt.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/powerpc/kvm/book3s.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 163e3e1..f68a34d 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -129,8 +129,8 @@ void kvmppc_book3s_queue_irqprio(struct kvm_vcpu *vcpu, unsigned int vec)
void kvmppc_core_queue_program(struct kvm_vcpu *vcpu, ulong flags)
{
- to_book3s(vcpu)->prog_flags = flags;
- kvmppc_book3s_queue_irqprio(vcpu, BOOK3S_INTERRUPT_PROGRAM);
+ /* might as well deliver this straight away */
+ kvmppc_inject_interrupt(vcpu, BOOK3S_INTERRUPT_PROGRAM, flags);
}
void kvmppc_core_queue_dec(struct kvm_vcpu *vcpu)
@@ -170,7 +170,6 @@ int kvmppc_book3s_irqprio_deliver(struct kvm_vcpu *vcpu, unsigned int priority)
{
int deliver = 1;
int vec = 0;
- ulong flags = 0ULL;
bool crit = kvmppc_critical_section(vcpu);
switch (priority) {
@@ -206,7 +205,6 @@ int kvmppc_book3s_irqprio_deliver(struct kvm_vcpu *vcpu, unsigned int priority)
break;
case BOOK3S_IRQPRIO_PROGRAM:
vec = BOOK3S_INTERRUPT_PROGRAM;
- flags = to_book3s(vcpu)->prog_flags;
break;
case BOOK3S_IRQPRIO_VSX:
vec = BOOK3S_INTERRUPT_VSX;
@@ -237,7 +235,7 @@ int kvmppc_book3s_irqprio_deliver(struct kvm_vcpu *vcpu, unsigned int priority)
#endif
if (deliver)
- kvmppc_inject_interrupt(vcpu, vec, flags);
+ kvmppc_inject_interrupt(vcpu, vec, 0);
return deliver;
}
--
1.6.0.2
next prev parent reply other threads:[~2011-07-04 14:12 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-04 14:12 [PULL 00/17] KVM PPC patch queue 2011-07-04 Alexander Graf
2011-07-04 14:12 ` [PATCH 01/17] KVM: PPC: Fix machine checks on 32-bit Book3S Alexander Graf
2011-07-04 14:12 ` [PATCH 02/17] KVM: PPC: Move fields between struct kvm_vcpu_arch and kvmppc_vcpu_book3s Alexander Graf
2011-07-04 14:12 ` [PATCH 03/17] KVM: PPC: Split out code from book3s.c into book3s_pr.c Alexander Graf
2011-07-04 14:12 ` [PATCH 04/17] powerpc, KVM: Rework KVM checks in first-level interrupt handlers Alexander Graf
2011-07-04 14:12 ` Alexander Graf [this message]
2011-07-04 14:12 ` [PATCH 06/17] KVM: PPC: Pass init/destroy vm and prepare/commit memory region ops down Alexander Graf
2011-07-04 14:12 ` [PATCH 07/17] KVM: PPC: Move guest enter/exit down into subarch-specific code Alexander Graf
2011-07-04 14:12 ` [PATCH 08/17] powerpc: Set up LPCR for running guest partitions Alexander Graf
2011-07-04 14:12 ` [PATCH 09/17] KVM: PPC: Split host-state fields out of kvmppc_book3s_shadow_vcpu Alexander Graf
2011-07-04 14:12 ` [PATCH 10/17] KVM: PPC: Add support for Book3S processors in hypervisor mode Alexander Graf
2011-07-04 14:12 ` [PATCH 11/17] KVM: PPC: Handle some PAPR hcalls in the kernel Alexander Graf
2011-07-04 14:12 ` [PATCH 12/17] KVM: PPC: Accelerate H_PUT_TCE by implementing it in real mode Alexander Graf
2011-07-04 14:12 ` [PATCH 13/17] KVM: PPC: Allow book3s_hv guests to use SMT processor modes Alexander Graf
2011-07-04 14:12 ` [PATCH 14/17] KVM: PPC: Allocate RMAs (Real Mode Areas) at boot for use by guests Alexander Graf
2011-07-04 14:12 ` [PATCH 15/17] powerpc, KVM: Split HVMODE_206 cpu feature bit into separate HV and architecture bits Alexander Graf
2011-07-04 14:12 ` [PATCH 16/17] KVM: PPC: book3s_hv: Add support for PPC970-family processors Alexander Graf
2011-07-04 14:12 ` [PATCH 17/17] KVM: PPC: Remove prog_flags Alexander Graf
2011-07-07 9:35 ` [PULL 00/17] KVM PPC patch queue 2011-07-04 Marcelo Tosatti
-- strict thread matches above, loose matches on Subject: below --
2011-06-29 10:15 [PATCH 0/17] Hypervisor-mode KVM on POWER7 and PPC970 Paul Mackerras
2011-06-29 10:18 ` [PATCH 05/17] KVM: PPC: Deliver program interrupts right away instead of queueing them Paul Mackerras
2011-07-01 11:47 ` Alexander Graf
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=1309788774-13644-6-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=avi@redhat.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=paulus@samba.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