aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/powerpc/include/asm/vphn.h
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2023-08-23 15:53:14 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2023-08-24 22:33:16 +1000
commitc040c7488b6a89c98dd0f6dd5f001101413779e2 (patch)
treeccf56fe13c89388f06d4bb0cd3d0fb483994a2fd /arch/powerpc/include/asm/vphn.h
parentcxl: Drop unused detach_spa() (diff)
downloadwireguard-linux-c040c7488b6a89c98dd0f6dd5f001101413779e2.tar.xz
wireguard-linux-c040c7488b6a89c98dd0f6dd5f001101413779e2.zip
powerpc/pseries: Move VPHN constants into vphn.h
These don't have any particularly good reason to belong in lppaca.h, move them into their own header. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230823055317.751786-1-mpe@ellerman.id.au
Diffstat (limited to 'arch/powerpc/include/asm/vphn.h')
-rw-r--r--arch/powerpc/include/asm/vphn.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/vphn.h b/arch/powerpc/include/asm/vphn.h
new file mode 100644
index 000000000000..e0970603fce2
--- /dev/null
+++ b/arch/powerpc/include/asm/vphn.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef _ASM_POWERPC_VPHN_H
+#define _ASM_POWERPC_VPHN_H
+
+/* The H_HOME_NODE_ASSOCIATIVITY h_call returns 6 64-bit registers. */
+#define VPHN_REGISTER_COUNT 6
+
+/*
+ * 6 64-bit registers unpacked into up to 24 be32 associativity values. To
+ * form the complete property we have to add the length in the first cell.
+ */
+#define VPHN_ASSOC_BUFSIZE (VPHN_REGISTER_COUNT*sizeof(u64)/sizeof(u16) + 1)
+
+/*
+ * The H_HOME_NODE_ASSOCIATIVITY hcall takes two values for flags:
+ * 1 for retrieving associativity information for a guest cpu
+ * 2 for retrieving associativity information for a host/hypervisor cpu
+ */
+#define VPHN_FLAG_VCPU 1
+#define VPHN_FLAG_PCPU 2
+
+#endif // _ASM_POWERPC_VPHN_H