[MTHCA] bugfix: data corruption while registering MR
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 20 Sep 2006 11:55:57 +0000 (11:55 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 20 Sep 2006 11:55:57 +0000 (11:55 +0000)
commit44e702424e816e2b29580c86acf046697476128f
tree372551b62791167cbe70ca03417ca4791e3ac2ce
parent6fa4efad7f107384ed27fc5245d65d197d08106e
[MTHCA] bugfix: data corruption while registering MR

  If a buffer to be registered overlaps a buffer, already registered, a race can happen between HCA, writing to the previously registered buffer and the probing functions (MmProbeAndLockPages, MmSecureVirtualMemory), used in the algorithm of memory registration.
  To prevent the race we maintain reference counters for the physical pages, being registered, and register every physical page FOR THE WRITE ACCESS only once.

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@501 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86
hw/mthca/kernel/SOURCES
hw/mthca/kernel/hca_driver.c
hw/mthca/kernel/mt_memory.c
hw/mthca/kernel/mt_memory.h
hw/mthca/kernel/mt_pa_cash.c [new file with mode: 0644]
hw/mthca/kernel/mt_pa_cash.h [new file with mode: 0644]
hw/mthca/kernel/mthca_provider.c