15 Oct, 2007
1 commit
-
Modify KVM to update guest time accounting.
[ mingo@elte.hu: ported to 2.6.24 KVM. ]
Signed-off-by: Laurent Vivier
Acked-by: Avi Kivity
Signed-off-by: Ingo Molnar
13 Oct, 2007
39 commits
-
If we defer updating rip until pio instructions are executed, we have a
problem with reset: a pio reset updates rip, and when the instruction
completes we skip the emulated instruction, pointing rip somewhere completely
unrelated.Fix by updating rip when we see decode the instruction, not after emulation.
Signed-off-by: Avi Kivity
-
Implement emulation of instruction:
popf
opcode: 0x9dSigned-off-by: Nitin A Kamble
Signed-off-by: Avi Kivity -
Some operand fetches are less than the machine word size and can result in
stale bits if used together with operands of different sizes.Signed-off-by: Nitin A Kamble
Signed-off-by: Avi Kivity -
Implement emulation of instruction:
jump absolute r/m
opcode: 0xff /4Signed-off-by: Nitin A Kamble
Signed-off-by: Avi Kivity -
Implement emulation of instruction
lea r16/r32, m
opcode: 0x8d:Signed-off-by: Nitin A Kamble
Signed-off-by: Avi Kivity -
Implement emulation of more jump conditional instructions
jcc shortrel
opcodes: 0x70 - 0x7fSigned-off-by: Nitin A Kamble
Signed-off-by: Avi Kivity -
Implement emulation of instruction:
jump conditional rel
opcodes: 0x0f 0x80 - 0x0f 0x8fSigned-off-by: Nitin A Kamble
Signed-off-by: Avi Kivity -
Signed-off-by: Nitin A Kamble
Signed-off-by: Avi Kivity -
Report failed opcodes from all locations.
Signed-off-by: Avi Kivity
-
Implement emulation of instruction
pushf
opcode: 0x9cSigned-off-by: Nitin A Kamble
Signed-off-by: Avi Kivity -
Implement emulation of instruction
opcode: 0xe8
call (near)Signed-off-by: Nitin A Kamble
Signed-off-by: Avi Kivity -
Implement the instruction
push imm8
opcode: 0x6aSigned-off-by: Nitin A Kamble
Signed-off-by: Avi Kivity -
According to Intel Software Developer's Manual, Vol. 3B, Appendix H.4.2,
exit qualification should be of natural width. However, current code
uses u64 as the data type for this register, which occasionally
introduces invalid value to VMExit handling logics. This patch fixes
this bug.I have tested Windows and Linux guest on i386 host, and they can boot
successfully with this patch.Signed-off-by: Qing He
Signed-off-by: Avi Kivity -
This simplifies adding new code as well as reducing overall code size.
Signed-off-by: Avi Kivity
-
This will help moving the main loop to subarch independent code.
Signed-off-by: Avi Kivity
-
Before preempt notifiers, kvm needed to allocate memory with GFP_NOWAIT so
as not to have to enable preemption and take a heavyweight exit. On oom, we'd
fall back to a GFP_KERNEL allocation.With preemption notifiers, we can do a GFP_KERNEL allocation, and perform
the heavyweight exit only if the kernel decides to put us to sleep.Signed-off-by: Avi Kivity
-
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
Signed-off-by: Avi Kivity -
The mutex->splinlock convertion alllows us to make some code simplifications.
As we can keep the lock longer, we don't have to release it and then
have to check if the environment has not been modified before re-taking it. We
can remove kvm->busy and kvm->memory_config_version.Signed-off-by: Laurent Vivier
Signed-off-by: Avi Kivity -
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
Signed-off-by: Avi Kivity -
We don't update the vcpu control registers in various places. We
should do so.Signed-off-by: Rusty Russell
Signed-off-by: Avi Kivity -
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
Signed-off-by: Avi Kivity -
Signed-off-by: Rusty Russell
Signed-off-by: Avi Kivity -
This was missed when moving stuff around in fbc4f2e
Fixes Solaris guests and bug #1773613
Signed-off-by: Amit Shah
Signed-off-by: Avi Kivity -
This patch enables INIT/SIPI handling using in-kernel APIC by
introducing a ->mp_state field to emulate the SMP state transition.[avi: remove smp_processor_id() warning]
Signed-off-by: Qing He
Signed-off-by: Xin Li
Signed-off-by: Avi Kivity -
Signed-off-by: Qing He
Signed-off-by: Avi Kivity -
This patch changes the PIC interrupts delivery. Now it is only delivered
to vcpu0 when either condition is met (on vcpu0):
1. local APIC is hardware disabled
2. LVT0 is unmasked and configured to delivery mode ExtIntIt fixes the 2x faster wall clock on x86_64 and SMP i386 Linux guests
Signed-off-by: Eddie (Yaozu) Dong
Signed-off-by: Qing He
Signed-off-by: Avi Kivity -
Signed-off-by: Qing He
Signed-off-by: Avi Kivity -
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
Signed-off-by: Qing He
Signed-off-by: Avi Kivity -
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
Signed-off-by: Qing He
Signed-off-by: Avi Kivity -
This patch enables TPR shadow of VMX on CR8 access. 64bit Windows using
CR8 access TPR frequently. The TPR shadow can improve the performance of
access TPR by not causing vmexit.Signed-off-by: Sheng Yang
Signed-off-by: Yaozu (Eddie) Dong
Signed-off-by: Qing He
Signed-off-by: Avi Kivity -
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
Signed-off-by: Qing He
Signed-off-by: Avi Kivity -
This patch adds a new vcpu-based IOCTL to save and restore the local
apic registers for a single vcpu. The kernel only copies the apic page as
a whole, extraction of registers is left to userspace side. On restore, the
APIC timer is restarted from the initial count, this introduces a little
delay, but works fine.Signed-off-by: Yaozu (Eddie) Dong
Signed-off-by: Qing He
Signed-off-by: Avi Kivity -
This patch adds support for in-kernel ioapic save and restore (to
and from userspace). It uses the same get/set_irqchip ioctl as
in-kernel PIC.Signed-off-by: Qing He
Signed-off-by: Yaozu (Eddie) Dong
Signed-off-by: Avi Kivity -
vcpu->irq_pending is saved in get/set_sreg IOCTL, but when in-kernel
local APIC is used, doing this may occasionally overwrite vcpu->apic to
an invalid value, as in the vm restore path.Signed-off-by: Qing He
-
This patch adds two new ioctls to dump and write kernel irqchips for
save/restore and live migration. PIC s/r and l/m is implemented in this
patch.Signed-off-by: Yaozu (Eddie) Dong
Signed-off-by: Qing He
Signed-off-by: Avi Kivity -
pio operation and IRQ_LINE kvm_vm_ioctl is not kvm->lock
protected. Add lock to same with IOAPIC MMIO operations.Signed-off-by: Yaozu (Eddie) Dong
Signed-off-by: Avi Kivity -
By sleeping in the kernel when hlt is executed, we simplify the in-kernel
guest interrupt path considerably.Signed-off-by: Gregory Haskins
Signed-off-by: Yaozu (Eddie) Dong
Signed-off-by: Avi Kivity -
This allows in-kernel host-side device drivers to raise guest interrupts
without going to userspace.[avi: fix level-triggered interrupt redelivery on eoi]
[avi: add missing #include]
[avi: avoid redelivery of edge-triggered interrupt]
[avi: implement polarity]
[avi: don't deliver edge-triggered interrupts when unmasking]
[avi: fix host oops on invalid guest access]Signed-off-by: Yaozu (Eddie) Dong
Signed-off-by: Avi Kivity -
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
Signed-off-by: Qing He
Signed-off-by: Avi Kivity