aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2016-01-06 07:10:58 -0500
committerMarc Zyngier <marc.zyngier@arm.com>2016-02-29 13:34:14 -0500
commitb57cd6f6407d420d522ab71b9c0dd11993e49ba1 (patch)
tree6363d50fede2853d126691c5e1d4f6ca0b19bafd /arch/arm/kvm
parentc36b6db5f3e4c1bd21659aee8e67226352d254ae (diff)
ARM: KVM: Change kvm_call_hyp return type to unsigned long
Having u64 as the kvm_call_hyp return type is problematic, as it forces all kind of tricks for the return values from HYP to be promoted to 64bit (LE has the LSB in r0, and BE has them in r1). Since the only user of the return value is perfectly happy with a 32bit value, let's make kvm_call_hyp return an unsigned long, which is 32bit on ARM. This solves yet another headache. Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r--arch/arm/kvm/interrupts.S10
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S
index 7bfb28936914..01eb169f38f6 100644
--- a/arch/arm/kvm/interrupts.S
+++ b/arch/arm/kvm/interrupts.S
@@ -207,20 +207,14 @@ after_vfp_restore:
207 207
208 restore_host_regs 208 restore_host_regs
209 clrex @ Clear exclusive monitor 209 clrex @ Clear exclusive monitor
210#ifndef CONFIG_CPU_ENDIAN_BE8
211 mov r0, r1 @ Return the return code 210 mov r0, r1 @ Return the return code
212 mov r1, #0 @ Clear upper bits in return value
213#else
214 @ r1 already has return code
215 mov r0, #0 @ Clear upper bits in return value
216#endif /* CONFIG_CPU_ENDIAN_BE8 */
217 bx lr @ return to IOCTL 211 bx lr @ return to IOCTL
218 212
219/******************************************************************** 213/********************************************************************
220 * Call function in Hyp mode 214 * Call function in Hyp mode
221 * 215 *
222 * 216 *
223 * u64 kvm_call_hyp(void *hypfn, ...); 217 * unsigned long kvm_call_hyp(void *hypfn, ...);
224 * 218 *
225 * This is not really a variadic function in the classic C-way and care must 219 * This is not really a variadic function in the classic C-way and care must
226 * be taken when calling this to ensure parameters are passed in registers 220 * be taken when calling this to ensure parameters are passed in registers
@@ -231,7 +225,7 @@ after_vfp_restore:
231 * passed as r0, r1, and r2 (a maximum of 3 arguments in addition to the 225 * passed as r0, r1, and r2 (a maximum of 3 arguments in addition to the
232 * function pointer can be passed). The function being called must be mapped 226 * function pointer can be passed). The function being called must be mapped
233 * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are 227 * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are
234 * passed in r0 and r1. 228 * passed in r0 (strictly 32bit).
235 * 229 *
236 * A function pointer with a value of 0xffffffff has a special meaning, 230 * A function pointer with a value of 0xffffffff has a special meaning,
237 * and is used to implement __hyp_get_vectors in the same way as in 231 * and is used to implement __hyp_get_vectors in the same way as in