gpu: nvgpu: Add SM diversity gpu characteristic flag

To achieve permanent fault coverage, the CTAs launched by
each kernel in the mission and redundant contexts must execute
on different hardware resources.
This feature requires a change in software to make it possible
to modify the virtual SM id to TPC mapping across mission and
redundant contexts.

This CL adds only SM diversity flags which are exposed to
its clients through ioctl/devctl interfaces.
Actual virtual SM id to TPC mapping implementation
will be part of upcoming patch sets.

Added NvGpu CFLAGS to identify the safety build
"CONFIG_NVGPU_BUILD_CONFIGURATION_IS_SAFETY"

JIRA NVGPU-4133

Change-Id: I5a18256780e6726e399e39c1c8d155d2ef07d7bd
Signed-off-by: Lakshmanan M <lm@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2250461
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Lakshmanan M
2019-11-28 15:48:08 +05:30
committed by Alex Waterman
parent b32470e3ae
commit a52ee77837
15 changed files with 155 additions and 5 deletions

View File

@@ -250,7 +250,9 @@ static struct nvgpu_flags_mapping flags_mapping[] = {
{NVGPU_GPU_FLAGS_SUPPORT_FAULT_RECOVERY,
NVGPU_SUPPORT_FAULT_RECOVERY},
{NVGPU_GPU_FLAGS_SUPPORT_COPY_ENGINE_DIVERSITY,
NVGPU_SUPPORT_COPY_ENGINE_DIVERSITY}
NVGPU_SUPPORT_COPY_ENGINE_DIVERSITY},
{NVGPU_GPU_FLAGS_SUPPORT_SM_DIVERSITY,
NVGPU_SUPPORT_SM_DIVERSITY}
};
static u64 nvgpu_ctrl_ioctl_gpu_characteristics_flags(struct gk20a *g)
@@ -321,6 +323,8 @@ gk20a_ctrl_ioctl_gpu_characteristics(
gpu.num_tpc_per_gpc = nvgpu_gr_config_get_max_tpc_per_gpc_count(gr_config);
gpu.max_sm_diversity_config_count = g->max_sm_diversity_config_count;
gpu.bus_type = NVGPU_GPU_BUS_TYPE_AXI; /* always AXI for now */
gpu.compression_page_size = g->ops.fb.compression_page_size(g);
@@ -849,6 +853,15 @@ static int gk20a_ctrl_vsm_mapping(struct gk20a *g,
struct nvgpu_gr_config *gr_config = nvgpu_gr_get_config_ptr(g);
u32 i;
if (nvgpu_is_enabled(g, NVGPU_SUPPORT_SM_DIVERSITY)) {
if (args->sm_diversity_config >=
g->max_sm_diversity_config_count) {
return -EINVAL;
}
} else {
args->sm_diversity_config = 0U;
}
vsms_buf = nvgpu_kzalloc(g, write_size);
if (vsms_buf == NULL)
return -ENOMEM;