16 Jun, 2016

1 commit

  • The new created_vcpus field makes it possible to avoid the race between
    irqchip and VCPU creation in a much nicer way; just check under kvm->lock
    whether a VCPU has already been created.

    We can then remove KVM_APIC_ARCHITECTURE too, because at this point the
    symbol is only governing the default definition of kvm_vcpu_compatible.

    Signed-off-by: Paolo Bonzini

    Paolo Bonzini
     

13 May, 2016

1 commit

  • Some wakeups should not be considered a sucessful poll. For example on
    s390 I/O interrupts are usually floating, which means that _ALL_ CPUs
    would be considered runnable - letting all vCPUs poll all the time for
    transactional like workload, even if one vCPU would be enough.
    This can result in huge CPU usage for large guests.
    This patch lets architectures provide a way to qualify wakeups if they
    should be considered a good/bad wakeups in regard to polls.

    For s390 the implementation will fence of halt polling for anything but
    known good, single vCPU events. The s390 implementation for floating
    interrupts does a wakeup for one vCPU, but the interrupt will be delivered
    by whatever CPU checks first for a pending interrupt. We prefer the
    woken up CPU by marking the poll of this CPU as "good" poll.
    This code will also mark several other wakeup reasons like IPI or
    expired timers as "good". This will of course also mark some events as
    not sucessful. As KVM on z runs always as a 2nd level hypervisor,
    we prefer to not poll, unless we are really sure, though.

    This patch successfully limits the CPU usage for cases like uperf 1byte
    transactional ping pong workload or wakeup heavy workload like OLTP
    while still providing a proper speedup.

    This also introduced a new vcpu stat "halt_poll_no_tuning" that marks
    wakeups that are considered not good for polling.

    Signed-off-by: Christian Borntraeger
    Acked-by: Radim Krčmář (for an earlier version)
    Cc: David Matlack
    Cc: Wanpeng Li
    [Rename config symbol. - Paolo]
    Signed-off-by: Paolo Bonzini

    Christian Borntraeger
     

04 Nov, 2015

1 commit


01 Oct, 2015

1 commit

  • This patch introduces
    - kvm_arch_irq_bypass_add_producer
    - kvm_arch_irq_bypass_del_producer
    - kvm_arch_irq_bypass_stop
    - kvm_arch_irq_bypass_start

    They make possible to specialize the KVM IRQ bypass consumer in
    case CONFIG_KVM_HAVE_IRQ_BYPASS is set.

    Signed-off-by: Eric Auger
    [Add weak implementations of the callbacks. - Feng]
    Signed-off-by: Feng Wu
    Reviewed-by: Alex Williamson
    Signed-off-by: Paolo Bonzini

    Eric Auger
     

09 Feb, 2015

1 commit

  • We never had a 31bit QEMU/kuli running. We would need to review several
    ioctls to check if this creates holes, bugs or whatever to make it work.
    Lets just disable compat support for KVM on s390.

    Signed-off-by: Christian Borntraeger
    Acked-by: Paolo Bonzini

    Christian Borntraeger
     

23 Jan, 2015

