qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
To: qemu-ppc@nongnu.org, david@gibson.dropbear.id.au
Cc: qemu-devel@nongnu.org, clg@kaod.org, benh@kernel.crashing.org,
	nikunj@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH v2 3/8] ppc/xics: Implement H_IPOLL using an accessor
Date: Wed, 29 Jun 2016 00:35:14 +0530	[thread overview]
Message-ID: <1467140719-4701-4-git-send-email-nikunj@linux.vnet.ibm.com> (raw)
In-Reply-To: <1467140719-4701-1-git-send-email-nikunj@linux.vnet.ibm.com>

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>

None of the other presenter functions directly mucks with the
internal state, so don't do it there either.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/intc/xics.c        | 8 ++++++++
 hw/intc/xics_spapr.c  | 7 ++++---
 include/hw/ppc/xics.h | 1 +
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index f01af08..f43f98a 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -288,6 +288,14 @@ uint32_t icp_accept(ICPState *ss)
     return xirr;
 }
 
+uint32_t icp_ipoll(ICPState *ss, uint32_t *mfrr)
+{
+    if (mfrr) {
+        *mfrr = ss->mfrr;
+    }
+    return ss->xirr;
+}
+
 void icp_eoi(XICSState *icp, int server, uint32_t xirr)
 {
     ICPState *ss = icp->ss + server;
diff --git a/hw/intc/xics_spapr.c b/hw/intc/xics_spapr.c
index 89190ef..94571dd 100644
--- a/hw/intc/xics_spapr.c
+++ b/hw/intc/xics_spapr.c
@@ -99,10 +99,11 @@ static target_ulong h_ipoll(PowerPCCPU *cpu, sPAPRMachineState *spapr,
                             target_ulong opcode, target_ulong *args)
 {
     CPUState *cs = CPU(cpu);
-    ICPState *ss = &spapr->icp->ss[cs->cpu_index];
+    uint32_t mfrr;
+    uint32_t xirr = icp_ipoll(spapr->icp->ss + cs->cpu_index, &mfrr);
 
-    args[0] = ss->xirr;
-    args[1] = ss->mfrr;
+    args[0] = xirr;
+    args[1] = mfrr;
 
     return H_SUCCESS;
 }
diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
index 3349006..7445a14 100644
--- a/include/hw/ppc/xics.h
+++ b/include/hw/ppc/xics.h
@@ -186,6 +186,7 @@ int xics_get_cpu_index_by_dt_id(int cpu_dt_id);
 void icp_set_cppr(XICSState *icp, int server, uint8_t cppr);
 void icp_set_mfrr(XICSState *icp, int server, uint8_t mfrr);
 uint32_t icp_accept(ICPState *ss);
+uint32_t icp_ipoll(ICPState *ss, uint32_t *mfrr);
 void icp_eoi(XICSState *icp, int server, uint32_t xirr);
 
 void ics_write_xive(ICSState *ics, int nr, int server,
-- 
2.7.4

  parent reply	other threads:[~2016-06-28 19:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-28 19:05 [Qemu-devel] [PATCH v2 0/8] sPAPR xics rework/cleanup Nikunj A Dadhania
2016-06-28 19:05 ` [Qemu-devel] [PATCH v2 1/8] ppc/xics: Rename existing xics to xics_spapr Nikunj A Dadhania
2016-06-28 19:05 ` [Qemu-devel] [PATCH v2 2/8] ppc/xics: Move SPAPR specific code to a separate file Nikunj A Dadhania
2016-06-28 19:05 ` Nikunj A Dadhania [this message]
2016-06-28 19:05 ` [Qemu-devel] [PATCH v2 4/8] ppc/xics: Replace "icp" with "xics" in most places Nikunj A Dadhania
2016-06-28 19:05 ` [Qemu-devel] [PATCH v2 5/8] ppc/xics: Make the ICSState a list Nikunj A Dadhania
2016-06-29  3:37   ` David Gibson
2016-06-29  4:05     ` Benjamin Herrenschmidt
2016-06-28 19:05 ` [Qemu-devel] [PATCH v2 6/8] ppc/xics: An ICS with offset 0 is assumed to be uninitialized Nikunj A Dadhania
2016-06-28 19:05 ` [Qemu-devel] [PATCH v2 7/8] ppc/xics: Use a helper to add a new ICS Nikunj A Dadhania
2016-06-28 19:05 ` [Qemu-devel] [PATCH v2 8/8] ppc/xics: Split ICS into ics-base and ics class Nikunj A Dadhania
2016-06-30  8:24   ` Cédric Le Goater
2016-06-30  9:54     ` Nikunj A Dadhania
2016-06-29  3:40 ` [Qemu-devel] [PATCH v2 0/8] sPAPR xics rework/cleanup David Gibson

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=1467140719-4701-4-git-send-email-nikunj@linux.vnet.ibm.com \
    --to=nikunj@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.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).