summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Daifuku <pdaifuku@nvidia.com>2019-10-08 17:03:49 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2019-10-14 22:09:53 -0400
commitbb1b3218c6e301b422b426a9c646fc9ece6fe0e2 (patch)
tree37a31e8147f54396dbfb994e60c370ee32a7e3b2
parent56f8e5b878348d1ac7f0b133d395808e0caed769 (diff)
nvgpu: vgpu: no debugfs entries that rely on PMU
When virtualized, the guest OS has no direct access to PMU functionality so don't create debugfs entries that rely on PMU access Bug 200543218 Change-Id: I12730b600802448a240f3de042760041d3ae7d29 Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2213650 (cherry picked from commit 053131ef44252748aecaad11ba8dc54f1dc40fce) Reviewed-on: https://git-master.nvidia.com/r/2215162 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Luis Dib <ldib@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/os/linux/debug_pmu.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/debug_pmu.c b/drivers/gpu/nvgpu/os/linux/debug_pmu.c
index f4ed992d..f3e36d0c 100644
--- a/drivers/gpu/nvgpu/os/linux/debug_pmu.c
+++ b/drivers/gpu/nvgpu/os/linux/debug_pmu.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2017 NVIDIA Corporation. All rights reserved. 2 * Copyright (C) 2017-2019 NVIDIA Corporation. All rights reserved.
3 * 3 *
4 * This software is licensed under the terms of the GNU General Public 4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and 5 * License version 2, as published by the Free Software Foundation, and
@@ -452,28 +452,31 @@ int gk20a_pmu_debugfs_init(struct gk20a *g)
452 goto err_out; 452 goto err_out;
453 453
454 d = debugfs_create_file( 454 d = debugfs_create_file(
455 "falc_trace", S_IRUGO, l->debugfs, g, 455 "pmu_security", S_IRUGO, l->debugfs, g,
456 &falc_trace_fops); 456 &security_fops);
457 if (!d) 457 if (!d)
458 goto err_out; 458 goto err_out;
459 459
460 d = debugfs_create_file( 460 /* No access to PMU if virtual */
461 "perfmon_events_enable", S_IRUGO, l->debugfs, g, 461 if (!g->is_virtual) {
462 d = debugfs_create_file(
463 "falc_trace", S_IRUGO, l->debugfs, g,
464 &falc_trace_fops);
465 if (!d)
466 goto err_out;
467
468 d = debugfs_create_file(
469 "perfmon_events_enable", S_IRUGO, l->debugfs, g,
462 &perfmon_events_enable_fops); 470 &perfmon_events_enable_fops);
463 if (!d) 471 if (!d)
464 goto err_out; 472 goto err_out;
465 473
466 d = debugfs_create_file( 474 d = debugfs_create_file(
467 "perfmon_events_count", S_IRUGO, l->debugfs, g, 475 "perfmon_events_count", S_IRUGO, l->debugfs, g,
468 &perfmon_events_count_fops); 476 &perfmon_events_count_fops);
469 if (!d) 477 if (!d)
470 goto err_out; 478 goto err_out;
471 479 }
472 d = debugfs_create_file(
473 "pmu_security", S_IRUGO, l->debugfs, g,
474 &security_fops);
475 if (!d)
476 goto err_out;
477 return 0; 480 return 0;
478err_out: 481err_out:
479 pr_err("%s: Failed to make debugfs node\n", __func__); 482 pr_err("%s: Failed to make debugfs node\n", __func__);