diff options
author | Sonny Rao <sonnyrao@us.ibm.com> | 2010-08-20 00:10:19 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-10-06 15:57:07 -0400 |
commit | 625fbd3a36d836efaaee4b6d9c2fcd25e3654624 (patch) | |
tree | b89d4762c1e6d5fbbfa83d447695a0f4ae969ce0 /drivers/infiniband/hw | |
parent | 252a52aa4fa22a668f019e55b3aac3ff71ec1c29 (diff) |
IB/ehca: Fix driver on relocatable kernel
the eHCA driver registers a MR for all of kernel memory, but makes the
assumption that valid memory exists at KERNELBASE. This assumption
may not be true in the case of a relocatable kernel, so use KERNELBASE
+ PHYSICAL_START to get the true beginning of usable kernel memory.
cc: Joachim Fenkes <fenkes@de.ibm.com>
cc: Christoph Raisch <raisch@de.ibm.com>
cc: Hoan-Ham Hguyen <hnguyen@de.ibm.com>
Signed-off-by: Sonny Rao <sonnyrao@us.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_mrmw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c b/drivers/infiniband/hw/ehca/ehca_mrmw.c index 53f4cd4fc19a..43cae84005f0 100644 --- a/drivers/infiniband/hw/ehca/ehca_mrmw.c +++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c | |||
@@ -171,7 +171,7 @@ struct ib_mr *ehca_get_dma_mr(struct ib_pd *pd, int mr_access_flags) | |||
171 | } | 171 | } |
172 | 172 | ||
173 | ret = ehca_reg_maxmr(shca, e_maxmr, | 173 | ret = ehca_reg_maxmr(shca, e_maxmr, |
174 | (void *)ehca_map_vaddr((void *)KERNELBASE), | 174 | (void *)ehca_map_vaddr((void *)(KERNELBASE + PHYSICAL_START)), |
175 | mr_access_flags, e_pd, | 175 | mr_access_flags, e_pd, |
176 | &e_maxmr->ib.ib_mr.lkey, | 176 | &e_maxmr->ib.ib_mr.lkey, |
177 | &e_maxmr->ib.ib_mr.rkey); | 177 | &e_maxmr->ib.ib_mr.rkey); |
@@ -1636,7 +1636,7 @@ int ehca_reg_internal_maxmr( | |||
1636 | 1636 | ||
1637 | /* register internal max-MR on HCA */ | 1637 | /* register internal max-MR on HCA */ |
1638 | size_maxmr = ehca_mr_len; | 1638 | size_maxmr = ehca_mr_len; |
1639 | iova_start = (u64 *)ehca_map_vaddr((void *)KERNELBASE); | 1639 | iova_start = (u64 *)ehca_map_vaddr((void *)(KERNELBASE + PHYSICAL_START)); |
1640 | ib_pbuf.addr = 0; | 1640 | ib_pbuf.addr = 0; |
1641 | ib_pbuf.size = size_maxmr; | 1641 | ib_pbuf.size = size_maxmr; |
1642 | num_kpages = NUM_CHUNKS(((u64)iova_start % PAGE_SIZE) + size_maxmr, | 1642 | num_kpages = NUM_CHUNKS(((u64)iova_start % PAGE_SIZE) + size_maxmr, |
@@ -2209,7 +2209,7 @@ int ehca_mr_is_maxmr(u64 size, | |||
2209 | { | 2209 | { |
2210 | /* a MR is treated as max-MR only if it fits following: */ | 2210 | /* a MR is treated as max-MR only if it fits following: */ |
2211 | if ((size == ehca_mr_len) && | 2211 | if ((size == ehca_mr_len) && |
2212 | (iova_start == (void *)ehca_map_vaddr((void *)KERNELBASE))) { | 2212 | (iova_start == (void *)ehca_map_vaddr((void *)(KERNELBASE + PHYSICAL_START)))) { |
2213 | ehca_gen_dbg("this is a max-MR"); | 2213 | ehca_gen_dbg("this is a max-MR"); |
2214 | return 1; | 2214 | return 1; |
2215 | } else | 2215 | } else |