Re: [RFC][PATCH 11/12] KVM: introduce new API for getting/switching dirty bitmaps

2010-05-12 Thread Takuya Yoshikawa
One alternative would be: KVM_SWITCH_DIRTY_LOG passing the address of a bitmap. If the active bitmap was clean, it returns 0, no switch performed. If the active bitmap was dirty, the kernel switches to the new bitmap and returns 1. And the responsability of cleaning the new bitmap could also

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

2010-05-12 Thread Xu, Dongxiao
Marcelo Tosatti wrote: On Tue, May 11, 2010 at 06:29:48PM +0800, Xu, Dongxiao wrote: From: Dongxiao Xu dongxiao...@intel.com 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

Re: [Qemu-devel] Re: QEMU-KVM and video performance

2010-05-12 Thread Gerhard Wiesinger
On Mon, 10 May 2010, Avi Kivity wrote: On 05/09/2010 10:35 PM, Gerhard Wiesinger wrote: For 256 color more the first priority is to find out why direct mapping is not used. I'd suggest tracing the code that makes this decision (in hw/*vga.c) and seeing if it's right or not. I think

Re: [RFC][PATCH RFC 10/12] KVM: move dirty bitmaps to user space

2010-05-12 Thread Takuya Yoshikawa
r = 0; @@ -1195,11 +1232,16 @@ void mark_page_dirty(struct kvm *kvm, gfn_t gfn) gfn = unalias_gfn(kvm, gfn); memslot = gfn_to_memslot_unaliased(kvm, gfn); if (memslot memslot-dirty_bitmap) { - unsigned long rel_gfn = gfn - memslot-base_gfn; +

Re: [PATCH 4/4] VMX: x86: Only reset MMU when necessary

2010-05-12 Thread Avi Kivity
On 05/12/2010 05:09 AM, Sheng Yang wrote: Only modifying some bits of CR0/CR4 needs paging mode switch. Add update_rsvd_bits_mask() to address EFER.NX bit updating for reserved bits. Can you please repost the whole series? Due to a problem with my mailbox I don't have the patches either

[PATCH 1/4] KVM: x86: Check LMA bit before set_efer

2010-05-12 Thread Sheng Yang
kvm_x86_ops-set_efer() would execute vcpu-arch.efer = efer, so the checking of LMA bit didn't work. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/x86.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index

[PATCH 4/4] VMX: x86: Only reset MMU when necessary

2010-05-12 Thread Sheng Yang
Only modifying some bits of CR0/CR4 needs paging mode switch. Add update_rsvd_bits_mask() to address EFER.NX bit updating for reserved bits. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/mmu.c | 17 ++---

[PATCH 3/4] KVM: x86: Remove kvm_mmu_reset_context() in kvm_set_efer()

2010-05-12 Thread Sheng Yang
Modify EFER won't result in mode switch directly. After EFER.LME set, the following set CR0.PG would result in mode switch to IA32e. And the later action already covered by kvm_set_cr0(). Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/x86.c |1 - 1 files changed, 0

[PATCH 2/4] KVM: Clean up duplicate assignment

2010-05-12 Thread Sheng Yang
mmu.free() already set root_hpa to INVALID_PAGE, no need to do it again in the destory_kvm_mmu(). kvm_x86_ops-set_cr4() and set_efer() already assign cr4/efer to vcpu-arch.cr4/efer, no need to do it again later. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/mmu.c |5 ++---

Re: [PATCH 0/9] pvclock misc fixes - v4.

2010-05-12 Thread Avi Kivity
On 05/12/2010 08:47 AM, Alexander Graf wrote: How about stable queuing of this one? Only after this gets some serious field testing. I'm not happy to trade a known issue for an unknown regression. While I don't expect any problems with the patchset, testing has often proven me wrong. --

Re: [PATCH 0/9] pvclock misc fixes - v4.

2010-05-12 Thread Alexander Graf
On 12.05.2010, at 08:33, Avi Kivity wrote: On 05/12/2010 08:47 AM, Alexander Graf wrote: How about stable queuing of this one? Only after this gets some serious field testing. I'm not happy to trade a known issue for an unknown regression. While I don't expect any problems with the

Re: [Qemu-devel] Re: QEMU-KVM and video performance

2010-05-12 Thread Avi Kivity
On 05/12/2010 09:14 AM, Gerhard Wiesinger wrote: On Mon, 10 May 2010, Avi Kivity wrote: On 05/09/2010 10:35 PM, Gerhard Wiesinger wrote: For 256 color more the first priority is to find out why direct mapping is not used. I'd suggest tracing the code that makes this decision (in

[PATCH -v2] KVM, Fix QEMU-KVM is killed by guest SRAO MCE

2010-05-12 Thread Huang Ying
In common cases, guest SRAO MCE will cause corresponding poisoned page be un-mapped and SIGBUS be sent to QEMU-KVM, then QEMU-KVM will relay the MCE to guest OS. But it is reported that if the poisoned page is accessed in guest after un-mapped and before MCE is relayed to guest OS, QEMU-KVM will

Re: [PATCH 4/4] VMX: x86: Only reset MMU when necessary

2010-05-12 Thread Avi Kivity
On 05/12/2010 09:33 AM, Sheng Yang wrote: Only modifying some bits of CR0/CR4 needs paging mode switch. Add update_rsvd_bits_mask() to address EFER.NX bit updating for reserved bits. @@ -2335,6 +2335,19 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, int level) } }

