Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPIO proxy drivers ready for passthrough testing in VM using systemd #552

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

KimGSandstrom
Copy link

Kernel update for GPIO passthrough.
Starts gpio-vm VM for testing

@KimGSandstrom KimGSandstrom temporarily deployed to internal-build-workflow April 10, 2024 10:30 — with GitHub Actions Inactive
@KimGSandstrom
Copy link
Author

After merging with newest tiiuae ghaf the virtual machine and its service (microvm@gpio-vm.service) do not start up anymore. No VM seem to be running.

this is missing:
./targets/nvidia-jetson-orin/default.nix: virtualization.microvm.gpiovm.enable = true;

- changes concern activation and deactivation of virtualised elements
  in passthough of uarta, bpmp, gpio.
- code deactivates uarta and bpmp because bpmp kernel patches conflict
  with gpio patches. This could be fixed by remaking the bpmp patches.
@KimGSandstrom KimGSandstrom temporarily deployed to internal-build-workflow April 10, 2024 16:11 — with GitHub Actions Inactive
@KimGSandstrom
Copy link
Author

The guest's device tree is not set. That's why the guest kernel fails at startup of microvm@gpio-vm

@brianmcgillion brianmcgillion marked this pull request as draft April 11, 2024 10:45
The vda device is removed from the gpio-vm because it will not work
while we do not have the proper Device Tree in the VM.
@KimGSandstrom KimGSandstrom temporarily deployed to internal-build-workflow April 15, 2024 07:18 — with GitHub Actions Inactive
startup of VM fails because the DT does not provide the vda device
gpio-vm's device tree tegra234-p3701-0000-gpio-passthrough.dtb declares
the vda device needed for passthrough.

gpio-vm goes into emergency mode because it cannot open AMA0 as a
console. Uarta passthrough is disabled because of conflicts with GPIO
passthrough. We need to disable the QEMU console. Somewhere in the code
console=ttyAMA0 is set for QEMU. It is not obvious where.
At the moment device tree overlays are not working when applied
according to template from other VM's. Posible cause is big changes
introduced in upstream. Will merge with tiiuae after this commit.
VM kernel params are
  -amend rootwait console=ttyS3
No qemu.extraArgs are set
Recent merge is partially retrenched. Newer files breaks this GPIO version
because the host dtb overlay is broken by netvm-wlan-pci-passthrough.
The changes in tiiuae git are realated to pci passthrough, optee kernel,
"machine" option for microvm/qemu and a patch provided for
netvm-wlan-pci-passthrough
GPIO guest driver in VM throws error at initialisation of shared qemu
memory.
ioremap fails:
mem_iova = ioremap(gpio_vpa, MEM_SIZE);
@KimGSandstrom KimGSandstrom temporarily deployed to internal-build-workflow May 6, 2024 12:45 — with GitHub Actions Inactive
@KimGSandstrom KimGSandstrom had a problem deploying to external-build-workflow May 6, 2024 12:45 — with GitHub Actions Failure
Guest proxy driver can passtrough low level readl and writel to host
proxy. This might (meaning: still being tested) be necessary to allow
guest to set up GPIO pins declared in guest's Device Tree.
…99608/72089e71a1f3d9f2d854711c6e16b703f1a426da
- New baseline for adding more passthrough functions
- ./simple-chardev-test.sh works in /dev/gpio-host and /dev/gpio.guest
- readl/writel execution blocked in host
- Guest kernel is not aware of pins in host (gpioinfo gives false data)
- use qemu: 8c5b0acccd3b4f47ba84d23b628ef294533e662a
- kernel: e3a4e96cd08ab8d1a31498a10f8f7320ef53bd9d/2d96cc2e8e1c4ee4a3e973023b6c398a98dc0d93
- precompiled as nix generation 233
- return value written to char buffer in write()
- return values from host seem reliable
- return value is 64 bit written at offset 2 words, 2*8 bytes
- full chain to guest does not work (qemu problem?)
- platform to fix qemu problem
- Guest kernel is not aware of pins in host (gpioinfo gives false data)
- kernel: 5b7326f7ce046a8ae6c943e238a645356f237f7b/e625198f19ab6874ea89e0a7b1c5c4dfacb38710
- precompiled as nix generation 274
  - gpio-virt commit 71192f60bd8b8f6be4d529c49b7c33529e21a1e2
  - kernel 5.10 commit fb9220ac23c9892ec6433f0e839b8f919511a927
  - qemu in ghaf is not yet updated
  - use qemu 8.1.2 patch
          in commit 95d5cdb19713369a9dceab53659628292d9ff884
  - precompiled into generation 299 (on dev system)
- added source patches:
  - kernel adfe63ef006a696e7384b9cee340f05bf7f4f1b3
    from git@github.com:KimGSandstrom/tegra_kernel-5.10.git
  - gpio-virt patch d90bd5625957fd164e4eb50803bd724fda89ba68
    from git@github.com:KimGSandstrom/gpio-virt.git
  - qemu 9.0.2 GPIO passthrough patch b077b3cb519958d091cd753f7015ffafd3bfcaee
    from git@github.com:KimGSandstrom/qemu-passthrough

  - GPIO passthrough works with provided qemu
  - microvm@gpio-vm.service does not start up correctly
@KimGSandstrom KimGSandstrom temporarily deployed to internal-build-workflow September 3, 2024 12:40 — with GitHub Actions Inactive
@tiiuae tiiuae deleted a comment Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant