aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Murzin <vladimir.murzin@arm.com>2015-11-16 06:28:17 -0500
committerMarc Zyngier <marc.zyngier@arm.com>2015-12-18 05:15:11 -0500
commit8420dcd37ef34040c8fc5a27bf66887b3b2faf80 (patch)
tree3230abbb76ed9892492d26b4318efded986d68d5
parent9d4dc688342a3cbda43a1789cd2c6c888658c60d (diff)
arm: KVM: Make kvm_arm.h friendly to assembly code
kvm_arm.h is included from both C code and assembly code; however some definitions in this header supplied with U/UL/ULL suffixes which might confuse assembly once they got evaluated. We have _AC macro for such cases, so just wrap problem places with it. Acked-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r--arch/arm/include/asm/kvm_arm.h33
1 files changed, 17 insertions, 16 deletions
diff --git a/arch/arm/include/asm/kvm_arm.h b/arch/arm/include/asm/kvm_arm.h
index b05bb5ae3659..01d4d7abe34e 100644
--- a/arch/arm/include/asm/kvm_arm.h
+++ b/arch/arm/include/asm/kvm_arm.h
@@ -19,6 +19,7 @@
19#ifndef __ARM_KVM_ARM_H__ 19#ifndef __ARM_KVM_ARM_H__
20#define __ARM_KVM_ARM_H__ 20#define __ARM_KVM_ARM_H__
21 21
22#include <linux/const.h>
22#include <linux/types.h> 23#include <linux/types.h>
23 24
24/* Hyp Configuration Register (HCR) bits */ 25/* Hyp Configuration Register (HCR) bits */
@@ -132,9 +133,9 @@
132 * space. 133 * space.
133 */ 134 */
134#define KVM_PHYS_SHIFT (40) 135#define KVM_PHYS_SHIFT (40)
135#define KVM_PHYS_SIZE (1ULL << KVM_PHYS_SHIFT) 136#define KVM_PHYS_SIZE (_AC(1, ULL) << KVM_PHYS_SHIFT)
136#define KVM_PHYS_MASK (KVM_PHYS_SIZE - 1ULL) 137#define KVM_PHYS_MASK (KVM_PHYS_SIZE - _AC(1, ULL))
137#define PTRS_PER_S2_PGD (1ULL << (KVM_PHYS_SHIFT - 30)) 138#define PTRS_PER_S2_PGD (_AC(1, ULL) << (KVM_PHYS_SHIFT - 30))
138 139
139/* Virtualization Translation Control Register (VTCR) bits */ 140/* Virtualization Translation Control Register (VTCR) bits */
140#define VTCR_SH0 (3 << 12) 141#define VTCR_SH0 (3 << 12)
@@ -161,17 +162,17 @@
161#define VTTBR_X (5 - KVM_T0SZ) 162#define VTTBR_X (5 - KVM_T0SZ)
162#endif 163#endif
163#define VTTBR_BADDR_SHIFT (VTTBR_X - 1) 164#define VTTBR_BADDR_SHIFT (VTTBR_X - 1)
164#define VTTBR_BADDR_MASK (((1LLU << (40 - VTTBR_X)) - 1) << VTTBR_BADDR_SHIFT) 165#define VTTBR_BADDR_MASK (((_AC(1, ULL) << (40 - VTTBR_X)) - 1) << VTTBR_BADDR_SHIFT)
165#define VTTBR_VMID_SHIFT (48LLU) 166#define VTTBR_VMID_SHIFT _AC(48, ULL)
166#define VTTBR_VMID_MASK (0xffLLU << VTTBR_VMID_SHIFT) 167#define VTTBR_VMID_MASK (_AC(0xff, ULL) << VTTBR_VMID_SHIFT)
167 168
168/* Hyp Syndrome Register (HSR) bits */ 169/* Hyp Syndrome Register (HSR) bits */
169#define HSR_EC_SHIFT (26) 170#define HSR_EC_SHIFT (26)
170#define HSR_EC (0x3fU << HSR_EC_SHIFT) 171#define HSR_EC (_AC(0x3f, UL) << HSR_EC_SHIFT)
171#define HSR_IL (1U << 25) 172#define HSR_IL (_AC(1, UL) << 25)
172#define HSR_ISS (HSR_IL - 1) 173#define HSR_ISS (HSR_IL - 1)
173#define HSR_ISV_SHIFT (24) 174#define HSR_ISV_SHIFT (24)
174#define HSR_ISV (1U << HSR_ISV_SHIFT) 175#define HSR_ISV (_AC(1, UL) << HSR_ISV_SHIFT)
175#define HSR_SRT_SHIFT (16) 176#define HSR_SRT_SHIFT (16)
176#define HSR_SRT_MASK (0xf << HSR_SRT_SHIFT) 177#define HSR_SRT_MASK (0xf << HSR_SRT_SHIFT)
177#define HSR_FSC (0x3f) 178#define HSR_FSC (0x3f)
@@ -179,9 +180,9 @@
179#define HSR_SSE (1 << 21) 180#define HSR_SSE (1 << 21)
180#define HSR_WNR (1 << 6) 181#define HSR_WNR (1 << 6)
181#define HSR_CV_SHIFT (24) 182#define HSR_CV_SHIFT (24)
182#define HSR_CV (1U << HSR_CV_SHIFT) 183#define HSR_CV (_AC(1, UL) << HSR_CV_SHIFT)
183#define HSR_COND_SHIFT (20) 184#define HSR_COND_SHIFT (20)
184#define HSR_COND (0xfU << HSR_COND_SHIFT) 185#define HSR_COND (_AC(0xf, UL) << HSR_COND_SHIFT)
185 186
186#define FSC_FAULT (0x04) 187#define FSC_FAULT (0x04)
187#define FSC_ACCESS (0x08) 188#define FSC_ACCESS (0x08)
@@ -209,13 +210,13 @@
209#define HSR_EC_DABT (0x24) 210#define HSR_EC_DABT (0x24)
210#define HSR_EC_DABT_HYP (0x25) 211#define HSR_EC_DABT_HYP (0x25)
211 212
212#define HSR_WFI_IS_WFE (1U << 0) 213#define HSR_WFI_IS_WFE (_AC(1, UL) << 0)
213 214
214#define HSR_HVC_IMM_MASK ((1UL << 16) - 1) 215#define HSR_HVC_IMM_MASK ((_AC(1, UL) << 16) - 1)
215 216
216#define HSR_DABT_S1PTW (1U << 7) 217#define HSR_DABT_S1PTW (_AC(1, UL) << 7)
217#define HSR_DABT_CM (1U << 8) 218#define HSR_DABT_CM (_AC(1, UL) << 8)
218#define HSR_DABT_EA (1U << 9) 219#define HSR_DABT_EA (_AC(1, UL) << 9)
219 220
220#define kvm_arm_exception_type \ 221#define kvm_arm_exception_type \
221 {0, "RESET" }, \ 222 {0, "RESET" }, \