Re: [kvm-devel] kvm-ifup bug with complex default routes

2007-04-01 Thread Baruch Even
* Dor Laor <[EMAIL PROTECTED]> [070402 00:43]: > > > >A user just submitted a bug report against the kvm-18 debian package. > >You can find the bug report at > >http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417151 > > > >The user has a default route with extra features and the kvm-ifup > script

Re: [kvm-devel] kvm-ifup bug with complex default routes

2007-04-01 Thread Dor Laor
> >A user just submitted a bug report against the kvm-18 debian package. >You can find the bug report at >http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417151 > >The user has a default route with extra features and the kvm-ifup script >fails for him, his default route looks like: >default via 10

Re: [kvm-devel] kvm-18 breaks Cisco VPN on WinXP SP1

2007-04-01 Thread Leslie Mann
Avi Kivity <[EMAIL PROTECTED]> writes: > > The SIGIO means some I/O has occured, but what exactly, we don't know. > Can you generate a core, attach it with gdb, and generate a backtrace? > > Check the backtrace for signs of your password and delete them if > found. It shouldn't be there, but

[kvm-devel] kvm-ifup bug with complex default routes

2007-04-01 Thread Baruch Even
A user just submitted a bug report against the kvm-18 debian package. You can find the bug report at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417151 The user has a default route with extra features and the kvm-ifup script fails for him, his default route looks like: default via 10.0.0.138

[kvm-devel] oops with kvm-18

2007-04-01 Thread Baruch Even
I've had an oops when running kvm-18 on my dual core intel laptop. This happened when I was installing Debian Etch with a net-install, the crash happened when it was working to download and install packages from the network. I've used a tap device bridged to my ethernet device. The oops follows, l

[kvm-devel] [PATCH 39/41] KVM: Add physical memory aliasing feature

2007-04-01 Thread Avi Kivity
With this, we can specify that accesses to one physical memory range will be remapped to another. This is useful for the vga window at 0xa which is used as a movable window into the (much larger) framebuffer. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm.h |9 +++

[kvm-devel] [PATCH 41/41] KVM: SVM: enable LBRV virtualization if available

2007-04-01 Thread Avi Kivity
From: Joerg Roedel <[EMAIL PROTECTED]> This patch enables the virtualization of the last branch record MSRs on SVM if this feature is available in hardware. It also introduces a small and simple check feature for specific SVM extensions. Signed-off-by: Joerg Roedel <[EMAIL PROTECTED]> Signed-off-

[kvm-devel] [PATCH 40/41] KVM: Add fpu get/set operations

2007-04-01 Thread Avi Kivity
These are really helpful when migrating an floating point app to another machine. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm_main.c | 86 include/linux/kvm.h| 17 + 2 files changed, 103 insertions(+), 0 deleti

[kvm-devel] [PATCH 38/41] KVM: Simply gfn_to_page()

2007-04-01 Thread Avi Kivity
Mapping a guest page to a host page is a common operation. Currently, one has first to find the memory slot where the page belongs (gfn_to_memslot), then locate the page itself (gfn_to_page()). This is clumsy, and also won't work well with memory aliases. So simplify gfn_to_page() not to require

[kvm-devel] [PATCH 33/41] KVM: Remove unused function

2007-04-01 Thread Avi Kivity
From: Michal Piotrowski <[EMAIL PROTECTED]> Remove unused function CC drivers/kvm/svm.o drivers/kvm/svm.c:207: warning: ‘inject_db’ defined but not used Signed-off-by: Michal Piotrowski <[EMAIL PROTECTED]> Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/svm.c |7 ---

[kvm-devel] [PATCH 36/41] KVM: x86 emulator: fix bit string operations operand size

2007-04-01 Thread Avi Kivity
On x86, bit operations operate on a string of bits that can reside in multiple words. For example, 'btsl %eax, (blah)' will touch the word at blah+4 if %eax is between 32 and 63. The x86 emulator compensates for that by advancing the operand address by (bit offset / BITS_PER_LONG) and truncating

[kvm-devel] [PATCH 34/41] KVM: Use list_move()

2007-04-01 Thread Avi Kivity
Use list_move() where possible. Noticed by Dor Laor. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/mmu.c | 12 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index 0216b77..c2487b6 100644 --- a/drivers/kvm/mmu.c

