diff options
Diffstat (limited to '')
-rw-r--r-- | arch/powerpc/platforms/pseries/vphn.c (renamed from arch/powerpc/mm/book3s64/vphn.c) | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/arch/powerpc/mm/book3s64/vphn.c b/arch/powerpc/platforms/pseries/vphn.c index 0ee7734afb50..3f07bf6c670e 100644 --- a/arch/powerpc/mm/book3s64/vphn.c +++ b/arch/powerpc/platforms/pseries/vphn.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include <asm/byteorder.h> -#include "vphn.h" +#include <asm/lppaca.h> /* * The associativity domain numbers are returned from the hypervisor as a @@ -22,7 +22,7 @@ * * Convert to the sequence they would appear in the ibm,associativity property. */ -int vphn_unpack_associativity(const long *packed, __be32 *unpacked) +static int vphn_unpack_associativity(const long *packed, __be32 *unpacked) { __be64 be_packed[VPHN_REGISTER_COUNT]; int i, nr_assoc_doms = 0; @@ -71,3 +71,19 @@ int vphn_unpack_associativity(const long *packed, __be32 *unpacked) return nr_assoc_doms; } + +/* NOTE: This file is included by a selftest and built in userspace. */ +#ifdef __KERNEL__ +#include <asm/hvcall.h> + +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; +} +#endif |