diff options
author | Alex Waterman <alexw@nvidia.com> | 2018-08-03 13:36:30 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-08-15 00:25:05 -0400 |
commit | 32127c65151ffc7288ff8483d5b18be77a662b0b (patch) | |
tree | da8bbd9e7f380a6bb9551499b75795d7b8e3cf68 /drivers/gpu/nvgpu | |
parent | 2a25d03f2b7ad0700f14640282abd72ff587d800 (diff) |
gpu: nvgpu: Use NVLINK config instead of has_physical_mode
This flag - has_physical_mode - doesn't seem to do much other than
force the PTE/PDE and inst block addresses to be physical instead
of potentially IOMMUed.
There is a reason to do this on volta (nvlink not being IOMMU'able
being the primary reason) but this flag is too general it seems.
The flag was being enabled on all native platforms. The problem is
that some page tables (the maxwell small page directories) could
be larger than 4KB which meant that the allocation used for them
could be potentially discontiguous. Discontiguous page directories
obviously is incorrect.
This patch deletes the has_physical_mode flag and instead replaces
the places where it's checked with a check for nvlink being
enabled. Since we _do_ want to program phyiscal PDEs and PTEs for
NVLINK devices (regardless of IOMMU status they always access
memory by physical address) we need a check for NVLINK state.
Bug 200414723
Change-Id: I09ad86b12d8aabcf9648a22503f4747fd63514dd
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1792163
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/gmmu.c | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/mm.c | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/mm.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/module.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/pci.c | 2 |
5 files changed, 6 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/gmmu.c b/drivers/gpu/nvgpu/common/mm/gmmu.c index 4e723e2e..f6f2b9ad 100644 --- a/drivers/gpu/nvgpu/common/mm/gmmu.c +++ b/drivers/gpu/nvgpu/common/mm/gmmu.c | |||
@@ -215,10 +215,11 @@ static u64 nvgpu_pde_phys_addr(struct gk20a *g, struct nvgpu_gmmu_pd *pd) | |||
215 | { | 215 | { |
216 | u64 page_addr; | 216 | u64 page_addr; |
217 | 217 | ||
218 | if (g->mm.has_physical_mode) | 218 | if (nvgpu_is_enabled(g, NVGPU_SUPPORT_NVLINK)) { |
219 | page_addr = nvgpu_mem_get_phys_addr(g, pd->mem); | 219 | page_addr = nvgpu_mem_get_phys_addr(g, pd->mem); |
220 | else | 220 | } else { |
221 | page_addr = nvgpu_mem_get_addr(g, pd->mem); | 221 | page_addr = nvgpu_mem_get_addr(g, pd->mem); |
222 | } | ||
222 | 223 | ||
223 | return page_addr + pd->mem_offs; | 224 | return page_addr + pd->mem_offs; |
224 | } | 225 | } |
diff --git a/drivers/gpu/nvgpu/common/mm/mm.c b/drivers/gpu/nvgpu/common/mm/mm.c index 42d708ee..2c3a1cd6 100644 --- a/drivers/gpu/nvgpu/common/mm/mm.c +++ b/drivers/gpu/nvgpu/common/mm/mm.c | |||
@@ -128,10 +128,11 @@ int nvgpu_mm_suspend(struct gk20a *g) | |||
128 | 128 | ||
129 | u64 nvgpu_inst_block_addr(struct gk20a *g, struct nvgpu_mem *inst_block) | 129 | u64 nvgpu_inst_block_addr(struct gk20a *g, struct nvgpu_mem *inst_block) |
130 | { | 130 | { |
131 | if (g->mm.has_physical_mode) | 131 | if (nvgpu_is_enabled(g, NVGPU_SUPPORT_NVLINK)) { |
132 | return nvgpu_mem_get_phys_addr(g, inst_block); | 132 | return nvgpu_mem_get_phys_addr(g, inst_block); |
133 | else | 133 | } else { |
134 | return nvgpu_mem_get_addr(g, inst_block); | 134 | return nvgpu_mem_get_addr(g, inst_block); |
135 | } | ||
135 | } | 136 | } |
136 | 137 | ||
137 | void nvgpu_free_inst_block(struct gk20a *g, struct nvgpu_mem *inst_block) | 138 | void nvgpu_free_inst_block(struct gk20a *g, struct nvgpu_mem *inst_block) |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/mm.h b/drivers/gpu/nvgpu/include/nvgpu/mm.h index 033e2548..3a1b2a6c 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/mm.h +++ b/drivers/gpu/nvgpu/include/nvgpu/mm.h | |||
@@ -147,7 +147,6 @@ struct mm_gk20a { | |||
147 | bool ltc_enabled_current; | 147 | bool ltc_enabled_current; |
148 | bool ltc_enabled_target; | 148 | bool ltc_enabled_target; |
149 | bool disable_bigpage; | 149 | bool disable_bigpage; |
150 | bool has_physical_mode; | ||
151 | 150 | ||
152 | struct nvgpu_mem sysmem_flush; | 151 | struct nvgpu_mem sysmem_flush; |
153 | 152 | ||
diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index 46a82d86..4b64847e 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c | |||
@@ -1257,8 +1257,6 @@ static int gk20a_probe(struct platform_device *dev) | |||
1257 | goto return_err; | 1257 | goto return_err; |
1258 | } | 1258 | } |
1259 | 1259 | ||
1260 | gk20a->mm.has_physical_mode = !nvgpu_is_hypervisor_mode(gk20a); | ||
1261 | |||
1262 | return 0; | 1260 | return 0; |
1263 | 1261 | ||
1264 | return_err: | 1262 | return_err: |
diff --git a/drivers/gpu/nvgpu/os/linux/pci.c b/drivers/gpu/nvgpu/os/linux/pci.c index e9374769..79a30495 100644 --- a/drivers/gpu/nvgpu/os/linux/pci.c +++ b/drivers/gpu/nvgpu/os/linux/pci.c | |||
@@ -806,8 +806,6 @@ static int nvgpu_pci_probe(struct pci_dev *pdev, | |||
806 | } | 806 | } |
807 | } | 807 | } |
808 | 808 | ||
809 | g->mm.has_physical_mode = false; | ||
810 | |||
811 | return 0; | 809 | return 0; |
812 | 810 | ||
813 | err_free_irq: | 811 | err_free_irq: |