xref: /openbmc/linux/arch/powerpc/include/asm/vphn.h (revision 9a6c05fe)
1c040c748SMichael Ellerman /* SPDX-License-Identifier: GPL-2.0-or-later */
2c040c748SMichael Ellerman #ifndef _ASM_POWERPC_VPHN_H
3c040c748SMichael Ellerman #define _ASM_POWERPC_VPHN_H
4c040c748SMichael Ellerman 
5c040c748SMichael Ellerman /* The H_HOME_NODE_ASSOCIATIVITY h_call returns 6 64-bit registers. */
6c040c748SMichael Ellerman #define VPHN_REGISTER_COUNT 6
7c040c748SMichael Ellerman 
8c040c748SMichael Ellerman /*
9c040c748SMichael Ellerman  * 6 64-bit registers unpacked into up to 24 be32 associativity values. To
10c040c748SMichael Ellerman  * form the complete property we have to add the length in the first cell.
11c040c748SMichael Ellerman  */
12c040c748SMichael Ellerman #define VPHN_ASSOC_BUFSIZE (VPHN_REGISTER_COUNT*sizeof(u64)/sizeof(u16) + 1)
13c040c748SMichael Ellerman 
14c040c748SMichael Ellerman /*
15c040c748SMichael Ellerman  * The H_HOME_NODE_ASSOCIATIVITY hcall takes two values for flags:
16c040c748SMichael Ellerman  * 1 for retrieving associativity information for a guest cpu
17c040c748SMichael Ellerman  * 2 for retrieving associativity information for a host/hypervisor cpu
18c040c748SMichael Ellerman  */
19c040c748SMichael Ellerman #define VPHN_FLAG_VCPU	1
20c040c748SMichael Ellerman #define VPHN_FLAG_PCPU	2
21c040c748SMichael Ellerman 
22*9a6c05feSMichael Ellerman long hcall_vphn(unsigned long cpu, u64 flags, __be32 *associativity);
23*9a6c05feSMichael Ellerman 
24c040c748SMichael Ellerman #endif // _ASM_POWERPC_VPHN_H
25