[kvm-devel] [PATCH 32/41] KVM: SVM: Ensure timestamp counter monotonicity

2007-04-01 Thread Avi Kivity
When a vcpu is migrated from one cpu to another, its timestamp counter may lose its monotonic property if the host has unsynced timestamp counters. This can confuse the guest, sometimes to the point of refusing to boot. As the rdtsc instruction is rather fast on AMD processors (7-10 cycles), we ca

[kvm-devel] [PATCH 31/41] KVM: MMU: Fix hugepage pdes mapping same physical address with different access

2007-04-01 Thread Avi Kivity
The kvm mmu keeps a shadow page for hugepage pdes; if several such pdes map the same physical address, they share the same shadow page. This is a fairly common case (kernel mappings on i386 nonpae Linux, for example). However, if the two pdes map the same memory but with different permissions, kv

[kvm-devel] [PATCH 22/41] KVM: MMU: Remove global pte tracking

2007-04-01 Thread Avi Kivity
The initial, noncaching, version of the kvm mmu flushed the all nonglobal shadow page table translations (much like a native tlb flush). The new implementation flushes translations only when they change, rendering global pte tracking superfluous. This removes the unused tracking mechanism and sto

[kvm-devel] [PATCH 30/41] KVM: SVM: forbid guest to execute monitor/mwait

2007-04-01 Thread Avi Kivity
From: Joerg Roedel <[EMAIL PROTECTED]> This patch forbids the guest to execute monitor/mwait instructions on SVM. This is necessary because the guest can execute these instructions if they are available even if the kvm cpuid doesn't report its existence. Signed-off-by: Joerg Roedel <[EMAIL PROTEC

[kvm-devel] [PATCH 20/41] KVM: Avoid guest virtual addresses in string pio userspace interface

2007-04-01 Thread Avi Kivity
The current string pio interface communicates using guest virtual addresses, relying on userspace to translate addresses and to check permissions. This interface cannot fully support guest smp, as the check needs to take into account two pages at one in case an unaligned string transfer straddles

[kvm-devel] [PATCH 37/41] KVM: Add mmu cache clear function