Re: [PATCHv2] Support for booting from virtio disks

2010-05-12 Thread Avi Kivity
On 05/11/2010 03:31 PM, Gleb Natapov wrote: On Tue, May 11, 2010 at 11:19:07AM +0300, Avi Kivity wrote: On 05/10/2010 06:48 PM, Anthony Liguori wrote: On 05/10/2010 03:11 AM, Gleb Natapov wrote: This patch adds native support for booting from virtio disks to Seabios.

Re: [PATCH 4/4] VMX: x86: Only reset MMU when necessary

2010-05-12 Thread Sheng Yang
On Wednesday 12 May 2010 14:59:14 Avi Kivity wrote: On 05/12/2010 09:33 AM, Sheng Yang wrote: Only modifying some bits of CR0/CR4 needs paging mode switch. Add update_rsvd_bits_mask() to address EFER.NX bit updating for reserved bits. @@ -2335,6 +2335,19 @@ static void

Re: [PATCHv2] Support for booting from virtio disks

2010-05-12 Thread Gleb Natapov
On Wed, May 12, 2010 at 10:22:59AM +0300, Avi Kivity wrote: On 05/11/2010 03:31 PM, Gleb Natapov wrote: On Tue, May 11, 2010 at 11:19:07AM +0300, Avi Kivity wrote: On 05/10/2010 06:48 PM, Anthony Liguori wrote: On 05/10/2010 03:11 AM, Gleb Natapov wrote: This patch adds native support for

[PATCH] test: emulator: lmsw may not clear cr0.pe

2010-05-12 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/emulator.c |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/emulator.c b/kvm/user/test/x86/emulator.c index 5406062..e677e3a 100644 --- a/kvm/user/test/x86/emulator.c +++

Re: [PATCH 4/4] VMX: x86: Only reset MMU when necessary

