Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26c99af1 authored by Victor Kamensky's avatar Victor Kamensky Committed by Christoffer Dall
Browse files

ARM64: KVM: set and get of sys registers in BE case



Since size of all sys registers is always 8 bytes. Current
code is actually endian agnostic. Just clean it up a bit.
Removed comment about little endian. Change type of pointer
from 'void *' to 'u64 *' to enforce stronger type checking.

Signed-off-by: default avatarVictor Kamensky <victor.kamensky@linaro.org>
Acked-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
parent 9662fb48
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -776,17 +776,15 @@ static struct sys_reg_desc invariant_sys_regs[] = {
	  NULL, get_ctr_el0 },
};

static int reg_from_user(void *val, const void __user *uaddr, u64 id)
static int reg_from_user(u64 *val, const void __user *uaddr, u64 id)
{
	/* This Just Works because we are little endian. */
	if (copy_from_user(val, uaddr, KVM_REG_SIZE(id)) != 0)
		return -EFAULT;
	return 0;
}

static int reg_to_user(void __user *uaddr, const void *val, u64 id)
static int reg_to_user(void __user *uaddr, const u64 *val, u64 id)
{
	/* This Just Works because we are little endian. */
	if (copy_to_user(uaddr, val, KVM_REG_SIZE(id)) != 0)
		return -EFAULT;
	return 0;