Age | Commit message (Collapse) | Author |
|
Use kvm_irqchip_add_msi_route and introduce kvm_irqchip_update_msi_route
to set up the required IRQ routes for MSI-X injections. This removes the
last direct interaction with the IRQ routing API of the KVM kernel so
that we can remove/unexport related services.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
* commit '5a4d701acde890a5ca134236424ece45545f70c7': (217 commits)
audio: Make pcspk card selectable again
win32: provide separate macros for weak decls and definitions
openpic: Added BRR1 register
pseries: Update SLOF firmware image
pseries dma: DMA window params added to PHB and DT population changed
pseries: Add PCI MSI/MSI-X support
pseries: Add trace event for PCI irqs
pseries: Export find_phb() utility function for PCI code
pseries: added allocator for a block of IRQs
pseries: Separate PCI RTAS setup from common from emulation specific PCI setup
pseries: Rework irq assignment to avoid carrying qemu_irqs around
pseries: Remove extraneous prints
pseries: Update SLOF
PPC: spapr: Remove global variable
PPC: spapr: Rework VGA select logic
xbzrle: fix compilation on ppc32
spapr: Add support for -vga option
Add one new file vga-pci.h and cleanup on all platforms
Revert "PPC: e500: Use new MPIC dt format"
ppc: Fix bug in handling of PAPR hypercall exits
...
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
* commit '1d31f66bbc886af56d2def349012a358dc3ada06': (22 commits)
kvm: Move kvm_allows_irq0_override() to target-i386, fix return type
kvm: Rename kvm_irqchip_set_irq() to kvm_set_irq()
kvm: Decouple 'async interrupt delivery' from 'kernel irqchip'
configure: Don't implicitly hardcode list of KVM architectures
kvm: Check if smp_cpus exceeds max cpus supported by kvm
usb-storage: fix SYNCHRONIZE_CACHE
usb-storage: improve debug logging
slirp: fix build on mingw32
qemu-img: use QemuOpts instead of QEMUOptionParameter in resize function
qemu-iotests: Be more flexible with image creation options
qemu-iotests: add 039 qcow2 lazy refcounts test
qemu-io: add "abort" command to simulate program crash
qcow2: implement lazy refcounts
qemu-iotests: ignore qemu-img create lazy_refcounts output
docs: add lazy refcounts bit to qcow2 specification
qcow2: introduce dirty bit
docs: add dirty bit to qcow2 specification
qemu-iotests: add qed.py image manipulation utility
qapi: generalize documentation of streaming commands
ide scsi: Mess with geometry only for hard disk devices
...
Conflicts:
kvm-all.c
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
Don't assume having an in-kernel irqchip means that GSI
routing is enabled.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Decouple another x86-specific assumption about what irqchips imply.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Instead of assuming that we can use irqfds if and only if
kvm_irqchip_in_kernel(), add a bool to the KVMState which
indicates this, and is set only on x86 and only if the
irqchip is in the kernel.
The kernel documentation implies that the only thing
you need to use KVM_IRQFD is that KVM_CAP_IRQFD is
advertised, but this seems to be untrue. In particular
the kernel does not (alas) return a sensible error if you
try to set up an irqfd when you haven't created an irqchip.
If it did we could remove all this nonsense and let the
kernel return the error code.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
kvm_allows_irq0_override() is a totally x86 specific concept:
move it to the target-specific source file where it belongs.
This means we need a new header file for the prototype:
kvm_i386.h, in line with the existing kvm_ppc.h.
While we are moving it, fix the return type to be 'bool' rather
than 'int'.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
On x86 userspace delivers interrupts to the kernel asynchronously
(and therefore VCPU idle management is done in the kernel) if and
only if there is an in-kernel irqchip. On other architectures this
isn't necessarily true (they may always send interrupts
asynchronously), so define a new kvm_async_interrupts_enabled()
function instead of misusing kvm_irqchip_in_kernel().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
* commit '15b2bd1847239fe0b4a1041b69a631741d2e273a':
virtio: move common irqfd handling out of virtio-pci
virtio: move common ioeventfd handling out of virtio-pci
event_notifier: add event_notifier_set_handler
memory: pass EventNotifier, not eventfd
ivshmem: wrap ivshmem_del_eventfd loops with transaction
ivshmem: use EventNotifier and memory API
event_notifier: add event_notifier_init_fd
event_notifier: remove event_notifier_test
event_notifier: add event_notifier_set
apic: Defer interrupt updates to VCPU thread
apic: Reevaluate pending interrupts on LVT_LINT0 changes
apic: Resolve potential endless loop around apic_update_irq
kvm: expose tsc deadline timer feature to guest
kvm_pv_eoi: add flag support
kvm: Don't abort on kvm_irqchip_add_msi_route()
Conflicts:
kvm.h
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
All transports can use the same event handler for the irqfd, though the
exact mechanics of the assignment will be specific. Note that there
are three states: handled by the kernel, handled in userspace, disabled.
This also lets virtio use event_notifier_set_handler.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
qemu-kvm no longer uses them outside of CONFIG_KVM.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
|
|
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
|
|
Conflicts:
hw/msix.c
hw/msix.h
hw/pci.h
hw/virtio-pci.c
kvm-all.c
kvm-stub.c
kvm.h
|
|
Provide a dummy kvm_kernel_irqchip so that kvm_irqchip_in_kernel can be
used by code that is not under CONFIG_KVM protection.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Add services to associate an eventfd file descriptor as input with an
IRQ line as output. Such a line can be an input pin of an in-kernel
irqchip or a virtual line returned by kvm_irqchip_add_route.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
This allows to drop routes created by kvm_irqchip_add_irq/msi_route
again.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Add a service that establishes a static route from a virtual IRQ line to
an MSI message. Will be used for IRQFD and device assignment. As we will
use this service outside of CONFIG_KVM protected code, stub it properly.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
* commit 'c73b00973b13a4a1e823ce935bcfe264c758b40b':
kvm: Drop unused kvm_pit_in_kernel
kvm: allow arbitrarily sized mmio ioeventfd
kvm: Drop redundant kvm_enabled from cpu_thread_is_idle
Conflicts:
kvm-stub.c
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
* commit '9349b4f9fda360f3d9adc4cf4443a1a9b429c17e':
Rename CPUState -> CPUArchState
xtensa hw/: Don't use CPUState
sparc hw/: Don't use CPUState
sh4 hw/: Don't use CPUState
s390x hw/: Don't use CPUState
ppc hw/: Don't use CPUState
mips hw/: Don't use CPUState
microblaze hw/: Don't use CPUState
m68k hw/: Don't use CPUState
lm32 hw/: Don't use CPUState
Conflicts:
kvm-all.c
kvm-stub.c
kvm.h
Related changes:
cpu.h
qemu-kvm.c
hw/acpi_piix.c
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
This is now implied by kvm_irqchip_in_kernel.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
We use a 2 byte ioeventfd for virtio memory,
add support for this.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Scripted conversion:
for file in *.[hc] hw/*.[hc] hw/kvm/*.[hc] linux-user/*.[hc] linux-user/m68k/*.[hc] bsd-user/*.[hc] darwin-user/*.[hc] tcg/*/*.[hc] target-*/cpu.h; do
sed -i "s/CPUState/CPUArchState/g" $file
done
All occurrences of CPUArchState are expected to be replaced by QOM CPUState,
once all targets are QOM'ified and common fields have been extracted.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
Functions are equivalent, let's switch.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Replace qemu-kvm's versions of kvm_add_irq_route, kvm_add_routing_entry,
kvm_init_irq_routing, kvm_arch_init_irq_routing, and
kvm_commit_irq_routes with the corresponding upstream services. Until
the MSI API is refactored, we only need to export kvm_add_routing_entry
for this.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
To be used for in-kernel PIT emulation.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
* commit '3d4b26494fdce89354dac49ef909356ccda77914':
kvm: Implement kvm_irqchip_in_kernel like kvm_enabled
Conflicts:
hw/pc.c
hw/pc_piix.c
Adjust:
kvm.h
qemu-kvm.c
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
To both avoid that kvm_irqchip_in_kernel always has to be paired with
kvm_enabled and that the former ends up in a function call, implement it
like the latter. This means keeping the state in a global variable and
defining kvm_irqchip_in_kernel as a preprocessor macro.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
KVM is forced to disable the IRQ0 override when we run with in-kernel
irqchip but without IRQ routing support of the kernel. Set the fwcfg
value correspondingly. This aligns us with qemu-kvm.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
|
|
* commit '2b41f10e186ccb4f0058815161586f8d6d006ea3':
Remove exec-all.h include directives
Move cpu_has_work and cpu_pc_from_tb to cpu.h
exec.h: fix coding style and change cpu_has_work to return bool
Conflicts:
exec.c
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Most exec-all.h include directives are now useless, remove them.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
|
|
* commit 'ba9bc59e1f5dc91caf35e0ef08da137b3a5e7386':
kvm: x86: Pass KVMState to kvm_arch_get_supported_cpuid
kvm: Clean up stubs
kvm: ppc: Drop KVM_CAP build dependencies
Conflicts:
target-i386/kvm.c
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
No one references kvm_check_extension, kvm_has_vcpu_events, and
kvm_has_robust_singlestep outside KVM code.
kvm_update_guest_debug is never called, thus has no job besides
returning an error.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
Minor fallout from recent refactorings.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
Moving virtio-pci into the hwlib in upstream broke qemu-kvm due to some
unneeded build dependency on CONFIG_KVM. Stub out kvm_set_irqfd so that
we can build against it unconditionally.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
Introduce kvm_allows_irq0_override to overcome the global irq0override
variable and convert the BIOS initialization.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
* commit '3110e2925489c571901e945e315942ce84fe696f': (41 commits)
s390x: Enable s390x-softmmu target
s390x: Prepare cpu.h for emulation
move helpers.h to helper.h
libcacard: fix opposite usage of isspace
target-mips: clear softfpu exception state for comparison instructions
target-mips: fix c.ps.* instructions
target-mips: don't hardcode softfloat exception bits
target-mips: simplify FP comparisons
target-ppc: fix SPE comparison functions
softfloat: improve description of comparison functions
softfloat: move float*_eq and float*_eq_quiet
softfloat: rename float*_eq_signaling() into float*_eq()
softfloat: rename float*_eq() into float*_eq_quiet()
target-i386: fix CMPUNORDPS/D and CMPORDPS/D instructions
target-mips: use new float*_unordered*() functions
target-alpha: use new float64_unordered_quiet() function
softfloat-native: add float*_unordered_quiet() functions
softfloat: add float*_unordered_{,quiet}() functions
target-i386: add floatx_{add,mul,sub} and use them
target-i386: use float unions from cpu-all.h
...
Conflicts:
cpu-exec.c
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
Remove unused sysemu.h include directives to speed up build
with the following patches.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
|
|
I pulled the latest qemu-kvm code and configured it with disabled-kvm
and related options. Configuration finishes well, but the compilation
fails.
prasad@prasad-kvm:~/KVM/qemu-kvm$ make
....
....
CC x86_64-softmmu/kvm-stub.o
/home/prasad/KVM/qemu-kvm/kvm-stub.c:140: error: expected identifier
or ‘(’ before ‘<<’ token
make[1]: *** [kvm-stub.o] Error 1
make: *** [subdir-x86_64-softmmu] Error 2
A Small fix would be
Signed-off-by: Prasad Joshi <prasadjoshi124@gmail.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
* commit 'e5896b12e20b86ba9d16582888d60cf5cb286517':
Introduce log_start/log_stop in CPUPhysMemoryClient
kvm: Remove unneeded memory slot reservation
kvm: x86: Catch and report failing IRQ and NMI injections
Conflicts:
kvm.h
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
* commit 'a1b87fe046bbb5a332e51906053c7e0307f26d89':
kvm: Provide sigbus services arch-independently
kvm: Handle kvm_init_vcpu errors
kvm: Drop redundant kvm_enabled from kvm_cpu_thread_fn
kvm: Report proper error on GET_VCPU_MMAP_SIZE failures
Flatten the main loop
Leave inner main_loop faster on pending requests
Trigger exit from cpu_exec_all on pending IO events
Process vmstop requests in IO thread
Conflicts:
kvm-all.c
kvm-stub.c
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
In order to use log_start/log_stop with Xen as well in the vga code,
this two operations have been put in CPUPhysMemoryClient.
The two new functions cpu_physical_log_start,cpu_physical_log_stop are
used in hw/vga.c and replace the kvm_log_start/stop. With this, vga does
no longer depends on kvm header.
[ Jan: rebasing and style fixlets ]
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
Provide arch-independent kvm_on_sigbus* stubs to remove the #ifdef'ery
from cpus.c. This patch also fixes --disable-kvm build by providing the
missing kvm_on_sigbus_vcpu kvm-stub.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
* commit 'cad1e2827b616487e3574300f2eaeea13a355197':
kvm: Drop smp_cpus argument from init functions
kvm: x86: Fix !CONFIG_KVM_PARA build
kvm: x86: Reset paravirtual MSRs
Conflicts:
kvm-all.c
kvm.h
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
No longer used.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
* commit 'd2f2b8a740c82319f9eea51ebed50815fbc3da3e':
kvm: test for ioeventfd support on old kernels
virtio: move vmstate change tracking to core
virtio-pci: Rename bugs field to flags
qxl: tag as not hotpluggable
vga: tag as not hotplugable.
piix: tag as not hotpluggable.
pci: allow devices being tagged as not hotpluggable.
rtl8139: Use subsection to restrict migration after hotplug
qdev: Track runtime machine modifications
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
There used to be a limit of 6 KVM io bus devices in the kernel.
On such a kernel, we can't use many ioeventfds for host notification
since the limit is reached too easily.
Add an API to test for this condition.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
* commit 'c0532a76b407af4b276dc5a62d8178db59857ea6':
MCE: Relay UCR MCE to guest
Conflicts:
kvm-stub.c
target-i386/kvm.c
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
Port qemu-kvm's
commit 4b62fff1101a7ad77553147717a8bd3bf79df7ef
Author: Huang Ying <ying.huang@intel.com>
Date: Mon Sep 21 10:43:25 2009 +0800
MCE: Relay UCR MCE to guest
UCR (uncorrected recovery) MCE is supported in recent Intel CPUs,
where some hardware error such as some memory error can be reported
without PCC (processor context corrupted). To recover from such MCE,
the corresponding memory will be unmapped, and all processes accessing
the memory will be killed via SIGBUS.
For KVM, if QEMU/KVM is killed, all guest processes will be killed
too. So we relay SIGBUS from host OS to guest system via a UCR MCE
injection. Then guest OS can isolate corresponding memory and kill
necessary guest processes only. SIGBUS sent to main thread (not VCPU
threads) will be broadcast to all VCPU threads as UCR MCE.
aliguori: fix build
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|