From: "Naveen N. Rao" <naveen.n.rao@linux.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: [PATCH v1 1/2] powerpc/pseries: Generalize hcall_vphn()
Date: Mon, 10 Dec 2018 23:44:46 +0530 [thread overview]
Message-ID: <89849f82d51056ad1a39f7649ddde9c46892b114.1544459267.git.naveen.n.rao@linux.ibm.com> (raw)
In-Reply-To: <cover.1544459267.git.naveen.n.rao@linux.ibm.com>
H_HOME_NODE_ASSOCIATIVITY hcall can take two different flags and return
different associativity information in each case. Generalize the
existing hcall_vphn() function to take flags as an argument and to
return the result. Update the only existing user to pass the proper
arguments.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.ibm.com>
---
arch/powerpc/mm/numa.c | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 87f0dd004295..6677a578f18d 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1078,6 +1078,17 @@ static void reset_topology_timer(void);
static int topology_timer_secs = 1;
static int topology_inited;
+static long hcall_vphn(unsigned long cpu, u64 flags, __be32 *associativity)
+{
+ long rc;
+ long retbuf[PLPAR_HCALL9_BUFSIZE] = {0};
+
+ rc = plpar_hcall9(H_HOME_NODE_ASSOCIATIVITY, retbuf, flags, cpu);
+ vphn_unpack_associativity(retbuf, associativity);
+
+ return rc;
+}
+
/*
* Change polling interval for associativity changes.
*/
@@ -1156,25 +1167,13 @@ static int update_cpu_associativity_changes_mask(void)
* Retrieve the new associativity information for a virtual processor's
* home node.
*/
-static long hcall_vphn(unsigned long cpu, __be32 *associativity)
-{
- long rc;
- long retbuf[PLPAR_HCALL9_BUFSIZE] = {0};
- u64 flags = 1;
- int hwcpu = get_hard_smp_processor_id(cpu);
-
- rc = plpar_hcall9(H_HOME_NODE_ASSOCIATIVITY, retbuf, flags, hwcpu);
- vphn_unpack_associativity(retbuf, associativity);
-
- return rc;
-}
-
static long vphn_get_associativity(unsigned long cpu,
__be32 *associativity)
{
long rc;
+ int hwcpu = get_hard_smp_processor_id(cpu);
- rc = hcall_vphn(cpu, associativity);
+ rc = hcall_vphn(hwcpu, 1, associativity);
switch (rc) {
case H_FUNCTION:
--
2.19.2
next prev parent reply other threads:[~2018-12-10 20:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-10 18:14 [PATCH v1 0/2] Interface to expose VPHN information Naveen N. Rao
2018-12-10 18:14 ` Naveen N. Rao [this message]
2018-12-10 18:14 ` [PATCH v1 2/2] powerpc/pseries: Add debugfs interface to retrieve VPHN info Naveen N. Rao
[not found] ` <e308130fe45a8930743cec9aba83d4885ac8d30d.1544459267.git.naveen.n.rao__35218.1831411601$1544472513$gmane$org@linux.ibm.com>
[not found] ` <e308130fe45a8930743cec9aba83d4885ac8d30d.1544459267.git.naveen.n.rao__35218. 1831411601$1544472513$gmane$org@linux.ibm.com>
2018-12-13 10:52 ` Naveen N. Rao
2018-12-14 0:33 ` Michael Ellerman
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=89849f82d51056ad1a39f7649ddde9c46892b114.1544459267.git.naveen.n.rao@linux.ibm.com \
--to=naveen.n.rao@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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).