)]}'
{
  "commit": "8d1c481960ba833362aa78245fdff12e3804f8b5",
  "tree": "d6315d4442f686b232770c4a89416c7453287fdd",
  "parents": [
    "e1d9fd2e3d33b2fec3207171ec8ca6e71d5c81c7"
  ],
  "author": {
    "name": "OGAWA Hirofumi",
    "email": "hogawa@miraclelinux.com",
    "time": "Sat Dec 23 10:00:43 2006 +0900"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@woody.osdl.org",
    "time": "Sat Dec 23 14:06:33 2006 -0800"
  },
  "message": "[PATCH] arch/i386/pci/mmconfig.c tlb flush fix\n\nWe use the fixmap for accessing pci config space in pci_mmcfg_read/write().\nThe problem is in pci_exp_set_dev_base(). It is caching a last\naccessed address to avoid calling set_fixmap_nocache() whenever\npci_mmcfg_read/write() is used.\n\n  static inline void pci_exp_set_dev_base(int bus, int devfn)\n  {\n\tu32 dev_base \u003d base | (bus \u003c\u003c 20) | (devfn \u003c\u003c 12);\n\tif (dev_base !\u003d mmcfg_last_accessed_device) {\n\t\tmmcfg_last_accessed_device \u003d dev_base;\n\t\tset_fixmap_nocache(FIX_PCIE_MCFG, dev_base);\n\t}\n  }\n\n            cpu0                                        cpu1\n  ---------------------------------------------------------------------------\n    pci_mmcfg_read(\"device-A\")\n        pci_exp_set_dev_base()\n            set_fixmap_nocache()\n                                              pci_mmcfg_read(\"device-B\")\n                                                  pci_exp_set_dev_base()\n                                                      set_fixmap_nocache()\n    pci_mmcfg_read(\"device-B\")\n        pci_exp_set_dev_base()\n            /* doesn\u0027t flush tlb */\n\nBut if cpus accessed the above order, the second pci_mmcfg_read() on\ncpu0 doesn\u0027t flush the TLB, because \"mmcfg_last_accessed_device\" is\ndevice-B.  So, second pci_mmcfg_read() on cpu0 accesses a device-A via\na previous TLB cache. This problem became the cause of several strange\nbehavior.\n\nThis patches fixes this situation by adds \"mmcfg_last_accessed_cpu\" check.\n\n[ Alternatively, we could make a per-cpu mapping area or something. Not\n  that it\u0027s probably worth it, but if we wanted to avoid all locking and\n  instead just disable preemption, that would be the way to go. --Linus ]\n\nSigned-off-by: OGAWA Hirofumi \u003chogawa@miraclelinux.com\u003e\nSigned-off-by: OGAWA Hirofumi \u003chirofumi@mail.parknet.co.jp\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c6b6d9bbc453834f0c6e17508e741d521144bd6f",
      "old_mode": 33188,
      "old_path": "arch/i386/pci/mmconfig.c",
      "new_id": "e2616a266e13c50cea634238b2dbbb98c3cbb062",
      "new_mode": 33188,
      "new_path": "arch/i386/pci/mmconfig.c"
    }
  ]
}
