- 30 Jan, 2008 16 commits
-
-
Amit Shah authored
Instead of having each architecture do it individually, we do this in the arch-independent code (just x86 as of now). [avi: add svm to the mix, which was added to mainline during the 2.6.24-rc process] Signed-off-by:
Amit Shah <amit.shah@qumranet.com> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Avi Kivity authored
This is a little more accurate (since it counts actual reloads, not potential reloads), and reverses the sense of the statistic to measure a bad event like most of the other stats (e.g. we want to minimize all counters). Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Joe Perches authored
Fix sparse warnings "Using plain integer as NULL pointer" Signed-off-by:
Joe Perches <joe@perches.com> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Zhang Xiantao authored
Will be called once arch module registers itself. Signed-off-by:
Zhang Xiantao <xiantao.zhang@intel.com> Acked-by:
Carsten Otte <cotte@de.ibm.com> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Avi Kivity authored
The code that dispatches the page fault and emulates if we failed to map is duplicated across vmx and svm. Merge it to simplify further bugfixing. Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Laurent Vivier authored
This patch lets GCC to determine which registers to save when we switch to/from a VCPU in the case of AMD i386 * Original code saves following registers: ebx, ecx, edx, esi, edi, ebp * Patched code: - informs GCC that we modify following registers using the clobber description: ebx, ecx, edx, esi, edi - rbp is saved (pop/push) because GCC seems to ignore its use in the clobber description. Signed-off-by:
Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Laurent Vivier authored
This patch lets GCC to determine which registers to save when we switch to/from a VCPU in the case of AMD x86_64. * Original code saves following registers: rbx, rcx, rdx, rsi, rdi, rbp, r8, r9, r10, r11, r12, r13, r14, r15 * Patched code: - informs GCC that we modify following registers using the clobber description: rbx, rcx, rdx, rsi, rdi r8, r9, r10, r11, r12, r13, r14, r15 - rbp is saved (pop/push) because GCC seems to ignore its use in the clobber description. Signed-off-by:
Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Izik Eidus authored
Currently kvm has a wart in that it requires three extra pages for use as a tss when emulating real mode on Intel. This patch moves the allocation internally, only requiring userspace to tell us where in the physical address space we can place the tss. Signed-off-by:
Izik Eidus <izike@qumranet.com> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Avi Kivity authored
Split guest reset code out of vmx_vcpu_setup(). Besides being cleaner, this moves the realmode tss setup (which can sleep) outside vmx_vcpu_setup() (which is executed with preemption enabled). [izik: remove unused variable] Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Zhang Xiantao authored
First step to split kvm_vcpu. Currently, we just use an macro to define the common fields in kvm_vcpu for all archs, and all archs need to define its own kvm_vcpu struct. Signed-off-by:
Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Avi Kivity authored
Beside the obvious goodness of making code more common, this prevents a livelock with the next patch which moves interrupt injection out of the critical section. Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Mike Day authored
Signed-off-by:
Mike D. Day <ncmike@ncultra.org> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Rusty Russell authored
Move kvm_create_lapic() into kvm_vcpu_init(), rather than having svm and vmx do it. And make it return the error rather than a fairly random -ENOMEM. This also solves the problem that neither svm.c nor vmx.c actually handles the error path properly. Signed-off-by:
Rusty Russell <rusty@rustcorp.com.au> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Laurent Vivier authored
Move emulate_ctxt to kvm_vcpu to keep emulate context when we exit from kvm module. Call x86_decode_insn() only when needed. Modify x86_emulate_insn() to not modify the context if it must be re-entered. Signed-off-by:
Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Anthony Liguori authored
This patch refactors the current hypercall infrastructure to better support live migration and SMP. It eliminates the hypercall page by trapping the UD exception that would occur if you used the wrong hypercall instruction for the underlying architecture and replacing it with the right one lazily. A fall-out of this patch is that the unhandled hypercalls no longer trap to userspace. There is very little reason though to use a hypercall to communicate with userspace as PIO or MMIO can be used. There is no code in tree that uses userspace hypercalls. [avi: fix #ud injection on vmx] Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Glauber de Oliveira Costa authored
This patch unifies struct desc_ptr between i386 and x86_64. They can be expressed in the exact same way in C code, only having to change the name of one of them. As Xgt_desc_struct is ugly and big, this is the one that goes away. There's also a padding field in i386, but it is not really needed in the C structure definition. Signed-off-by:
Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by:
Ingo Molnar <mingo@elte.hu> Signed-off-by:
Thomas Gleixner <tglx@linutronix.de>
-
- 27 Nov, 2007 1 commit
-
-
Avi Kivity authored
Not unloading the guest fpu can cause fpu leaks from guest to guest (or host to guest). Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
- 08 Nov, 2007 3 commits
-
-
Avi Kivity authored
'invd' can destroy host data, and 'wbinvd' allows the guest to induce long (milliseconds) latencies. Noted by Ben Serebrin. Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Avi Kivity authored
If we stgi() too soon, nmis can reach the processor even though interrupts are disabled, catching it in a half-switched state. Delay the stgi() until we're done switching. Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Avi Kivity authored
AP processor needs to reset to the SIPI vector, not normal INIT. Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
- 13 Oct, 2007 20 commits
-
-
Avi Kivity authored
Report failed opcodes from all locations. Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Avi Kivity authored
This simplifies adding new code as well as reducing overall code size. Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Christian Ehrhardt authored
This patch just renames the current (misnamed) _arch namings to _x86 to ensure better readability when a real arch layer takes place. Signed-off-by:
Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Rusty Russell authored
SVM gets the DB and L bits for the cs by decoding the segment. This is in fact the completely generic code, so hoist it for kvm-lite to use. Signed-off-by:
Rusty Russell <rusty@rustcorp.com.au> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Rusty Russell authored
invlpg shouldn't fetch the "src" address, since it may not be valid, however SVM's "solution" which neuters emulation of all group 7 instruction is horrible and breaks kvm-lite. The simplest fix is to put a special check in for invlpg. Signed-off-by:
Rusty Russell <rusty@rustcorp.com.au> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Rusty Russell authored
Signed-off-by:
Rusty Russell <rusty@rustcorp.com.au> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Eddie Dong authored
This reduces overhead by accessing cachelines from the wrong node, as well as simplifying locking. [Qing: fix for inactive or expired one-shot timer] Signed-off-by:
Yaozu (Eddie) Dong <Eddie.Dong@intel.com> Signed-off-by:
Qing He <qing.he@intel.com> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Eddie Dong authored
APIC timer IRQ is set every time when a certain period expires at host time, but the guest may be descheduled at that time and thus the irq be overwritten by later fire. This patch keep track of firing irq numbers and decrease only when the IRQ is injected to guest or buffered in APIC. Signed-off-by:
Yaozu (Eddie) Dong <Eddie.Dong@intel.com> Signed-off-by:
Qing He <qing.he@intel.com> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Eddie Dong authored
Add in kernel irqchip save/restore support for pending vectors. [avi: fix compile warning on i386] [avi: remove printk] Signed-off-by:
Yaozu (Eddie) Dong <eddie.dong@intel.com> Signed-off-by:
Qing He <qing.he@intel.com> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Eddie Dong authored
By sleeping in the kernel when hlt is executed, we simplify the in-kernel guest interrupt path considerably. Signed-off-by:
Gregory Haskins <ghaskins@novell.com> Signed-off-by:
Yaozu (Eddie) Dong <eddie.dong@intel.com> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Eddie Dong authored
Because lightweight exits (exits which don't involve userspace) are many times faster than heavyweight exits, it makes sense to emulate high usage devices in the kernel. The local APIC is one such device, especially for Windows and for SMP, so we add an APIC model to kvm. It also allows in-kernel host-side drivers to inject interrupts without going through userspace. [compile fix on i386 from Jindrich Makovicka] Signed-off-by:
Yaozu (Eddie) Dong <Eddie.Dong@intel.com> Signed-off-by:
Qing He <qing.he@intel.com> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Eddie Dong authored
This patch is to wrap APIC base register and CR8 operation which can provide a unique API for user level irqchip and kernel irqchip. This is a preparation of merging lapic/ioapic patch. Signed-off-by:
Yaozu (Eddie) Dong <eddie.dong@intel.com> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Eddie Dong authored
Signed-off-by:
Yaozu (Eddie) Dong <eddie.dong@intel.com> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Avi Kivity authored
We need to check for signals inside the critical section, otherwise a signal can be sent which we will not notice. Also move the check before entry, so that if the signal happens before the first entry, we exit immediately instead of waiting for something to happen to the guest. Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Laurent Vivier authored
Split kvm_setup_pio() into two functions, one to setup in/out pio (kvm_emulate_pio()) and one to setup ins/outs pio (kvm_emulate_pio_string()). Signed-off-by:
Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Laurent Vivier authored
Both vmx and svm decode the I/O instructions, and both botch the job, requiring the instruction prefixes to be fetched in order to completely decode the instruction. So, if we see a string I/O instruction, use the x86 emulator to decode it, as it already has all the prefix decoding machinery. This patch defines ins/outs opcodes in x86_emulate.c and calls emulate_instruction() from io_interception() (svm.c) and from handle_io() (vmx.c). It removes all vmx/svm prefix instruction decoders (get_addr_size(), io_get_override(), io_address(), get_io_count()) Signed-off-by:
Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Rusty Russell authored
We use kfree in svm.c and vmx.c, and this works, but it could break at any time. kfree() is supposed to match up with kmalloc(). Signed-off-by:
Rusty Russell <rusty@rustcorp.com.au> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Rusty Russell authored
All guest-invokable printks should be ratelimited to prevent malicious guests from flooding logs. This is a start. Signed-off-by:
Rusty Russell <rusty@rustcorp.com.au> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Rusty Russell authored
set_msr_interception() is used by svm to set up which MSRs should be intercepted. It can only fail if someone has changed the code to try to intercept an MSR without updating the array of ranges. The return value is ignored anyway: it should just BUG() if it doesn't work. (A build-time failure would be better, but that's tricky). Signed-off-by:
Rusty Russell <rusty@rustcorp.com.au> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-
Yang, Sheng authored
All the physical CPUs on the board should support the same VMX feature set. Add check_processor_compatibility to kvm_arch_ops for the consistency check. Signed-off-by:
Sheng Yang <sheng.yang@intel.com> Signed-off-by:
Avi Kivity <avi@qumranet.com>
-