[COMMIT master] Fix segfault after device assignment hot remove

2010-05-16 Thread Avi Kivity
From: Alex Williamson alex.william...@redhat.com 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

[COMMIT master] turn off kvmclock when resetting cpu

2010-05-16 Thread Avi Kivity
From: Glauber Costa glom...@redhat.com Currently, in the linux kernel, we reset kvmclock if we are rebooting into a crash kernel through kexec. The rationale, is that a new kernel won't follow the same memory addresses, and the memory where kvmclock is located in the first kernel, will be

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

2010-05-16 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com 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 +++

[COMMIT master] test: Add test for xor acc, imm

2010-05-16 Thread Avi Kivity
From: Mohammed Gamal m.gamal...@gmail.com Adds test for xor acc, imm Signed-off-by: Mohammed Gamal m.gamal...@gmail.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/user/test/x86/realmode.c b/kvm/user/test/x86/realmode.c index 41e2aea..70a1e05 100644 ---

[COMMIT master] device-assignment: fix failure to exit on shared IRQ

2010-05-16 Thread Avi Kivity
From: Alex Williamson alex.william...@redhat.com 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, so we

[COMMIT master] test: Add test for sub acc,imm

2010-05-16 Thread Avi Kivity
From: Mohammed Gamal m.gamal...@gmail.com Adds tests fot sub acc, imm Signed-off-by: Mohammed Gamal m.gamal...@gmail.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/user/test/x86/realmode.c b/kvm/user/test/x86/realmode.c index bc4ed97..41e2aea 100644 ---

[COMMIT master] KVM: update mmu documetation for role.nxe

2010-05-16 Thread Avi Kivity
From: Gui Jianfeng guijianf...@cn.fujitsu.com There's no member cr4_nxe in struct kvm_mmu_page_role, it names nxe now. Update mmu document. Signed-off-by: Gui Jianfeng guijianf...@cn.fujitsu.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/Documentation/kvm/mmu.txt

[COMMIT master] KVM: x86: Call vcpu_load and vcpu_put in cpuid_update

2010-05-16 Thread Avi Kivity
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 Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c

[COMMIT master] Merge remote branch 'tip/x86/fpu'

2010-05-16 Thread Avi Kivity
From: Marcelo Tosatti mtosa...@redhat.com Conflicts: arch/x86/kernel/process.c Signed-off-by: Marcelo Tosatti mtosa...@redhat.com -- To unsubscribe from this list: send the line unsubscribe kvm-commits in the body of a message to majord...@vger.kernel.org More majordomo info at

[COMMIT master] KVM: VMX: blocked-by-sti must not defer NMI injections

2010-05-16 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com 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 endless loop. Resolve this

[COMMIT master] KVM: VMX: Define new functions to wrapper direct call of asm code

2010-05-16 Thread Avi Kivity
From: Dongxiao Xu dongxiao...@intel.com 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 dongxiao...@intel.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git

[COMMIT master] KVM: x86: add new KVMCLOCK cpuid feature

2010-05-16 Thread Avi Kivity
From: Glauber Costa glom...@redhat.com This cpuid, KVM_CPUID_CLOCKSOURCE2, will indicate to the guest that kvmclock is available through a new set of MSRs. The old ones are deprecated. Signed-off-by: Glauber Costa glom...@redhat.com Acked-by: Zachary Amsden zams...@redhat.com Signed-off-by:

[COMMIT master] KVM: VMX: VMCLEAR/VMPTRLD usage changes

2010-05-16 Thread Avi Kivity
From: Dongxiao Xu dongxiao...@intel.com 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

[COMMIT master] Enable pvclock flags in vcpu_time_info structure

2010-05-16 Thread Avi Kivity
From: Glauber Costa glom...@redhat.com This patch removes one padding byte and transform it into a flags field. New versions of guests using pvclock will query these flags upon each read. Flags, however, will only be interpreted when the guest decides to. It uses the pvclock_valid_flags function

[COMMIT master] don't compute pvclock adjustments if we trust the tsc

2010-05-16 Thread Avi Kivity
From: Glauber Costa glom...@redhat.com If the HV told us we can fully trust the TSC, skip any correction Signed-off-by: Glauber Costa glom...@redhat.com Acked-by: Zachary Amsden zams...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/include/asm/kvm_para.h

