gpu: nvgpu: Add NVGPU_REPLAYABLE_FAULT compiler flag

This flag is added to compile out replayable fault support for
safety build.

JIRA NVGPU-3514

Change-Id: I4ee56e6637a4fe70dd22ed91c1ebf1c53c29278d
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2124379
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Seema Khowala
2019-05-23 10:12:22 -07:00
committed by mobile promotions
parent 0a2bac5974
commit 1e570d5a16
4 changed files with 18 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ ccflags-y += -DNVGPU_USERD
ccflags-y += -DNVGPU_CHANNEL_WDT
ccflags-y += -DNVGPU_DGPU_SUPPORT
ccflags-y += -DNVGPU_VPR
ccflags-y += -DNVGPU_REPLAYABLE_FAULT
obj-$(CONFIG_GK20A) := nvgpu.o

View File

@@ -62,4 +62,7 @@ NVGPU_COMMON_CFLAGS += -DNVGPU_DGPU_SUPPORT
NVGPU_VPR := 1
NVGPU_COMMON_CFLAGS += -DNVGPU_VPR
NVGPU_REPLAYABLE_FAULT := 1
NVGPU_COMMON_CFLAGS += -DNVGPU_REPLAYABLE_FAULT
endif

View File

@@ -44,9 +44,11 @@ int gv11b_ramfc_setup(struct nvgpu_channel *ch, u64 gpfifo_base,
nvgpu_memset(g, mem, 0, 0, ram_fc_size_val_v());
#ifdef NVGPU_REPLAYABLE_FAULT
if ((flags & NVGPU_SETUP_BIND_FLAGS_REPLAYABLE_FAULTS_ENABLE) != 0U) {
replayable = true;
}
#endif
g->ops.ramin.init_subctx_pdb(g, mem, ch->vm->pdb.mem, replayable);

View File

@@ -46,8 +46,10 @@
#include "hal/fb/fb_mmu_fault_gv11b.h"
#include "hal/mm/mmu_fault/mmu_fault_gv11b.h"
#ifdef NVGPU_REPLAYABLE_FAULT
static int gv11b_fb_fix_page_fault(struct gk20a *g,
struct mmu_fault_info *mmufault);
#endif
static const char * const invalid_str = "invalid";
@@ -305,7 +307,11 @@ void gv11b_mm_mmu_fault_handle_mmu_fault_common(struct gk20a *g,
gmmu_fault_mmu_eng_id_ce0_v() + num_lce)) {
/* CE page faults are not reported as replayable */
nvgpu_log(g, gpu_dbg_intr, "CE Faulted");
#ifdef NVGPU_REPLAYABLE_FAULT
err = gv11b_fb_fix_page_fault(g, mmufault);
#else
err = -EINVAL;
#endif
if (mmufault->refch != NULL) {
tsg = nvgpu_tsg_from_ch(mmufault->refch);
@@ -401,7 +407,11 @@ void gv11b_mm_mmu_fault_handle_mmu_fault_common(struct gk20a *g,
} else {
if (mmufault->fault_type == gmmu_fault_type_pte_v()) {
nvgpu_log(g, gpu_dbg_intr, "invalid pte! try to fix");
#ifdef NVGPU_REPLAYABLE_FAULT
err = gv11b_fb_fix_page_fault(g, mmufault);
#else
err = -EINVAL;
#endif
if (err != 0) {
*invalidate_replay_val |=
gv11b_fb_get_replay_cancel_global_val(g);
@@ -540,6 +550,7 @@ void gv11b_mm_mmu_fault_handle_other_fault_notify(struct gk20a *g,
}
}
#ifdef NVGPU_REPLAYABLE_FAULT
static int gv11b_fb_fix_page_fault(struct gk20a *g,
struct mmu_fault_info *mmufault)
{
@@ -594,6 +605,7 @@ static int gv11b_fb_fix_page_fault(struct gk20a *g,
pte[1], pte[0]);
return err;
}
#endif
void gv11b_mm_mmu_fault_disable_hw(struct gk20a *g)
{