[PATCH v5 6/9] KVM MMU: support keeping sp live while it's out of protection

2010-05-06 Thread Xiao Guangrong
If we want to keep sp live while it it's out of kvm->mmu_lock protection, we can increase sp->active_count. Then, the invalid page is not only for active root but also unsync sp, we should filter those out when we make a page to unsync. And move 'hlist_del(&sp->hash_link)' into kvm_mmu_free_page(

[PATCH v5 5/9] KVM MMU: rename 'root_count' to 'active_count'

2010-05-06 Thread Xiao Guangrong
Rename 'root_count' to 'active_count' in kvm_mmu_page, since the unsync pages also will use it in later patch Signed-off-by: Xiao Guangrong --- arch/x86/include/asm/kvm_host.h |8 +++- arch/x86/kvm/mmu.c | 14 +++--- arch/x86/kvm/mmutrace.h |6 +++--- 3

Re: [PATCH v4 0/9] KVM MMU: allow more shadow pages become asynchronous

2010-05-06 Thread Xiao Guangrong
Hi Avi, Marcelo, patch 5 and patch 6 are can't apply to current kvm tree, i'll rebase those two patches. Marcelo, does this patchset fix your issue? I have tested it with Fedora12/Ubuntu/CentOS 32/64 guests, it works well. Thanks, Xiao -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH RFC] virtio: put last seen used index into ring itself

2010-05-06 Thread Rusty Russell
On Thu, 6 May 2010 03:49:46 pm Michael S. Tsirkin wrote: > Now, I also added an mb() in guest between read and write so > that last used index write can not get ahead of used index read. > It does feel good to have it there, but I can not say why > it's helpful. Works fine without it, but then thes

Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself

2010-05-06 Thread Rusty Russell
On Thu, 6 May 2010 07:30:00 pm Avi Kivity wrote: > On 05/05/2010 11:58 PM, Michael S. Tsirkin wrote: > > + /* We publish the last-seen used index at the end of the available ring. > > +* It is at the end for backwards compatibility. */ > > + vr->last_used_idx =&(vr)->avail->ring[num]; > > +

Re: virtio: put last_used and last_avail index into ring itself.

2010-05-06 Thread Rusty Russell
On Thu, 6 May 2010 03:57:55 pm Michael S. Tsirkin wrote: > On Thu, May 06, 2010 at 10:22:12AM +0930, Rusty Russell wrote: > > On Wed, 5 May 2010 03:52:36 am Michael S. Tsirkin wrote: > > > What do you think? > > > > I think everyone is settled on 128 byte cache lines for the forseeable > > future,

[PATCH 3/4 v3] KVM: VMX: VMCLEAR/VMPTRLD usage changes.

2010-05-06 Thread Xu, Dongxiao
From: Dongxiao Xu Originally VMCLEAR/VMPTRLD is called on vcpu migration. To support hosted VMM coexistance, VMCLEAR is executed on vcpu schedule out, and VMPTRLD is executed on vcpu schedule in. This could also eliminate the IPI when doing VMCLEAR. vmm_exclusive is introduced as a module parame

[PATCH 4/4 v3] KVM: VMX: VMXON/VMXOFF usage changes.

2010-05-06 Thread Xu, Dongxiao
From: Dongxiao Xu SDM suggests VMXON should be called before VMPTRLD, and VMXOFF should be called after doing VMCLEAR. Therefore in vmm coexistence case, we should firstly call VMXON before any VMCS operation, and then call VMXOFF after the operation is done. Signed-off-by: Dongxiao Xu --- ar

[PATCH 0/4 v3] KVM: VMX: Support hosted VMM coexsitence.

2010-05-06 Thread Xu, Dongxiao
Hi all, This is hosted VMM coexistence support v3. Main changes from v2: 1) Change vmm_coexistence to vmm_exclusive. 2) Some code structure changes. Split the original 3 patches to 4. 3) Address some comments from Avi. Main changes from v1: 1) Add an module option "vmm_coexistence" to decide whe

[PATCH 2/4 v3] KVM: VMX: Some minor changes to code structure.

2010-05-06 Thread Xu, Dongxiao
From: Dongxiao Xu Do some preparations for vmm coexistence support. Signed-off-by: Dongxiao Xu --- arch/x86/kvm/vmx.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index e77da89..49b0850 100644 --- a/arch/x86/kvm

[PATCH 1/4 v3] KVM: VMX: Define new functions to wrapper direct call of asm code.

2010-05-06 Thread Xu, Dongxiao
From: Dongxiao Xu Define vmcs_load() and kvm_cpu_vmxon() to avoid direct call of asm code. Also move VMXE bit operation out of kvm_cpu_vmxoff(). Signed-off-by: Dongxiao Xu --- arch/x86/kvm/vmx.c | 36 +++- 1 files changed, 23 insertions(+), 13 deletions(-) di

RE: [PATCH 2/3 v2] KVM: VMX: VMCLEAR/VMPTRLD usage changes.

2010-05-06 Thread Xu, Dongxiao
Avi Kivity wrote: > On 05/06/2010 11:45 AM, Xu, Dongxiao wrote: >> From: Dongxiao Xu >> >> Originally VMCLEAR/VMPTRLD is called on vcpu migration. To >> support hosted VMM coexistance, VMCLEAR is executed on vcpu >> schedule out, and VMPTRLD is executed on vcpu schedule in. >> This could also elim