2010-05-12 Thread Avi Kivity
On 05/12/2010 10:31 AM, Sheng Yang wrote: diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index b59fc67..971a295 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -416,6 +416,10 @@ out: static int __kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) { + unsigned

Re: network between host and guest

2010-05-12 Thread Thanasis
on 05/10/2010 09:28 PM Thanasis wrote the following: Probably it's slirp. The url you provided doesn't help much though. Anyone to provide some more help? -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info

[PATCH][v2 0/3] Some MMU related fix/clean up

2010-05-12 Thread Sheng Yang
Sheng Yang (3): KVM: x86: Check LMA bit before set_efer KVM: Clean up duplicate assignment VMX: x86: Only reset MMU when necessary arch/x86/kvm/mmu.c |5 ++--- arch/x86/kvm/x86.c | 22 -- 2 files changed, 18 insertions(+), 9 deletions(-) -- To unsubscribe from

[PATCH][v2 1/3] KVM: x86: Check LMA bit before set_efer

2010-05-12 Thread Sheng Yang
kvm_x86_ops-set_efer() would execute vcpu-arch.efer = efer, so the checking of LMA bit didn't work. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/x86.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index

[PATCH][v2 2/3] KVM: Clean up duplicate assignment

2010-05-12 Thread Sheng Yang
mmu.free() already set root_hpa to INVALID_PAGE, no need to do it again in the destory_kvm_mmu(). kvm_x86_ops-set_cr4() and set_efer() already assign cr4/efer to vcpu-arch.cr4/efer, no need to do it again later. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/mmu.c |5 ++---

[PATCH][v2 3/3] VMX: x86: Only reset MMU when necessary

2010-05-12 Thread Sheng Yang
Only modifying some bits of CR0/CR4 needs paging mode switch. Modify EFER.NXE bit would result in reserved bit updates. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/x86.c | 16 ++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git

Re: [PATCH][v2 3/3] VMX: x86: Only reset MMU when necessary

2010-05-12 Thread Avi Kivity
On 05/12/2010 11:40 AM, Sheng Yang wrote: Only modifying some bits of CR0/CR4 needs paging mode switch. Modify EFER.NXE bit would result in reserved bit updates. Signed-off-by: Sheng Yangsh...@linux.intel.com --- arch/x86/kvm/x86.c | 16 ++-- 1 files changed, 14 insertions(+),

[PATCH] KVM: MMU: Segregate shadow pages with different cr0.wp

2010-05-12 Thread Avi Kivity
When cr0.wp=0, we may shadow a gpte having u/s=1 and r/w=0 with an spte having u/s=0 and r/w=1. This allows excessive access if the guest sets cr0.wp=1 and accesses through this spte. Fix by making cr0.wp part of the base role; we'll have different sptes for the two cases and the problem

Re: [PATCH][v2 3/3] VMX: x86: Only reset MMU when necessary

2010-05-12 Thread Avi Kivity
On 05/12/2010 11:54 AM, Sheng Yang wrote: On Wednesday 12 May 2010 16:47:36 you wrote: On 05/12/2010 11:40 AM, Sheng Yang wrote: Only modifying some bits of CR0/CR4 needs paging mode switch. Modify EFER.NXE bit would result in reserved bit updates. Signed-off-by: Sheng

Re: [RFC][PATCH 0/12] KVM, x86, ppc, asm-generic: moving dirty bitmaps to user space

2010-05-12 Thread Takuya Yoshikawa
[To ppc people] Hi, Benjamin, Paul, Alex, Please see the patches 6,7/12. I first say sorry for that I've not tested these yet. In that sense, these may not be in the quality for precise reviews. But I will be happy if you would give me any comments. Alex, could you help me? Though I have a

Re: [RFC][PATCH 7/12 not tested yet] PPC: introduce __set_bit() like function for bitmaps in user space

2010-05-12 Thread Takuya Yoshikawa
+static inline int set_bit_user_non_atomic(int nr, void __user *addr) +{ + u8 __user *p; + u8 val; + + p = (u8 __user *)((unsigned long)addr + nr / BITS_PER_BYTE); Does C do the + or the / first? Either way, I'd like to see brackets here :) OK, I'll change like that! I

Re: [PATCH RFC] vhost: fix barrier pairing

2010-05-12 Thread Juan Quintela
Michael S. Tsirkin m...@redhat.com wrote: According to memory-barriers.txt, an smp memory barrier should always be paired with another smp memory barrier, and I quote a lack of appropriate pairing is almost certainly an error. In case of vhost, failure to flush out used index update before

Re: [PATCH 1/2] x86 emulator: Add missing decoder flags for sub instruction

2010-05-12 Thread Avi Kivity
On 05/12/2010 01:39 AM, Mohammed Gamal wrote: This adds missing decoder flags for sub instructions (opcodes 0x2c - 0x2d) Looks good (both patches). Please post test cases for realmode.c. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. -- To

Re: [PATCH] x86 emulator: Add test acc, imm instruction (opcodes 0xA8 - 0xA9)

2010-05-12 Thread Avi Kivity
On 05/11/2010 10:22 PM, Mohammed Gamal wrote: This adds test acc, imm instruction to the x86 emulator Looks good. Testcases please. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. -- To unsubscribe from this list: send the line unsubscribe kvm in

Re: [PATCH v2 10/10] KVM test: Add a helper to search the panic in the log

2010-05-12 Thread Michael Goldish
On 05/11/2010 12:04 PM, Jason Wang wrote: This checker serves as the post_command to find the panic information in the file which contains the content of guest serial console. Signed-off-by: Jason Wang jasow...@redhat.com --- client/tests/kvm/scripts/check_serial.py | 41

Re: [Qemu-devel] Re: QEMU-KVM and video performance

2010-05-12 Thread Jamie Lokier
Gerhard Wiesinger wrote: On Wed, 21 Apr 2010, Jamie Lokier wrote: Gerhard Wiesinger wrote: Hmmm. I'm very new to QEMU and KVM but at least accessing the virtual HW of QEMU even from KVM must be possible (e.g. memory and port accesses are done on nearly every virtual device) and therefore

Re: [Qemu-devel] Re: QEMU-KVM and video performance

2010-05-12 Thread Jamie Lokier
Gerhard Wiesinger wrote: Can one switch to the old software vmm in VMWare? Perhaps you can install a very old version of VMWare. Maybe run it under KVM ;-) That was one of the reasons why I was looking for alternatives for graphical DOS programs. Overall summary so far: 1.) QEMU without

[RFC PATCH 0/2] Sheepdog: distributed storage system for QEMU

2010-05-12 Thread MORITA Kazutaka
Hi all, This patch adds a block driver for Sheepdog distributed storage system. Please consider for inclusion. Sheepdog is a distributed storage system for QEMU. It provides highly available block level storage volumes to VMs like Amazon EBS. Sheepdog features are: - No node in the cluster is

[RFC PATCH 1/2] close all the block drivers before the qemu process exits

2010-05-12 Thread MORITA Kazutaka
This patch calls the close handler of the block driver before the qemu process exits. This is necessary because the sheepdog block driver releases the lock of VM images in the close handler. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block.c | 11 +++ block.h

network problem with Solaris 10u8 guest

