diff options
author | Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> | 2019-07-03 22:33:58 +0530 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-07-04 22:23:38 +1000 |
commit | ef34e0efa22a867f8db16feb79fba9964cfbe253 (patch) | |
tree | 8da2d8e0af59be1127348854d04082fdbcd47fb3 /arch/powerpc/mm/numa.c | |
parent | 06220d78f24a20549757be1014e57c382406cc92 (diff) | |
download | linux-ef34e0efa22a867f8db16feb79fba9964cfbe253.tar.gz linux-ef34e0efa22a867f8db16feb79fba9964cfbe253.tar.bz2 linux-ef34e0efa22a867f8db16feb79fba9964cfbe253.zip |
powerpc/pseries: Generalize hcall_vphn()
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.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/numa.c')
-rw-r--r-- | arch/powerpc/mm/numa.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 57e64273cb33..57f006b6214b 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -1087,6 +1087,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. */ @@ -1165,25 +1176,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; - rc = hcall_vphn(cpu, associativity); + rc = hcall_vphn(get_hard_smp_processor_id(cpu), + VPHN_FLAG_VCPU, associativity); switch (rc) { case H_FUNCTION: |