* [PATCH] KVM: arm64: Consolidate functions to skip an instruction into skip_instr.h
@ 2021-05-17 16:05 Alexandru Elisei
0 siblings, 0 replies; only message in thread
From: Alexandru Elisei @ 2021-05-17 16:05 UTC (permalink / raw)
To: maz, linux-arm-kernel, kvmarm; +Cc: james.morse, suzuki.poulose
The function prototype kvm_skip_instr32() is used only by the hyp code, so
it makes more sense to live in the hyp specific header file adjust_pc.h.
Since __adjust_pc() has been moved to kvm_asm.h so it can be used by the
generic code, rename adjust_pc.h -> skip_instr.h to avoid confusion and to
better reflect the purpose of the remaining functions.
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
Based on git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git
tags/kvmarm-fixes-5.13-1
arch/arm64/include/asm/kvm_emulate.h | 1 -
arch/arm64/kvm/hyp/aarch32.c | 1 +
arch/arm64/kvm/hyp/exception.c | 2 +-
.../arm64/kvm/hyp/include/hyp/{adjust_pc.h => skip_instr.h} | 6 ++++--
arch/arm64/kvm/hyp/include/hyp/switch.h | 2 +-
arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c | 2 +-
arch/arm64/kvm/hyp/vgic-v3-sr.c | 2 +-
7 files changed, 9 insertions(+), 7 deletions(-)
rename arch/arm64/kvm/hyp/include/hyp/{adjust_pc.h => skip_instr.h} (90%)
diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h
index f612c090f2e4..436b77e6d1e8 100644
--- a/arch/arm64/include/asm/kvm_emulate.h
+++ b/arch/arm64/include/asm/kvm_emulate.h
@@ -34,7 +34,6 @@ enum exception_type {
};
bool kvm_condition_valid32(const struct kvm_vcpu *vcpu);
-void kvm_skip_instr32(struct kvm_vcpu *vcpu);
void kvm_inject_undefined(struct kvm_vcpu *vcpu);
void kvm_inject_vabt(struct kvm_vcpu *vcpu);
diff --git a/arch/arm64/kvm/hyp/aarch32.c b/arch/arm64/kvm/hyp/aarch32.c
index f98cbe2626a1..65ea395d81f3 100644
--- a/arch/arm64/kvm/hyp/aarch32.c
+++ b/arch/arm64/kvm/hyp/aarch32.c
@@ -10,6 +10,7 @@
* Author: Christoffer Dall <c.dall@virtualopensystems.com>
*/
+#include <hyp/skip_instr.h>
#include <linux/kvm_host.h>
#include <asm/kvm_emulate.h>
#include <asm/kvm_hyp.h>
diff --git a/arch/arm64/kvm/hyp/exception.c b/arch/arm64/kvm/hyp/exception.c
index 11541b94b328..ac03ad63c1b4 100644
--- a/arch/arm64/kvm/hyp/exception.c
+++ b/arch/arm64/kvm/hyp/exception.c
@@ -10,7 +10,7 @@
* Author: Christoffer Dall <c.dall@virtualopensystems.com>
*/
-#include <hyp/adjust_pc.h>
+#include <hyp/skip_instr.h>
#include <linux/kvm_host.h>
#include <asm/kvm_emulate.h>
diff --git a/arch/arm64/kvm/hyp/include/hyp/adjust_pc.h b/arch/arm64/kvm/hyp/include/hyp/skip_instr.h
similarity index 90%
rename from arch/arm64/kvm/hyp/include/hyp/adjust_pc.h
rename to arch/arm64/kvm/hyp/include/hyp/skip_instr.h
index 4fdfeabefeb4..d3ece9a90751 100644
--- a/arch/arm64/kvm/hyp/include/hyp/adjust_pc.h
+++ b/arch/arm64/kvm/hyp/include/hyp/skip_instr.h
@@ -7,12 +7,14 @@
* Author: Marc Zyngier <maz@kernel.org>
*/
-#ifndef __ARM64_KVM_HYP_ADJUST_PC_H__
-#define __ARM64_KVM_HYP_ADJUST_PC_H__
+#ifndef __ARM64_KVM_HYP_SKIP_INSTR_H__
+#define __ARM64_KVM_HYP_SKIP_INSTR_H__
#include <asm/kvm_emulate.h>
#include <asm/kvm_host.h>
+void kvm_skip_instr32(struct kvm_vcpu *vcpu);
+
static inline void kvm_skip_instr(struct kvm_vcpu *vcpu)
{
if (vcpu_mode_is_32bit(vcpu)) {
diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/include/hyp/switch.h
index e4a2f295a394..13578c1e91a6 100644
--- a/arch/arm64/kvm/hyp/include/hyp/switch.h
+++ b/arch/arm64/kvm/hyp/include/hyp/switch.h
@@ -7,7 +7,7 @@
#ifndef __ARM64_KVM_HYP_SWITCH_H__
#define __ARM64_KVM_HYP_SWITCH_H__
-#include <hyp/adjust_pc.h>
+#include <hyp/skip_instr.h>
#include <linux/arm-smccc.h>
#include <linux/kvm_host.h>
diff --git a/arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c b/arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c
index 87a54375bd6e..a11790cc42b4 100644
--- a/arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c
+++ b/arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c
@@ -4,7 +4,7 @@
* Author: Marc Zyngier <marc.zyngier@arm.com>
*/
-#include <hyp/adjust_pc.h>
+#include <hyp/skip_instr.h>
#include <linux/compiler.h>
#include <linux/irqchip/arm-gic.h>
diff --git a/arch/arm64/kvm/hyp/vgic-v3-sr.c b/arch/arm64/kvm/hyp/vgic-v3-sr.c
index 39f8f7f9227c..756cde8125ef 100644
--- a/arch/arm64/kvm/hyp/vgic-v3-sr.c
+++ b/arch/arm64/kvm/hyp/vgic-v3-sr.c
@@ -4,7 +4,7 @@
* Author: Marc Zyngier <marc.zyngier@arm.com>
*/
-#include <hyp/adjust_pc.h>
+#include <hyp/skip_instr.h>
#include <linux/compiler.h>
#include <linux/irqchip/arm-gic-v3.h>
--
2.31.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-17 16:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17 16:05 [PATCH] KVM: arm64: Consolidate functions to skip an instruction into skip_instr.h Alexandru Elisei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).