Skip to content

Commit

Permalink
powerpc: Refactor is_kvm_guest() declaration to new header
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Srikar Dronamraju authored and Michael Ellerman committed Dec 3, 2020
1 parent bf13718 commit 92cc6bf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
6 changes: 0 additions & 6 deletions arch/powerpc/include/asm/firmware.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,6 @@ extern int ibm_nmi_interlock_token;

extern unsigned int __start___fw_ftr_fixup, __stop___fw_ftr_fixup;

#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_KVM_GUEST)
bool is_kvm_guest(void);
#else
static inline bool is_kvm_guest(void) { return false; }
#endif

#ifdef CONFIG_PPC_PSERIES
void pseries_probe_fw_features(void);
#else
Expand Down
15 changes: 15 additions & 0 deletions arch/powerpc/include/asm/kvm_guest.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2020 IBM Corporation
*/

#ifndef _ASM_POWERPC_KVM_GUEST_H_
#define _ASM_POWERPC_KVM_GUEST_H_

#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_KVM_GUEST)
bool is_kvm_guest(void);
#else
static inline bool is_kvm_guest(void) { return false; }
#endif

#endif /* _ASM_POWERPC_KVM_GUEST_H_ */
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/kvm_para.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef __POWERPC_KVM_PARA_H__
#define __POWERPC_KVM_PARA_H__

#include <asm/firmware.h>
#include <asm/kvm_guest.h>

#include <uapi/asm/kvm_para.h>

Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kernel/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/of.h>

#include <asm/firmware.h>
#include <asm/kvm_guest.h>

#ifdef CONFIG_PPC64
unsigned long powerpc_firmware_features __read_mostly;
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/platforms/pseries/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <asm/plpar_wrappers.h>
#include <asm/code-patching.h>
#include <asm/svm.h>
#include <asm/kvm_guest.h>

#include "pseries.h"

Expand Down

0 comments on commit 92cc6bf

Please sign in to comment.