.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* |
---|
2 | 3 | * lppaca.h |
---|
3 | 4 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify |
---|
6 | | - * it under the terms of the GNU General Public License as published by |
---|
7 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
8 | | - * (at your option) any later version. |
---|
9 | | - * |
---|
10 | | - * This program is distributed in the hope that it will be useful, |
---|
11 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | | - * GNU General Public License for more details. |
---|
14 | | - * |
---|
15 | | - * You should have received a copy of the GNU General Public License |
---|
16 | | - * along with this program; if not, write to the Free Software |
---|
17 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
18 | 5 | */ |
---|
19 | 6 | #ifndef _ASM_POWERPC_LPPACA_H |
---|
20 | 7 | #define _ASM_POWERPC_LPPACA_H |
---|
| 8 | + |
---|
| 9 | +/* |
---|
| 10 | + * The below VPHN macros are outside the __KERNEL__ check since these are |
---|
| 11 | + * used for compiling the vphn selftest in userspace |
---|
| 12 | + */ |
---|
| 13 | + |
---|
| 14 | +/* The H_HOME_NODE_ASSOCIATIVITY h_call returns 6 64-bit registers. */ |
---|
| 15 | +#define VPHN_REGISTER_COUNT 6 |
---|
| 16 | + |
---|
| 17 | +/* |
---|
| 18 | + * 6 64-bit registers unpacked into up to 24 be32 associativity values. To |
---|
| 19 | + * form the complete property we have to add the length in the first cell. |
---|
| 20 | + */ |
---|
| 21 | +#define VPHN_ASSOC_BUFSIZE (VPHN_REGISTER_COUNT*sizeof(u64)/sizeof(u16) + 1) |
---|
| 22 | + |
---|
| 23 | +/* |
---|
| 24 | + * The H_HOME_NODE_ASSOCIATIVITY hcall takes two values for flags: |
---|
| 25 | + * 1 for retrieving associativity information for a guest cpu |
---|
| 26 | + * 2 for retrieving associativity information for a host/hypervisor cpu |
---|
| 27 | + */ |
---|
| 28 | +#define VPHN_FLAG_VCPU 1 |
---|
| 29 | +#define VPHN_FLAG_PCPU 2 |
---|
| 30 | + |
---|
21 | 31 | #ifdef __KERNEL__ |
---|
22 | 32 | |
---|
23 | 33 | /* |
---|
.. | .. |
---|
135 | 145 | } save_area[SLB_NUM_BOLTED]; |
---|
136 | 146 | } ____cacheline_aligned; |
---|
137 | 147 | |
---|
138 | | -/* |
---|
139 | | - * Layout of entries in the hypervisor's dispatch trace log buffer. |
---|
140 | | - */ |
---|
141 | | -struct dtl_entry { |
---|
142 | | - u8 dispatch_reason; |
---|
143 | | - u8 preempt_reason; |
---|
144 | | - __be16 processor_id; |
---|
145 | | - __be32 enqueue_to_dispatch_time; |
---|
146 | | - __be32 ready_to_enqueue_time; |
---|
147 | | - __be32 waiting_to_ready_time; |
---|
148 | | - __be64 timebase; |
---|
149 | | - __be64 fault_addr; |
---|
150 | | - __be64 srr0; |
---|
151 | | - __be64 srr1; |
---|
152 | | -}; |
---|
153 | | - |
---|
154 | | -#define DISPATCH_LOG_BYTES 4096 /* bytes per cpu */ |
---|
155 | | -#define N_DISPATCH_LOG (DISPATCH_LOG_BYTES / sizeof(struct dtl_entry)) |
---|
156 | | - |
---|
157 | | -extern struct kmem_cache *dtl_cache; |
---|
158 | | - |
---|
159 | | -/* |
---|
160 | | - * When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE = y, the cpu accounting code controls |
---|
161 | | - * reading from the dispatch trace log. If other code wants to consume |
---|
162 | | - * DTL entries, it can set this pointer to a function that will get |
---|
163 | | - * called once for each DTL entry that gets processed. |
---|
164 | | - */ |
---|
165 | | -extern void (*dtl_consumer)(struct dtl_entry *entry, u64 index); |
---|
| 148 | +extern long hcall_vphn(unsigned long cpu, u64 flags, __be32 *associativity); |
---|
166 | 149 | |
---|
167 | 150 | #endif /* CONFIG_PPC_BOOK3S */ |
---|
168 | 151 | #endif /* __KERNEL__ */ |
---|