)]}'
{
  "commit": "98ec8fda18165139512c27cf2b6a9194b4b16576",
  "tree": "b8b5af4f14491f5fce3ff7dcfc6c622ae67c5704",
  "parents": [
    "1b32f04428c1181e295611f2df72c96c2b8c4a23"
  ],
  "author": {
    "name": "Christoffer Dall",
    "email": "cdall@linaro.org",
    "time": "Fri Sep 01 16:25:12 2017 +0200"
  },
  "committer": {
    "name": "Christoffer Dall",
    "email": "cdall@linaro.org",
    "time": "Fri Sep 15 15:15:15 2017 -0700"
  },
  "message": "KVM: arm/arm64: Support VGIC dist pend/active changes for mapped IRQs\n\nFor mapped IRQs (with the HW bit set in the LR) we have to follow some\nrules of the architecture.  One of these rules is that VM must not be\nallowed to deactivate a virtual interrupt with the HW bit set unless the\nphysical interrupt is also active.\n\nThis works fine when injecting mapped interrupts, because we leave it up\nto the injector to either set EOImode\u003d\u003d1 or manually set the active\nstate of the physical interrupt.\n\nHowever, the guest can set virtual interrupt to be pending or active by\nwriting to the virtual distributor, which could lead to deactivating a\nvirtual interrupt with the HW bit set without the physical interrupt\nbeing active.\n\nWe could set the physical interrupt to active whenever we are about to\nenter the VM with a HW interrupt either pending or active, but that\nwould be really slow, especially on GICv2.  So we take the long way\naround and do the hard work when needed, which is expected to be\nextremely rare.\n\nWhen the VM sets the pending state for a HW interrupt on the virtual\ndistributor we set the active state on the physical distributor, because\nthe virtual interrupt can become active and then the guest can\ndeactivate it.\n\nWhen the VM clears the pending state we also clear it on the physical\nside, because the injector might otherwise raise the interrupt.  We also\nclear the physical active state when the virtual interrupt is not\nactive, since otherwise a SPEND/CPEND sequence from the guest would\nprevent signaling of future interrupts.\n\nChanging the state of mapped interrupts from userspace is not supported,\nand it\u0027s expected that userspace unmaps devices from VFIO before\nattempting to set the interrupt state, because the interrupt state is\ndriven by hardware.  One annoying exception with this is the arch timer,\nwhich is mapped directly from the kernel without userspace knowing when\nthat happens.  Since we already support saving/restoring the timer IRQ\nstate while it is mapped, and we rely on the timer code to set the\nphysical active state on VCPU entry, we have to preserve this behavior\nand specifically check if the interrupt is for the timer.  Oh well.\n\nSigned-off-by: Christoffer Dall \u003ccdall@linaro.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f3087f66b37d91d848189793a3618a37408225f3",
      "old_mode": 33188,
      "old_path": "virt/kvm/arm/vgic/vgic-mmio.c",
      "new_id": "3a8c7aef1615c950c3b032a529fae8112306e593",
      "new_mode": 33188,
      "new_path": "virt/kvm/arm/vgic/vgic-mmio.c"
    },
    {
      "type": "modify",
      "old_id": "af0de3db7b996a6f442216eb4510e45ffa4333c4",
      "old_mode": 33188,
      "old_path": "virt/kvm/arm/vgic/vgic.c",
      "new_id": "0ca2b3d4ff8673e81fea106cbd8fed5d2808b78e",
      "new_mode": 33188,
      "new_path": "virt/kvm/arm/vgic/vgic.c"
    },
    {
      "type": "modify",
      "old_id": "7bdcda24e0627888b562fab464413bba455c97db",
      "old_mode": 33188,
      "old_path": "virt/kvm/arm/vgic/vgic.h",
      "new_id": "498ee0548ebb70726ba1aa510d14c62f0b22389e",
      "new_mode": 33188,
      "new_path": "virt/kvm/arm/vgic/vgic.h"
    }
  ]
}
