Skip to content

Commit 61c5d9f

Browse files
srikardgregkh
authored andcommitted
powerpc: Refactor is_kvm_guest() declaration to new header
[ Upstream commit 92cc6bf ] Only code/declaration movement, in anticipation of doing a KVM-aware vcpu_is_preempted(). No additional changes. Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Acked-by: Waiman Long <longman@redhat.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20201202050456.164005-2-srikar@linux.vnet.ibm.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 67074c6 commit 61c5d9f

5 files changed

Lines changed: 18 additions & 7 deletions

File tree

‎arch/powerpc/include/asm/firmware.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,6 @@ extern int ibm_nmi_interlock_token;
134134

135135
extern unsigned int __start___fw_ftr_fixup, __stop___fw_ftr_fixup;
136136

137-
#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_KVM_GUEST)
138-
bool is_kvm_guest(void);
139-
#else
140-
static inline bool is_kvm_guest(void) { return false; }
141-
#endif
142-
143137
#ifdef CONFIG_PPC_PSERIES
144138
void pseries_probe_fw_features(void);
145139
#else
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
/*
3+
* Copyright (C) 2020 IBM Corporation
4+
*/
5+
6+
#ifndef _ASM_POWERPC_KVM_GUEST_H_
7+
#define _ASM_POWERPC_KVM_GUEST_H_
8+
9+
#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_KVM_GUEST)
10+
bool is_kvm_guest(void);
11+
#else
12+
static inline bool is_kvm_guest(void) { return false; }
13+
#endif
14+
15+
#endif /* _ASM_POWERPC_KVM_GUEST_H_ */

‎arch/powerpc/include/asm/kvm_para.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#ifndef __POWERPC_KVM_PARA_H__
99
#define __POWERPC_KVM_PARA_H__
1010

11-
#include <asm/firmware.h>
11+
#include <asm/kvm_guest.h>
1212

1313
#include <uapi/asm/kvm_para.h>
1414

‎arch/powerpc/kernel/firmware.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/of.h>
1515

1616
#include <asm/firmware.h>
17+
#include <asm/kvm_guest.h>
1718

1819
#ifdef CONFIG_PPC64
1920
unsigned long powerpc_firmware_features __read_mostly;

‎arch/powerpc/platforms/pseries/smp.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include <asm/plpar_wrappers.h>
4343
#include <asm/code-patching.h>
4444
#include <asm/svm.h>
45+
#include <asm/kvm_guest.h>
4546

4647
#include "pseries.h"
4748

0 commit comments

Comments
 (0)