From: Laurent Vivier <lvivier@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@ozlabs.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Thomas Huth <thuth@redhat.com>, Sam Bobroff <sbobroff@redhat.com>,
Laurent Vivier <lvivier@redhat.com>
Subject: [PATCH] powerpc/xive: store server for masked interrupt in kvmppc_xive_set_xive()
Date: Thu, 23 Nov 2017 10:06:33 +0100 [thread overview]
Message-ID: <20171123090633.873-1-lvivier@redhat.com> (raw)
This is needed to map kvmppc_xive_set_xive() behavior
to kvmppc_xics_set_xive().
As we store the server, kvmppc_xive_get_xive() can return
the good value and we can also allow kvmppc_xive_int_on().
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
arch/powerpc/kvm/book3s_xive.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_xive.c b/arch/powerpc/kvm/book3s_xive.c
index bf457843e032..2781b8733038 100644
--- a/arch/powerpc/kvm/book3s_xive.c
+++ b/arch/powerpc/kvm/book3s_xive.c
@@ -584,10 +584,14 @@ int kvmppc_xive_set_xive(struct kvm *kvm, u32 irq, u32 server,
* we could initialize interrupts with valid default
*/
- if (new_act_prio != MASKED &&
- (state->act_server != server ||
- state->act_priority != new_act_prio))
- rc = xive_target_interrupt(kvm, state, server, new_act_prio);
+ if (state->act_server != server ||
+ state->act_priority != new_act_prio) {
+ if (new_act_prio != MASKED)
+ rc = xive_target_interrupt(kvm, state, server,
+ new_act_prio);
+ if (!rc)
+ state->act_server = server;
+ }
/*
* Perform the final unmasking of the interrupt source
@@ -646,14 +650,6 @@ int kvmppc_xive_int_on(struct kvm *kvm, u32 irq)
pr_devel("int_on(irq=0x%x)\n", irq);
- /*
- * Check if interrupt was not targetted
- */
- if (state->act_priority == MASKED) {
- pr_devel("int_on on untargetted interrupt\n");
- return -EINVAL;
- }
-
/* If saved_priority is 0xff, do nothing */
if (state->saved_priority == MASKED)
return 0;
--
2.13.6
next reply other threads:[~2017-11-23 9:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-23 9:06 Laurent Vivier [this message]
2017-11-23 20:38 ` [PATCH] powerpc/xive: store server for masked interrupt in kvmppc_xive_set_xive() Benjamin Herrenschmidt
2017-12-05 3:05 ` Paul Mackerras
2017-12-05 8:06 ` Laurent Vivier
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=20171123090633.873-1-lvivier@redhat.com \
--to=lvivier@redhat.com \
--cc=benh@kernel.crashing.org \
--cc=kvm-ppc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@ozlabs.org \
--cc=pbonzini@redhat.com \
--cc=sbobroff@redhat.com \
--cc=thuth@redhat.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 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).