forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/arch/powerpc/kvm/e500_emulate.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2008-2011 Freescale Semiconductor, Inc. All rights reserved.
34 *
....@@ -6,10 +7,6 @@
67 * Description:
78 * This file is derived from arch/powerpc/kvm/44x_emulate.c,
89 * by Hollis Blanchard <hollisb@us.ibm.com>.
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License, version 2, as
12
- * published by the Free Software Foundation.
1310 */
1411
1512 #include <asm/kvm_ppc.h>
....@@ -86,16 +83,16 @@
8683 }
8784 #endif
8885
89
-static int kvmppc_e500_emul_ehpriv(struct kvm_run *run, struct kvm_vcpu *vcpu,
86
+static int kvmppc_e500_emul_ehpriv(struct kvm_vcpu *vcpu,
9087 unsigned int inst, int *advance)
9188 {
9289 int emulated = EMULATE_DONE;
9390
9491 switch (get_oc(inst)) {
9592 case EHPRIV_OC_DEBUG:
96
- run->exit_reason = KVM_EXIT_DEBUG;
97
- run->debug.arch.address = vcpu->arch.regs.nip;
98
- run->debug.arch.status = 0;
93
+ vcpu->run->exit_reason = KVM_EXIT_DEBUG;
94
+ vcpu->run->debug.arch.address = vcpu->arch.regs.nip;
95
+ vcpu->run->debug.arch.status = 0;
9996 kvmppc_account_exit(vcpu, DEBUG_EXITS);
10097 emulated = EMULATE_EXIT_USER;
10198 *advance = 0;
....@@ -128,7 +125,7 @@
128125 return EMULATE_FAIL;
129126 }
130127
131
-int kvmppc_core_emulate_op_e500(struct kvm_run *run, struct kvm_vcpu *vcpu,
128
+int kvmppc_core_emulate_op_e500(struct kvm_vcpu *vcpu,
132129 unsigned int inst, int *advance)
133130 {
134131 int emulated = EMULATE_DONE;
....@@ -185,8 +182,7 @@
185182 break;
186183
187184 case XOP_EHPRIV:
188
- emulated = kvmppc_e500_emul_ehpriv(run, vcpu, inst,
189
- advance);
185
+ emulated = kvmppc_e500_emul_ehpriv(vcpu, inst, advance);
190186 break;
191187
192188 default:
....@@ -200,7 +196,7 @@
200196 }
201197
202198 if (emulated == EMULATE_FAIL)
203
- emulated = kvmppc_booke_emulate_op(run, vcpu, inst, advance);
199
+ emulated = kvmppc_booke_emulate_op(vcpu, inst, advance);
204200
205201 return emulated;
206202 }