1. 08 Feb, 2019 1 commit
  2. 22 Jan, 2019 1 commit
  3. 19 Jun, 2018 1 commit
    • Jean-Philippe Brucker's avatar
      Add PCI device passthrough using VFIO · 6078a454
      Jean-Philippe Brucker authored
      Assigning devices using VFIO allows the guest to have direct access to the
      device, whilst filtering accesses to sensitive areas by trapping config
      space accesses and mapping DMA with an IOMMU.
      This patch adds a new option to lkvm run: --vfio-pci=<BDF>. Before
      assigning a device to a VM, some preparation is required. As described in
      Linux Documentation/vfio.txt, the device driver needs to be changed to
        $ dev=0000:00:00.0
        $ echo $dev > /sys/bus/pci/devices/$dev/driver/unbind
        $ echo vfio-pci > /sys/bus/pci/devices/$dev/driver_override
        $ echo $dev > /sys/bus/pci/drivers_probe
      Adding --vfio-pci=$dev to lkvm-run will pass the device to the guest.
      Multiple devices can be passed to the guest by adding more --vfio-pci
      This patch only implements PCI with INTx. MSI-X routing will be added in a
      subsequent patch, and at some point we might add support for passing
      platform devices to guests.
      Reviewed-by: default avatarPunit Agrawal <punit.agrawal@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: Robin Murphy's avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarJean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
  4. 03 Nov, 2017 1 commit
  5. 25 Oct, 2017 1 commit
  6. 14 Apr, 2016 1 commit
    • Will Deacon's avatar
      kvmtool: delegate exit/reboot responsibility to vcpu0 · e8cb90fb
      Will Deacon authored
      Our exit/reboot code is a bit of a mess:
        - Both kvm__reboot and kvm_cpu_exit send SIGKVMEXIT to running vcpus
        - When vcpu0 exits, the main thread starts executing destructors
          (exitcalls) whilst other vcpus may be running
        - The pause_lock isn't always held when inspecting is_running for
          a vcpu
      This patch attempts to fix these issues by restricting the exit/reboot
      path to vcpu0 and the main thread. In particular, a KVM_SYSTEM_EVENT
      will signal SIGKVMEXIT to vcpu0, which will join with the main thread
      and then tear down the other vcpus before invoking any destructor code.
      Acked-by: default avatarBalbir Singh <bsingharora@gmail.com>
      Tested-by: default avatarJulien Grall <julien.grall@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
  7. 02 Nov, 2015 1 commit
    • William Dauchy's avatar
      kvmtool/run: set a default cmdline if not set · d583df25
      William Dauchy authored
      when starting with custom kernel and disk options, kernel_cmdline is
      NULL; it results in a segfault while trying to look for a string
      using `strstr`:
      __strstr_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strstr-sse2-unaligned.S:40
      0x00000000004056bf in kvm_cmd_run_init (argc=<optimized out>, argv=<optimized out>) at builtin-run.c:608
      0x000000000040639d in kvm_cmd_run (argc=<optimized out>, argv=<optimized out>, prefix=<optimized out>) at builtin-run.c:659
      0x0000000000412b8f in handle_command (command=0x62bbc0 <kvm_commands>, argc=5, argv=0x7fffffffe840) at kvm-cmd.c:84
      0x00007ffff7211b45 in __libc_start_main (main=0x403540 <main>, argc=6, argv=0x7fffffffe838, init=<optimized out>, fini=<optimized out>,
        rtld_fini=<optimized out>, stack_end=0x7fffffffe828) at libc-start.c:287
      0x0000000000403962 in _start ()
      this patch suggests to set a minimal cmdline when kernel_cmdline is NULL
      Fixes: 8a7163f3
       ("kvmtool/run: append cfg.kernel_cmdline at the end of real_cmdline")
      Signed-off-by: default avatarWilliam Dauchy <william@gandi.net>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
  8. 28 Oct, 2015 1 commit
  9. 27 Oct, 2015 3 commits
    • Oleg Nesterov's avatar
      kvmtool/run: don't abuse "root=" parameter, don't pass "rw" to v9fs_mount() · 1c2a21f0
      Oleg Nesterov authored
      1. kvm_cmd_run_init() appends "root=/dev/root" to real_cmdline if
         cfg.using_rootfs == T. This doesn't hurt but makes no sense and
         looks confusing.
         We do not need to initialiaze the kernel's saved_root_name[] and
         "/dev/root" means nothing to name_to_dev_t().
         We only need to pass this mount-tag to 9p but the kernel always
         uses dev_name="/dev/root" in mount_root() path, so we can safely
         remove this option from the command line.
      2. "rw" in rootflags looks confusing too, it is silently ignored by
         v9fs_parse_options() and has no effect.
         We need to clear MS_RDONLY from root_mountflags, this is what the
         "standalone" kernel parameter correctly does.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    • Oleg Nesterov's avatar
      kvmtool/x86: implement guest_pre_init · 5614f9d9
      Oleg Nesterov authored
      Add the tiny x86/init.S which just mounts /host and execs
      NOTE: of course, the usage of CONFIG_GUEST_PRE_INIT is ugly, we
      need to cleanup this code. But I'd prefer to do this on top of
      this minimal/simple change. And I think this needs cleanups in
      any case, for example I think lkvm shouldn't abuse the "init="
      kernel parameter at all.
      Acked-by: default avatarPekka Enberg <penberg@kernel.org>
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    • Oleg Nesterov's avatar
      kvmtool/run: append cfg.kernel_cmdline at the end of real_cmdline · 8a7163f3
      Oleg Nesterov authored
      This allows the user to always override the paramaters set by lkvm.
      Say, currently 'lkvm run -p ro' doesn't work.
      To keep the current logic we need to change strstr("root=") to check
      cfg.kernel_cmdline, not real_cmdline. And perhaps we can even add a
      simple helper add_param(name, val) to make this all more consistent;
      it should only append "name=val" to real_cmdline if cfg.kernel_cmdline
      doesn't include this paramater.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
  10. 15 Sep, 2015 1 commit
  11. 01 Jun, 2015 28 commits