aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2015-03-26 10:39:32 -0400
committerMarc Zyngier <marc.zyngier@arm.com>2015-03-26 17:43:14 -0400
commitcf50a1eb43b98daa181714e40e22c8e5ad5007d6 (patch)
tree66a940dedf2b0e1083381fba058c4549d34c1c79
parentf0e4b2776c12c1633ccef17f210733d6e1b6b2b3 (diff)
KVM: arm/arm64: rename struct kvm_mmio_range to vgic_io_range
The name "kvm_mmio_range" is a bit bold, given that it only covers the VGIC's MMIO ranges. To avoid confusion with kvm_io_range, rename it to vgic_io_range. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Christoffer Dall <christoffer.dall@linaro.org> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r--virt/kvm/arm/vgic-v2-emul.c6
-rw-r--r--virt/kvm/arm/vgic-v3-emul.c8
-rw-r--r--virt/kvm/arm/vgic.c18
-rw-r--r--virt/kvm/arm/vgic.h12
4 files changed, 22 insertions, 22 deletions
diff --git a/virt/kvm/arm/vgic-v2-emul.c b/virt/kvm/arm/vgic-v2-emul.c
index c81866284441..ddb3135363d8 100644
--- a/virt/kvm/arm/vgic-v2-emul.c
+++ b/virt/kvm/arm/vgic-v2-emul.c
@@ -319,7 +319,7 @@ static bool handle_mmio_sgi_clear(struct kvm_vcpu *vcpu,
319 return write_set_clear_sgi_pend_reg(vcpu, mmio, offset, false); 319 return write_set_clear_sgi_pend_reg(vcpu, mmio, offset, false);
320} 320}
321 321
322static const struct kvm_mmio_range vgic_dist_ranges[] = { 322static const struct vgic_io_range vgic_dist_ranges[] = {
323 { 323 {
324 .base = GIC_DIST_CTRL, 324 .base = GIC_DIST_CTRL,
325 .len = 12, 325 .len = 12,
@@ -647,7 +647,7 @@ static bool handle_cpu_mmio_ident(struct kvm_vcpu *vcpu,
647 * CPU Interface Register accesses - these are not accessed by the VM, but by 647 * CPU Interface Register accesses - these are not accessed by the VM, but by
648 * user space for saving and restoring VGIC state. 648 * user space for saving and restoring VGIC state.
649 */ 649 */
650static const struct kvm_mmio_range vgic_cpu_ranges[] = { 650static const struct vgic_io_range vgic_cpu_ranges[] = {
651 { 651 {
652 .base = GIC_CPU_CTRL, 652 .base = GIC_CPU_CTRL,
653 .len = 12, 653 .len = 12,
@@ -674,7 +674,7 @@ static int vgic_attr_regs_access(struct kvm_device *dev,
674 struct kvm_device_attr *attr, 674 struct kvm_device_attr *attr,
675 u32 *reg, bool is_write) 675 u32 *reg, bool is_write)
676{ 676{
677 const struct kvm_mmio_range *r = NULL, *ranges; 677 const struct vgic_io_range *r = NULL, *ranges;
678 phys_addr_t offset; 678 phys_addr_t offset;
679 int ret, cpuid, c; 679 int ret, cpuid, c;
680 struct kvm_vcpu *vcpu, *tmp_vcpu; 680 struct kvm_vcpu *vcpu, *tmp_vcpu;
diff --git a/virt/kvm/arm/vgic-v3-emul.c b/virt/kvm/arm/vgic-v3-emul.c
index b3f154631515..14943e3f7248 100644
--- a/virt/kvm/arm/vgic-v3-emul.c
+++ b/virt/kvm/arm/vgic-v3-emul.c
@@ -340,7 +340,7 @@ static bool handle_mmio_idregs(struct kvm_vcpu *vcpu,
340 return false; 340 return false;
341} 341}
342 342
343static const struct kvm_mmio_range vgic_v3_dist_ranges[] = { 343static const struct vgic_io_range vgic_v3_dist_ranges[] = {
344 { 344 {
345 .base = GICD_CTLR, 345 .base = GICD_CTLR,
346 .len = 0x04, 346 .len = 0x04,
@@ -570,7 +570,7 @@ static bool handle_mmio_cfg_reg_redist(struct kvm_vcpu *vcpu,
570 return vgic_handle_cfg_reg(reg, mmio, offset); 570 return vgic_handle_cfg_reg(reg, mmio, offset);
571} 571}
572 572
573static const struct kvm_mmio_range vgic_redist_sgi_ranges[] = { 573static const struct vgic_io_range vgic_redist_sgi_ranges[] = {
574 { 574 {
575 .base = GICR_IGROUPR0, 575 .base = GICR_IGROUPR0,
576 .len = 0x04, 576 .len = 0x04,
@@ -676,7 +676,7 @@ static bool handle_mmio_typer_redist(struct kvm_vcpu *vcpu,
676 return false; 676 return false;
677} 677}
678 678
679static const struct kvm_mmio_range vgic_redist_ranges[] = { 679static const struct vgic_io_range vgic_redist_ranges[] = {
680 { 680 {
681 .base = GICR_CTLR, 681 .base = GICR_CTLR,
682 .len = 0x04, 682 .len = 0x04,
@@ -726,7 +726,7 @@ static bool vgic_v3_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run,
726 unsigned long rdbase = dist->vgic_redist_base; 726 unsigned long rdbase = dist->vgic_redist_base;
727 int nrcpus = atomic_read(&vcpu->kvm->online_vcpus); 727 int nrcpus = atomic_read(&vcpu->kvm->online_vcpus);
728 int vcpu_id; 728 int vcpu_id;
729 const struct kvm_mmio_range *mmio_range; 729 const struct vgic_io_range *mmio_range;
730 730
731 if (is_in_range(mmio->phys_addr, mmio->len, dbase, GIC_V3_DIST_SIZE)) { 731 if (is_in_range(mmio->phys_addr, mmio->len, dbase, GIC_V3_DIST_SIZE)) {
732 return vgic_handle_mmio_range(vcpu, run, mmio, 732 return vgic_handle_mmio_range(vcpu, run, mmio,
diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
index ffd937ca5141..21a3550d525c 100644
--- a/virt/kvm/arm/vgic.c
+++ b/virt/kvm/arm/vgic.c
@@ -712,11 +712,11 @@ void vgic_unqueue_irqs(struct kvm_vcpu *vcpu)
712} 712}
713 713
714const 714const
715struct kvm_mmio_range *vgic_find_range(const struct kvm_mmio_range *ranges, 715struct vgic_io_range *vgic_find_range(const struct vgic_io_range *ranges,
716 struct kvm_exit_mmio *mmio, 716 struct kvm_exit_mmio *mmio,
717 phys_addr_t offset) 717 phys_addr_t offset)
718{ 718{
719 const struct kvm_mmio_range *r = ranges; 719 const struct vgic_io_range *r = ranges;
720 720
721 while (r->len) { 721 while (r->len) {
722 if (offset >= r->base && 722 if (offset >= r->base &&
@@ -729,7 +729,7 @@ struct kvm_mmio_range *vgic_find_range(const struct kvm_mmio_range *ranges,
729} 729}
730 730
731static bool vgic_validate_access(const struct vgic_dist *dist, 731static bool vgic_validate_access(const struct vgic_dist *dist,
732 const struct kvm_mmio_range *range, 732 const struct vgic_io_range *range,
733 unsigned long offset) 733 unsigned long offset)
734{ 734{
735 int irq; 735 int irq;
@@ -757,7 +757,7 @@ static bool vgic_validate_access(const struct vgic_dist *dist,
757static bool call_range_handler(struct kvm_vcpu *vcpu, 757static bool call_range_handler(struct kvm_vcpu *vcpu,
758 struct kvm_exit_mmio *mmio, 758 struct kvm_exit_mmio *mmio,
759 unsigned long offset, 759 unsigned long offset,
760 const struct kvm_mmio_range *range) 760 const struct vgic_io_range *range)
761{ 761{
762 u32 *data32 = (void *)mmio->data; 762 u32 *data32 = (void *)mmio->data;
763 struct kvm_exit_mmio mmio32; 763 struct kvm_exit_mmio mmio32;
@@ -804,10 +804,10 @@ static bool call_range_handler(struct kvm_vcpu *vcpu,
804 */ 804 */
805bool vgic_handle_mmio_range(struct kvm_vcpu *vcpu, struct kvm_run *run, 805bool vgic_handle_mmio_range(struct kvm_vcpu *vcpu, struct kvm_run *run,
806 struct kvm_exit_mmio *mmio, 806 struct kvm_exit_mmio *mmio,
807 const struct kvm_mmio_range *ranges, 807 const struct vgic_io_range *ranges,
808 unsigned long mmio_base) 808 unsigned long mmio_base)
809{ 809{
810 const struct kvm_mmio_range *range; 810 const struct vgic_io_range *range;
811 struct vgic_dist *dist = &vcpu->kvm->arch.vgic; 811 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
812 bool updated_state; 812 bool updated_state;
813 unsigned long offset; 813 unsigned long offset;
@@ -1984,7 +1984,7 @@ int vgic_get_common_attr(struct kvm_device *dev, struct kvm_device_attr *attr)
1984 return r; 1984 return r;
1985} 1985}
1986 1986
1987int vgic_has_attr_regs(const struct kvm_mmio_range *ranges, phys_addr_t offset) 1987int vgic_has_attr_regs(const struct vgic_io_range *ranges, phys_addr_t offset)
1988{ 1988{
1989 struct kvm_exit_mmio dev_attr_mmio; 1989 struct kvm_exit_mmio dev_attr_mmio;
1990 1990
diff --git a/virt/kvm/arm/vgic.h b/virt/kvm/arm/vgic.h
index 1e5a38128804..6fccb969b169 100644
--- a/virt/kvm/arm/vgic.h
+++ b/virt/kvm/arm/vgic.h
@@ -74,7 +74,7 @@ void mmio_data_write(struct kvm_exit_mmio *mmio, u32 mask, u32 value)
74 *((u32 *)mmio->data) = cpu_to_le32(value) & mask; 74 *((u32 *)mmio->data) = cpu_to_le32(value) & mask;
75} 75}
76 76
77struct kvm_mmio_range { 77struct vgic_io_range {
78 phys_addr_t base; 78 phys_addr_t base;
79 unsigned long len; 79 unsigned long len;
80 int bits_per_irq; 80 int bits_per_irq;
@@ -89,13 +89,13 @@ static inline bool is_in_range(phys_addr_t addr, unsigned long len,
89} 89}
90 90
91const 91const
92struct kvm_mmio_range *vgic_find_range(const struct kvm_mmio_range *ranges, 92struct vgic_io_range *vgic_find_range(const struct vgic_io_range *ranges,
93 struct kvm_exit_mmio *mmio, 93 struct kvm_exit_mmio *mmio,
94 phys_addr_t offset); 94 phys_addr_t offset);
95 95
96bool vgic_handle_mmio_range(struct kvm_vcpu *vcpu, struct kvm_run *run, 96bool vgic_handle_mmio_range(struct kvm_vcpu *vcpu, struct kvm_run *run,
97 struct kvm_exit_mmio *mmio, 97 struct kvm_exit_mmio *mmio,
98 const struct kvm_mmio_range *ranges, 98 const struct vgic_io_range *ranges,
99 unsigned long mmio_base); 99 unsigned long mmio_base);
100 100
101bool vgic_handle_enable_reg(struct kvm *kvm, struct kvm_exit_mmio *mmio, 101bool vgic_handle_enable_reg(struct kvm *kvm, struct kvm_exit_mmio *mmio,
@@ -120,7 +120,7 @@ bool vgic_handle_cfg_reg(u32 *reg, struct kvm_exit_mmio *mmio,
120 120
121void vgic_kick_vcpus(struct kvm *kvm); 121void vgic_kick_vcpus(struct kvm *kvm);
122 122
123int vgic_has_attr_regs(const struct kvm_mmio_range *ranges, phys_addr_t offset); 123int vgic_has_attr_regs(const struct vgic_io_range *ranges, phys_addr_t offset);
124int vgic_set_common_attr(struct kvm_device *dev, struct kvm_device_attr *attr); 124int vgic_set_common_attr(struct kvm_device *dev, struct kvm_device_attr *attr);
125int vgic_get_common_attr(struct kvm_device *dev, struct kvm_device_attr *attr); 125int vgic_get_common_attr(struct kvm_device *dev, struct kvm_device_attr *attr);
126 126