)]}'
{
  "commit": "7faa8075d898ae56d2c533c530569bb25ab86eaf",
  "tree": "0a0cc54ec7a06d843c1b3d3eaff120304526761f",
  "parents": [
    "ba737541edddf9d0026460eb7b1d1c599b4c8ae9"
  ],
  "author": {
    "name": "Alex Williamson",
    "email": "alex.williamson@redhat.com",
    "time": "Thu Apr 05 11:07:15 2012 -0600"
  },
  "committer": {
    "name": "Michael S. Tsirkin",
    "email": "mst@redhat.com",
    "time": "Sun Apr 15 12:17:23 2012 +0300"
  },
  "message": "acpi_piix4: Fix PCI hotplug race\n\nAs Michael Tsirkin demonstrated, current PCI hotplug is vulnerable\nto a few races.  The first is a race with other hotplug operations\nbecause we clear the up \u0026 down registers at each event.  If a new\nevent comes before the last is processed, up/down is cleared and\nthe event is lost.\n\nTo fix this for the down register, we create a life cycle for\nthe event request that starts with the hot unplug request in\npiix4_device_hotplug() and ends when the device is ejected.\nThis allows us to mask and clear individual bits, preserving them\nagainst races.  For the up register, we have no clear end point\nfor when the event is finished.  We could modify the BIOS to\nacknowledge the bit and clear it, but this creates BIOS compatibiliy\nissues without offering a complete solution.  Instead we note that\ngratuitous ACPI device checks are not harmful, which allows us to\nissue a device check for every slot.  We know which slots are present\nand we know which slots are hotpluggable, so we can easily reduce\nthis to a more manageable set for the guest.\n\nThe other race Michael noted was that an unplug request followed\nby reset may also lose the eject notification, which may also\nresult in the eject request being lost which a subsequent add\nor remove.  Once we\u0027re in reset, the device is unused and we can\nflush the queue of device removals ourselves.  Previously if a\ndevice_del was issued to a guest without ACPI PCI hotplug support,\nit was necessary to shutdown the guest to recover the device.\nWith this, a guest reboot is sufficient.\n\nSigned-off-by: Alex Williamson \u003calex.williamson@redhat.com\u003e\nSigned-off-by: Michael S. Tsirkin \u003cmst@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5e8b261b7497ac571e2e46028a1a69fef6701f3b",
      "old_mode": 33188,
      "old_path": "hw/acpi_piix4.c",
      "new_id": "0e7af51063af1d4f64059f75da40a535ccb4402c",
      "new_mode": 33188,
      "new_path": "hw/acpi_piix4.c"
    }
  ]
}