Re: [Autotest] [PATCH 3/3] KVM Test: Add ioquit test case

2010-05-06 Thread Feng Yang
Hi, Lucas Thanks for your comment. I am sorry for no response so long time. I will update it according to your comment. Also thanks Michael for his comment. - "Lucas Meneghel Rodrigues" wrote: > From: "Lucas Meneghel Rodrigues" > To: "Feng Yang" > Cc: autot...@test.kernel.org, kvm

Re: Endless loop in qcow2_alloc_cluster_offset

2010-05-06 Thread Marcelo Tosatti
On Thu, Nov 19, 2009 at 01:19:55PM +0100, Jan Kiszka wrote: > Hi, > > I just managed to push a qemu-kvm process (git rev. b496fe3431) into an > endless loop in qcow2_alloc_cluster_offset, namely over > QLIST_FOREACH(old_alloc, &s->cluster_allocs, next_in_flight): > > (gdb) bt > #0 0x0048

Re: [Autotest] [PATCH 3/3] KVM Test: Add ioquit test case

2010-05-06 Thread Lucas Meneghel Rodrigues
On Wed, Apr 7, 2010 at 5:49 AM, Feng Yang wrote: > Signed-off-by: Feng Yang > --- >  client/tests/kvm/tests/ioquit.py       |   54 > >  client/tests/kvm/tests_base.cfg.sample |    4 ++ >  2 files changed, 58 insertions(+), 0 deletions(-) >  create mode 100644 cli

Re: [Autotest] [PATCH 3/3] KVM Test: Add ioquit test case

2010-05-06 Thread Lucas Meneghel Rodrigues
On Wed, Apr 7, 2010 at 5:49 AM, Feng Yang wrote: > Signed-off-by: Feng Yang > --- >  client/tests/kvm/tests/ioquit.py       |   54 > >  client/tests/kvm/tests_base.cfg.sample |    4 ++ >  2 files changed, 58 insertions(+), 0 deletions(-) >  create mode 100644 cli

Re: OPCODE Emulation

2010-05-06 Thread Mohammed Gamal
On Thu, May 6, 2010 at 11:37 PM, Matteo Signorini wrote: > > Dear Yaniv, Dear Avi, > > I would like to add the "sidt emulation" feature in kvm, but in order to > implement it I need to know the details on how the OPCODE works and how > exactly opcodes are emulated within kvm. > For example let's

Re: [Autotest] [PATCH] KVM test: Add a subtest iofuzz

2010-05-06 Thread Lucas Meneghel Rodrigues
On Wed, Apr 7, 2010 at 8:55 AM, Jason Wang wrote: > The design of iofuzz is simple: it just generate random I/O port > activity inside the virtual machine. The correctness of the device > emulation may be verified through this test. > > As the instrcutions are randomly generated, guest may enter t

[PATCH] KVM test: Add a subtest iofuzz

2010-05-06 Thread Lucas Meneghel Rodrigues
From: Jason Wang The design of iofuzz is simple: it just generate random I/O port activity inside the virtual machine. The correctness of the device emulation may be verified through this test. As the instrcutions are randomly generated, guest may enter the wrong state. The test solve this issue

Re: virtio-win problem

2010-05-06 Thread Brian Jackson
On Thursday, May 06, 2010 04:05:17 pm Jernej Simončič wrote: > On Thursday, May 6, 2010, 22:36:02, Brian Jackson wrote: > > What about the XP32 drivers from: > > http://theiggy.com/tmp/virtio-20091208.zip > > This is what I currently use on XP, and it works fine (I think I > mentioned this on IRC

Re: virtio-win problem

2010-05-06 Thread Jernej Simončič
On Thursday, May 6, 2010, 22:36:02, Brian Jackson wrote: > What about the XP32 drivers from: > http://theiggy.com/tmp/virtio-20091208.zip This is what I currently use on XP, and it works fine (I think I mentioned this on IRC - my nickname's ender` there). -- < Jernej Simončič ><><><><>< http://

OPCODE Emulation

2010-05-06 Thread Matteo Signorini
Dear Yaniv, Dear Avi, I would like to add the "sidt emulation" feature in kvm, but in order to implement it I need to know the details on how the OPCODE works and how exactly opcodes are emulated within kvm. For example let's take the SIDT instruction. I know the LIDT opcode is "0F 01 /1" but w

Re: virtio-win problem

2010-05-06 Thread Brian Jackson
On Thursday, May 06, 2010 03:11:00 pm Jernej Simončič wrote: > On Thursday, May 6, 2010, 21:59:21, Brian Jackson wrote: > > http://theiggy.com/tmp/virtio-20100228.zip > > These are not guaranteed to work and they will probably kill kittens. > > That said, I've had luck with them and had only a few

Re: virtio-win problem

2010-05-06 Thread Jernej Simončič
On Thursday, May 6, 2010, 21:59:21, Brian Jackson wrote: > http://theiggy.com/tmp/virtio-20100228.zip > These are not guaranteed to work and they will probably kill kittens. That > said, I've had luck with them and had only a few reports of things not working > (mostly with the balloon drivers).

Re: [PATCH] KVM: MMU: Don't read pdptrs with mmu spinlock held in mmu_alloc_roots

