From 46b43d2b2485233397f4f62b9bac6d35434b7aea Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Mon, 31 Jan 2022 08:13:19 +0530 Subject: gpu: nvgpu: add support for disabling l3 via DT On volta the GPU determines whether to do L3 allocation for a mapping by checking bit 36 of the physical address. So if a mapping should allocate lines in the L3 this bit must be set. However, when the physical addresses for 64GB of RAM uses the 36th bit resulting in a conflict. Thus, add support for disabling l3 support for SKUs having 64GB of physical memory. Bug 3486025 Signed-off-by: Debarshi Dutta Change-Id: Ic540e754274cf1d9e6625493962699d21509e540 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2661548 Reviewed-by: Brad Griffis Reviewed-by: Bibek Basu Tested-by: Brad Griffis GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c') diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c index 926f243d..fe28bf21 100644 --- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c +++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c @@ -1,7 +1,7 @@ /* * Virtualized GPU Memory Management * - * Copyright (c) 2015-2021, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2015-2022, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -178,8 +178,10 @@ u64 vgpu_gp10b_locked_gmmu_map(struct vm_gk20a *vm, p->flags = TEGRA_VGPU_MAP_CACHEABLE; if (flags & NVGPU_VM_MAP_IO_COHERENT) p->flags |= TEGRA_VGPU_MAP_IO_COHERENT; - if (flags & NVGPU_VM_MAP_L3_ALLOC) - p->flags |= TEGRA_VGPU_MAP_L3_ALLOC; + if (!nvgpu_is_enabled(g, NVGPU_DISABLE_L3_SUPPORT)) { + if (flags & NVGPU_VM_MAP_L3_ALLOC) + p->flags |= TEGRA_VGPU_MAP_L3_ALLOC; + } if (flags & NVGPU_VM_MAP_PLATFORM_ATOMIC) { p->flags |= TEGRA_VGPU_MAP_PLATFORM_ATOMIC; } -- cgit v1.2.2