summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/kvm_ppc.h
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@ozlabs.org>2023-03-08 17:34:48 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2023-04-03 15:45:41 +1000
commitacf17878da680a0c11c0bcb8a54b4f676ff39c80 (patch)
treea3b9d8e9723adb4af45875fe37c1d9ccac809879 /arch/powerpc/include/asm/kvm_ppc.h
parent6cd5c1db9983600f1848822e86e4906377b4a899 (diff)
downloadlinux-stable-acf17878da680a0c11c0bcb8a54b4f676ff39c80.tar.gz
linux-stable-acf17878da680a0c11c0bcb8a54b4f676ff39c80.tar.bz2
linux-stable-acf17878da680a0c11c0bcb8a54b4f676ff39c80.zip
KVM: PPC: Make kvmppc_get_last_inst() produce a ppc_inst_t
This changes kvmppc_get_last_inst() so that the instruction it fetches is returned in a ppc_inst_t variable rather than a u32. This will allow us to return a 64-bit prefixed instruction on those 64-bit machines that implement Power ISA v3.1 or later, such as POWER10. On 32-bit platforms, ppc_inst_t is 32 bits wide, and is turned back into a u32 by ppc_inst_val, which is an identity operation on those platforms. Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Tested-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Paul Mackerras <paulus@ozlabs.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/ZAgsiPlL9O7KnlZZ@cleo
Diffstat (limited to 'arch/powerpc/include/asm/kvm_ppc.h')
-rw-r--r--arch/powerpc/include/asm/kvm_ppc.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
index 23ea02b06ffa..d703d1b3ba7e 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -28,6 +28,7 @@
#include <asm/xive.h>
#include <asm/cpu_has_feature.h>
#endif
+#include <asm/inst.h>
/*
* KVMPPC_INST_SW_BREAKPOINT is debug Instruction
@@ -324,7 +325,7 @@ extern struct kvmppc_ops *kvmppc_hv_ops;
extern struct kvmppc_ops *kvmppc_pr_ops;
static inline int kvmppc_get_last_inst(struct kvm_vcpu *vcpu,
- enum instruction_fetch_type type, u32 *inst)
+ enum instruction_fetch_type type, ppc_inst_t *inst)
{
int ret = EMULATE_DONE;
u32 fetched_inst;
@@ -342,7 +343,7 @@ static inline int kvmppc_get_last_inst(struct kvm_vcpu *vcpu,
else
fetched_inst = vcpu->arch.last_inst;
- *inst = fetched_inst;
+ *inst = ppc_inst(fetched_inst);
return ret;
}