1. 08 Feb, 2019 1 commit
    • Andre Przywara's avatar
      arm: fdt: add stdout-path to /chosen node · 56e45ea4
      Andre Przywara authored
      
      
      The DT spec describes the stdout-path property in the /chosen node to
      contain the DT path for a default device usable for outputting characters.
      The Linux kernel uses this for earlycon (without further parameters),
      other DT users might rely on this as well.
      
      Add a stdout-path property pointing to the "serial0" alias, then add an
      aliases node at the end of the FDT, containing the actual path. This
      allows the FDT generation code in hw/serial.c to set this string.
      
      Even when we use the virtio console, the serial console is still there
      and works, so we can expose this unconditionally. Putting the virtio
      console path in there will not work anyway.
      
      Signed-off-by: Andre Przywara's avatarAndre Przywara <andre.przywara@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      56e45ea4
  2. 01 Feb, 2019 1 commit
  3. 30 Jan, 2019 2 commits
  4. 22 Jan, 2019 4 commits
  5. 19 Jun, 2018 4 commits
    • 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
      vfio-pci:
      
        $ 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
      parameters.
      
      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>
      6078a454
    • Jean-Philippe Brucker's avatar
      Extend memory bank API with memory types · 8f46c736
      Jean-Philippe Brucker authored
      
      
      Introduce memory types RAM and DEVICE, along with a way for subsystems to
      query the global memory banks. This is required by VFIO, which will need
      to pin and map guest RAM so that assigned devices can safely do DMA to it.
      Depending on the architecture, the physical map is made of either one or
      two RAM regions. In addition, this new memory types API paves the way to
      reserved memory regions introduced in a subsequent patch.
      
      For the moment we put vesa and ivshmem memory into the DEVICE category, so
      they don't have to be pinned. This means that physical devices assigned
      with VFIO won't be able to DMA to the vesa frame buffer or ivshmem. In
      order to do that, simply changing the type to "RAM" would work. But to
      keep the types consistent, it would be better to introduce flags such as
      KVM_MEM_TYPE_DMA that would complement both RAM and DEVICE type. We could
      then reuse the API for generating firmware information (that is, for x86
      bios; DT supports reserved-memory description).
      
      Reviewed-by: default avatarPunit Agrawal <punit.agrawal@arm.com>
      Signed-off-by: default avatarJean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      8f46c736
    • Jean-Philippe Brucker's avatar
      irq: add irqfd helpers · e59679d2
      Jean-Philippe Brucker authored
      
      
      Add helpers to add and remove IRQFD routing for both irqchips and MSIs.
      We have to make a special case of IRQ lines on ARM where the
      initialisation order goes like this:
      
       (1) Devices reserve their IRQ lines
       (2) VGIC is setup with VGIC_CTRL_INIT (in a late_init call)
       (3) MSIs are reserved lazily, when the guest needs them
      
      Since we cannot setup IRQFD before (2), store the IRQFD routing for IRQ
      lines temporarily until we're ready to submit them.
      
      Reviewed-by: default avatarPunit Agrawal <punit.agrawal@arm.com>
      Signed-off-by: default avatarJean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      e59679d2
    • Jean-Philippe Brucker's avatar
      pci: allow to specify IRQ type for PCI devices · ff01b5db
      Jean-Philippe Brucker authored
      
      
      Currently all our virtual device interrupts are edge-triggered. But we're
      going to need level-triggered interrupts when passing physical devices.
      Let the device configure its interrupt kind. Keep edge as default, to
      avoid changing existing users.
      
      Reviewed-by: default avatarPunit Agrawal <punit.agrawal@arm.com>
      Signed-off-by: default avatarJean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      ff01b5db
  6. 23 May, 2018 3 commits
  7. 06 Apr, 2018 1 commit
  8. 03 Nov, 2017 1 commit
    • Jean-Philippe Brucker's avatar
      Add GICv2m support · f6108d72
      Jean-Philippe Brucker authored
      
      
      GICv2m is a small extension to the GICv2 architecture, specified in the
      Server Base System Architecture (SBSA). It adds a set of register to
      converts MSIs into SPIs, effectively enabling MSI support for pre-GICv3
      platforms.
      
      Implement a GICv2m emulation entirely in userspace. Add a thin translation
      layer in irq.c to catch the MSI->SPI routing setup of the guest, and then
      transform irqfd injection of MSI into the associated SPI. There shouldn't
      be any significant runtime overhead compared to gicv3-its.
      
      The device can be enabled by passing "--irqchip gicv2m" to kvmtool.
      
      Signed-off-by: default avatarJean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      f6108d72
  9. 24 Oct, 2017 1 commit
    • Wei Chen's avatar
      arm: Allow all terminal ports to be bi-directional · 83042d1e
      Wei Chen authored
      
      
      In kvmtool, the terminal has 4 term-devices at most. And these term-devices
      can connect to serial8250 or virtio console ports. The kvmtool has a loop
      thread to detect the incoming data on these term-devices and then send the
      data to guest through serial8250 or virtio console ports. On x86, kvmtool
      allow to read data from all 4 term-devices. But on ARM, we only support reading
      data from the first term-devices. The data from the other term-devices will
      be ignored.
      
      Currently, we're adding the kvmtool support to runv (a kind of hyper container)
      with Hyperhq guys. Here we're using 3 serial ports in guest to communicate with
      host (Container runtime). On x86, it works fine, but on ARM it could not work.
      Because we're using terminal 2 to send/receive control message, but terminal 2
      is single direction.
      
      In this case, we change the kvm__arch_read_term for ARM to allow reading data
      from all term-devices.
      
      Signed-off-by: default avatarWei Chen <Wei.Chen@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      83042d1e
  10. 09 Oct, 2017 1 commit
  11. 09 Jun, 2017 11 commits
  12. 01 Feb, 2017 1 commit
  13. 09 Aug, 2016 1 commit
  14. 29 Jul, 2016 1 commit
  15. 14 Jun, 2016 1 commit
  16. 11 Apr, 2016 1 commit
  17. 11 Mar, 2016 1 commit
  18. 02 Mar, 2016 2 commits
  19. 18 Nov, 2015 2 commits