diff options
| -rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 8845f4b9621b..05036dbb9804 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c | |||
| @@ -991,7 +991,14 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(struct ib_device *ibdev, | |||
| 991 | if (field_avail(typeof(resp), cqe_version, udata->outlen)) | 991 | if (field_avail(typeof(resp), cqe_version, udata->outlen)) |
| 992 | resp.response_length += sizeof(resp.cqe_version); | 992 | resp.response_length += sizeof(resp.cqe_version); |
| 993 | 993 | ||
| 994 | if (field_avail(typeof(resp), hca_core_clock_offset, udata->outlen)) { | 994 | /* |
| 995 | * We don't want to expose information from the PCI bar that is located | ||
| 996 | * after 4096 bytes, so if the arch only supports larger pages, let's | ||
| 997 | * pretend we don't support reading the HCA's core clock. This is also | ||
| 998 | * forced by mmap function. | ||
| 999 | */ | ||
| 1000 | if (PAGE_SIZE <= 4096 && | ||
| 1001 | field_avail(typeof(resp), hca_core_clock_offset, udata->outlen)) { | ||
| 995 | resp.comp_mask |= | 1002 | resp.comp_mask |= |
| 996 | MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_CORE_CLOCK_OFFSET; | 1003 | MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_CORE_CLOCK_OFFSET; |
| 997 | resp.hca_core_clock_offset = | 1004 | resp.hca_core_clock_offset = |
