Thread (58 messages) 58 messages, 6 authors, 2012-12-05
STALE4925d

[PATCH v4 06/13] ARM: KVM: VGIC distributor handling

From: Christoffer Dall <hidden>
Date: 2012-11-13 13:38:18
Also in: kvm

On Mon, Nov 12, 2012 at 4:29 AM, Dong Aisheng [off-list ref] wrote:
On Sat, Nov 10, 2012 at 04:44:58PM +0100, Christoffer Dall wrote:
[...]
quoted
@@ -141,7 +519,98 @@ struct mmio_range *find_matching_range(const struct mmio_range *ranges,
  */
 bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run, struct kvm_exit_mmio *mmio)
 {
-     return KVM_EXIT_MMIO;
+     const struct mmio_range *range;
+     struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
+     unsigned long base = dist->vgic_dist_base;
+     bool updated_state;
+
+     if (!irqchip_in_kernel(vcpu->kvm) ||
+         mmio->phys_addr < base ||
+         (mmio->phys_addr + mmio->len) > (base + dist->vgic_dist_size))
+             return false;
+
+     range = find_matching_range(vgic_ranges, mmio, base);
+     if (unlikely(!range || !range->handle_mmio)) {
+             pr_warn("Unhandled access %d %08llx %d\n",
+                     mmio->is_write, mmio->phys_addr, mmio->len);
+             return false;
+     }
+
+     spin_lock(&vcpu->kvm->arch.vgic.lock);
+     updated_state = range->handle_mmio(vcpu, mmio,mmio->phys_addr - range->base - base);
Missing space after ','.
Checkpatch may fail here.
thanks,
-Christoffer
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help