2007-04-01 Thread Avi Kivity
From: Dor Laor <[EMAIL PROTECTED]> Functions that play around with the physical memory map need a way to clear mappings to possibly nonexistent or invalid memory. Both the mmu cache and the processor tlb are cleared. Signed-off-by: Dor Laor <[EMAIL PROTECTED]> Signed-off-by: Avi Kivity <[EMAIL P

[kvm-devel] [PATCH 29/41] KVM: Handle writes to MCG_STATUS msr

2007-04-01 Thread Avi Kivity
From: Sergey Kiselev <[EMAIL PROTECTED]> Some older (~2.6.7) kernels write MCG_STATUS register during kernel boot (mce_clear_all() function, called from mce_init()). It's not currently handled by kvm and will cause it to inject a GPF. Following patch adds a "nop" handler for this. Signed-off-by:

[kvm-devel] [PATCH 18/41] KVM: Allow kernel to select size of mmap() buffer

2007-04-01 Thread Avi Kivity
This allows us to store offsets in the kernel/user kvm_run area, and be sure that userspace has them mapped. As offsets can be outside the kvm_run struct, userspace has no way of knowing how much to mmap. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm_main.c |8 +++- i

[kvm-devel] [PATCH 25/41] KVM: Modify guest segments after potentially switching modes

2007-04-01 Thread Avi Kivity
The SET_SREGS ioctl modifies both cr0.pe (real mode/protected mode) and guest segment registers. Since segment handling is modified by the mode on Intel procesors, update the segment registers after the mode switch has taken place. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kv

[kvm-devel] [PATCH 24/41] KVM: Remove set_cr0_no_modeswitch() arch op

2007-04-01 Thread Avi Kivity
set_cr0_no_modeswitch() was a hack to avoid corrupting segment registers. As we now cache the protected mode values on entry to real mode, this isn't an issue anymore, and it interferes with reboot (which usually _is_ a modeswitch). Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kv

[kvm-devel] [PATCH 23/41] KVM: Workaround vmx inability to virtualize the reset state

2007-04-01 Thread Avi Kivity
The reset state has cs.selector == 0xf000 and cs.base == 0x, which aren't compatible with vm86 mode, which is used for real mode virtualization. When we create a vcpu, we set cs.base to 0xf, but if we get there by way of a reset, the values are inconsistent and vmx refuses to enter gue

[kvm-devel] [PATCH 28/41] KVM: Remove unused and write-only variables

2007-04-01 Thread Avi Kivity
Trivial cleanup. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm_svm.h |2 -- drivers/kvm/svm.c |2 -- 2 files changed, 0 insertions(+), 4 deletions(-) diff --git a/drivers/kvm/kvm_svm.h b/drivers/kvm/kvm_svm.h index 624f1ca..a1a9eba 100644 --- a/drivers/kvm/kvm_svm

[kvm-devel] [PATCH 21/41] KVM: MMU: Remove unnecessary check for pdptr access

2007-04-01 Thread Avi Kivity
We already special case the pdptr access, so no need to check it again. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/paging_tmpl.h |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index f3bcee9..17bd4

[kvm-devel] [PATCH 35/41] KVM: Remove debug message

2007-04-01 Thread Avi Kivity
No longer interesting. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/vmx.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 578dff5..b64b7b7 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -1131,7 +1131,

[kvm-devel] [PATCH 26/41] KVM: Hack real-mode segments on vmx from KVM_SET_SREGS

2007-04-01 Thread Avi Kivity
As usual, we need to mangle segment registers when emulating real mode as vm86 has specific constraints. We special case the reset segment base, and set the "access rights" (or descriptor flags) to vm86 comaptible values. This fixes reboot on vmx. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --

[kvm-devel] [PATCH 27/41] KVM: Don't allow the guest to turn off the cpu cache

2007-04-01 Thread Avi Kivity
The cpu cache is a host resource; the guest should not be able to turn it off (even for itself). Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/svm.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index d3cc115..191

[kvm-devel] [PATCH 17/41] KVM: Add guest mode signal mask

2007-04-01 Thread Avi Kivity
Allow a special signal mask to be used while executing in guest mode. This allows signals to be used to interrupt a vcpu without requiring signal delivery to a userspace handler, which is quite expensive. Userspace still receives -EINTR and can get the signal via sigwait(). Signed-off-by: Avi Ki

[kvm-devel] [PATCH 19/41] KVM: Future-proof argument-less ioctls

2007-04-01 Thread Avi Kivity
Some ioctls ignore their arguments. By requiring them to be zero now, we allow a nonzero value to have some special meaning in the future. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm_main.c |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/dri

[kvm-devel] [PATCH 16/41] KVM: Initialize the apic_base msr on svm too

2007-04-01 Thread Avi Kivity
Older userspace didn't care, but newer userspace (with the cpuid changes) does. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/svm.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 0311665..2396ada 100644 --- a/

[kvm-devel] [PATCH 13/41] KVM: Allow userspace to process hypercalls which have no kernel handler

2007-04-01 Thread Avi Kivity
This is useful for paravirtualized graphics devices, for example. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm_main.c | 18 +- include/linux/kvm.h| 10 +- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/drivers/kvm/kvm_main.c b/

[kvm-devel] [PATCH 14/41] KVM: Fold kvm_run::exit_type into kvm_run::exit_reason

2007-04-01 Thread Avi Kivity
Currently, userspace is told about the nature of the last exit from the guest using two fields, exit_type and exit_reason, where exit_type has just two enumerations (and no need for more). So fold exit_type into exit_reason, reducing the complexity of determining what really happened. Signed-off-

[kvm-devel] [PATCH 15/41] KVM: Add a special exit reason when exiting due to an interrupt

2007-04-01 Thread Avi Kivity
This is redundant, as we also return -EINTR from the ioctl, but it allows us to examine the exit_reason field on resume without seeing old data. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/svm.c |2 ++ drivers/kvm/vmx.c |2 ++ include/linux/kvm.h |3 ++- 3 files

[kvm-devel] [PATCH 11/41] KVM: Renumber ioctls

2007-04-01 Thread Avi Kivity
The recent changes have left the ioctl numbers in complete disarray. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- include/linux/kvm.h | 34 +- 1 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/linux/kvm.h b/include/linux/kvm.h index d8

[kvm-devel] [PATCH 05/41] KVM: Fix bogus sign extension in mmu mapping audit

2007-04-01 Thread Avi Kivity
When auditing a 32-bit guest on a 64-bit host, sign extension of the page table directory pointer table index caused bogus addresses to be shown on audit errors. Fix by declaring the index unsigned. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/mmu.c |2 +- 1 files changed, 1

[kvm-devel] [PATCH 12/41] KVM: Add method to check for backwards-compatible API extensions

2007-04-01 Thread Avi Kivity
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm_main.c |6 ++ include/linux/kvm.h|5 + 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 5d24203..39cf8fd 100644 --- a/drivers/kvm/kvm_main.c ++

[kvm-devel] [PATCH 08/41] KVM: Handle cpuid in the kernel instead of punting to userspace

2007-04-01 Thread Avi Kivity
KVM used to handle cpuid by letting userspace decide what values to return to the guest. We now handle cpuid completely in the kernel. We still let userspace decide which values the guest will see by having userspace set up the value table beforehand (this is necessary to allow management softwar

[kvm-devel] [PATCH 07/41] KVM: Do not communicate to userspace through cpu registers during PIO

2007-04-01 Thread Avi Kivity
Currently when passing the a PIO emulation request to userspace, we rely on userspace updating %rax (on 'in' instructions) and %rsi/%rdi/%rcx (on string instructions). This (a) requires two extra ioctls for getting and setting the registers and (b) is unfriendly to non-x86 archs, when they get kvm

[kvm-devel] [PATCH 10/41] KVM: Remove minor wart from KVM_CREATE_VCPU ioctl

2007-04-01 Thread Avi Kivity
That ioctl does not transfer any data, so it should be an _IO rather than an _IOW. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- include/linux/kvm.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux/kvm.h b/include/linux/kvm.h index c6dd4a7..d89189a 10064

[kvm-devel] [PATCH 06/41] KVM: Use a shared page for kernel/user communication when runing a vcpu

2007-04-01 Thread Avi Kivity
Instead of passing a 'struct kvm_run' back and forth between the kernel and userspace, allocate a page and allow the user to mmap() it. This reduces needless copying and makes the interface expandable by providing lots of free space. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/

[kvm-devel] [PATCH 09/41] KVM: Remove the 'emulated' field from the userspace interface

2007-04-01 Thread Avi Kivity
We no longer emulate single instructions in userspace. Instead, we service mmio or pio requests. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm_main.c |5 - include/linux/kvm.h|3 +-- 2 files changed, 1 insertions(+), 7 deletions(-) diff --git a/drivers/kvm/kv

[kvm-devel] [PATCH 03/41] KVM: Use own minor number

2007-04-01 Thread Avi Kivity
Use the minor number (232) allocated to kvm by lanana. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm_main.c |2 +- include/linux/miscdevice.h |1 + 2 files changed, 2 insertions(+), 1 deletions(-) mode change 100644 => 100755 drivers/kvm/kvm_main.c diff --git a/d

[kvm-devel] [PATCH 02/41] KVM: Use the generic skip_emulated_instruction() in hypercall code

2007-04-01 Thread Avi Kivity
From: Dor Laor <[EMAIL PROTECTED]> Instead of twiddling the rip registers directly, use the skip_emulated_instruction() function to do that for us. Signed-off-by: Dor Laor <[EMAIL PROTECTED]> Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/svm.c |3 ++- drivers/kvm/vmx.c |2

[kvm-devel] [PATCH 04/41] KVM: Export

2007-04-01 Thread Avi Kivity
This allows users to actually build prgrams that use kvm without the entire source tree. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- include/linux/Kbuild |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/linux/Kbuild b/include/linux/Kbuild index e81e301..b35b5

[kvm-devel] [PATCH 01/41] KVM: Fix guest register corruption on paravirt hypercall

2007-04-01 Thread Avi Kivity
From: Dor Laor <[EMAIL PROTECTED]> The hypercall code mixes up the ->cache_regs() and ->decache_regs() callbacks, resulting in guest register corruption. Signed-off-by: Dor Laor <[EMAIL PROTECTED]> Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm_main.c |4 ++-- 1 files chan

[kvm-devel] [PATCH 00/41] kvm updates for 2.6.22

2007-04-01 Thread Avi Kivity
Following is my current 2.6.22 kvm queue. It contains userspace interface updates, improved guest support, cleanups, and plain bugfixes. It will likely grow slightly by the time the merge window opens. Avi Kivity (34): KVM: Use own minor number KVM: Export KVM: Fix bogus sign