)]}'
{
  "commit": "bdf026317daa3b9dfa281f29e96fbb6fd48394c8",
  "tree": "091f0d1f962bf57708c5c8fb89e83e330af2d0be",
  "parents": [
    "41da4bd6420afd1209c408974920f63ff9c658e1"
  ],
  "author": {
    "name": "马文霜",
    "email": "kevinnma@tencent.com",
    "time": "Wed Jul 01 15:41:41 2015 +0200"
  },
  "committer": {
    "name": "Paolo Bonzini",
    "email": "pbonzini@redhat.com",
    "time": "Wed Jul 01 15:45:50 2015 +0200"
  },
  "message": "Fix irq route entries exceeding KVM_MAX_IRQ_ROUTES\n\nLast month, we experienced several guests crash(6cores-8cores), qemu logs\ndisplay the following messages:\n\nqemu-system-x86_64: /build/qemu-2.1.2/kvm-all.c:976:\nkvm_irqchip_commit_routes: Assertion `ret \u003d\u003d 0\u0027 failed.\n\nAfter analysis and verification, we can confirm it\u0027s irq-balance\ndaemon(in guest) leads to the assertion failure. Start a 8 core guest with\ntwo disks, execute the following scripts will reproduce the BUG quickly:\n\nirq_affinity.sh\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nvda_irq_num\u003d25\nvdb_irq_num\u003d27\nwhile [ 1 ]\ndo\n    for irq in {1,2,4,8,10,20,40,80}\n        do\n            echo $irq \u003e /proc/irq/$vda_irq_num/smp_affinity\n            echo $irq \u003e /proc/irq/$vdb_irq_num/smp_affinity\n            dd if\u003d/dev/vda of\u003d/dev/zero bs\u003d4K count\u003d100 iflag\u003ddirect\n            dd if\u003d/dev/vdb of\u003d/dev/zero bs\u003d4K count\u003d100 iflag\u003ddirect\n        done\ndone\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nQEMU setup static irq route entries in kvm_pc_setup_irq_routing(), PIC and\nIOAPIC share the first 15 GSI numbers, take up 23 GSI numbers, but take up\n38 irq route entries. When change irq smp_affinity in guest, a dynamic route\nentry may be setup, the current logic is: if allocate GSI number succeeds,\na new route entry can be added. The available dynamic GSI numbers is\n1021(KVM_MAX_IRQ_ROUTES-23), but available irq route entries is only\n986(KVM_MAX_IRQ_ROUTES-38), GSI numbers greater than route entries.\nirq-balance\u0027s behavior will eventually leads to total irq route entries\nexceed KVM_MAX_IRQ_ROUTES, ioctl(KVM_SET_GSI_ROUTING) fail and\nkvm_irqchip_commit_routes() trigger assertion failure.\n\nThis patch fix the BUG.\n\nSigned-off-by: Wenshuang Ma \u003ckevinnma@tencent.com\u003e\nCc: qemu-stable@nongnu.org\nSigned-off-by: Paolo Bonzini \u003cpbonzini@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "53e01d468e5b544350846ef32eb7f1070b462a36",
      "old_mode": 33188,
      "old_path": "kvm-all.c",
      "new_id": "e98b08def2253b2d7c1a812e61a482ce285adfbf",
      "new_mode": 33188,
      "new_path": "kvm-all.c"
    }
  ]
}
