From 3c33c863a178dbb656c835a000df0defdbaa1a9d Mon Sep 17 00:00:00 2001 From: John Levon Date: Mon, 22 Mar 2021 16:53:15 +0000 Subject: README: fix qemu cmdline (#398) For the GPIO demo, we were asking qemu to create a file-backed hostmem backend, but neglecting to actually allocate guest RAM from it. While we're here, let's give some clues on how to use hugepages and share memory with libvfio-user. Signed-off-by: John Levon Reviewed-by: Swapnil Ingle --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 4aa87b2..3a990cb 100644 --- a/README.md +++ b/README.md @@ -179,12 +179,13 @@ to build the `gpio-pci-idio-16` kernel module yourself - it's part of the standard Linux kernel, but not usually built and shipped on x86. Start your guest VM: - ./x86_64-softmmu/qemu-system-x86_64 -mem-prealloc -m 1024 \ - -object memory-backend-file,id=ram-node0,prealloc=yes,mem-path=mem,share=yes,size=1073741824 \ - -kernel ~/vmlinuz -initrd ~/initrd -nographic \ - -append "console=ttyS0 root=/dev/sda1 single" \ - -hda ~/bionic-server-cloudimg-amd64-0.raw \ - -device vfio-user-pci,socket=/tmp/vfio-user.sock + ./x86_64-softmmu/qemu-system-x86_64 -mem-prealloc -m 256 \ + -object memory-backend-file,id=ram-node0,prealloc=yes,mem-path=/dev/hugepages/gpio,share=yes,size=256M \ + -numa node,memdev=ram-node0 \ + -kernel ~/vmlinuz -initrd ~/initrd -nographic \ + -append "console=ttyS0 root=/dev/sda1 single" \ + -hda ~/bionic-server-cloudimg-amd64-0.raw \ + -device vfio-user-pci,socket=/tmp/vfio-user.sock Log in to your guest VM, and you should be able to load the module and observe the emulated GPIO device's pins: -- cgit v1.1