[COMMIT master] KVM: VMX: VMXON/VMXOFF usage changes

2010-05-16 Thread Avi Kivity
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 before any VMCS operation, and then call VMXOFF after the operation is done.

[COMMIT master] Add a global synchronization point for pvclock

2010-05-16 Thread Avi Kivity
From: Glauber Costa glom...@redhat.com In recent stress tests, it was found that pvclock-based systems could seriously warp in smp systems. Using ingo's time-warp-test.c, I could trigger a scenario as bad as 1.5mi warps a minute in some systems. (to be fair, it wasn't that bad in most of them).

[COMMIT master] KVM: x86: export paravirtual cpuid flags in KVM_GET_SUPPORTED_CPUID

2010-05-16 Thread Avi Kivity
From: Glauber Costa glom...@redhat.com Right now, we were using individual KVM_CAP entities to communicate userspace about which cpuids we support. This is suboptimal, since it generates a delay between the feature arriving in the host, and being available at the guest. A much better mechanism

[COMMIT master] KVM: x86 emulator: Add missing decoder flags for sub instruction

2010-05-16 Thread Avi Kivity
From: Mohammed Gamal m.gamal...@gmail.com This adds missing decoder flags for sub instructions (opcodes 0x2c - 0x2d) Signed-off-by: Mohammed Gamal m.gamal...@gmail.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index

[COMMIT master] Fix tip/x86/fpu merge

2010-05-16 Thread Avi Kivity
From: Marcelo Tosatti mtosa...@redhat.com Code removed upstream sneaked in through the merge. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 83ccfdf..8bcc21f 100644 --- a/arch/x86/kernel/process.c +++

[COMMIT master] KVM: Add cpuid.txt file

2010-05-16 Thread Avi Kivity
From: Glauber Costa glom...@redhat.com This file documents cpuid bits used by KVM. Signed-off-by: Glauber Costa glom...@redhat.com Acked-by: Zachary Amsden zams...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/Documentation/kvm/cpuid.txt

[COMMIT master] KVM: VMX: Only reset MMU when necessary

2010-05-16 Thread Avi Kivity
From: Sheng Yang sh...@linux.intel.com 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 Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/x86.c

[COMMIT master] KVM: x86 emulator: Add test acc, imm instruction (opcodes 0xA8 - 0xA9)

2010-05-16 Thread Avi Kivity
From: Mohammed Gamal m.gamal...@gmail.com This adds test acc, imm instruction to the x86 emulator Signed-off-by: Mohammed Gamal m.gamal...@gmail.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index b43ac98..35dd57c 100644 ---

[COMMIT master] KVM: Don't allow lmsw to clear cr0.pe

2010-05-16 Thread Avi Kivity
From: Avi Kivity a...@redhat.com 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 Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff

[COMMIT master] KVM: MMU: use proper cache object freeing function

2010-05-16 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Use kmem_cache_free to free objects allocated by kmem_cache_alloc. Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index

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

2010-05-16 Thread Avi Kivity
From: Avi Kivity a...@redhat.com 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

[COMMIT master] KVM: MMU: unalias gfn before sp-gfns[] comparison in sync_page

2010-05-16 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com sp-gfns[] contain unaliased gfns, but gpte might contain pointer to aliased region. Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/paging_tmpl.h

[COMMIT master] KVM: x86: Clean up duplicate assignment

2010-05-16 Thread Avi Kivity
From: Sheng Yang sh...@linux.intel.com 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

[COMMIT master] KVM: PPC: Add missing vcpu_load()/vcpu_put() in vcpu ioctls

2010-05-16 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index 11f226f..b998abf 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c @@ -1110,6 +1110,8 @@ int

[COMMIT master] KVM: s390: Centrally lock arch specific vcpu ioctls

2010-05-16 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index e80f55e..28cd8fd 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -363,9 +363,7 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu

[COMMIT master] KVM: x86: Add missing locking to arch specific vcpu ioctls

