summaryrefslogtreecommitdiffstats
path: root/kvm-stub.c
Commit message (Collapse)AuthorAgeFilesLines
* kvm: Clean up irqfd APIJan Kiszka2012-09-091-12/+2
| | | | | | | | | | No need to expose the fd-based interface, everyone will already be fine with the more handy EventNotifier variant. Rename the latter to clarify that we are still talking about irqfds here. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
* kvm: Decouple 'GSI routing' from 'kernel irqchip'Peter Maydell2012-08-091-0/+1
| | | | | | | | 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>
* kvm: Decouple 'MSI routing via irqfds' from 'kernel irqchip'Peter Maydell2012-08-091-0/+1
| | | | | | | 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>
* kvm: Decouple 'irqfds usable' from 'kernel irqchip'Peter Maydell2012-08-091-0/+1
| | | | | | | | | | | | | | | | | | | 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: Move kvm_allows_irq0_override() to target-i386, fix return typePeter Maydell2012-08-091-5/+0
| | | | | | | | | | | | | 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>
* kvm: Decouple 'async interrupt delivery' from 'kernel irqchip'Peter Maydell2012-08-091-0/+1
| | | | | | | | | | | | 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>
* virtio: move common irqfd handling out of virtio-pciPaolo Bonzini2012-07-121-0/+10
| | | | | | | | | | | 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>
* kvm: Enable use of kvm_irqchip_in_kernel in hwlib codeJan Kiszka2012-05-211-0/+1
| | | | | | | | 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>
* kvm: Introduce kvm_irqchip_add/remove_irqfdJan Kiszka2012-05-211-0/+10
| | | | | | | | | 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>
* kvm: Publicize kvm_irqchip_release_virqJan Kiszka2012-05-211-0/+4
| | | | | | | | 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>
* kvm: Introduce kvm_irqchip_add_msi_routeJan Kiszka2012-05-211-0/+8
| | | | | | | | | 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>
* kvm: Drop unused kvm_pit_in_kernelJan Kiszka2012-04-121-6/+0
| | | | | | | 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>
* kvm: allow arbitrarily sized mmio ioeventfdMichael S. Tsirkin2012-04-121-1/+1
| | | | | | | | | 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>
* Rename CPUState -> CPUArchStateAndreas Färber2012-03-141-11/+11
| | | | | | | | | | | | | 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>
* kvm: Add kvm_has_pit_state2 helperJan Kiszka2012-03-071-0/+5
| | | | | | | 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>
* kvm: Implement kvm_irqchip_in_kernel like kvm_enabledJan Kiszka2012-02-081-5/+0
| | | | | | | | | | 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: x86: Establish IRQ0 override controlJan Kiszka2012-01-191-0/+5
| | | | | | | | 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>
* Remove exec-all.h include directivesBlue Swirl2011-06-261-1/+1
| | | | | | Most exec-all.h include directives are now useless, remove them. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* kvm: Clean up stubsJan Kiszka2011-06-201-17/+1
| | | | | | | | | | | 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>
* Remove unused sysemu.h include directivesBlue Swirl2011-04-151-1/+0
| | | | | | | Remove unused sysemu.h include directives to speed up build with the following patches. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Introduce log_start/log_stop in CPUPhysMemoryClientAnthony PERARD2011-02-141-10/+0
| | | | | | | | | | | | | | | 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>
* kvm: Provide sigbus services arch-independentlyJan Kiszka2011-02-141-0/+5
| | | | | | | | | | | 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>
* kvm: Drop smp_cpus argument from init functionsJan Kiszka2011-01-231-1/+1
| | | | | | | No longer used. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* kvm: test for ioeventfd support on old kernelsStefan Hajnoczi2011-01-101-0/+5
| | | | | | | | | | | 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>
* MCE: Relay UCR MCE to guestMarcelo Tosatti2010-10-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add kvm_set_ioeventfd_mmio_long definition for non-KVM systemsCam Macdonell2010-08-151-0/+5
| | | | | Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* remove exec-all.h inclusion from cpu.hPaolo Bonzini2010-07-031-0/+1
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* provide a stub version of kvm-all.c if !CONFIG_KVMPaolo Bonzini2010-04-191-0/+137
This allows limited use of kvm functions (which will return ENOSYS) even in once-compiled modules. The patch also improves a bit the error messages for KVM initialization. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> [blauwirbel@gmail.com: fixed Win32 build] Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
OpenPOWER on IntegriCloud