Commit Graph

8 Commits

Author SHA1 Message Date
Jon Hunter
ef52cefdda nv-virtio-poc: Add missing header
In Linux v6.10 the nv-virtio-poc driver fails to build and the following
error is seen ...

 drivers/nv-virtio/nv-virtio-console-poc.c:277:13:
  error: implicit declaration of function 'remap_pfn_range';
  did you mean 'vmap_page_range'? [-Werror=implicit-function-declaration]
  277 |         if (remap_pfn_range(vma, vma->vm_start, ipa_pfn,
      |             ^~~~~~~~~~~~~~~
      |             vmap_page_range

Upstream commit 22bcc915ae91 ("kfifo: don't use "proxy" headers")
updated some kernel headers to only 'include what is used' and exposed
that the nv-virtio-poc driver is not explicitly including 'linux/mm.h'.
The function remap_pfn_range() has been defined in 'linux/mm.h' since
Linux v2.6 and so fix this by always including 'linux/mm.h'.

Bug 4593750

Change-Id: Ic43b22ca51bbc16e2085d146d28e40c21206ae2f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3142213
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-05-22 09:19:28 -07:00
Nitin Kumbhar
7791c1b400 nv-virtio-poc: add android vm loopback support
Loop back data received by BE console driver to Android VM.

Bug 4206871

Change-Id: I06b9523c9898a205cecae1eb35c04c458a3ddc1d
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3021893
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-30 12:54:26 -08:00
Nikhil Jagdale
936d6f0db3 virtio: Modify the offset of Android RAM IPA
We have switched over to swiotlb based reserved memory that is currently
using a IPA region starting at 3GB offset. Use this new offset when
determing the shift when accessing Android virtio memory.

Jira HYP-15395

Change-Id: I79d87d3b6ef33168ff14a136dfbbcf59eb1d0dfb
Signed-off-by: Nikhil Jagdale <njagdale@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3006921
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-10 08:08:52 -08: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
Nitin Kumbhar
0f04078fb6 drivers: nv-virtio-poc: fix coverity issues
Fix issues about unused value of err and overwriting write_size
value.

write_size:
assigned_value: Assigning value from err to write_size here, but that
stored value is overwritten before it can be used.
...
value_overwrite: Overwriting previous write to write_size with value
from copied.

err:
returned_value: Assigning value from nvvc_process_rxdataavaiable()
to err here, but that stored value is overwritten before
it can be used.

CID 10174057
CID 10174058

Bug 3952896

Change-Id: I21ef42b7c1c3fec83e558f80d954b65dbb14a5b8
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2969244
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-30 20:33:26 -07:00
Bharat Nihalani
0f7f6190a1 nv-virtio-poc: Include correct header
This driver was including <linux/tegra-ivc.h> that uses deprecated
CONFIG_TEGRA_HV_MANAGER. This caused all tegra_hv functions to be
stubbed.

With K5.15, a new header <soc/tegra/virt/hv-ivc.h> should be
used instead that makes use of CONFIG_TEGRA_VIRTUALIZATION which
is enabled as part of the kernel build flow. With this header
included, all tegra_hv functions are correctly linked.

Also, there is no need to include tegra_hv.h as this driver
does not use the functions declared in that header.

Bug 4206871

Change-Id: I6ef6e2cf5f2c88dab015c2f10913ede4fdfd5583
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2954916
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-17 20:27:27 -07:00
Nitin Kumbhar
8472163ba0 drivers: nv virtio poc console driver
Add a back-end char driver to implement a virtio console driver which
handles a part of virtio mmio protocol to send and receive data
from a peer VM. IVC queue and mempool are used for this communication.

Also, this driver adds blocking read, write and poll ops for an
user-space application.

JIRA TSSKERNEL-1
Bug 4050146

This change also cherry-picks the fix pushed in linux-nvidia repo:
https://git-master.nvidia.com/r/c/linux-nvidia/+/2918779

Change-Id: I97a88f1dd4eb9e3ac7e1e94439f3ebc8ac933239
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2898234
(cherry picked from commit 10436d9d5bfbbf11ffc63771189b57fdf94e50f6)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2936644
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2023-07-21 11:58:30 -07:00