Skip to content

Commit c040c74

Browse files
committed
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 <[email protected]> Link: https://msgid.link/[email protected]
1 parent fe32945 commit c040c74

File tree

8 files changed

+27
-24
lines changed

8 files changed

+27
-24
lines changed

arch/powerpc/include/asm/lppaca.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,6 @@
66
#ifndef _ASM_POWERPC_LPPACA_H
77
#define _ASM_POWERPC_LPPACA_H
88

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-
319
#ifdef __KERNEL__
3210

3311
/*

arch/powerpc/include/asm/vphn.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* SPDX-License-Identifier: GPL-2.0-or-later */
2+
#ifndef _ASM_POWERPC_VPHN_H
3+
#define _ASM_POWERPC_VPHN_H
4+
5+
/* The H_HOME_NODE_ASSOCIATIVITY h_call returns 6 64-bit registers. */
6+
#define VPHN_REGISTER_COUNT 6
7+
8+
/*
9+
* 6 64-bit registers unpacked into up to 24 be32 associativity values. To
10+
* form the complete property we have to add the length in the first cell.
11+
*/
12+
#define VPHN_ASSOC_BUFSIZE (VPHN_REGISTER_COUNT*sizeof(u64)/sizeof(u16) + 1)
13+
14+
/*
15+
* The H_HOME_NODE_ASSOCIATIVITY hcall takes two values for flags:
16+
* 1 for retrieving associativity information for a guest cpu
17+
* 2 for retrieving associativity information for a host/hypervisor cpu
18+
*/
19+
#define VPHN_FLAG_VCPU 1
20+
#define VPHN_FLAG_PCPU 2
21+
22+
#endif // _ASM_POWERPC_VPHN_H

arch/powerpc/mm/numa.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <asm/hvcall.h>
3535
#include <asm/setup.h>
3636
#include <asm/vdso.h>
37+
#include <asm/vphn.h>
3738
#include <asm/drmem.h>
3839

3940
static int numa_enabled = 1;

arch/powerpc/platforms/pseries/lpar.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <asm/kexec.h>
4242
#include <asm/fadump.h>
4343
#include <asm/dtl.h>
44+
#include <asm/vphn.h>
4445

4546
#include "pseries.h"
4647

arch/powerpc/platforms/pseries/vas.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <asm/hvcall.h>
1818
#include <asm/plpar_wrappers.h>
1919
#include <asm/firmware.h>
20+
#include <asm/vphn.h>
2021
#include <asm/vas.h>
2122
#include "vas.h"
2223

arch/powerpc/platforms/pseries/vphn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include <asm/byteorder.h>
3-
#include <asm/lppaca.h>
3+
#include <asm/vphn.h>
44

55
/*
66
* The associativity domain numbers are returned from the hypervisor as a

tools/testing/selftests/powerpc/vphn/asm/lppaca.h

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../../arch/powerpc/include/asm/vphn.h

0 commit comments

Comments
 (0)