Commit Graph

68 Commits

Author SHA1 Message Date
Manish Bhardwaj
e3f7b0f173 nvidia-oot: remove tegra_hv_ivc_convert_cookie API
tegra_hv_ivc_convert_cookie API is not being used
and is there lying as dead code.

Bug 5433066

Change-Id: I8036cb5e398bcc3fb720ff3afbea92e350d441a0
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3440189
(cherry picked from commit 8560fc5c340ae63e39169aca3beb02dbf229e9bc)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3448411
(cherry picked from commit 2c8771c90e44da8d423fc1896ff277343c06647b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3480666
Tested-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-10-31 10:42:10 -07:00
Jon Hunter
a5bb404485 virt: tegra: Fix build for Linux v6.17
Upstream commit fc2898ea793a ("workqueue: Remove unused
work_on_cpu_safe") removed the 'work_on_cpu_safe()' function for Linux
v6.17. Fix this by open coding the 'work_on_cpu_safe()' in the Tegra HV
CPU Yield driver.

Bug 5420210

Change-Id: I3110554839853be9a906063d479539543394acbd
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3423830
(cherry picked from commit 97075404a16dc4f9d66147ae4b15a04526978e0e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3462466
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-02 10:14:02 -07:00
Jon Hunter
da9c8f46c4 virt: hvc_sysfs: Fix build for Linux v6.16
In Linux v6.16, the 'bin_attribute' argument to the 'read' and 'write'
function pointers of the 'bin_attribute' structure was made const. Add a
test to conftest to detect this and update the Tegra HVC SYSFS driver
accordingly.

JIRA LINQPJ14-60

Change-Id: I74b88bc0d1ed55eca1565386b38d16ff65626132
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3375213
(cherry picked from commit fef581cb0bac2d1468a710927771be9fa027f6e0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461880
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-10-01 15:28:30 -07:00
Brad Griffis
f50f1ec51b hvc_sysfs: introduce NV_OOT_HVC_SYSFS_SKIP_BUILD
Add infrastructure to make it possible to have configs that
skip the building of hvc_sysfs.o.

Bug 5413835

Change-Id: I8fa1fd6bbdcc1cc1d4d64c27fb6b913661be38e7
Signed-off-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3419689
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-31 07:43:22 -07:00
Manish Bhardwaj
bc0fa73ed6 nvidia-oot: expose tegra_hv_ivc_tx_empty API for hv comm driver
Jira HYP-20929

Change-Id: I4ba92c8c7e76cc391d1c4a8a2e8d22f312cde7fa
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3369454
Tested-by: Daniel Kudrow <dkudrow@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Daniel Kudrow <dkudrow@nvidia.com>
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
2025-07-24 10:20:35 +00:00
Manish Bhardwaj
9c6469ff98 tegra_hv: stop compiling unused APIs for prod kernel
- stop compiling unused APIs for prod kernel
- remove APIs having just function declaration

Jira ESLC-8593

Change-Id: I8acd01a88e0ea4c3792d7080f685bcac9c9cf559
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3363569
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
2025-07-24 10:20:35 +00:00
Manish Bhardwaj
edd7b240b0 nvidia-oot: clear out the memory before freeing
Jira ESLC-8592

Change-Id: I0532bab29d4267477770f317576610514c25d4ea
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3356255
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:19 +00:00
Manish Bhardwaj
025c3b6b37 nvidia-oot: set the nvlog mode with read only permission
Bug 4997347

Change-Id: I7823b318a932877647243852af36649fb563090e
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3351170
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:18 +00:00
Manish Bhardwaj
381d88e597 nvidia-oot: don't set nvlog & mempool buffers as executable
Bug 5248920

Change-Id: I89ac129953aa312f30d11f721c0ab8255e515af2
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3350549
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
2025-07-24 10:19:18 +00:00
Manish Bhardwaj
897e587b25 virt: add sanity checks for ivc info's metadata
Jira ESLC-8494
Bug 5226392

Change-Id: Ie401827cab2a326ee449ba4c9e0e294ace2c48bd
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3340893
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:18 +00:00
Jon Hunter
a59a10dfeb drivers: Update timer APIs for Linux v6.15
In Linux v6.15, the timer APIs hrtimer_init() and del_timer() have been
removed. The hrtimer_setup() was added in Linux v6.13 to replace
hrtimer_init() and hrtimer_init() have finally been removed. The
functions del_timer()/del_timer_sync() were renamed to
timer_delete()/timer_delete_sync() in Linux v6.15. Use conftest to
detect these changes and update the drivers as necessary.

JIRA LINQPJ14-47

Change-Id: Id3994900384aad4b91155507cda91e04898ab12c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3336168
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:18 +00:00
Manish Bhardwaj
c7180f767c nvidia-oot: update copyright year in virt drivers
Bug 4985113

Change-Id: I16682c1c2c8b2d5f76700e9133c8626a11905bfd
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3328450
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
2025-07-24 10:19:17 +00:00
Jeungwoo Yoo
b62ef100a7 ivc-cdev.c: Fix INT30-C and INT08-C
Jira NVIPC-3395

Change-Id: Iaacae60c6e20ca9d8f9c142d12e96fada895a7e5
Signed-off-by: Jeungwoo Yoo <jeungwooy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3298198
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-by: Simon Je <sje@nvidia.com>
2025-07-24 10:19:17 +00:00
Joshua Cha
c9ee1f5372 nvsciipc: remove unused CMDs
removed NVIPC_IVC_IOCTL_NOTIFY_REMOTE and NVIPC_IVC_IOCTL_GET_VMID

JIRA NVIPC-3488

Change-Id: Ic511e6f059ae2149bd82e0c5980c5f95e9494b85
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3322033
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Suneel Kumar Pemmineti <spemmineti@nvidia.com>
Reviewed-by: Simon Je <sje@nvidia.com>
2025-07-24 10:19:17 +00:00
Suneel Kumar Pemmineti
04ccb5c0c3 nvsciipc: enable endpoint security
- allow ioctl access if UID looked up is one of process UID
  or SGIDs.
- removed legacy codes
- set UID of set DB ioctl using sysfs

JIRA: NVIPC-2817

Change-Id: Ic910b5bdbb362e9cda0cc3af4bcd9c1642725a25
Signed-off-by: Suneel Kumar Pemmineti <spemmineti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3225830
Tested-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-by: Simon Je <sje@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:16 +00:00
Manish Bhardwaj
1fabab5472 hvc_sysfs: supporess hvc trace buffer error log
hvc trace buffers logs are being used for collecting
eventlib by hypervisor. Since this is not needed in
prod binary so suppressing the hvc buffer missing error.

Bug 5150377

Change-Id: I567cb2cd3e8b5e7e10a24a57e09221c6014264fc
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3320466
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Ashwin Joshi <asjoshi@nvidia.com>
2025-07-24 10:19:16 +00:00
Manish Bhardwaj
ecfef7f862 nvidia-oot: cert & misra fixes in tegra_hv_pm_ctl.c drv
using this patch fixing below cert & misra errors:-
- cert_exp39_c_violation: Accessing an object through a pointer "nlh"
  whose type "struct nlmsghdr *" is incompatible with the type of the object.
- cert_int08_c_violation: Signed integer operation "count += snprintf(buf + count, 4096UL - count, "%u ",
  data->wait_for_guests[i])" may overflow.
- cert_int08_c_violation: Unsigned integer operation "4096UL - count" may wrap.
- cert_int08_c_violation: Signed integer operation "count += snprintf(buf + count, 4096UL - count, "\n")"
  may overflow.
- cert_int32_c_violation: Signed integer operation "count += snprintf(buf + count, 4096UL - count, "%u ", data->wait_for_guests[i])"
  may overflow.
- cert_int32_c_violation: Signed integer operation "count += snprintf(buf + count, 4096UL - count, "\n")"
  may overflow.
- cert_str07_c_violation: Using unsafe interface "strncpy" instead of "strncpy_s"
  for string manipulation.
- missing_lock:	Accessing "user_client_count" without holding lock "netlink_lock".
  Elsewhere, "user_client_count" is written to with "netlink_lock" held 1 out of 1 times.

JIRA ESLC-8381

Change-Id: I2f84aa09b3a940cabda62a2391e782108755c80b
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3304762
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:16 +00:00
Manish Bhardwaj
dd30ab0bfd nvidia-oot: cert & misra fixes in hvc_sysfs.c drv
using this patch fixing below cert & misra errors:-
- cert_int08_c_violation: Unsigned integer operation
  "vma->vm_end - vma->vm_start" may wrap.
- cert_int08_c_violation: Unsigned integer operation
  "vma->vm_end - vma->vm_start" may wrap.
- cert_str07_c_violation: Using unsafe interface
  "strncpy" instead of "strncpy_s" for string manipulation.
- cert_str07_c_violation: Using unsafe interface "strncat"
  instead of "strncat_s" for string manipulation.
- cert_exp39_c_violation: Accessing an object through a
  pointer "(uint64_t *)buf" whose type "uint64_t *" is
  incompatible with the type of the object
- cert_exp39_c_violation: Calling function
  "hyp_trace_get_mask(uint64_t *)" which accesses an object
  through a pointer "(uint64_t *)buf" whose type "uint64_t *"
  is incompatible with the type of the object. [details]
- cert_exp39_c_violation: Accessing an object through a
  pointer "(uint64_t *)buf" whose type "uint64_t *" is
  incompatible with the type of the object.

JIRA ESLC-8400

Change-Id: Ia8e03dac4e939078719543d8e6d3bbc464301b16
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3304759
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
2025-07-24 10:19:16 +00:00
Jon Hunter
eea9f99397 drivers: Remove CONFIG_TEGRA_VIRTUALIZATION
Remove CONFIG_TEGRA_VIRTUALIZATION so that virtualization is always
enabled for drivers. This permits the same drivers to work on bare-metal
Linux machines as well as virtual Linux machines.

Bug 5157858

Change-Id: I29d13dae957ed2273b65f95fff0bee1e06f45a27
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3314409
Reviewed-by: Sumit Gupta <sumitg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:16 +00:00
Suneel Kumar Pemmineti
38d739c860 nvsciipc: Add UID member to Config structure
- Added UID member to nvsciipc_config_entry data
structure. this is needed for implementing
test_nvsciipc_cfgblob in linux.
- removed static from ioctl function to attach eBPF program
- add error-injection.h and ALLOW_ERROR_INJECTION macro to ioctl
  to use bpf_override_return()

JIRA NVIPC-2817

Change-Id: Ic27156e321368041f41fbabff9e6375140fe1d0e
Signed-off-by: Suneel Kumar Pemmineti <spemmineti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3301786
Tested-by: Joshua Cha <joshuac@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Simon Je <sje@nvidia.com>
2025-07-24 10:19:15 +00:00
Vishnu Mandalapu
09bf300e40 drivers: tegra: virt: runtime frequency
- Add support to change VM profiler frequency in rumtime.

 Jira HYP-19279

Signed-off-by: Vishnu Reddy Mandalapu <vmandalapu@nvidia.com>
Change-Id: I2b260fff61addbd5e2bd53d9b16e441506bdf2d6
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3222316
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3252176
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Daniel Kudrow <dkudrow@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Alexey Lugovskoy <alugovskoy@nvidia.com>
2025-07-24 10:19:15 +00:00
Manish Bhardwaj
9f909306a0 kernel-oot: update driver license to GPL
Bug 5065840

Change-Id: If5f1783d8168af51c8964ff5605e8a04993973d6
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3289957
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
2025-07-24 10:19:13 +00:00
Jon Hunter
005cbe4462 virt: hvc_sysfs: Another build fix for Linux v6.13
In Linux v6.13, commit 94a20fb9af16 ("sysfs: treewide: constify
attribute callback of bin_attribute::mmap()") changed the type of
the 'struct bin_attribute' argument of the bin_attribute:mmap function
pointer to const.

One instance of this change has already been fixed in the hvc_sysfs
driver but another case was recently introduced breaking the build for
Linux v6.13. Fix this in the same way as the previous instance.

Bug 4985113
Bug 4991705

Change-Id: I7f68138f3b484ebfe7a4ff5032c7b4365865f248
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3287044
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
2025-07-24 10:19:13 +00:00
Manish Bhardwaj
ed5b67aa73 nvidia-oot: add support for nvlog buffer
Using this patch we have done below changes :-
- exposed buf_count, buf_size, region_size to userspace
  via sysfs node to read meta data related to nvlog buffers
- mmap nvlog buffer to the userspace

Bug 4985113

Change-Id: If5824f7199d63364847eecffd0f490213d2acda0
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3268716
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
2025-07-24 10:19:13 +00:00
Jon Hunter
66ddf2ba6f virt: hvc_sysfs: Fix build for Linux v6.13
In Linux v6.13, commit 94a20fb9af16 ("sysfs: treewide: constify
attribute callback of bin_attribute::mmap()") changed the type of the
'struct bin_attribute' argument of the bin_attribute:mmap function
pointer to const. Use conftest to detect if this argument is const or
not in the kernel the driver is being compiled against to fix the build.

Bug 4991705

Change-Id: I791d6c9dde50f1444d0339ebd8a18434045f9026
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261699
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:11 +00:00
Manish Bhardwaj
f666d39d4d nvidia: timed out wait for userspace response
Using this patch we are waiting for 5secs for
response from userspace else we are returning
error.

Bug 3712829

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: I43ee139d4c2f737851ec1cf375e463d7c7c7d6f7
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2760068
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Preetham Chandru <pchandru@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261630
Tested-by: Bhavesh Parekh <bparekh@nvidia.com>
Reviewed-by: Bhavesh Parekh <bparekh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svc-bootloader-acv <svc-bootloader-acv@nvidia.com>
2025-07-24 10:19:11 +00:00
Jon Hunter
f01227d4ea drivers: Drop inline from driver remove wrapper
The driver remove function is a function pointer and therefore, it does
not make sense to define the function as an 'inline'. Update the
coccinelle script and drivers to remove the inline statement.

Bug 4749580

Change-Id: Ia03691b75c4edffe609f27468b911a92a5ddbd68
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233980
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:08 +00:00
Jon Hunter
5a54d4161a drivers: Fix build for Linux v6.12
In Linux v6.12 the definition 'no_llseek' was finally removed. Since
Linux v6.0 it had been redefined as NULL. Add a test to conftest to
determine if 'no_llseek' is present and if not then it is no longer
necessary to populate this and we can leave as NULL.

Bug 4876974

Change-Id: I051fdb285b32260b5913dad89cabe0be04253f67
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3222106
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:07 +00:00
Manish Bhardwaj
150beca335 nvidia-oot: tegra_hv: add dummy driver support
For some of the kernel tegra_hv is part of core kernel and
hence it is nto required to use the OOT tegra_hv driver.

However, some packaging still expect the tegra_hv.ko from
the OOT path. To trick the packaging file, add dummy tegra_hv
driver which does not have anything other than module_init/module_exit.

Bug 4551265

Change-Id: I59f6233705e2cfb510470ae3b9c1ce7d39618330
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3197802
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2025-07-24 10:19:07 +00:00
Jon Hunter
951b2423a8 drivers: Fix platform_driver remove for Linux v6.11
In Linux v6.11, the 'platform_driver' structure 'remove' callback was
updated to return void instead of 'int'. Update all the impacted drivers
as necessary to fix this.

Bug 4749580

Change-Id: I3bb5c549777f7ccad0e3f870373fdd25726ad7ed
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3182878
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-08-11 17:20:34 -07:00
Jon Hunter
e74d45174b tegra_hv: Remove unused dummy driver
Support for building the dummy tegra_hv driver has been removed from the
Makefile and so remove the unused source file as this is no longer being
used.

Bug 4370594
Bug 4346767

Change-Id: I44134df27374338d37ebbb71d9562bcabd0b86e9
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3141627
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2024-05-22 23:27:23 -07:00
Laxman Dewangan
288de33b62 tegra_hv: Fix missing headers for Linux v6.8
For Linux v6.8, commit ef175b29a242 ("of: Stop circularly including
of_device.h and of_platform.h") updated the OF headers included by these
header files. This breaks the build for various drivers and so fix this
by including the headers that are actually needed for each driver.

Bug 4448428

Change-Id: I19a0d9003aa655d12c8ae50131f15a6ee4cc59f8
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3063634
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-27 03:12:34 -08:00
Laxman Dewangan
de4295cfa6 tegra_hv: Use conftest to find if class_attribute function has const type arg
Determine if struct class_attribute function has const type
"struct class_attribute" argument or not.

Modified the argument by change
commit 75a2d4226b5371 ("driver core: class: mark the struct class
for sysfs callbacks as constant") for Linux 6.3

Bug 4346767

Change-Id: I2a36025b23af80761faf1da406481731289eedd2
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3030734
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-08 18:36:58 -08:00
Manish Bhardwaj
912dda68d1 hv: port tegra hypervisor driver on noble kernel
Bug 4377196

Change-Id: Idecaac1915c444fe04c40f0e848e36bd3f90b78f
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3018492
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Akhil R <akhilrajeev@nvidia.com>
2023-12-08 18:18:50 -08:00
Joshua Cha
21a661c58f nvsciipc: fix mixed license
Bug 4405013

Change-Id: I4c37c89b7dcc4c25e0b4e568b8d68d1a73c424f7
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028570
Reviewed-by: Kurt Yi <kyi@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-07 08:13:27 -08:00
Laxman Dewangan
af936f3b1e tegra_hv: Enable driver for Linux 6.2 and above
The driver tegra_hv was disabled for the Linux 6.2 and above
due to build failure. All build issue is fixed and re-enabling
driver for all kernel.

Bug 4370594

Change-Id: I9edef01a4f204b138204d583d9f7f61dc6112a25
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3014191
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-10 14:14:12 -08:00
Manish Bhardwaj
57f8639acb nvidia: hv_pm: send resume req to userspace
Using this patch instead of sending suspend req
in resume path, sending resume req.

Bug 4212516

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: I7eb29cf4ad24952f4efe4c56fd58006f6ebf1071
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2771827
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3012461
Reviewed-by: Preetham Chandru <pchandru@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
2023-11-10 14:09:39 -08:00
Laxman Dewangan
9647ab8386 tegra_hv: Update driver to support Linux 6.2 and above
The IO sys map helpers are used for the IVC communication
on Linux 6.2 and above. Update drivers to have compatible
with IVC APIs of Linux 6.2 and above.

Bug 4370594

Change-Id: I0528248efa9edc3d4962f7b62d8ebfe2ac0a027e
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3013108
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-09 10:19:12 -08:00
Laxman Dewangan
c8a83b5692 tegra_hv: Use const in class attributes APIs for Linux 6.4 and above
The callback APIs of class attribute are updated on
Linux6.4 and above to have the constant type pointer
argument.

Update the driver compatible with the updated APIs
for Linux 6.4 and above.

Bug 4370594

Change-Id: Ic06cb0d752797bb272f110aa0bb35bdd3afa1e6a
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3013107
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-09 10:15:03 -08:00
Laxman Dewangan
b6dcd3d9ce virt: Add tegra_hv dummy driver for Linux 6.6
Tegra HV driver is not getting build with the
Linux 6.6. While it is being fixed, add dummy
variant for this driver to make the packaging
success.

Bug 4346767

Change-Id: I58e9817fc6ebc8bf61a932ed7f1917225ac6a54e
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3012091
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-08 03:30:52 -08:00
Joshua Cha
236a2f09ee nvidia-oot: add IPA type info of IVC channel
Bug 4293372

Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Change-Id: I5c0cf142afdac9a6a1108a38513af6861272a8e9
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2995973
(cherry picked from commit ebedbb2492ea13211b53a48655e9312ba6b255dd)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3004066
Reviewed-by: Kurt Yi <kyi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-02 18:13:33 -07:00
Vishnu Mandalapu
d539245685 drivers: virt: hvc sysfs
- Previously numbers are appended to the sysfs name to solve
  the duplicate name issue. Now this issue is fixed as name
  is changed by server owners. so remove the numbers from
  sysfs name.

Jira HYP-15378

Change-Id: I3384583182520ccd53ea895d799c1e8debc07705
Signed-off-by: Vishnu Mandalapu <vmandalapu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2998182
Reviewed-by: Anil Varma Biruduraju <abiruduraju@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3002432
Reviewed-by: Kiran Puttur <kputtur@nvidia.com>
2023-10-27 01:03:07 -07:00
Shreshtha SAHU
36531e7e1d virt: tegra: tegra_hv: print total IVC and mempool memory usage
bug 4115385
bug 4136301

Change-Id: Idfdf1b3a45943b4da58bb7da9070825472ec3d53
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2997776
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-by: Kasinadha Dendukuri <kdendukuri@nvidia.com>
Tested-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-17 10:01:50 -07:00
Jon Hunter
ce678a37b1 drivers: Add conftest test for class_create
In Linux v6.4, the module pointer argument is removed from the
class_create() function. Add a test to the conftest script that checks
if this argument for the class_create() function has been removed and
use the definition created by conftest to select which version of the
function is used.

Bug 4183168
Bug 4221847

Change-Id: I440e4b318001886cd0319bb3499ba33178475e8c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989020
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-05 17:54:05 -07:00
Shardar Mohammed
4be2dd36bb nvidia-oot: remove module * from class_create()
Remove the module pointer from the class_create() based
on following change in core kernel

======
driver core: class: remove module * from class_create()

The module pointer in class_create() never actually did anything, and it
shouldn't have been requred to be set as a parameter even if it did
something.  So just remove it and fix up all callers of the function in
the kernel tree at the same time.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
=====

Bug 4276500

Change-Id: Ifa0a92a282151ce12dc4a48f4f4b5b9499d3fbd8
Signed-off-by: Shardar Mohammed <smohammed@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2976600
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-08 18:09:50 -07:00
Jian-Min Liu
898a587665 Revert "Add compiler flag to avoid function re-definition"
This reverts commit 2cf67077e2.

The CONFIG_TEGRA_VIRTUALIZATION defined in the top-level Makefile
can be effective in the ACK build after refined make cmd.

Bug 4187941
Bug 4223187

Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Change-Id: Ibe2eabd7c3b84c8f753a089231e90993f377b513
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2954802
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-08-14 01:55:13 -07:00
Manish Bhardwaj
d421a6465c storage: fix cert-c issue in tegra_hv driver
Using this patch we are fixing below cert error:-
1. check_return: Calling tegra_ivc_init without checking
   return value (as is done elsewhere 42 out of 52 times).

CID 10177835

Bug 3512545

Change-Id: I625914bbeee69718689d23da942feec9f05e9236
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2937650
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-19 08:49:56 -07:00
Jian-Min Liu
2cf67077e2 Add compiler flag to avoid function re-definition
Add CONFIG_TEGRA_VIRTUALIZATION with ack-5.15 build to avoid
re-definition symbols when building tegra_hv.ko

Bug 4187941

Change-Id: I64eb10264b527d59919fbe781198d227d0a21dda
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2933664
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
2023-07-14 20:20:16 -07:00
Jon Hunter
deffbf24ab virt: tegra: Ensure functions stubs are defined
When building the out-of-tree drivers with virtualization support
disabled, symbols for some of the virtualization functions are not found
...

 nvgpu: Unknown symbol tegra_hv_mempool_unreserve (err -2)
 nvgpu: Unknown symbol is_tegra_hypervisor_mode (err -2)
 nvgpu: Unknown symbol tegra_hv_mempool_reserve (err -2)
 nvhost_pva: Unknown symbol is_tegra_hypervisor_mode (err -2)
 mc_utils: Unknown symbol is_tegra_hypervisor_mode (err -2)
 mc_utils: Unknown symbol is_tegra_hypervisor_mode (err -2)

Update the hv-ivc.h header to ensure that these function stubs are
defined when virtualization support is disabled and only build the
hv-ivc driver if virtualization is enabled.

Finally, move populating the ccflags to the top-level Makefile and use
the subdir-ccflags directive to ensure the ccflags are passed to all
sub-directories.

Bug 4159372
Bug 4170085

Change-Id: I35edb91007524c3143dff7564f9ad545bd34e969
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2921199
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-07-05 14:34:15 -07:00
Manish Bhardwaj
61f67509a8 hvc_sysfs: delete kernel object
delete kernel object if driver initialization
gets failed

Bug 4080433

Change-Id: Iabe0cabf32a067224f6e17a5e54a1c7d90161c16
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2921795
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-24 07:26:30 -07:00