1 commit

  • The dirty patch logging series introduced both
    HAVE_KVM_ARCH_DIRTY_LOG_PROTECT and KVM_GENERIC_DIRTYLOG_READ_PROTECT
    config symbols, but only KVM_GENERIC_DIRTYLOG_READ_PROTECT is used.
    Just remove the unused one.

    (The config symbol was renamed during the development of the patch
    series and the old name just creeped in by accident.()

    Reported-by: Paul Bolle
    Signed-off-by: Christoffer Dall

    Christoffer Dall
     

16 Jan, 2015

2 commits

  • kvm_get_dirty_log() provides generic handling of dirty bitmap, currently reused
    by several architectures. Building on that we intrdoduce
    kvm_get_dirty_log_protect() adding write protection to mark these pages dirty
    for future write access, before next KVM_GET_DIRTY_LOG ioctl call from user
    space.

    Reviewed-by: Christoffer Dall
    Signed-off-by: Mario Smarduch

    Mario Smarduch
     
  • Allow architectures to override the generic kvm_flush_remote_tlbs()
    function via HAVE_KVM_ARCH_TLB_FLUSH_ALL. ARMv7 will need this to
    provide its own TLB flush interface.

    Reviewed-by: Christoffer Dall
    Reviewed-by: Marc Zyngier
    Reviewed-by: Paolo Bonzini
    Signed-off-by: Mario Smarduch

    Mario Smarduch
     

05 Aug, 2014

1 commit

  • Currently, the IRQFD code is conditional on CONFIG_HAVE_KVM_IRQ_ROUTING.
    So that we can have the IRQFD code compiled in without having the
    IRQ routing code, this creates a new CONFIG_HAVE_KVM_IRQFD, makes
    the IRQFD code conditional on it instead of CONFIG_HAVE_KVM_IRQ_ROUTING,
    and makes all the platforms that currently select HAVE_KVM_IRQ_ROUTING
    also select HAVE_KVM_IRQFD.

    Signed-off-by: Paul Mackerras
    Tested-by: Eric Auger
    Tested-by: Cornelia Huck
    Signed-off-by: Paolo Bonzini

    Paul Mackerras
     

30 Jan, 2014

1 commit

  • By setting a Kconfig option, the architecture can control when
    guest notifications will be presented by the apf backend.
    There is the default batch mechanism, working as before, where the vcpu
    thread should pull in this information.
    Opposite to this, there is now the direct mechanism, that will push the
    information to the guest.
    This way s390 can use an already existing architecture interface.

    Still the vcpu thread should call check_completion to cleanup leftovers.

    Signed-off-by: Dominik Dingel
    Signed-off-by: Christian Borntraeger

    Dominik Dingel
     

31 Oct, 2013

1 commit

  • So far we've succeeded at making KVM and VFIO mostly unaware of each
    other, but areas are cropping up where a connection beyond eventfds
    and irqfds needs to be made. This patch introduces a KVM-VFIO device
    that is meant to be a gateway for such interaction. The user creates
    the device and can add and remove VFIO groups to it via file
    descriptors. When a group is added, KVM verifies the group is valid
    and gets a reference to it via the VFIO external user interface.

    Signed-off-by: Alex Williamson
    Signed-off-by: Paolo Bonzini

    Alex Williamson
     

27 Apr, 2013

1 commit

  • Quite a bit of code in KVM has been conditionalized on availability of
    IOAPIC emulation. However, most of it is generically applicable to
    platforms that don't have an IOPIC, but a different type of irq chip.

    Make code that only relies on IRQ routing, not an APIC itself, on
    CONFIG_HAVE_KVM_IRQ_ROUTING, so that we can reuse it later.

    Signed-off-by: Alexander Graf
    Acked-by: Michael S. Tsirkin

    Alexander Graf
     

23 Jul, 2012

1 commit


24 Apr, 2012

1 commit

  • Currently, MSI messages can only be injected to in-kernel irqchips by
    defining a corresponding IRQ route for each message. This is not only
    unhandy if the MSI messages are generated "on the fly" by user space,
    IRQ routes are a limited resource that user space has to manage
    carefully.

    By providing a direct injection path, we can both avoid using up limited
    resources and simplify the necessary steps for user land.

    Signed-off-by: Jan Kiszka
    Signed-off-by: Avi Kivity

    Jan Kiszka
     

12 Jan, 2011

1 commit

  • If a guest accesses swapped out memory do not swap it in from vcpu thread
    context. Schedule work to do swapping and put vcpu into halted state
    instead.

    Interrupts will still be delivered to the guest and if interrupt will
    cause reschedule guest will continue to run another task.

    [avi: remove call to get_user_pages_noio(), nacked by Linus; this
    makes everything synchrnous again]

    Acked-by: Rik van Riel
    Signed-off-by: Gleb Natapov
    Signed-off-by: Marcelo Tosatti

    Gleb Natapov
     

01 Mar, 2010

1 commit


10 Sep, 2009

3 commits

  • Archs are free to use vcpu_id as they see fit. For x86 it is used as
    vcpu's apic id. New ioctl is added to configure boot vcpu id that was
    assumed to be 0 till now.

    Signed-off-by: Gleb Natapov
    Signed-off-by: Avi Kivity

    Gleb Natapov
     
  • KVM provides a complete virtual system environment for guests, including
    support for injecting interrupts modeled after the real exception/interrupt
    facilities present on the native platform (such as the IDT on x86).
    Virtual interrupts can come from a variety of sources (emulated devices,
    pass-through devices, etc) but all must be injected to the guest via
    the KVM infrastructure. This patch adds a new mechanism to inject a specific
    interrupt to a guest using a decoupled eventfd mechnanism: Any legal signal
    on the irqfd (using eventfd semantics from either userspace or kernel) will
    translate into an injected interrupt in the guest at the next available
    interrupt window.

    Signed-off-by: Gregory Haskins
    Signed-off-by: Avi Kivity

    Gregory Haskins
     
  • Reduce Kconfig code duplication.

    Signed-off-by: Avi Kivity

    Avi Kivity