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>
This commit is contained in:
Peter Daifuku
2019-10-08 14:03:49 -07:00
committed by mobile promotions
parent 56f8e5b878
commit bb1b3218c6

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017 NVIDIA Corporation. All rights reserved. * Copyright (C) 2017-2019 NVIDIA Corporation. All rights reserved.
* *
* This software is licensed under the terms of the GNU General Public * This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and * License version 2, as published by the Free Software Foundation, and
@@ -451,6 +451,14 @@ int gk20a_pmu_debugfs_init(struct gk20a *g)
if (!d) if (!d)
goto err_out; goto err_out;
d = debugfs_create_file(
"pmu_security", S_IRUGO, l->debugfs, g,
&security_fops);
if (!d)
goto err_out;
/* No access to PMU if virtual */
if (!g->is_virtual) {
d = debugfs_create_file( d = debugfs_create_file(
"falc_trace", S_IRUGO, l->debugfs, g, "falc_trace", S_IRUGO, l->debugfs, g,
&falc_trace_fops); &falc_trace_fops);
@@ -468,12 +476,7 @@ int gk20a_pmu_debugfs_init(struct gk20a *g)
&perfmon_events_count_fops); &perfmon_events_count_fops);
if (!d) if (!d)
goto err_out; goto err_out;
}
d = debugfs_create_file(
"pmu_security", S_IRUGO, l->debugfs, g,
&security_fops);
if (!d)
goto err_out;
return 0; return 0;
err_out: err_out:
pr_err("%s: Failed to make debugfs node\n", __func__); pr_err("%s: Failed to make debugfs node\n", __func__);