2010-05-16 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index bfe0730..7167109 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1854,6 +1854,7 @@ static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu, {

[COMMIT master] KVM: pass correct parameter to kvm_mmu_free_some_pages

2010-05-16 Thread Avi Kivity
From: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 604eb3f..fd2c8f4 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2067,7 +2067,7 @@ static int mmu_alloc_roots(struct kvm_vcpu

[COMMIT master] KVM: x86: Check LMA bit before set_efer

2010-05-16 Thread Avi Kivity
From: Sheng Yang sh...@linux.intel.com 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 Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c

[COMMIT master] KVM: x86: Lock arch specific vcpu ioctls centrally

2010-05-16 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 75a6e8a..ce4e943 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1541,16 +1541,12 @@ static int __msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs

[COMMIT master] KVM: remove CAP_SYS_RAWIO requirement from kvm_vm_ioctl_assign_irq

2010-05-16 Thread Avi Kivity
From: Alex Williamson alex.william...@redhat.com 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

[COMMIT master] KVM: x86: cleanup unused local variable

2010-05-16 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com fix: arch/x86/kvm/x86.c: In function ‘handle_emulation_failure’: arch/x86/kvm/x86.c:3844: warning: unused variable ‘ctxt’ Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git

[COMMIT master] KVM: Consolidate arch specific vcpu ioctl locking

2010-05-16 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Now that all arch specific ioctls have centralized locking, it is easy to move it to the central dispatcher. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index caeed7b..a1d8750 100644 ---

Re: [PATCH 0/7] Consolidate vcpu ioctl locking

2010-05-16 Thread Avi Kivity
On 05/16/2010 04:00 AM, Alexander Graf wrote: On 15.05.2010, at 19:30, Avi Kivity wrote: On 05/15/2010 11:26 AM, Alexander Graf wrote: That means you never inject an interrupt from the iothread (or from a different vcpu thread)? If that's the case we might make it part of

Re: [SeaBIOS] [PATCHv2] Support for booting from virtio disks

2010-05-16 Thread Gleb Natapov
On Thu, May 13, 2010 at 07:49:40PM +0300, Avi Kivity wrote: On 05/10/2010 06:58 PM, Anthony Liguori wrote: Isn't this problem unrelated to this patch? I mean if I start qemu with two ide devices can I specify from qemu command line which one I want to boot from? That's sort of what I'm

Re: [PATCH 0/7] Consolidate vcpu ioctl locking

2010-05-16 Thread Alexander Graf
On 16.05.2010, at 10:23, Avi Kivity wrote: On 05/16/2010 04:00 AM, Alexander Graf wrote: On 15.05.2010, at 19:30, Avi Kivity wrote: On 05/15/2010 11:26 AM, Alexander Graf wrote: That means you never inject an interrupt from the iothread (or from a different vcpu

Re: [PATCH 0/7] Consolidate vcpu ioctl locking

2010-05-16 Thread Avi Kivity
On 05/16/2010 12:01 PM, Alexander Graf wrote: That's what the world looked like in 2006. We could change it, but there's not much point, since having the local apic in the kernel is pretty much a requirement for reasonable performance. Well, I'm not convinced yet that's the case for

Re: [PATCH 0/7] Consolidate vcpu ioctl locking

2010-05-16 Thread Alexander Graf
On 16.05.2010, at 11:09, Avi Kivity wrote: On 05/16/2010 12:01 PM, Alexander Graf wrote: That's what the world looked like in 2006. We could change it, but there's not much point, since having the local apic in the kernel is pretty much a requirement for reasonable performance.

Re: [PATCH 0/7] Consolidate vcpu ioctl locking

2010-05-16 Thread Avi Kivity
On 05/16/2010 12:35 PM, Alexander Graf wrote: So let me think this through. With remote interrupt injection we have. * thread 1 does vcpu_run * thread 2 triggers KVM_INTERRUPT on fd * thread 2 signals thread 1 so we're sure the interrupt gets injected * thread 1 exits into qemu

Re: [PATCH 0/7] Consolidate vcpu ioctl locking

2010-05-16 Thread Alexander Graf
On 16.05.2010, at 11:47, Avi Kivity wrote: 1: vcpu_run 2: KVM_INTERRUPT 2k: sets flag, if msr.ee IPIs 1 or wakes up 1 if halted Doesn't that break when we have a while(1) loop in the guest with msr.ee=0 while no timer is scheduled on the host? But then again with msr.ee=0 we don't get

Re: [PATCH 3/7] KVM: move vcpu locking to dispatcher for generic vcpu ioctls

2010-05-16 Thread Avi Kivity
On 05/15/2010 03:03 AM, Marcelo Tosatti wrote: On Thu, May 13, 2010 at 02:17:35PM +0300, Avi Kivity wrote: All vcpu ioctls need to be locked, so instead of locking each one specifically we lock at the generic dispatcher. This patch only updates generic ioctls and leaves arch specific

Re: system_powerdown not working for qemu-kvm 0.12.4?

2010-05-16 Thread Avi Kivity
On 05/15/2010 04:19 AM, Teck Choon Giam wrote: Hi, Anyone encountered the same issue as me about system_powerdown no longer working since upgraded to qemu-kvm 0.12.4? Compared with what version? -- error compiling committee.c: too many arguments to function -- To unsubscribe from this

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

2010-05-16 Thread Avi Kivity
On 05/12/2010 02:11 AM, Juan Quintela wrote: Peter Lievenp...@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 failed Is there any way to find out, why exactly it fails? I have a lot of VMs running on

Re: kvm-intel does not load when Intel TXT is enabled

2010-05-16 Thread Avi Kivity
On 05/14/2010 09:24 PM, Andrej Podzimek wrote: Hello, when I enable Intel TXT (Trusted Execution Technology) in the BIOS settings of my Lenovo W510, the kvm-intel module does not load and says 'kvm: disabled by bios', despite the fact that both VT-x and VT-d are enabled. Disabling TXT

Re: [PATCH 1/2] [block]: Fix scsi-generic breakage in find_image_format()

2010-05-16 Thread Christoph Hellwig
On Sat, May 15, 2010 at 06:30:52AM -0700, Nicholas A. Bellinger wrote: From: Nicholas Bellinger n...@linux-iscsi.org This patch adds a special BlockDriverState-sg check in block.c:find_image_format() after bdrv_file_open() - block/raw-posix.c:hdev_open() has been called to determine if

Re: [PATCH 2/2] [block]: Skip refresh_total_sectors() for scsi-generic devices

2010-05-16 Thread Christoph Hellwig
On Sat, May 15, 2010 at 06:30:59AM -0700, Nicholas A. Bellinger wrote: From: Nicholas Bellinger n...@linux-iscsi.org This patch adds a BlockDriverState-sg check in block.c:bdrv_common_open() to skip the new refresh_total_sectors() call once we know we are working with a scsi-generic device.

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

2010-05-16 Thread Juan Quintela
Avi Kivity a...@redhat.com wrote: On 05/12/2010 02:11 AM, Juan Quintela wrote: Peter Lievenp...@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 failed Is there any way to find out, why exactly it

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

2010-05-16 Thread Avi Kivity
On 05/16/2010 05:42 PM, Juan Quintela wrote: Any idea why it fails? And how to fix it? Lack of proper subsections. IDE is something like: const VMStateDescription vmstate_ide_drive = { .version_id = 4, } static const VMStateDescription vmstate_bmdma = { .name = ide

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

2010-05-16 Thread Jan Kiszka
Juan Quintela wrote: Lack of proper subsections. IDE is something like: const VMStateDescription vmstate_ide_drive = { .version_id = 4, } static const VMStateDescription vmstate_bmdma = { .name = ide bmdma, .version_id = 4, ... } const VMStateDescription

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

2010-05-16 Thread Juan Quintela
Avi Kivity a...@redhat.com wrote: On 05/16/2010 05:42 PM, Juan Quintela wrote: Any idea why it fails? And how to fix it? Lack of proper subsections. IDE is something like: const VMStateDescription vmstate_ide_drive = { .version_id = 4, } static const

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

2010-05-16 Thread Juan Quintela
Jan Kiszka jan.kis...@web.de wrote: Juan Quintela wrote: Lack of proper subsections. IDE is something like: const VMStateDescription vmstate_ide_drive = { .version_id = 4, } static const VMStateDescription vmstate_bmdma = { .name = ide bmdma, .version_id = 4, ... }

Re: [PATCH 1/2] [block]: Fix scsi-generic breakage in find_image_format()

2010-05-16 Thread Nicholas A. Bellinger
On Sun, 2010-05-16 at 15:29 +0200, Christoph Hellwig wrote: On Sat, May 15, 2010 at 06:30:52AM -0700, Nicholas A. Bellinger wrote: From: Nicholas Bellinger n...@linux-iscsi.org This patch adds a special BlockDriverState-sg check in block.c:find_image_format() after bdrv_file_open() -

Re: [PATCH 2/2] [block]: Skip refresh_total_sectors() for scsi-generic devices

2010-05-16 Thread Nicholas A. Bellinger
On Sun, 2010-05-16 at 15:30 +0200, Christoph Hellwig wrote: On Sat, May 15, 2010 at 06:30:59AM -0700, Nicholas A. Bellinger wrote: From: Nicholas Bellinger n...@linux-iscsi.org This patch adds a BlockDriverState-sg check in block.c:bdrv_common_open() to skip the new

[PATCH 0/2] Fix scsi-generic breakage in upstream qemu-kvm.git

2010-05-16 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org Greetings, Attached are the updated patches following hch's comments to fix scsi-generic device breakage with find_image_format() and refresh_total_sectors(). These are being resent as the last attachments where in MBOX format from

[PATCH 2/2] [block]: Add SG_IO device check in refresh_total_sectors()

2010-05-16 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch adds a special case check for scsi-generic devices in refresh_total_sectors() to skip the subsequent BlockDriver-bdrv_getlength() that will be returning -ESPIPE from block/raw-posic.c:raw_getlength() for BlockDriverState-sg=1 devices.

[PATCH 1/2] [block]: Make find_image_format() return 'raw' BlockDriver for SG_IO devices

2010-05-16 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch adds a special BlockDriverState-sg check in block.c:find_image_format() after bdrv_file_open() - block/raw-posix.c:hdev_open() has been called to determine if we are dealing with a Linux host scsi-generic device. The patch then returns

Re: [PATCH 0/7] Consolidate vcpu ioctl locking

2010-05-16 Thread Avi Kivity
On 05/16/2010 04:00 AM, Alexander Graf wrote: On 15.05.2010, at 19:30, Avi Kivity wrote: On 05/15/2010 11:26 AM, Alexander Graf wrote: That means you never inject an interrupt from the iothread (or from a different vcpu thread)? If that's the case we might make it part of

Re: [PATCH 0/7] Consolidate vcpu ioctl locking

2010-05-16 Thread Alexander Graf
On 16.05.2010, at 10:23, Avi Kivity wrote: On 05/16/2010 04:00 AM, Alexander Graf wrote: On 15.05.2010, at 19:30, Avi Kivity wrote: On 05/15/2010 11:26 AM, Alexander Graf wrote: That means you never inject an interrupt from the iothread (or from a different vcpu

Re: [PATCH 0/7] Consolidate vcpu ioctl locking

2010-05-16 Thread Alexander Graf
On 16.05.2010, at 11:09, Avi Kivity wrote: On 05/16/2010 12:01 PM, Alexander Graf wrote: That's what the world looked like in 2006. We could change it, but there's not much point, since having the local apic in the kernel is pretty much a requirement for reasonable performance.

Re: [PATCH 0/7] Consolidate vcpu ioctl locking

2010-05-16 Thread Avi Kivity
On 05/16/2010 12:35 PM, Alexander Graf wrote: So let me think this through. With remote interrupt injection we have. * thread 1 does vcpu_run * thread 2 triggers KVM_INTERRUPT on fd * thread 2 signals thread 1 so we're sure the interrupt gets injected * thread 1 exits into qemu

Re: [PATCH 0/7] Consolidate vcpu ioctl locking

2010-05-16 Thread Alexander Graf
On 16.05.2010, at 11:47, Avi Kivity wrote: 1: vcpu_run 2: KVM_INTERRUPT 2k: sets flag, if msr.ee IPIs 1 or wakes up 1 if halted Doesn't that break when we have a while(1) loop in the guest with msr.ee=0 while no timer is scheduled on the host? But then again with msr.ee=0 we don't get