2010-05-12 Thread Harald Dunkel
Hi folks, I am trying to run Solaris 10u8 as a guest in kvm (kernel 2.6.33.2). Problem: The virtual network devices don't work with this Solaris version. e1000 and pcnet work just by chance, as it seems. I can ping the guest (even though some packets are lost). I cannot use ssh to login.

Re: Another SIGFPE in display code, now in cirrus

2010-05-12 Thread Stefano Stabellini
On Mon, 10 May 2010, Avi Kivity wrote: On 05/10/2010 10:41 AM, Avi Kivity wrote: On 05/06/2010 11:07 PM, Michael Tokarev wrote: 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

Qemu-KVM with 3x IDE HDD + CDROM not working

2010-05-12 Thread Peter Lieven
Hi Qemu/KVM Devel Team, if I create a VM with more than 2 harddisks and a CDROM Image and want to boot from CDROM this is not working. From my understanding at least 3 IDE Drives + 1 IDE CDROM should work. cmdline: /usr/bin/qemu-kvm-0.12.4 -net none -drive

Re: Another SIGFPE in display code, now in cirrus

2010-05-12 Thread Stefano Stabellini
On Wed, 12 May 2010, Avi Kivity wrote: On 05/12/2010 03:20 PM, Stefano Stabellini wrote: On Mon, 10 May 2010, Avi Kivity wrote: On 05/10/2010 10:41 AM, Avi Kivity wrote: On 05/06/2010 11:07 PM, Michael Tokarev wrote: There was a bug recently fixed in vnc code.

Re: [Qemu-devel] Re: Qemu-KVM Livate Migration 0.12.2 - 0.12.3/4 broken?

2010-05-12 Thread Peter Lieven
Hi, I can confirm that reverting this patch makes Live Migration from 0.12.2 to 0.12.4 again possible. Br, Peter Juan Quintela wrote: Peter Lieven p...@dlh.net wrote: Hi Qemu/KVM Devel Team, Live Migration from a 0.12.2 qemu-kvm to a 0.12.3 (and 0.12.4) does not work: load of migration

[PATCH 1/2] test: Add test for sub acc,imm

2010-05-12 Thread Mohammed Gamal
Adds tests fot sub acc, imm Signed-off-by: Mohammed Gamal m.gamal...@gmail.com --- kvm/user/test/x86/realmode.c | 44 ++ 1 files changed, 44 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/realmode.c b/kvm/user/test/x86/realmode.c index

Re: [Qemu-devel] [RFC PATCH 1/2] close all the block drivers before the qemu process exits

2010-05-12 Thread Christoph Hellwig
On Wed, May 12, 2010 at 07:46:52PM +0900, MORITA Kazutaka wrote: This patch calls the close handler of the block driver before the qemu process exits. This is necessary because the sheepdog block driver releases the lock of VM images in the close handler. Signed-off-by: MORITA Kazutaka

Re: Another SIGFPE in display code, now in cirrus

2010-05-12 Thread Avi Kivity
On 05/12/2010 04:45 PM, Stefano Stabellini wrote: Note it's just during mode changes. During normal operation I'm sure the pitches are equal. The source blt pitch as set by the driver is always equal to the display pitch (apart from the case reported above). However

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

