aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/uapi/asm/kvm.h
diff options
context:
space:
mode:
authorChristoffer Dall <c.dall@virtualopensystems.com>2013-01-20 18:28:10 -0500
committerChristoffer Dall <c.dall@virtualopensystems.com>2013-01-23 13:29:14 -0500
commitc27581ed32275897651a84043b04ea3ccdd644e0 (patch)
treedc541728d54d1c9114eafc3930634434c7912a69 /arch/arm/include/uapi/asm/kvm.h
parent1138245ccf9652429630c09fb068e9b12c56c3d3 (diff)
KVM: ARM: Demux CCSIDR in the userspace API
The Cache Size Selection Register (CSSELR) selects the current Cache Size ID Register (CCSIDR). You write which cache you are interested in to CSSELR, and read the information out of CCSIDR. Which cache numbers are valid is known by reading the Cache Level ID Register (CLIDR). To export this state to userspace, we add a KVM_REG_ARM_DEMUX numberspace (17), which uses 8 bits to represent which register is being demultiplexed (0 for CCSIDR), and the lower 8 bits to represent this demultiplexing (in our case, the CSSELR value, which is 4 bits). Reviewed-by: Will Deacon <will.deacon@arm.com> Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
Diffstat (limited to 'arch/arm/include/uapi/asm/kvm.h')
-rw-r--r--arch/arm/include/uapi/asm/kvm.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/include/uapi/asm/kvm.h b/arch/arm/include/uapi/asm/kvm.h
index 53f45f146875..71ae27ec0599 100644
--- a/arch/arm/include/uapi/asm/kvm.h
+++ b/arch/arm/include/uapi/asm/kvm.h
@@ -104,6 +104,15 @@ struct kvm_arch_memory_slot {
104#define KVM_REG_ARM_CORE (0x0010 << KVM_REG_ARM_COPROC_SHIFT) 104#define KVM_REG_ARM_CORE (0x0010 << KVM_REG_ARM_COPROC_SHIFT)
105#define KVM_REG_ARM_CORE_REG(name) (offsetof(struct kvm_regs, name) / 4) 105#define KVM_REG_ARM_CORE_REG(name) (offsetof(struct kvm_regs, name) / 4)
106 106
107/* Some registers need more space to represent values. */
108#define KVM_REG_ARM_DEMUX (0x0011 << KVM_REG_ARM_COPROC_SHIFT)
109#define KVM_REG_ARM_DEMUX_ID_MASK 0x000000000000FF00
110#define KVM_REG_ARM_DEMUX_ID_SHIFT 8
111#define KVM_REG_ARM_DEMUX_ID_CCSIDR (0x00 << KVM_REG_ARM_DEMUX_ID_SHIFT)
112#define KVM_REG_ARM_DEMUX_VAL_MASK 0x00000000000000FF
113#define KVM_REG_ARM_DEMUX_VAL_SHIFT 0
114
115
107/* KVM_IRQ_LINE irq field index values */ 116/* KVM_IRQ_LINE irq field index values */
108#define KVM_ARM_IRQ_TYPE_SHIFT 24 117#define KVM_ARM_IRQ_TYPE_SHIFT 24
109#define KVM_ARM_IRQ_TYPE_MASK 0xff 118#define KVM_ARM_IRQ_TYPE_MASK 0xff