linux/arch
OGAWA Hirofumi 8d1c481960 [PATCH] arch/i386/pci/mmconfig.c tlb flush fix
We use the fixmap for accessing pci config space in pci_mmcfg_read/write().
The problem is in pci_exp_set_dev_base(). It is caching a last
accessed address to avoid calling set_fixmap_nocache() whenever
pci_mmcfg_read/write() is used.

  static inline void pci_exp_set_dev_base(int bus, int devfn)
  {
	u32 dev_base = base | (bus << 20) | (devfn << 12);
	if (dev_base != mmcfg_last_accessed_device) {
		mmcfg_last_accessed_device = dev_base;
		set_fixmap_nocache(FIX_PCIE_MCFG, dev_base);
	}
  }

            cpu0                                        cpu1
  ---------------------------------------------------------------------------
    pci_mmcfg_read("device-A")
        pci_exp_set_dev_base()
            set_fixmap_nocache()
                                              pci_mmcfg_read("device-B")
                                                  pci_exp_set_dev_base()
                                                      set_fixmap_nocache()
    pci_mmcfg_read("device-B")
        pci_exp_set_dev_base()
            /* doesn't flush tlb */

But if cpus accessed the above order, the second pci_mmcfg_read() on
cpu0 doesn't flush the TLB, because "mmcfg_last_accessed_device" is
device-B.  So, second pci_mmcfg_read() on cpu0 accesses a device-A via
a previous TLB cache. This problem became the cause of several strange
behavior.

This patches fixes this situation by adds "mmcfg_last_accessed_cpu" check.

[ Alternatively, we could make a per-cpu mapping area or something. Not
  that it's probably worth it, but if we wanted to avoid all locking and
  instead just disable preemption, that would be the way to go. --Linus ]

Signed-off-by: OGAWA Hirofumi <hogawa@miraclelinux.com>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-23 14:06:33 -08:00
..
alpha [PATCH] fdtable: Make fdarray and fdsets equal in size 2006-12-10 09:57:22 -08:00
arm [ARM] 4062/1: S3C24XX: Anubis and Osiris shuld have CONFIG_PM_SIMTEC 2006-12-19 22:54:53 +00:00
arm26 [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
avr32 Merge branch 'for-linus' of git://www.atmel.no/~hskinnemoen/linux/kernel/avr32 2006-12-11 18:28:59 -08:00
cris [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
frv [PATCH] sysctl: remove unused "context" param 2006-12-10 09:55:41 -08:00
h8300 [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
i386 [PATCH] arch/i386/pci/mmconfig.c tlb flush fix 2006-12-23 14:06:33 -08:00
ia64 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2006-12-22 18:46:56 -08:00
m32r
m68k [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
m68knommu
mips [PATCH] MIPS: Fix COW D-cache aliasing on fork 2006-12-13 09:27:08 -08:00
parisc [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
powerpc Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6 2006-12-21 00:01:47 -08:00
ppc [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
s390 [S390] Save prefix register for dump on panic 2006-12-15 17:18:27 +01:00
sh sh: Fixup SH-2 BUG() trap handling. 2006-12-12 09:11:45 +09:00
sh64
sparc [SPARC]: Make bitops use same spinlocks as atomics. 2006-12-17 16:18:47 -08:00
sparc64 [SPARC64]: Mirror x86_64's PERCPU_ENOUGH_ROOM definition. 2006-12-17 14:06:59 -08:00
um [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
v850 kconfig: Standardize "depends" -> "depends on" in Kconfig files 2006-12-12 20:04:19 +01:00
x86_64 [PATCH] sched: fix bad missed wakeups in the i386, x86_64, ia64, ACPI and APM idle code 2006-12-22 08:55:51 -08:00
xtensa [PATCH] Xtensa: Add ktermios and minor filename fix 2006-12-13 09:05:50 -08:00