2010-05-12 Thread Cam Macdonell
On Tue, May 11, 2010 at 12:13 PM, Avi Kivity a...@redhat.com wrote: On 05/11/2010 08:05 PM, Anthony Liguori wrote: On 05/11/2010 11:39 AM, Cam Macdonell wrote: Most of the people I hear from who are using my patch are using a peer model to share data between applications (simulations, JVMs,

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

2010-05-12 Thread Avi Kivity
On 05/10/2010 07:48 PM, Cam Macdonell wrote: On Mon, May 10, 2010 at 10:40 AM, Avi Kivitya...@redhat.com wrote: On 05/10/2010 06:41 PM, Cam Macdonell wrote: What would happen to any data written to the BAR before the the handshake completed? I think it would disappear.

Re: Another SIGFPE in display code, now in cirrus

2010-05-12 Thread Stefano Stabellini
On Wed, 12 May 2010, Avi Kivity wrote: I suggest to start using the display pitch (with the proper sign) instead of cirrus_blt_srcpitch in cirrus_do_copy at least when cirrus_blt_srcpitch doesn't have a proper value. Why switch from one bug to the other? It's perfectly possible

Re: Another SIGFPE in display code, now in cirrus

2010-05-12 Thread Avi Kivity
On 05/12/2010 06:57 PM, Stefano Stabellini wrote: On Wed, 12 May 2010, Avi Kivity wrote: I suggest to start using the display pitch (with the proper sign) instead of cirrus_blt_srcpitch in cirrus_do_copy at least when cirrus_blt_srcpitch doesn't have a proper value. Why switch

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

2010-05-12 Thread Cam Macdonell
On Wed, May 12, 2010 at 9:49 AM, Avi Kivity a...@redhat.com wrote: On 05/10/2010 07:48 PM, Cam Macdonell wrote: On Mon, May 10, 2010 at 10:40 AM, Avi Kivitya...@redhat.com  wrote: On 05/10/2010 06:41 PM, Cam Macdonell wrote: What would happen to any data written to the BAR before the

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

2010-05-12 Thread Avi Kivity
On 05/12/2010 07:14 PM, Cam Macdonell wrote: Why can't we complete initialization before exposing the card and BAR? Seems to be the simplest solution. Looking at it more closely, you're right, the fds for shared memory/eventfds are received in a fraction of a second, so that's why I

Re: Another SIGFPE in display code, now in cirrus

2010-05-12 Thread Stefano Stabellini
On Wed, 12 May 2010, Avi Kivity wrote: I guess even a src blt pitch of 0 could be useful there, however in practice I think the only rop function that was written with this case in mind has: dstpitch -= bltwidth; srcpitch -= bltwidth; if (dstpitch 0 || srcpitch 0) { /* is

Re: [PATCH 0/9] pvclock misc fixes - v4.

2010-05-12 Thread Glauber Costa
On Wed, May 12, 2010 at 07:47:39AM +0200, Alexander Graf wrote: On 12.05.2010, at 05:33, Zachary Amsden wrote: On 05/11/2010 06:17 AM, Glauber Costa wrote: This is the fourth version ov kvmclock fixes. Just two minor changes in patch 5, per avi request, and the addition of

Re: [Qemu-devel] Re: Another SIGFPE in display code, now in cirrus

2010-05-12 Thread Jamie Lokier
Stefano Stabellini wrote: On Wed, 12 May 2010, Avi Kivity wrote: It's useful if you have a one-line horizontal pattern you want to propagate all over. It might be useful all right, but it is not entirely clear what the hardware should do in this situation from the documentation we have,

Re: [Qemu-devel] Re: Another SIGFPE in display code, now in cirrus

2010-05-12 Thread Stefano Stabellini
On Wed, 12 May 2010, Jamie Lokier wrote: Stefano Stabellini wrote: On Wed, 12 May 2010, Avi Kivity wrote: It's useful if you have a one-line horizontal pattern you want to propagate all over. It might be useful all right, but it is not entirely clear what the hardware should do

Re: [Qemu-devel] Re: Another SIGFPE in display code, now in cirrus

2010-05-12 Thread Michael Tokarev
12.05.2010 22:11, Stefano Stabellini wrote: On Wed, 12 May 2010, Jamie Lokier wrote: Stefano Stabellini wrote: On Wed, 12 May 2010, Avi Kivity wrote: It's useful if you have a one-line horizontal pattern you want to propagate all over. It might be useful all right, but it is not entirely

Re: [RFC PATCH] sysfs: bin_attr permission checking

2010-05-12 Thread Greg KH
On Wed, May 12, 2010 at 11:47:13AM -0700, Chris Wright wrote: The PCI config space bin_attr read handler has a hardcoded CAP_SYS_ADMIN check to verify privileges before allowing a user to read device dependent config space. This is meant to protect from an unprivileged user potentially

Re: [RFC PATCH] sysfs: bin_attr permission checking

2010-05-12 Thread Greg KH
On Wed, May 12, 2010 at 12:28:28PM -0700, Chris Wright wrote: * Greg KH (g...@kroah.com) wrote: On Wed, May 12, 2010 at 11:47:13AM -0700, Chris Wright wrote: The PCI config space bin_attr read handler has a hardcoded CAP_SYS_ADMIN check to verify privileges before allowing a user to read

Re: [RFC PATCH] sysfs: bin_attr permission checking

2010-05-12 Thread Chris Wright
* Greg KH (g...@kroah.com) wrote: On Wed, May 12, 2010 at 12:28:28PM -0700, Chris Wright wrote: * Greg KH (g...@kroah.com) wrote: On Wed, May 12, 2010 at 11:47:13AM -0700, Chris Wright wrote: The PCI config space bin_attr read handler has a hardcoded CAP_SYS_ADMIN check to verify

Re: 2.6.33.3: possible recursive locking detected

2010-05-12 Thread Greg KH
On Wed, May 12, 2010 at 12:34:20PM +0800, Américo Wang wrote: On Tue, May 11, 2010 at 08:03:20AM -0700, Greg KH wrote: On Tue, May 11, 2010 at 09:33:50PM +1000, CaT wrote: On Wed, May 05, 2010 at 10:52:50AM +0800, Américo Wang wrote: On Wed, May 5, 2010 at 10:32 AM, Yong Zhang

Re: [PATCH] device-assignment: fix failure to exit on shared IRQ

2010-05-12 Thread Chris Wright
* Alex Williamson (alex.william...@redhat.com) wrote: Since c1699988, piix config space isn't programmed until the first system reset. This means that when we call assign_irq() from assigned_initfn(), we're going to get back an irq of 0x0, which unfortunately matches our initialization value,

Re: [Qemu-devel] [RFC PATCH 1/2] close all the block drivers before the qemu process exits

2010-05-12 Thread MORITA Kazutaka
On 2010/05/12 23:01, Christoph Hellwig wrote: On Wed, May 12, 2010 at 07:46:52PM +0900, MORITA Kazutaka wrote: This patch calls the close handler of the block driver before the qemu process exits. This is necessary because the sheepdog block driver releases the lock of VM images in the close

Re: [PATCH] KVM: x86: Call vcpu_load and vcpu_put in cpuid_update.

2010-05-12 Thread Marcelo Tosatti
On Tue, May 11, 2010 at 06:21:33PM +0800, Xu, Dongxiao wrote: From: Dongxiao Xu dongxiao...@intel.com cpuid_update may operate VMCS, so vcpu_load() and vcpu_put() should be called to ensure correctness. Signed-off-by: Dongxiao Xu dongxiao...@intel.com --- arch/x86/kvm/x86.c |4

Re: [PATCH] KVM: VMX: blocked-by-sti must not defer NMI injections

2010-05-12 Thread Marcelo Tosatti
On Tue, May 11, 2010 at 03:16:46PM +0200, Jan Kiszka wrote: As the processor may not consider GUEST_INTR_STATE_STI as a reason for blocking NMI, it could return immediately with EXIT_REASON_NMI_WINDOW when we asked for it. But as we consider this state as NMI-blocking, we can run into an

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

2010-05-12 Thread Marcelo Tosatti
On Wed, May 12, 2010 at 02:13:26PM +0800, Xu, Dongxiao wrote: - ept_sync_global(); + if (vmm_exclusive) { + kvm_cpu_vmxon(phys_addr); + ept_sync_global(); + } return 0; The documentation recommends usage of INVEPT all-context after execution of VMXON

Re: [RFC PATCH 1/2] close all the block drivers before the qemu process exits

2010-05-12 Thread MORITA Kazutaka
On 2010/05/12 23:28, Avi Kivity wrote: On 05/12/2010 01:46 PM, MORITA Kazutaka wrote: This patch calls the close handler of the block driver before the qemu process exits. This is necessary because the sheepdog block driver releases the lock of VM images in the close handler. How do

Re: [Qemu-devel] [RFC PATCH 0/2] Sheepdog: distributed storage system for QEMU

2010-05-12 Thread MORITA Kazutaka
On 2010/05/12 20:38, Kevin Wolf wrote: Am 12.05.2010 12:46, schrieb MORITA Kazutaka: Hi all, This patch adds a block driver for Sheepdog distributed storage system. Please consider for inclusion. Sheepdog is a distributed storage system for QEMU. It provides highly available block level

Re: [PATCH 0/9] pvclock misc fixes - v4.

2010-05-12 Thread Marcelo Tosatti
On Tue, May 11, 2010 at 12:17:38PM -0400, Glauber Costa wrote: This is the fourth version ov kvmclock fixes. Just two minor changes in patch 5, per avi request, and the addition of cpuid.txt file, documenting all cpuid flags we use. As a side effect, this patch removes the time-travel

Re: Keep index within boundaries in kvmppc_44x_emul_tlbwe()

2010-05-12 Thread Marcelo Tosatti
On Tue, May 11, 2010 at 01:10:49AM +0200, Alexander Graf wrote: On 11.05.2010, at 00:58, Hollis Blanchard wrote: On Sun, May 9, 2010 at 8:26 AM, Roel Kluin roel.kl...@gmail.com wrote: An index of KVM44x_GUEST_TLB_SIZE is already one too large. Signed-off-by: Roel Kluin

[PATCH 08/12] move stop/stopped CPU_COMMON fields after area zeroed by reset

2010-05-12 Thread Marcelo Tosatti
cpu_reset zeroes CPUState upto breakpoints member. Contents of stop/stopped should not be zeroed on cpu_reset. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com --- cpu-defs.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 10/12] kvm: enable smp 1

2010-05-12 Thread Marcelo Tosatti
Process INIT/SIPI requests and enable -smp 1. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com --- kvm-all.c | 10 +- kvm.h |2 ++ target-i386/kvm.c | 16 target-ppc/kvm.c |5 +

[PATCH 05/12] port qemu-kvm's on_vcpu code

2010-05-12 Thread Marcelo Tosatti
run_on_cpu allows to execute work on a given CPUState context. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com --- cpu-all.h |1 + cpu-defs.h|2 ++ cpus.c| 53 +

[PATCH 09/12] kvm: validate context for kvm cpu get/put operations

2010-05-12 Thread Marcelo Tosatti
From: Jan Kiszka jan.kis...@siemens.com Validate that KVM vcpu state is only read/written from cpu thread itself or that cpu is stopped. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com --- target-i386/kvm.c |4 1 files changed, 4

[PATCH 03/12] make SIG_IPI to tcg vcpu thread reliable

2010-05-12 Thread Marcelo Tosatti
Store tcg loop exit request on a global variable, and transfer it to per-CPUState exit_request after assignment of cpu_single_env. This makes exit request signal from robust. Drop the timedlock hack. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com ---

[PATCH 00/12] [PULL] qemu-kvm.git uq/master queue

2010-05-12 Thread Marcelo Tosatti
The following changes since commit 54d7cf136f040713095cbc064f62d753bff6f9d2: Markus Armbruster (1): doc: Clean up monitor command function index are available in the git repository at: git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git uq/master Gleb Natapov (2): Do not stop

[PATCH 01/12] Fix -mem-path with hugetlbfs

2010-05-12 Thread Marcelo Tosatti
Fallback to qemu_vmalloc in case file_ram_alloc fails. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com --- exec.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index 3416aed..56b5561 100644 ---

[PATCH 12/12] kvm: fix 80000001.EDX supported bit filtering

2010-05-12 Thread Marcelo Tosatti
From: Gleb Natapov g...@redhat.com On AMD some bits from 1.EDX are reported in 8001.EDX. The mask used to copy bits from 1.EDX to 8001.EDX is incorrect resulting in unsupported features passed into a guest. Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Marcelo Tosatti

[PATCH 06/12] kvm: synchronize state from cpu context

2010-05-12 Thread Marcelo Tosatti
From: Jan Kiszka jan.kis...@siemens.com 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. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity

[PATCH 07/12] add cpu_is_stopped helper

2010-05-12 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com --- cpu-all.h |1 + cpus.c|5 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/cpu-all.h b/cpu-all.h index 9efb8a9..47a5722 100644 --- a/cpu-all.h +++ b/cpu-all.h @@ -821,6

[PATCH 02/12] kvm: set cpu_single_env around KVM_RUN ioctl

2010-05-12 Thread Marcelo Tosatti
Zero cpu_single_env before leaving global lock protection, and restore on return. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com --- kvm-all.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index

[PATCH 04/12] standardize on qemu_cpu_kick for signalling cpu thread(s)

2010-05-12 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com --- cpus.c |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cpus.c b/cpus.c index 53226b3..5afdb4a 100644 --- a/cpus.c +++ b/cpus.c @@ -454,8 +454,7 @@ void

[PATCH 11/12] Do not stop VM if emulation failed in userspace.

2010-05-12 Thread Marcelo Tosatti
From: Gleb Natapov g...@redhat.com Continue vcpu execution in case emulation failure happened while vcpu was in userspace. In this case #UD will be injected into the guest allowing guest OS to kill offending process and continue. Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Marcelo

[PATCH] kvm: remove CAP_SYS_RAWIO requirement from kvm_vm_ioctl_assign_irq

2010-05-12 Thread Alex Williamson
Remove this check in an effort to allow kvm guests to run without root privileges. This capability check doesn't seem to add any security since the device needs to have already been added via the assign device ioctl and the io actually occurs through the pci sysfs interface. Signed-off-by: Alex

Re: [Autotest] [KVM_AUTOTEST][PATCH] KSM_overcommit: dynamic reserve calculation (2)

2010-05-12 Thread Lucas Meneghel Rodrigues
Hi Lukas and Jiri - please hold on, cause this week I'm on vacation, will be back next week and will finish work on your patchset. Cheers, On Sat, May 8, 2010 at 2:01 PM, Lukas Doktor ldok...@redhat.com wrote: Hi, thanks for nice page about git workflow. I always wanted to try it but never

Re: [Autotest] [PATCH v2 01/10] KVM test: Introduce prompt assist

2010-05-12 Thread Lucas Meneghel Rodrigues
Hi Jason, just hold on cause next week I'm back and will finish work on your patchset. Cheers, On Tue, May 11, 2010 at 6:03 AM, Jason Wang jasow...@redhat.com wrote: We need to send an assist string to a session in order to get the prompt when re-connecting to session through serial. This

Re: [Autotest] [PATCH 2/2] KVM test: Support to SLES install

2010-05-12 Thread Lucas Meneghel Rodrigues
On Mon, May 10, 2010 at 7:27 AM, pradeepkumar psuri...@linux.vnet.ibm.com wrote: On Wed, 10 Mar 2010 08:45:59 -0300 Lucas Meneghel Rodrigues l...@redhat.com wrote: Hi Yogi/Lucas Thanks for including SLES guests support in KVM autotest. I tried SLES guest install. After succsfull install of

[PATCH 1/5] KVM MMU: fix objects free

2010-05-12 Thread Xiao Guangrong
Where to alloc, where to free Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 18 ++ 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 604eb3f..67da751 100644 ---

[PATCH 2/5] KVM MMU: remove rmap before clear spte

2010-05-12 Thread Xiao Guangrong
Remove rmap before clear spte otherwise it will trigger BUG_ON() in some functions such as rmap_write_protect() Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/mmu.c

[PATCH 3/5] KVM MMU: fix for got gfn when sync shadow pages

2010-05-12 Thread Xiao Guangrong
sp-gfns[] are not mapping gfn since it has cooked by unalias_gfn() Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/paging_tmpl.h |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h

[PATCH 4/5] KVM MMU: fix two typos

2010-05-12 Thread Xiao Guangrong
fix two typos in next branch Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index a474d93..68f79b0 100644 --- a/arch/x86/kvm/mmu.c +++

[PATCH 2/2] pci: allow sysfs file owner to read device dependent config space

2010-05-12 Thread Chris Wright
The PCI config space bin_attr read handler has a hardcoded CAP_SYS_ADMIN check to verify privileges before allowing a user to read device dependent config space. This is meant to protect from an unprivileged user potentially locking up the box. When assigning a PCI device directly to a guest

Re: [RFC PATCH 1/2] close all the block drivers before the qemu process exits

2010-05-12 Thread MORITA Kazutaka
At Thu, 13 May 2010 05:16:35 +0900, MORITA Kazutaka wrote: On 2010/05/12 23:28, Avi Kivity wrote: On 05/12/2010 01:46 PM, MORITA Kazutaka wrote: This patch calls the close handler of the block driver before the qemu process exits. This is necessary because the sheepdog block driver

Re: [PATCH] VMX: Fix and improve guest state validity checks

2010-05-12 Thread Marcelo Tosatti
On Tue, May 11, 2010 at 07:52:41PM +0300, Mohammed Gamal wrote: - Add 's' and 'g' field checks on segment registers - Correct SS checks for request and descriptor privilege levels Signed-off-by: Mohammed Gamal m.gamal...@gmail.com --- arch/x86/kvm/vmx.c | 73

Re: [PATCH] x86 emulator: Add test acc, imm instruction (opcodes 0xA8 - 0xA9)

2010-05-12 Thread Marcelo Tosatti
On Tue, May 11, 2010 at 10:22:40PM +0300, Mohammed Gamal wrote: This adds test acc, imm instruction to the x86 emulator Signed-off-by: Mohammed Gamal m.gamal...@gmail.com --- arch/x86/kvm/emulate.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) Applied, thanks. -- To

Migration failure from AMD to Intel

2010-05-12 Thread Tomoe Sugihara
Hi, Does anyone have any idea on a issue that I have regarding VM migration from AMD to Intel host? When the guest is migrated from AMD host and right after it starts on Intel host, qemu process crashes with log messages like below. Looks like, when the guest is loaded on its network, it is

Re: [PATCH] KVM: Don't allow lmsw to clear cr0.pe

2010-05-12 Thread Marcelo Tosatti
On Wed, May 12, 2010 at 12:28:44AM +0300, Avi Kivity wrote: The current lmsw implementation allows the guest to clear cr0.pe, contrary to the manual, which breaks EMM386.EXE. Fix by ORing the old cr0.pe with lmsw's operand. Signed-off-by: Avi Kivity a...@redhat.com ---

Re: [RFC][PATCH 11/12] KVM: introduce new API for getting/switching dirty bitmaps

2010-05-12 Thread Takuya Yoshikawa
One alternative would be: KVM_SWITCH_DIRTY_LOG passing the address of a bitmap. If the active bitmap was clean, it returns 0, no switch performed. If the active bitmap was dirty, the kernel switches to the new bitmap and returns 1. And the responsability of cleaning the new bitmap could also

Re: [RFC][PATCH 0/12] KVM, x86, ppc, asm-generic: moving dirty bitmaps to user space

2010-05-12 Thread Takuya Yoshikawa
[To ppc people] Hi, Benjamin, Paul, Alex, Please see the patches 6,7/12. I first say sorry for that I've not tested these yet. In that sense, these may not be in the quality for precise reviews. But I will be happy if you would give me any comments. Alex, could you help me? Though I have a

Re: [RFC][PATCH 7/12 not tested yet] PPC: introduce __set_bit() like function for bitmaps in user space

2010-05-12 Thread Takuya Yoshikawa
+static inline int set_bit_user_non_atomic(int nr, void __user *addr) +{ + u8 __user *p; + u8 val; + + p = (u8 __user *)((unsigned long)addr + nr / BITS_PER_BYTE); Does C do the + or the / first? Either way, I'd like to see brackets here :) OK, I'll change like that! I

Re: Keep index within boundaries in kvmppc_44x_emul_tlbwe()

2010-05-12 Thread Marcelo Tosatti
On Tue, May 11, 2010 at 01:10:49AM +0200, Alexander Graf wrote: On 11.05.2010, at 00:58, Hollis Blanchard wrote: On Sun, May 9, 2010 at 8:26 AM, Roel Kluin roel.kl...@gmail.com wrote: An index of KVM44x_GUEST_TLB_SIZE is already one too large. Signed-off-by: Roel Kluin

  1   2   >