summaryrefslogtreecommitdiff
path: root/include/kvm/arm_vgic.h
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2016-07-15 14:43:32 +0300
committerMarc Zyngier <marc.zyngier@arm.com>2016-07-18 20:14:36 +0300
commit424c33830f53f248a68da125e70d9a4d95a8e010 (patch)
tree9b975ccc2cb6083ce3ebe9ba865e6904dad595f7 /include/kvm/arm_vgic.h
parent1085fdc68c6097244627a02a56bd2d8fe58a1a9c (diff)
downloadlinux-424c33830f53f248a68da125e70d9a4d95a8e010.tar.xz
KVM: arm64: vgic-its: Implement basic ITS register handlers
Add emulation for some basic MMIO registers used in the ITS emulation. This includes: - GITS_{CTLR,TYPER,IIDR} - ID registers - GITS_{CBASER,CREADR,CWRITER} (which implement the ITS command buffer handling) - GITS_BASER<n> Most of the handlers are pretty straight forward, only the CWRITER handler is a bit more involved by taking the new its_cmd mutex and then iterating over the command buffer. The registers holding base addresses and attributes are sanitised before storing them. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> Tested-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'include/kvm/arm_vgic.h')
-rw-r--r--include/kvm/arm_vgic.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index 8609faced83e..61867492d361 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -22,6 +22,7 @@
#include <linux/spinlock.h>
#include <linux/types.h>
#include <kvm/iodev.h>
+#include <linux/list.h>
#define VGIC_V3_MAX_CPUS 255
#define VGIC_V2_MAX_CPUS 8
@@ -136,6 +137,21 @@ struct vgic_its {
bool enabled;
bool initialized;
struct vgic_io_device iodev;
+
+ /* These registers correspond to GITS_BASER{0,1} */
+ u64 baser_device_table;
+ u64 baser_coll_table;
+
+ /* Protects the command queue */
+ struct mutex cmd_lock;
+ u64 cbaser;
+ u32 creadr;
+ u32 cwriter;
+
+ /* Protects the device and collection lists */
+ struct mutex its_lock;
+ struct list_head device_list;
+ struct list_head collection_list;
};
struct vgic_dist {