summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2017-01-13 17:25:11 +0000
committerMark Rutland <mark.rutland@arm.com>2017-03-22 18:37:36 +0000
commit8db5d8f141db8c05d7e4ff44e15fedf142511fc9 (patch)
tree06d3f535ad01516efc2eff462303c9ab690d4eb0 /arch/arm64/kvm
parent4dc529257d9dd6a2c930c794ed8077cdd6e843ce (diff)
downloadlinux-8db5d8f141db8c05d7e4ff44e15fedf142511fc9.tar.gz
linux-8db5d8f141db8c05d7e4ff44e15fedf142511fc9.tar.bz2
linux-8db5d8f141db8c05d7e4ff44e15fedf142511fc9.zip
KVM: arm64: add SYS_DESC()
This patch adds a macro enabling us to initialise sys_reg_desc structures based on common sysreg encoding definitions in <asm/sysreg.h>. Subsequent patches will use this to simplify the KVM code. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Acked-by: Christoffer Dall <christoffer.dall@linaro.org> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: kvmarm@lists.cs.columbia.edu
Diffstat (limited to 'arch/arm64/kvm')
-rw-r--r--arch/arm64/kvm/sys_regs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm64/kvm/sys_regs.h b/arch/arm64/kvm/sys_regs.h
index 9c6ffd0f0196..66859a5b85e5 100644
--- a/arch/arm64/kvm/sys_regs.h
+++ b/arch/arm64/kvm/sys_regs.h
@@ -147,4 +147,9 @@ const struct sys_reg_desc *find_reg_by_id(u64 id,
#define CRm(_x) .CRm = _x
#define Op2(_x) .Op2 = _x
+#define SYS_DESC(reg) \
+ Op0(sys_reg_Op0(reg)), Op1(sys_reg_Op1(reg)), \
+ CRn(sys_reg_CRn(reg)), CRm(sys_reg_CRm(reg)), \
+ Op2(sys_reg_Op2(reg))
+
#endif /* __ARM64_KVM_SYS_REGS_LOCAL_H__ */