162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
262306a36Sopenharmony_ci#ifndef _ASM_POWERPC_VPHN_H
362306a36Sopenharmony_ci#define _ASM_POWERPC_VPHN_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci/* The H_HOME_NODE_ASSOCIATIVITY h_call returns 6 64-bit registers. */
662306a36Sopenharmony_ci#define VPHN_REGISTER_COUNT 6
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci/*
962306a36Sopenharmony_ci * 6 64-bit registers unpacked into up to 24 be32 associativity values. To
1062306a36Sopenharmony_ci * form the complete property we have to add the length in the first cell.
1162306a36Sopenharmony_ci */
1262306a36Sopenharmony_ci#define VPHN_ASSOC_BUFSIZE (VPHN_REGISTER_COUNT*sizeof(u64)/sizeof(u16) + 1)
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci/*
1562306a36Sopenharmony_ci * The H_HOME_NODE_ASSOCIATIVITY hcall takes two values for flags:
1662306a36Sopenharmony_ci * 1 for retrieving associativity information for a guest cpu
1762306a36Sopenharmony_ci * 2 for retrieving associativity information for a host/hypervisor cpu
1862306a36Sopenharmony_ci */
1962306a36Sopenharmony_ci#define VPHN_FLAG_VCPU	1
2062306a36Sopenharmony_ci#define VPHN_FLAG_PCPU	2
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_cilong hcall_vphn(unsigned long cpu, u64 flags, __be32 *associativity);
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci#endif // _ASM_POWERPC_VPHN_H
25