2010-05-06 Thread Marcelo Tosatti
On Tue, May 04, 2010 at 01:03:50PM +0300, Avi Kivity wrote: > On svm, kvm_read_pdptr() may require reading guest memory, which can sleep. > > Push the spinlock into mmu_alloc_roots(), and only take it after we've read > the pdptr. > > Signed-off-by: Avi Kivity > --- > > Marcelo, dropping and re

Re: [PATCH v2 0/5] Fix EFER.NX=0 with EPT

2010-05-06 Thread Marcelo Tosatti
On Sun, May 02, 2010 at 12:48:49PM +0300, Avi Kivity wrote: > Currently we run with EFER.NX=1 on the guest even if the guest value is 0. > This is fine with shadow, since we check bit 63 when instantiating a page > table, and fault if bit 63 is set while EFER.NX is clear. > > This doesn't work wit

Re: [PATCH] KVM: Get rid of KVM_REQ_KICK

2010-05-06 Thread Marcelo Tosatti
On Mon, May 03, 2010 at 05:19:08PM +0300, Avi Kivity wrote: > KVM_REQ_KICK poisons vcpu->requests by having a bit set during normal > operation. This causes the fast path check for a clear vcpu->requests > to fail all the time, triggering tons of atomic operations. > > Fix by replacing KVM_REQ_KI

Another SIGFPE in display code, now in cirrus

2010-05-06 Thread Michael Tokarev
There was a bug recently fixed in vnc code. Apparently there's something similar in the cirrus emulation as well. Here it triggers _always_ (including old versions of kvm) when running windows NT and hitting "test" button in its display resolution dialog. Here's what gdb is to say: Program rece

Re: virtio-win problem

2010-05-06 Thread Brian Jackson
On Thursday, May 06, 2010 07:10:07 am Riccardo Veraldi wrote: > Hello, > if I install virtio-win drivers on windows 2008 Server R2, I have the > problem of signed device drivers. > I Can install the drivers but Windows 2008 server refuses to use them > unless I start > the machine pressing F8 every

Re: [PATCH 1/1] KVM: X86: add the support of XSAVE/XRSTOR to guest

2010-05-06 Thread Avi Kivity
On 05/06/2010 10:45 PM, Avi Kivity wrote: All those control registers are annoying, we have cr1 and cr5-cr7 free, cr9-cr15 on x86_64, infinite msr space, and now we have XCRs. Great. Looking forward to YCR0. I think I see the reason - xgetbv is unprivileged, so applications can see what

Re: [PATCH 1/1] KVM: X86: add the support of XSAVE/XRSTOR to guest

2010-05-06 Thread Avi Kivity
On 05/06/2010 05:20 PM, Cui, Dexuan wrote: However, switching xcr0 may be slow. That's our experience with msrs. Can you measure its latency? We can measure that. However, I think the changing xcr0 to guest xcr0 in handle_xsetbv() is necessary -- or else, inside guest xgetbv() would re

Re: [PATCH] kvm mmu: reduce 50% memory usage

2010-05-06 Thread Marcelo Tosatti
On Thu, May 06, 2010 at 03:03:48PM +0800, Lai Jiangshan wrote: > Marcelo Tosatti wrote: > > On Thu, Apr 29, 2010 at 09:43:40PM +0300, Avi Kivity wrote: > >> On 04/29/2010 09:09 PM, Marcelo Tosatti wrote: > >>> You missed quadrant on 4mb large page emulation with shadow (see updated > >>> patch belo

[PATCH] Fix segfault after device assignment hot remove

2010-05-06 Thread Alex Williamson
We keep a qlist of assigned devices for irq updates, but we forgot to remove entries from it if they're hot unplugged. This makes assigned_dev_update_irqs() a timebomb that goes off when the guest is rebooted. Signed-off-by: Alex Williamson --- diff --git a/hw/device-assignment.c b/hw/device-as

Re: [Autotest] [KVM_AUTOTEST][PATCH] KSM_overcommit: dynamic reserve calculation

2010-05-06 Thread Lucas Meneghel Rodrigues
On Wed, 2010-05-05 at 21:52 +0100, Lukáš Doktor wrote: > Hi, > > we are back with new features of KSM_overcommit test: > * NEW: guest_reserve and host_reserve are now calculated based on used > memory > * NEW: tmpfs reserve is also evaluated to fit the overhead > * NEW: VM alive check during spli

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-06 Thread Cam Macdonell
On Thu, May 6, 2010 at 11:32 AM, Anthony Liguori wrote: > On 04/21/2010 12:53 PM, Cam Macdonell wrote: >> >> Support an inter-vm shared memory device that maps a shared-memory object >> as a >> PCI device in the guest.  This patch also supports interrupts between >> guest by >> communicating over

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-06 Thread Anthony Liguori
On 04/21/2010 12:53 PM, Cam Macdonell wrote: Support an inter-vm shared memory device that maps a shared-memory object as a PCI device in the guest. This patch also supports interrupts between guest by communicating over a unix domain socket. This patch applies to the qemu-kvm repository.

Re: [Autotest] [PATCH 1/3] KVM test: Use customized command to get the version of kvm and its

2010-05-06 Thread Lucas Meneghel Rodrigues
On Mon, Apr 26, 2010 at 7:07 AM, Jason Wang wrote: > userspace > > Current method may or may not work for various kinds of > distribution. So this patch enable the ability to use customized > commands to get the version of kvm and its userspace. "kvm_ver_cmd" is > used for kvm verison and "kvm_use

Re: [Autotest] [PATCH 2/3] KVM test: Create ksm scanner through pre_command

2010-05-06 Thread Lucas Meneghel Rodrigues
On Mon, Apr 26, 2010 at 7:07 AM, Jason Wang wrote: > KSM may have various control interface for different distributions,so > this patch launch ksm through pre_command instead of the hard-coded > bits in the test. User may specify their owner suitable commands or > paramteres. Applied, thanks! >

Re: [Autotest] [PATCH 3/3] KVM test: Remove the duplicated KERNEL paramters in the pxe configuration file

2010-05-06 Thread Lucas Meneghel Rodrigues
On Mon, Apr 26, 2010 at 7:07 AM, Jason Wang wrote: > Remove the duplicated "KERNEL vmlinuz" in unattended.py Good catch, applied, thanks! > Signed-off-by: Jason Wang > --- >  client/tests/kvm/scripts/unattended.py |    1 - >  1 files changed, 0 insertions(+), 1 deletions(-) > > diff --git a/cli

Re: [Qemu-devel] Re: How to map PCI memory into the VM without trapping

2010-05-06 Thread Cam Macdonell
On Wed, May 5, 2010 at 5:20 PM, Frank Berreth wrote: > Hi there, > this is just an update if you are interested in the outcome. I turns out > that my initial assumption that there would be page faults/trapping on the > memory pages was false. The reason the throughput is so low is because the > me

Re: [Qemu-devel] question on virtio

2010-05-06 Thread Jamie Lokier
Michael S. Tsirkin wrote: > Hi! > I see this in virtio_ring.c: > > /* Put entry in available array (but don't update avail->idx * > until they do sync). */ > > Why is it done this way? > It seems that updating the index straight away would be simpler, while > this might allow the

Re: [PATCH 9/9] KVM test: Redirect the console to serial for all linux guests

2010-05-06 Thread Lucas Meneghel Rodrigues
On Thu, 2010-05-06 at 11:08 +0800, Jason Wang wrote: > Michael Goldish wrote: > > On 04/26/2010 01:04 PM, Jason Wang wrote: > > > >> As we have the ability to dump the content from serial console or use > >> a session through it, we need to redirect the console to serial > >> through unattended

Re: [Autotest] [PATCH 8/9] KVM test: Create the background threads before calling process()

2010-05-06 Thread Lucas Meneghel Rodrigues
On Wed, Apr 28, 2010 at 8:55 AM, Michael Goldish wrote: > On 04/26/2010 01:04 PM, Jason Wang wrote: >> If the screendump and scrialdump threads are created after the >> process(), we may lose the progress tracking of guest shutting >> down. So this patch creates them before calling process() in pr

Re: [Qemu-devel] Re: [PATCH] virtio-spec: document block CMD and FLUSH

2010-05-06 Thread Jamie Lokier
Rusty Russell wrote: > On Wed, 5 May 2010 05:47:05 am Jamie Lokier wrote: > > Jens Axboe wrote: > > > On Tue, May 04 2010, Rusty Russell wrote: > > > > ISTR someone mentioning a desire for such an API years ago, so CC'ing > > > > the > > > > usual I/O suspects... > > > > > > It would be nice to h

Re: [PATCH 1/9] KVM test: Introduce the prompt assist

2010-05-06 Thread Lucas Meneghel Rodrigues
On Thu, 2010-05-06 at 10:55 +0800, Jason Wang wrote: > Michael Goldish wrote: > > On 04/26/2010 01:03 PM, Jason Wang wrote: > > > >> Sometimes we need to send an assist string to a session in order to > >> get the prompt especially when re-connecting to an already logged > >> serial session. Thi

Re: [Autotest] [PATCH 6/9] KVM test: Raise error when met unknown type in kvm_vm.remote_login().

2010-05-06 Thread Lucas Meneghel Rodrigues
On Mon, Apr 26, 2010 at 7:04 AM, Jason Wang wrote: > Need to raise the error when met the unknown type of shell_client in > kvm_vm.remote_login() in order to avoid the traceback. In order to keep consistency, please make the function return None instead of throwing an exception. You might log the

RE: virtio-win problem

2010-05-06 Thread Martin Maurer
> -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On > Behalf Of Riccardo Veraldi > Sent: Donnerstag, 06. Mai 2010 14:10 > To: kvm@vger.kernel.org > Subject: virtio-win problem > > Hello, > if I install virtio-win drivers on windows 2008 Server R2, I

Re: [Qemu-devel] Re: [PATCH] virtio-spec: document block CMD and FLUSH

2010-05-06 Thread Jamie Lokier
Rusty Russell wrote: > > Seems over-zealous. > > If the recovery_header held a strong checksum of the recovery_data you would > > not need the first fsync, and as long as you have two places to write > > recovery > > data, you don't need the 3rd and 4th syncs. > > Just: > > > > write_internally

RE: [PATCH 1/1] KVM: X86: add the support of XSAVE/XRSTOR to guest

2010-05-06 Thread Cui, Dexuan
Avi Kivity wrote: > On 05/06/2010 07:23 AM, Cui, Dexuan wrote: >> + goto err; + vcpu->arch.guest_xstate_mask = new_bv; + xsetbv(XCR_XFEATURE_ENABLED_MASK, vcpu->arch.guest_xstate_mask); >>> Can't we run with the host xcr0? isn't it guaranteed to be a >>> supe

Re: [Autotest] [PATCH] IOzone preprocessing: Fix wrong column mapping on graph generation

2010-05-06 Thread Martin Bligh
LGTM On Thu, May 6, 2010 at 6:24 AM, Lucas Meneghel Rodrigues wrote: > Fix a silly bug on graph generation: it was mapping the wrong > columns when plotting the 2D throughput graphs. Sorry for the > mistake. > > Signed-off-by: Lucas Meneghel Rodrigues > --- >  client/tests/iozone/postprocessing

Re: [RFC][PATCH resend 8/12] asm-generic: bitops: introduce le bit offset macro

2010-05-06 Thread Arnd Bergmann
On Wednesday 05 May 2010, Takuya Yoshikawa wrote: > Date: > Yesterday 04:59:24 > > That's why the bitmaps are defined as little endian u64 aligned, even on > > big endian 32-bit systems. Little endian bitmaps are wordsize agnostic, > > and u64 alignment ensures we can use long-sized bitops on m

Re: [PATCH 2/3 v2] KVM: VMX: VMCLEAR/VMPTRLD usage changes.

2010-05-06 Thread Avi Kivity
On 05/06/2010 11:45 AM, Xu, Dongxiao wrote: From: Dongxiao Xu Originally VMCLEAR/VMPTRLD is called on vcpu migration. To support hosted VMM coexistance, VMCLEAR is executed on vcpu schedule out, and VMPTRLD is executed on vcpu schedule in. This could also eliminate the IPI when doing VMCLEAR.

[PATCH] IOzone preprocessing: Fix wrong column mapping on graph generation

2010-05-06 Thread Lucas Meneghel Rodrigues
Fix a silly bug on graph generation: it was mapping the wrong columns when plotting the 2D throughput graphs. Sorry for the mistake. Signed-off-by: Lucas Meneghel Rodrigues --- client/tests/iozone/postprocessing.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/client/

Re: [PATCH 1/3 v2] KVM: VMX code cleanup and preparation.

2010-05-06 Thread Avi Kivity
On 05/06/2010 11:45 AM, Xu, Dongxiao wrote: From: Dongxiao Xu Changelog needs to describe what's being done and why. Splitting the changes will help. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the

Re: [PATCH RFC] KVM: inject #UD if instruction emulation fails while vcpu is in cpl==3

2010-05-06 Thread Avi Kivity
On 05/06/2010 03:41 PM, Gleb Natapov wrote: On Thu, May 06, 2010 at 03:33:12PM +0300, Avi Kivity wrote: On 05/06/2010 03:25 PM, Gleb Natapov wrote: We can expect that from a developer or a user subscribed to k...@. But what about some random user running virt-manager?

Re: [PATCH RFC] KVM: inject #UD if instruction emulation fails while vcpu is in cpl==3

2010-05-06 Thread Gleb Natapov
On Thu, May 06, 2010 at 03:33:12PM +0300, Avi Kivity wrote: > On 05/06/2010 03:25 PM, Gleb Natapov wrote: > > > >>We can expect that from a developer or a user subscribed to k...@. > >>But what about some random user running virt-manager? > >> > >What virt-manager would do about such error? > > Ca

Re: [PATCH RFC] KVM: inject #UD if instruction emulation fails while vcpu is in cpl==3

2010-05-06 Thread Avi Kivity
On 05/06/2010 03:25 PM, Gleb Natapov wrote: We can expect that from a developer or a user subscribed to k...@. But what about some random user running virt-manager? What virt-manager would do about such error? Call up abrt. True. But the same problem exists with cpl>0 #UD. It

virtio-win problem

2010-05-06 Thread Riccardo Veraldi
Hello, if I install virtio-win drivers on windows 2008 Server R2, I have the problem of signed device drivers. I Can install the drivers but Windows 2008 server refuses to use them unless I start the machine pressing F8 every time at each reboot bypassing the checking of signed certified driver

Re: [PATCH RFC] KVM: inject #UD if instruction emulation fails while vcpu is in cpl==3

2010-05-06 Thread Gleb Natapov
On Thu, May 06, 2010 at 01:13:30PM +0300, Avi Kivity wrote: > On 05/06/2010 01:06 PM, Gleb Natapov wrote: > >On Thu, May 06, 2010 at 12:15:58PM +0300, Avi Kivity wrote: > >>On 04/29/2010 02:58 PM, Gleb Natapov wrote: > >>>Do not kill VM If instruction emulation fails while vcpu is in > >>>userspace

Re: [PATCH 4/5] KVM: SVM: Allow EFER.LMSLE to be set with nested svm

2010-05-06 Thread Avi Kivity
On 05/06/2010 12:38 PM, Roedel, Joerg wrote: Subject: [PATCH] KVM: X86: Inject #GP with the right rip on efer writes This patch fixes a bug in the KVM efer-msr write path. If a guest writes to a reserved efer bit the set_efer function injects the #GP directly. The architecture dependent wrmsr fun

Re: [patch uq/master 0/9] enable smp > 1 and related fixes

2010-05-06 Thread Avi Kivity
On 05/04/2010 03:45 PM, Marcelo Tosatti wrote: Applied all, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.o

Re: [patch uq/master 0/9] enable smp > 1 and related fixes

2010-05-06 Thread Avi Kivity
On 05/05/2010 09:24 PM, Anthony Liguori wrote: On 05/04/2010 07:45 AM, Marcelo Tosatti wrote: -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html How does this

Re: [patch uq/master 5/9] kvm: synchronize state from cpu context

2010-05-06 Thread Avi Kivity
On 05/04/2010 03:45 PM, Marcelo Tosatti wrote: From: Jan Kiszka It is not safe to retrieve the KVM internal state of a given cpu while its potentially modifying it. Queue the request to run on cpu context, similarly to qemu-kvm. Even better is to query the state in the cpu thread; but tha

Re: [PATCH RFC] KVM: inject #UD if instruction emulation fails while vcpu is in cpl==3

2010-05-06 Thread Avi Kivity
On 05/06/2010 01:06 PM, Gleb Natapov wrote: On Thu, May 06, 2010 at 12:15:58PM +0300, Avi Kivity wrote: On 04/29/2010 02:58 PM, Gleb Natapov wrote: Do not kill VM If instruction emulation fails while vcpu is in userspace. Inject #UD instead in a hope that guest OS will kill offending

Re: [PATCH RFC] KVM: inject #UD if instruction emulation fails while vcpu is in cpl==3

2010-05-06 Thread Gleb Natapov
On Thu, May 06, 2010 at 12:15:58PM +0300, Avi Kivity wrote: > On 04/29/2010 02:58 PM, Gleb Natapov wrote: > >Do not kill VM If instruction emulation fails while vcpu is in > >userspace. Inject #UD instead in a hope that guest OS will kill offending > >process. Emulation failure is still traced by f

Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself

2010-05-06 Thread Avi Kivity
On 05/05/2010 11:58 PM, Michael S. Tsirkin wrote: + /* We publish the last-seen used index at the end of the available ring. +* It is at the end for backwards compatibility. */ + vr->last_used_idx =&(vr)->avail->ring[num]; + /* Verify that last used index does not spill

Re: [PATCH 4/5] KVM: SVM: Allow EFER.LMSLE to be set with nested svm

2010-05-06 Thread Roedel, Joerg
On Wed, May 05, 2010 at 04:57:00PM -0400, Przywara, Andre wrote: > If I understood this correctly, there is a bug somewhere, maybe even in > KVM's nested SVM implementation. Xen is fine with this bit-set provoking > a #GP. I haven't had time yet to further investigate this, though. Ok, I looked

[PATCH v4 9/9] KVM MMU: optimize sync/update unsync-page

2010-05-06 Thread Xiao Guangrong
invlpg only need update unsync page, sp->unsync and sp->unsync_children can help us to find it Now, a gfn may have many shadow pages, when one sp need be synced, we write protect sp->gfn and sync this sp but we keep other shadow pages asynchronous So, while gfn happen page fault, let it not touch

[PATCH v4 8/9] KVM MMU: no need atomic operation for 'invlpg_counter'

2010-05-06 Thread Xiao Guangrong
'invlpg_counter' is protected by 'kvm->mmu_lock', no need atomic operation anymore Signed-off-by: Xiao Guangrong --- arch/x86/include/asm/kvm_host.h |2 +- arch/x86/kvm/paging_tmpl.h |7 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/kvm_

[PATCH v4 7/9] KVM MMU: separate invlpg code form kvm_mmu_pte_write()

2010-05-06 Thread Xiao Guangrong
Let invlpg not depends on kvm_mmu_pte_write path, later patch will need this feature Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 22 +- arch/x86/kvm/paging_tmpl.h | 44 +++- 2 files changed, 44 insertions(+), 22 d

[PATCH v4 6/9] KVM MMU: support keeping sp live while it's out of protection

2010-05-06 Thread Xiao Guangrong
If we want to keep sp live while it it's out of kvm->mmu_lock protection, we can increase sp->active_count. Then, the invalid page is not only for active root but also unsync sp, we should filter those out when we make a page to unsync. And move 'hlist_del(&sp->hash_link)' into kvm_mmu_free_page(

[PATCH v4 5/9] KVM MMU: rename 'root_count' to 'active_count'

2010-05-06 Thread Xiao Guangrong
Rename 'root_count' to 'active_count' in kvm_mmu_page, since the unsync pages also will use it in later patch Signed-off-by: Xiao Guangrong --- arch/x86/include/asm/kvm_host.h |7 ++- arch/x86/kvm/mmu.c | 14 +++--- arch/x86/kvm/mmutrace.h |6 +++--- 3

[PATCH v4 4/9] KVM MMU: allow more page become unsync at getting sp time

2010-05-06 Thread Xiao Guangrong
Allow more page become asynchronous at getting sp time, if need create new shadow page for gfn but it not allow unsync(level > 1), we should unsync all gfn's unsync page Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 47 +-- 1 files changed,

[PATCH v4 2/9] KVM MMU: don't write-protect if have new mapping to unsync page

2010-05-06 Thread Xiao Guangrong
Two cases maybe happen in kvm_mmu_get_page() function: - one case is, the goal sp is already in cache, if the sp is unsync, we only need update it to assure this mapping is valid, but not mark it sync and not write-protect sp->gfn since it not broke unsync rule(one shadow page for a gfn) -

[PATCH v4 3/9] KVM MMU: allow more page become unsync at gfn mapping time

2010-05-06 Thread Xiao Guangrong
In current code, shadow page can become asynchronous only if one shadow page for a gfn, this rule is too strict, in fact, we can let all last mapping page(i.e, it's the pte page) become unsync, and sync them at invlpg or flush tlb time. This patch allow more page become asynchronous at gfn mapping

[PATCH v4 1/9] KVM MMU: split kvm_sync_page() function

2010-05-06 Thread Xiao Guangrong
Split kvm_sync_page() into kvm_sync_page() and kvm_sync_page_transient() to clarify the code address Avi's suggestion kvm_sync_page_transient() function only update shadow page but not mark it sync and not write protect sp->gfn. it will be used by later patch Signed-off-by: Xiao Guangrong --- a

[PATCH v4 0/9] KVM MMU: allow more shadow pages become asynchronous

2010-05-06 Thread Xiao Guangrong
Changlog v4: - fix the bug that reported by Marcelo - fix the race in invlpg code Changlog v3: Those changes all form Avi's suggestion, thanks. - use smart way to fix the bug in patch 1 - remove duplicates code in patch 5 - check error code and fix forgot release page in patch 9 - sync shadow

Re: [PATCH] KVM: make kvm_mmu_zap_page() return the number of pages it actually freed.

2010-05-06 Thread Avi Kivity
On 05/06/2010 12:25 PM, Gui Jianfeng wrote: Avi Kivity wrote: On 05/05/2010 04:03 AM, Gui Jianfeng wrote: Currently, kvm_mmu_zap_page() returning the number of freed children sp. This might confuse the caller, because caller don't know the actual freed number. Let's make kvm_mmu_zap_p

Re: [PATCH] KVM: make kvm_mmu_zap_page() return the number of pages it actually freed.

2010-05-06 Thread Gui Jianfeng
Avi Kivity wrote: > On 05/05/2010 04:03 AM, Gui Jianfeng wrote: >> Currently, kvm_mmu_zap_page() returning the number of freed children sp. >> This might confuse the caller, because caller don't know the actual freed >> number. Let's make kvm_mmu_zap_page() return the number of pages it >> actually

Re: [PATCH 2/3] KVM MMU: fix sp->unsync type error in trace event definition.

2010-05-06 Thread Avi Kivity
On 04/22/2010 12:33 PM, Gui Jianfeng wrote: sp->unsync is bool now, so update trace event declaration. Signed-off-by: Gui Jianfeng --- arch/x86/kvm/mmutrace.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/mmutrace.h b/arch/x86/kvm/mmutrace.h index 3851

Re: High CPU load on target host after migration

2010-05-06 Thread Avi Kivity
On 04/29/2010 12:14 AM, Thomas Beinicke wrote: Hi, I have been toying around with kvm / libvirt / virt-manager and it's migration feature. Both host machines are running a 2.6.33 Kernel. One host is a Dual Quad Core Intel Xeon E5520 @ 2.27GHz and the other is a Dual Quad Core Intel E5420 @ 2.

Re: [PATCH RFC] KVM: inject #UD if instruction emulation fails while vcpu is in cpl==3

2010-05-06 Thread Avi Kivity
On 04/29/2010 02:58 PM, Gleb Natapov wrote: Do not kill VM If instruction emulation fails while vcpu is in userspace. Inject #UD instead in a hope that guest OS will kill offending process. Emulation failure is still traced by ftrace point to help analyze the problem. Still there's the risk

Re: [PATCH] KVM: Fix debug output error

2010-05-06 Thread Avi Kivity
On 05/05/2010 04:58 AM, Gui Jianfeng wrote: Fix a debug output error in walk_addr Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More m

Re: [PATCH] KVM: mark page dirty when page is actually modified.

2010-05-06 Thread Avi Kivity
On 05/05/2010 04:09 AM, Gui Jianfeng wrote: Sometime cmpxchg_gpte doesn't modify gpte, in such case, don't mark page table page as dirty. Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in t

Re: [PATCH] KVM: make kvm_mmu_zap_page() return the number of pages it actually freed.

2010-05-06 Thread Avi Kivity
On 05/05/2010 04:03 AM, Gui Jianfeng wrote: Currently, kvm_mmu_zap_page() returning the number of freed children sp. This might confuse the caller, because caller don't know the actual freed number. Let's make kvm_mmu_zap_page() return the number of pages it actually freed. if

Re: KVM hook for code integrity checking

2010-05-06 Thread Avi Kivity
On 05/06/2010 07:51 AM, Suen Chun Hui wrote: Hi, Thanks for the reply. On 05/05/2010 11:05 AM, Avi Kivity wrote: On 04/30/2010 05:53 PM, Suen Chun Hui wrote: Dear KVM developers, I'm currently working on an open source security patch to use KVM to implement code verification on a g

Re: [PATCH 0/5] Important fixes for KVM-AMD

2010-05-06 Thread Avi Kivity
On 05/05/2010 05:04 PM, Joerg Roedel wrote: Hi Avi, Marcelo, here is a set of patches which fix problems in kvm-amd. Patch 1 fixes a stupid problem with the event-reinjection introduced by me in my previous patchset. Patch 2 was a helper to find the bug patch 3 fixes. I kept it in the patchset

[PATCH 2/3 v2] KVM: VMX: VMCLEAR/VMPTRLD usage changes.

2010-05-06 Thread Xu, Dongxiao
From: Dongxiao Xu Originally VMCLEAR/VMPTRLD is called on vcpu migration. To support hosted VMM coexistance, VMCLEAR is executed on vcpu schedule out, and VMPTRLD is executed on vcpu schedule in. This could also eliminate the IPI when doing VMCLEAR. Signed-off-by: Dongxiao Xu --- arch/x86/kvm/

[PATCH v3 2/2] x86: Introduce 'struct fpu' and related API

2010-05-06 Thread Avi Kivity
Currently all fpu state access is through tsk->thread.xstate. Since we wish to generalize fpu access to non-task contexts, wrap the state in a new 'struct fpu' and convert existing access to use an fpu API. Signal frame handlers are not converted to the API since they will remain task context onl

[PATCH v3 0/2] x86 FPU API

2010-05-06 Thread Avi Kivity
Currently all fpu accessors are wedded to task_struct. However kvm also uses the fpu in a different context. Introduce an FPU API, and replace the current uses with the new API. While this patchset is oriented towards deeper changes, as a first step it simlifies xsave for kvm. v3: use u

[PATCH v3 1/2] x86: eliminate TS_XSAVE

2010-05-06 Thread Avi Kivity
The fpu code currently uses current->thread_info->status & TS_XSAVE as a way to distinguish between XSAVE capable processors and older processors. The decision is not really task specific; instead we use the task status to avoid a global memory reference - the value should be the same across all th

[PATCH 3/3 v2] KVM: VMX: VMXON/VMXOFF usage changes.

2010-05-06 Thread Xu, Dongxiao
From: Dongxiao Xu Intel SDM also suggests that VMXOFF should be called after doing VMCLEAR. Therefore VMXON should be called before VMPTRLD. Signed-off-by: Dongxiao Xu --- arch/x86/kvm/vmx.c | 30 -- 1 files changed, 24 insertions(+), 6 deletions(-) diff --git a/

[PATCH 0/3 v2] KVM: VMX: Support hosted VMM coexsitence.

2010-05-06 Thread Xu, Dongxiao
Main changes from v1: 1) Add an module option "vmm_coexistence" to decide whether to enable this feature. Currently it is off defaultly. 2) Each time when a KVM vcpu is scheduled in, it will invalidate EPT and VPID TLBs to avoid conflict between different VMMs. VMX: Support for coexistence of KVM

[PATCH 1/3 v2] KVM: VMX code cleanup and preparation.

2010-05-06 Thread Xu, Dongxiao
From: Dongxiao Xu Signed-off-by: Dongxiao Xu --- arch/x86/kvm/vmx.c | 36 +++- 1 files changed, 23 insertions(+), 13 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 875b785..e77da89 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx

[PATCH RFC] qemu/virtio: use last used index published by guest

2010-05-06 Thread Michael S. Tsirkin
Reduces irq_window in guest by only injecting an interrupt if guest has handled all buffers we used so far. Signed-off-by: Michael S. Tsirkin --- This is the qemu part of the story. hw/vhost_net.c |6 ++ hw/virtio.c| 15 +++ hw/virtio.h|4 3 files changed

Re: [PATCH 1/1] KVM: X86: add the support of XSAVE/XRSTOR to guest

2010-05-06 Thread Avi Kivity
On 05/06/2010 07:23 AM, Cui, Dexuan wrote: + goto err; + vcpu->arch.guest_xstate_mask = new_bv; + xsetbv(XCR_XFEATURE_ENABLED_MASK, vcpu->arch.guest_xstate_mask); Can't we run with the host xcr0? isn't it guaranteed to be a superset of the guest xcr0?

Re: vCPU scalability for linux VMs

2010-05-06 Thread Alec Istomin
On Wednesday, May 5, 2010 at 01:53:55 -0400, Srivatsa Vaddagiri wrote: > On Wed, May 05, 2010 at 12:31:11PM -0700, Alec Istomin wrote: >> >> On Wednesday, May 5, 2010 at 13:27:39 -0400, Srivatsa Vaddagiri wrote: >> >> My preliminary results show that single vCPU Linux VMs perform up to 10 >> >>

Re: [GIT PULL] amended: first round of vhost-net enhancements for net-next

2010-05-06 Thread David Miller
From: "Michael S. Tsirkin" Date: Tue, 4 May 2010 14:21:01 +0300 > This is an amended pull request: I have rebased the tree to the > correct patches. This has been through basic tests and seems > to work fine here. > > The following tree includes a couple of enhancements that help vhost-net. > Pl

Re: [PATCH] kvm mmu: reduce 50% memory usage

2010-05-06 Thread Lai Jiangshan
Marcelo Tosatti wrote: > On Thu, Apr 29, 2010 at 09:43:40PM +0300, Avi Kivity wrote: >> On 04/29/2010 09:09 PM, Marcelo Tosatti wrote: >>> You missed quadrant on 4mb large page emulation with shadow (see updated >>> patch below). >> Good catch. >> >>> Also for some reason i can't understand the ass