Re: [PATCH 2/5] exec.c: use refcnt to protect device during dispatching

2012-07-26 Thread Avi Kivity
On 07/26/2012 04:06 PM, liu ping fan wrote: On Wed, Jul 25, 2012 at 8:27 PM, Avi Kivity a...@redhat.com wrote: On 07/25/2012 01:58 PM, Avi Kivity wrote: while (len 0) { page = addr TARGET_PAGE_MASK; l = (page + TARGET_PAGE_SIZE) - addr; if (l len

Re: [PATCH 1/5] qom: adopt rwlock to protect accessing dev from removing it

2012-07-26 Thread Avi Kivity
On 07/26/2012 04:14 PM, liu ping fan wrote: From the description above, I don't see why it can't be a mutex. Searching in the device tree (or MemoryRegion view) can be often in parallel, especially in mmio-dispatch code path In mmio dispatch we have a pointer to the object, we don't need to

Re: [PATCH 1/5] qom: adopt rwlock to protect accessing dev from removing it

2012-07-26 Thread Avi Kivity
On 07/26/2012 04:21 PM, liu ping fan wrote: On Thu, Jul 26, 2012 at 9:15 PM, Avi Kivity a...@redhat.com wrote: On 07/26/2012 04:14 PM, liu ping fan wrote: From the description above, I don't see why it can't be a mutex. Searching in the device tree (or MemoryRegion view) can be often

Re: Can we force a KVM VCPU in Guest Mode to Exit to User Mode From User Mode ?

2012-07-26 Thread Avi Kivity
On 07/26/2012 04:39 PM, Mian M. Hamayun wrote: Can you share your reproducer? Actually its based on kvm-tool and I have integrated some code from qemu-kvm to add debug support to kvm-tool. I don't have a smaller example that could reproduce the same problem. Then there's probably a bug

Re: [kvm:auto-next 24/39] (.init.rodata+0x830): undefined reference to `x86_hyper_kvm'

2012-07-26 Thread Avi Kivity
On 07/26/2012 04:26 PM, Fengguang Wu wrote: Hi Raghavendra, Kernel build failed on tree: git://git.kernel.org/pub/scm/virt/kvm/kvm.git auto-next head: 12938728e8145ecd49dce97c52f10b713bcdfc94 commit: f2a743473194a1ad44a85f8b63aeef9d63e5bf47 [24/39] KVM: Add config to support ple or

Re: [kvm:auto-next 24/39] (.init.rodata+0x830): undefined reference to `x86_hyper_kvm'

2012-07-26 Thread Avi Kivity
On 07/26/2012 05:03 PM, Fengguang Wu wrote: Hi Avi, On Thu, Jul 26, 2012 at 04:58:35PM +0300, Avi Kivity wrote: On 07/26/2012 04:26 PM, Fengguang Wu wrote: Hi Raghavendra, Kernel build failed on tree: git://git.kernel.org/pub/scm/virt/kvm/kvm.git auto-next head

[PATCH 0/4] kvm_timer cleanup

2012-07-26 Thread Avi Kivity
While preparing to fix up KVM_REQ_PENDING_TIMERS, and looking for a bug that turned out not to exist, I cleaned up kvm_timer a little. Avi Kivity (4): KVM: Remove internal timer abstraction. KVM: Simplify kvm_timer KVM: Simplify kvm_pit_timer KVM: fold kvm_pit_timer into kvm_kpit_state

[PATCH 1/4] KVM: Remove internal timer abstraction

2012-07-26 Thread Avi Kivity
kvm_timer_fn(), the sole inhabitant of timer.c, is only used by lapic.c. Move it there to make it easier to hack on it. struct kvm_timer is a thin wrapper around hrtimer, and only adds obfuscation. Move near its two users (with different names) to prepare for simplification. Signed-off-by: Avi

[PATCH 2/4] KVM: Simplify kvm_timer

2012-07-26 Thread Avi Kivity
'reinject' is never initialized 't_ops' only serves as indirection to lapic_is_periodic; call that directly instead 'kvm' is never used 'vcpu' can be derived via container_of Remove these fields. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/lapic.c | 18 +- arch

[PATCH 3/4] KVM: Simplify kvm_pit_timer

2012-07-26 Thread Avi Kivity
'timer_mode_mask' is unused 'tscdeadline' is unused 't_ops' only adds needless indirection 'vcpu' is unused Remove. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/i8254.c | 14 +- arch/x86/kvm/i8254.h | 8 2 files changed, 1 insertion(+), 21 deletions(-) diff

[PATCH 4/4] KVM: fold kvm_pit_timer into kvm_kpit_state

2012-07-26 Thread Avi Kivity
One structure nests inside the other, providing no value at all. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/i8254.c | 52 +--- arch/x86/kvm/i8254.h | 14 +- arch/x86/kvm/x86.c | 2 +- 3 files changed, 31 insertions

Re: [RFC PATCH] vfio: VFIO PCI driver for Qemu

2012-07-26 Thread Avi Kivity
On 07/26/2012 05:56 PM, Alex Williamson wrote: Let's use the same syntax as for kvm device assignment. Then we can fall back on kvm when vfio is not available. We can also have an optional parameter kernel-driver to explicitly select vfio or kvm. This seems confusing to me, pci-assign

Re: [RFC PATCH] vfio: VFIO PCI driver for Qemu

2012-07-26 Thread Avi Kivity
On 07/26/2012 05:56 PM, Alex Williamson wrote: Both KVM and VFIO do strive to make the device in the guest look as much like it does on bare metal as possible, but we don't guarantee they're identical and we don't guarantee to match each other. btw, this is somewhat problematic, conceivably

Re: [Qemu-devel] [RFC PATCH] vfio: VFIO PCI driver for Qemu

2012-07-26 Thread Avi Kivity
On 07/25/2012 08:03 PM, Alex Williamson wrote: +/* + * Resource setup + */ +static void vfio_unmap_bar(VFIODevice *vdev, int nr) +{ +VFIOBAR *bar = vdev-bars[nr]; +uint64_t size; + +if (!memory_region_size(bar-mem)) { +return; +} + +size =

Re: [RFC PATCH] vfio: VFIO PCI driver for Qemu

2012-07-26 Thread Avi Kivity
On 07/26/2012 07:40 PM, Alex Williamson wrote: On Thu, 2012-07-26 at 19:06 +0300, Avi Kivity wrote: On 07/26/2012 05:56 PM, Alex Williamson wrote: Both KVM and VFIO do strive to make the device in the guest look as much like it does on bare metal as possible, but we don't guarantee

Re: [RFC PATCH] vfio: VFIO PCI driver for Qemu

2012-07-26 Thread Avi Kivity
On 07/26/2012 07:33 PM, Alex Williamson wrote: In the common case, on x86 (but I'm repeating myself), the iommu group includes just one device, yes? Could we make pci-stub an alias for the corresponding vfio steps? PCI bridges masking devices is not as uncommon as you'd like, that's

Re: + ppc-e500_tlb-memset-clears-nothing.patch added to -mm tree

2012-07-25 Thread Avi Kivity
: e500_tlb memset clears nothing Put the parameters the right way around Addresses https://bugzilla.kernel.org/show_bug.cgi?id=44031 Reported-by: David Binderman dcb...@hotmail.com Signed-off-by: Alan Cox a...@linux.intel.com Cc: Avi Kivity a...@redhat.com Cc: Marcelo Tosatti mtosa

Re: + ppc-e500_tlb-memset-clears-nothing.patch added to -mm tree

2012-07-25 Thread Avi Kivity
On 07/25/2012 12:00 PM, Alexander Graf wrote: On 25.07.2012, at 10:32, Avi Kivity a...@redhat.com wrote: On 07/25/2012 12:00 AM, a...@linux-foundation.org wrote: The patch titled Subject: ppc: e500_tlb memset clears nothing has been added to the -mm tree. Its filename is ppc

Re: + ppc-e500_tlb-memset-clears-nothing.patch added to -mm tree

2012-07-25 Thread Avi Kivity
On 07/25/2012 01:12 PM, Alan Cox wrote: I wonder how many such bugs a memzero()/bzero() will prevent. If the compiler-foo is possible with gcc then a 0 length constant memset warning and a warning if the set value is 255 would both probably be useful. It's pretty easy with BUILD_BUG_ON(),

Re: [PATCH 2/5] exec.c: use refcnt to protect device during dispatching

2012-07-25 Thread Avi Kivity
On 07/25/2012 06:31 AM, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com acquire device's refcnt with qemu_device_tree_mutex rwlock, so we can safely handle it when mmio dispatch. If in radix-tree, leaf is subpage, then move further step to acquire opaque which is the

Re: [PATCH 3/5] hotplug: introduce qdev_unplug_ack() to remove device from views

2012-07-25 Thread Avi Kivity
On 07/25/2012 06:31 AM, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com When guest confirm the removal of device, we should --unmap from MemoryRegion view --isolated from device tree view + +void qdev_unplug_ack(DeviceState *dev, Error **errp) +{ +

Re: [PATCH 2/5] exec.c: use refcnt to protect device during dispatching

2012-07-25 Thread Avi Kivity
On 07/25/2012 01:58 PM, Avi Kivity wrote: while (len 0) { page = addr TARGET_PAGE_MASK; l = (page + TARGET_PAGE_SIZE) - addr; if (l len) l = len; + +qemu_rwlock_rdlock_devtree(); section = phys_page_find(page

Re: [PATCH] tcm_vhost: Expose ABI version via VHOST_SCSI_GET_ABI_VERSION

2012-07-25 Thread Avi Kivity
On 07/24/2012 11:45 PM, Nicholas A. Bellinger wrote: diff --git a/drivers/vhost/tcm_vhost.h b/drivers/vhost/tcm_vhost.h index e942df9..3d5378f 100644 --- a/drivers/vhost/tcm_vhost.h +++ b/drivers/vhost/tcm_vhost.h @@ -80,7 +80,17 @@ struct tcm_vhost_tport { #include linux/vhost.h

Re: [RFC PATCH] vfio: VFIO PCI driver for Qemu

2012-07-25 Thread Avi Kivity
On 07/25/2012 08:03 PM, Alex Williamson wrote: This adds PCI based device assignment to Qemu using the Linux VFIO userspace driver interface. After setting up VFIO device access, devices can be added to Qemu guests using the vfio-pci device option: -device vfio-pci,host=1:10.1,id=net0

Re: [PATCH] kvm: Move kvm_allows_irq0_override() to target-i386

2012-07-24 Thread Avi Kivity
On 07/23/2012 08:58 PM, Peter Maydell wrote: On 23 July 2012 15:30, Avi Kivity a...@redhat.com wrote: But I was only joking. Nested virtualization is interesting technically but so far I haven't seen any huge or even small uptake. Yes; that (as I understand it) is why it wasn't an expected

Re: [PATCH] kvm: Move kvm_allows_irq0_override() to target-i386

2012-07-24 Thread Avi Kivity
On 07/23/2012 06:19 PM, Peter Maydell wrote: On 23 July 2012 13:26, Avi Kivity a...@redhat.com wrote: On 07/21/2012 11:54 AM, Peter Maydell wrote: The reason I want to get rid of common-code uses of kvm_irqchip_in_kernel() is because I think they're all similar to this -- the common code

[GIT PULL] KVM updates for the 3.6 merge window

2012-07-23 Thread Avi Kivity
Avi Kivity (31): KVM: ia64: Mark ia64 KVM as BROKEN Merge branch 'for-upstream' of git://github.com/agraf/linux-2.6 into next KVM: MMU: Force cr3 reload with two dimensional paging on mov cr3 emulation KVM: VMX: Return correct

Re: [PATCH RFC V5 0/3] kvm: Improving directed yield in PLE handler

2012-07-23 Thread Avi Kivity
On 07/18/2012 04:37 PM, Raghavendra K T wrote: Currently Pause Loop Exit (PLE) handler is doing directed yield to a random vcpu on pl-exit. We already have filtering while choosing the candidate to yield_to. This change adds more checks while choosing a candidate to yield_to. On a large

Re: [PATCH] kvm: Move kvm_allows_irq0_override() to target-i386

2012-07-23 Thread Avi Kivity
On 07/23/2012 03:04 PM, Cornelia Huck wrote: OK, so I was reading through this thread since I want to add irqfd support for s390, but we don't have any kind of irqchip. The understanding I got so far is that !s390 architectures have some kind of mechanism that allows them to route an

Re: [PATCH] kvm: Move kvm_allows_irq0_override() to target-i386

2012-07-23 Thread Avi Kivity
On 07/21/2012 11:54 AM, Peter Maydell wrote: On 21 July 2012 07:57, Jan Kiszka jan.kis...@web.de wrote: On 2012-07-20 21:14, Peter Maydell wrote: I'm sure this isn't the only x86ism in the KVM generic source files. However the thing I'm specifically trying to do is nuke all the uses of

Re: [PATCH] kvm: Move kvm_allows_irq0_override() to target-i386

2012-07-23 Thread Avi Kivity
On 07/23/2012 03:25 PM, Peter Maydell wrote: On 23 July 2012 13:18, Avi Kivity a...@redhat.com wrote: While you don't have an irqchip, you do have asynchronous interrupt injection, yes? That's what irqchip really is all about. This seems an odd point of view -- async interrupt injection

Re: [PATCH] kvm: Move kvm_allows_irq0_override() to target-i386

2012-07-23 Thread Avi Kivity
On 07/23/2012 03:31 PM, Avi Kivity wrote: On 07/23/2012 03:25 PM, Peter Maydell wrote: On 23 July 2012 13:18, Avi Kivity a...@redhat.com wrote: While you don't have an irqchip, you do have asynchronous interrupt injection, yes? That's what irqchip really is all about. This seems an odd

Re: [PATCH] kvm: Move kvm_allows_irq0_override() to target-i386

2012-07-23 Thread Avi Kivity
On 07/23/2012 03:58 PM, Peter Maydell wrote: On 23 July 2012 13:26, Avi Kivity a...@redhat.com wrote: Really, irqchip in kernel means asynchronous interrupts - you can inject an interrupt from outside the vcpu thread. Obviously if the vcpu is sleeping you need to wake it up and that pulls

Re: [PATCH] kvm: Move kvm_allows_irq0_override() to target-i386

2012-07-23 Thread Avi Kivity
On 07/23/2012 04:06 PM, Cornelia Huck wrote: On Mon, 23 Jul 2012 15:18:49 +0300 Avi Kivity a...@redhat.com wrote: So, for example, if a specific subchannel (=device) has pending status and an I/O interrupt is to be generated, this interrupt remains pending until an arbitrary cpu

Re: [PATCH] kvm: Move kvm_allows_irq0_override() to target-i386

2012-07-23 Thread Avi Kivity
On 07/23/2012 04:27 PM, Peter Maydell wrote: On 23 July 2012 14:09, Avi Kivity a...@redhat.com wrote: On 07/23/2012 03:58 PM, Peter Maydell wrote: So should we be using something other than KVM_CREATE_IRQCHIP to ask the kernel to create a GIC model for us (and leave KVM_CREATE_IRQCHIP

Re: [PATCH] kvm: Move kvm_allows_irq0_override() to target-i386

2012-07-23 Thread Avi Kivity
On 07/23/2012 04:55 PM, Cornelia Huck wrote: Basically, we have some flags in our control block we can set so that the cpu drops out of SIE whenever external/I/O/... interrupts are enabled and then have the host do the lowcore updates, psw swaps, etc. Can you write them from a different

Re: [PATCH] kvm: Move kvm_allows_irq0_override() to target-i386

2012-07-23 Thread Avi Kivity
On 07/23/2012 04:50 PM, Peter Maydell wrote: Yet. There is no mechanism in the virtualization extensions to either trap on or present a false value for guest accesses to the CPSR mode bits. So you can't make the guest OS think it is in Hypervisor mode. Therefore you can't provide the guest

Re: [PATCH RFC V5 0/3] kvm: Improving directed yield in PLE handler

2012-07-22 Thread Avi Kivity
On 07/22/2012 03:34 PM, Raghavendra K T wrote: Thanks Marcelo for the review. Avi, Rik, Christian, please let me know if this series looks good now. It looks fine to me. Christian, is this okay for s390? -- error compiling committee.c: too many arguments to function -- To unsubscribe

[PATCH] KVM: Don't update PPR on any APIC read

2012-07-22 Thread Avi Kivity
The current code will update the PPR on almost any APIC read; however that's only required if we read the PPR. kvm_update_ppr() shows up in some profiles, albeit with a low usage (~1%). This should reduce it further (it will still be called during interrupt processing). Signed-off-by: Avi Kivity

Re: [Qemu-devel] [RFC v9 06/27] virtio-blk: Take PCI memory range into account

2012-07-19 Thread Avi Kivity
On 07/19/2012 12:16 PM, Stefan Hajnoczi wrote: On Thu, Jul 19, 2012 at 10:14 AM, Stefan Hajnoczi stefa...@gmail.com wrote: On Wed, Jul 18, 2012 at 7:29 PM, Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jul 18, 2012 at 04:07:33PM +0100, Stefan Hajnoczi wrote: Support 4 GB physical memory

Re: [PATCH 07/10] KVM: introduce readonly_fault_pfn

2012-07-19 Thread Avi Kivity
On 07/17/2012 05:44 PM, Xiao Guangrong wrote: Introduce readonly_fault_pfn, in the later patch, it indicates failure when we try to get a writable pfn from the readonly memslot + inline int kvm_is_mmio_pfn(pfn_t pfn) { if (pfn_valid(pfn)) { @@ -949,13 +952,15 @@

Re: [PATCH 08/10] KVM: introduce readonly_bad_hva

2012-07-19 Thread Avi Kivity
On 07/17/2012 05:45 PM, Xiao Guangrong wrote: In the later patch, it indicates failure when we try to get a writable hva from the readonly slot Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- virt/kvm/kvm_main.c | 12 +++- 1 files changed, 11 insertions(+), 1

Re: [PATCHv4 4/5] KVM: emulator: make linearize() callable from outside of emulator

2012-07-19 Thread Avi Kivity
On 07/19/2012 10:40 AM, Gleb Natapov wrote: The function will be used outside of the emulator. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h | 16 + arch/x86/kvm/emulate.c | 114 2 files

Re: [PATCHv4 5/5] KVM: Provide fast path for rep ins emulation if possible.

2012-07-19 Thread Avi Kivity
On 07/19/2012 10:40 AM, Gleb Natapov wrote: rep ins emulation is going through emulator now. This is slow because emulator knows how to write back only one datum at a time. This patch provides fast path for the instruction in certain conditions. The conditions are: DF flag is not set,

Re: [PATCHv4 3/5] KVM: emulator: move some address manipulation function out of emulator code.

2012-07-19 Thread Avi Kivity
On 07/19/2012 10:40 AM, Gleb Natapov wrote: The functions will be used outside of the emulator. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_host.h | 25 + arch/x86/kvm/emulate.c | 15 ++- 2 files changed, 27

[PATCH] KVM: x86 emulator: access GPRs on demand

2012-07-19 Thread Avi Kivity
Instead of populating the the entire register file, read in registers as they are accessed, and write back only the modified ones. This saves a VMREAD and VMWRITE on Intel (for rsp, since it is not usually used during emulation), and a two 128-byte copies for the registers. Signed-off-by: Avi

Re: qemu-kvm-1.1.0 crashing with kernel 3.5.0-rc6

2012-07-19 Thread Avi Kivity
On 07/19/2012 03:14 PM, Chris Clayton wrote: Change of diagnostics, unfortunately. qemu-kvm-1.0.1 can, in fact, crash on 3.5.0-rc6 (and rc7). I didn't get it earlier because it takes many times more invocations before the crash occurs with 1.0.1 and I haven't used qemu-kvm much in the past

Re: [PATCHv4 4/5] KVM: emulator: make linearize() callable from outside of emulator

2012-07-19 Thread Avi Kivity
On 07/19/2012 01:51 PM, Gleb Natapov wrote: +int x86_linearize(struct x86_linearize_params *p, ulong *linear) { - struct desc_struct desc; - bool usable; ulong la; u32 lim; - u16 sel; unsigned cpl, rpl; - la = seg_base(ctxt, addr.seg) + addr.ea; - switch

Re: [PATCHv4 3/5] KVM: emulator: move some address manipulation function out of emulator code.

2012-07-19 Thread Avi Kivity
On 07/19/2012 01:49 PM, Gleb Natapov wrote: All those exports suggest it's better to move the fast path into the emulator. We've already being through that. Putting the code into emulator gives us nothing unless it also works on emulator context and working on partially initialized

[PATCH] x86, hyper: fix build with !CONFIG_KVM_GUEST

2012-07-18 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kernel/cpu/hypervisor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c index 6d6dd7a..a8f8fa9 100644 --- a/arch/x86/kernel/cpu/hypervisor.c +++ b/arch/x86/kernel/cpu

Re: buildbot failure in kvm on next-i386

2012-07-18 Thread Avi Kivity
On 07/18/2012 08:05 AM, k...@buildbot.b1-systems.de wrote: The Buildbot has detected a new failure on builder next-i386 while building kvm. Full details are available at: http://buildbot.b1-systems.de/kvm/builders/next-i386/builds/590 It seems like the config does not include

Re: [PATCH RFC V4 2/3] kvm: Note down when cpu relax intercepted or pause loop exited

2012-07-17 Thread Avi Kivity
On 07/16/2012 08:24 PM, Raghavendra K T wrote: So are you saying allow vcpu to spin in non over-commit scenarios? So that we avoid all yield_to etc... ( Or even in some other place where it is useful). When is yielding useful, if you're not overcommitted? -- error compiling committee.c:

Re: [PATCH RFC V4 3/3] kvm: Choose better candidate for directed yield

2012-07-17 Thread Avi Kivity
On 07/16/2012 07:10 PM, Rik van Riel wrote: On 07/16/2012 06:07 AM, Avi Kivity wrote: +{ +bool eligible; + +eligible = !vcpu-ple.cpu_relax_intercepted || +(vcpu-ple.cpu_relax_intercepted + vcpu-ple.dy_eligible); + +if (vcpu-ple.cpu_relax_intercepted

Re: [PATCH 0/3] make KVM PV use apic through APIs

2012-07-16 Thread Avi Kivity
On 07/15/2012 03:56 PM, Michael S. Tsirkin wrote: KVM PV EOI optimization overrides eoi_write apic op with its own version. at Ingo's suggestion, add an API for this and switch kvm to use it, to avoid meddling with core x86 apic driver data structures directly. Applied to next, thanks. --

Re: [PATCH RFC V4 2/3] kvm: Note down when cpu relax intercepted or pause loop exited

2012-07-16 Thread Avi Kivity
On 07/16/2012 11:25 AM, Raghavendra K T wrote: From: Raghavendra K T raghavendra...@linux.vnet.ibm.com Noting pause loop exited vcpu or cpu relax intercepted helps in filtering right candidate to yield. Wrong selection of vcpu; i.e., a vcpu that just did a pl-exit or cpu relax intercepted

Re: [PATCH RFC V4 3/3] kvm: Choose better candidate for directed yield

2012-07-16 Thread Avi Kivity
On 07/16/2012 11:25 AM, Raghavendra K T wrote: From: Raghavendra K T raghavendra...@linux.vnet.ibm.com Currently, on a large vcpu guests, there is a high probability of yielding to the same vcpu who had recently done a pause-loop exit or cpu relax intercepted. Such a yield can lead to the

[ANNOUNCE] qemu-kvm-1.1.1

2012-07-16 Thread Avi Kivity
qemu-kvm-1.1.1 is now available. This release is based on the upstream qemu 1.1.1, plus kvm-specific enhancements. Please see the original QEMU 1.1.1 release announcement [1] for details. This release can be used with the kvm kernel modules provided by your distribution kernel, or by the modules

Re: [ kernel 3.5 ] Kernel bug when using kvm

2012-07-16 Thread Avi Kivity
On 07/16/2012 02:06 PM, nicolas prochazka wrote: Hello, with linux kernel 3.5rc6 and 3.5rc7 I do not test with other kernel 3.5. On linux kernel 3.3.8 , threre is no problem. If I start qemu-kvm process, system is overload and dmesg : BUG: unable to handle kernel paging request at

Re: [GIT PULL] KVM fixes for 3.5-rc6

2012-07-16 Thread Avi Kivity
On 07/14/2012 03:55 PM, Jan Kiszka wrote: The only way we can avoid that, is that we get a hint from the underlying irq chip/ handler setup with an extra flag to tell the core, that it's safe to avoid the ONESHOT/finalize magic. So now it took a full month of ignorance to come up with the

Re: [PATCH v3 0/2] kvm: level irqfd and new eoifd

2012-07-16 Thread Avi Kivity
On 07/16/2012 05:03 PM, Alex Williamson wrote: This is what I meant, except I forgot that we already do direct path for MSI. Ok, vfio now does it for the unmask irqfd-line interface too. Except when we re-inject from eoifd we have to do the eventfd_signal from a work queue as we can't

Re: [ kernel 3.5 ] Kernel bug when using kvm

2012-07-16 Thread Avi Kivity
options should i set, i've already kernel debug . Should be following the BUG message. Is what you posted everything you got? Regards, Nicolas Prochazka. 2012/7/16 Avi Kivity a...@redhat.com: On 07/16/2012 02:06 PM, nicolas prochazka wrote: Hello, with linux kernel 3.5rc6 and 3.5rc7 I do

Oops in proc_fd_instantiate (was: Re: [ kernel 3.5 ] Kernel bug when using kvm)

2012-07-16 Thread Avi Kivity
On 07/16/2012 05:46 PM, nicolas prochazka wrote: sorry, i recompile kernel with some option, and crash again : ( it seems i need to run a lot of qemu process to bug ) [ 3117.379546] BUG: unable to handle kernel paging request at 0001003b [ 3117.379783] IP: [811a3654]

Re: qemu fails to build with glibc-2.15

2012-07-16 Thread Avi Kivity
(fixed mailing list) On 07/16/2012 03:37 PM, X O wrote: Hello, I suspect upgrading my system to glibc-2.15 was a mistake. It seems to be qemu-1.0.1, and latter versions including qemu-1.1.1, can't be compiled anymore. Yes, I did search around and that led me to glibc, resp.

Re: lots of APIC_TMICT exit on VM with assigned NIC

2012-07-15 Thread Avi Kivity
On 07/12/2012 08:32 PM, sheng qiu wrote: thanks for your reply. the value is very large. Can you provide samples? If it's large and fairly constant it means a timer keeps being pushed back by the interrupts/ is there anyway that i can avoid such frequent exits due to APIC_TMICT? do i

Re: Possible KVM bug

2012-07-15 Thread Avi Kivity
On 07/14/2012 07:08 AM, Nick Skeen wrote: Every time a try and start a kvm-based VM with virt-manager the guest crashes during boot-up with this message in the host's kernel logger. [ 6762.680687] device eth0 entered promiscuous mode [ 6769.287090] kvm: 14513: cpu0 unhandled rdmsr:

Re: [PATCH v3 0/2] kvm: level irqfd and new eoifd

2012-07-15 Thread Avi Kivity
On 07/12/2012 07:19 PM, Alex Williamson wrote: On Thu, 2012-07-12 at 12:35 +0300, Avi Kivity wrote: On 07/11/2012 10:57 PM, Alex Williamson wrote: We still have classic KVM device assignment to provide fast-path INTx. But if we want to replace it midterm, I think it's necessary for VFIO

Re: [PULL 0/9] ppc patch queue 2012-07-11

2012-07-15 Thread Avi Kivity
On 07/11/2012 03:56 AM, Alexander Graf wrote: Hi Avi, This is my current patch queue for ppc. Please pull. It contains the following changes: * VERY IMPORTANT (please forward to -stable): Fix H_CEDE with PR KVM and newer guest kernels * Prepare some of the booke code for 64 bit

Re: [PATCH v3 0/2] kvm: level irqfd and new eoifd

2012-07-15 Thread Avi Kivity
On 07/12/2012 08:38 PM, Alex Williamson wrote: On Thu, 2012-07-12 at 10:19 -0600, Alex Williamson wrote: On Thu, 2012-07-12 at 12:35 +0300, Avi Kivity wrote: On 07/11/2012 10:57 PM, Alex Williamson wrote: We still have classic KVM device assignment to provide fast-path INTx

Re: [PATCH 0/3] make KVM PV use apic through APIs

2012-07-15 Thread Avi Kivity
On 07/15/2012 03:56 PM, Michael S. Tsirkin wrote: KVM PV EOI optimization overrides eoi_write apic op with its own version. at Ingo's suggestion, add an API for this and switch kvm to use it, to avoid meddling with core x86 apic driver data structures directly. Ingo, could you please review

[PULL] kvm queue

2012-07-15 Thread Avi Kivity
Please pull from git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git uq/master to receive the kvm queue for qemu.git. Features include fixes for the apic device model (including a longstanding bug which caused random failures on 64-bit Windows), exposing new cpu features, and an eventfd API

Re: [PULL 0/9] ppc patch queue 2012-07-11

2012-07-15 Thread Avi Kivity
On 07/11/2012 03:56 AM, Alexander Graf wrote: Hi Avi, This is my current patch queue for ppc. Please pull. It contains the following changes: * VERY IMPORTANT (please forward to -stable): Fix H_CEDE with PR KVM and newer guest kernels * Prepare some of the booke code for 64 bit

Re: [PATCH RFC 0/2] kvm: Improving directed yield in PLE handler

2012-07-12 Thread Avi Kivity
On 07/12/2012 08:11 AM, Raghavendra K T wrote: Ah, I thouht you objected to the CONFIG var. Maybe call it cpu_relax_intercepted since that's the linuxy name for the instruction. Ok, just to be on same page. 'll have : 1. cpu_relax_intercepted instead of pause_loop_exited. 2.

Re: [PATCH RFC 0/2] kvm: Improving directed yield in PLE handler

2012-07-12 Thread Avi Kivity
On 07/12/2012 05:17 AM, Benjamin Herrenschmidt wrote: ARM doesn't have an instruction for cpu_relax(), so it can't intercept it. Given ppc's dislike of overcommit, and the way it implements cpu_relax() by adjusting hw thread priority, I'm guessing it doesn't intercept those either, but I'm

Re: [PATCH RFC 0/2] kvm: Improving directed yield in PLE handler

2012-07-12 Thread Avi Kivity
On 07/11/2012 05:01 PM, Raghavendra K T wrote: On 07/11/2012 07:29 PM, Raghavendra K T wrote: On 07/11/2012 02:30 PM, Avi Kivity wrote: On 07/10/2012 12:47 AM, Andrew Theurer wrote: For the cpu threads in the host that are actually active (in this case 1/2 of them), ~50% of their time

Re: [PATCH v2 1/2] kvm tools: Fix VHOST_SET_MEM_TABLE failure

2012-07-12 Thread Avi Kivity
On 07/12/2012 05:46 AM, Asias He wrote: On Thu, Jul 12, 2012 at 12:09 AM, Avi Kivity a...@redhat.com wrote: On 07/11/2012 07:08 PM, Asias He wrote: VHOST_SET_MEM_TABLE failed: Operation not supported In vhost_set_memory(), We have if (mem.padding) return -EOPNOTSUPP

Re: lots of APIC_TMICT exit on VM with assigned NIC

2012-07-12 Thread Avi Kivity
On 07/12/2012 02:54 AM, sheng qiu wrote: Hi all, i saw lots of APIC_TMICT exits while running a linux guest with assigned NIC. The APIC_TMICT exits is only a little fewer than the number of injected interrupts while handling network traffic on the assigned NIC. The network traffic was

Re: [PATCH] qemu-kvm: Fix default machine options

2012-07-12 Thread Avi Kivity
On 07/06/2012 07:21 PM, Jan Kiszka wrote: qemu-kvm-specific machine defaults were missing for pc-0.15 to pc-1.1. Then Daniel noted that --disable-kvm caused problems as the generated binaries would be unable to run. As we are at it, we can drop the kernel_irqchip=on that is now enable by

Re: [PATCH uq/master 2/9] event_notifier: remove event_notifier_test

2012-07-12 Thread Avi Kivity
On 07/05/2012 06:16 PM, Paolo Bonzini wrote: This is broken; since the eventfd is used in nonblocking mode there is a race between reading and writing. diff --git a/event_notifier.c b/event_notifier.c index 2b210f4..c339bfe 100644 --- a/event_notifier.c +++ b/event_notifier.c @@ -51,18

Re: [PATCH uq/master 3/9] event_notifier: add event_notifier_init_fd

2012-07-12 Thread Avi Kivity
On 07/05/2012 06:16 PM, Paolo Bonzini wrote: struct EventNotifier { - int fd; +int fd; }; If you're fixing whitespace, might as well fix it correctly. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line

Re: [PATCH uq/master 0/9] remove event_notifier_get_fd from non-KVM code

2012-07-12 Thread Avi Kivity
On 07/05/2012 06:16 PM, Paolo Bonzini wrote: This is part 1 of a three-part series that expands usage of EventNotifier in QEMU (including AIO and the main loop). I started working on this when playing with the threaded block layer; the part of that work that I hope will be in 1.2 is

Re: [PATCH v3 0/2] kvm: level irqfd and new eoifd

2012-07-12 Thread Avi Kivity
On 07/11/2012 10:57 PM, Alex Williamson wrote: We still have classic KVM device assignment to provide fast-path INTx. But if we want to replace it midterm, I think it's necessary for VFIO to be able to provide such a path as well. I would like VFIO to have no regressions vs. kvm device

Re: QEMU- 1CPU for guest while more cores used on host?

2012-07-12 Thread Avi Kivity
On 07/04/2012 10:59 PM, Javier Guerra Giraldez wrote: On Wed, Jul 4, 2012 at 2:44 PM, robert.kuc...@centrum.cz wrote: Thank you very much for your explanation, it makes sense :-) 2: why do you think course amd-v+KVM is impossible to be used ?? it does work very well Not for me, it is some

Re: [PATCH v5] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-07-12 Thread Avi Kivity
On 07/02/2012 04:18 AM, Mao, Junjie wrote: This patch handles PCID/INVPCID for guests. Process-context identifiers (PCIDs) are a facility by which a logical processor may cache information for multiple linear-address spaces so that the processor may retain cached information when software

Re: [PATCH uq/master 2/9] event_notifier: remove event_notifier_test

2012-07-12 Thread Avi Kivity
On 07/12/2012 01:30 PM, Paolo Bonzini wrote: Il 12/07/2012 11:10, Avi Kivity ha scritto: On 07/05/2012 06:16 PM, Paolo Bonzini wrote: This is broken; since the eventfd is used in nonblocking mode there is a race between reading and writing. diff --git a/event_notifier.c b/event_notifier.c

[GIT PULL] KVM fixes for 3.5-rc6

2012-07-12 Thread Avi Kivity
): KVM: Fix device assignment threaded irq handler Avi Kivity (1): Merge branch 'for-upstream-master' of git://github.com/agraf/linux-2.6 Benjamin Herrenschmidt (1): powerpc/kvm: Fix PR KVM implementation of H_CEDE -- error compiling committee.c: too many arguments to function

Re: [PATCH RFC 0/2] kvm: Improving directed yield in PLE handler

2012-07-12 Thread Avi Kivity
On 07/12/2012 11:25 AM, Raghavendra K T wrote: The problem occurs even with no overcommit at all. One vcpu is in a legitimately long pause loop. All those exits accomplish nothing, since all vcpus are scheduled. Better to let it spin in guest mode. I agree. One idea is we can have a

Re: [PULL 0/9] ppc patch queue 2012-07-11

2012-07-11 Thread Avi Kivity
On 07/11/2012 03:56 AM, Alexander Graf wrote: Hi Avi, This is my current patch queue for ppc. Please pull. It contains the following changes: * VERY IMPORTANT (please forward to -stable): Fix H_CEDE with PR KVM and newer guest kernels If it's important please separate it and put

Re: [PULL 0/9] ppc patch queue 2012-07-11

2012-07-11 Thread Avi Kivity
On 07/11/2012 03:56 AM, Alexander Graf wrote: Hi Avi, This is my current patch queue for ppc. Please pull. * Book3S HV: Fix locks (should be in your tree already?) Indeed it's in 3.5 already. The way to check it to look for it in auto-next, which includes master, upstream, and next.

Re: [PATCH RFC 1/2] kvm vcpu: Note down pause loop exit

2012-07-11 Thread Avi Kivity
On 07/09/2012 09:20 AM, Raghavendra K T wrote: Signed-off-by: Raghavendra K T raghavendra...@linux.vnet.ibm.com Noting pause loop exited vcpu helps in filtering right candidate to yield. Yielding to same vcpu may result in more wastage of cpu. struct kvm_lpage_info { diff --git

Re: [PATCH RFC 0/2] kvm: Improving directed yield in PLE handler

2012-07-11 Thread Avi Kivity
On 07/10/2012 12:47 AM, Andrew Theurer wrote: For the cpu threads in the host that are actually active (in this case 1/2 of them), ~50% of their time is in kernel and ~43% in guest. This is for a no-IO workload, so that's just incredible to see so much cpu wasted. I feel that 2

Re: [PATCH RFC 0/2] kvm: Improving directed yield in PLE handler

2012-07-11 Thread Avi Kivity
On 07/09/2012 10:55 AM, Christian Borntraeger wrote: On 09/07/12 08:20, Raghavendra K T wrote: Currently Pause Looop Exit (PLE) handler is doing directed yield to a random VCPU on PL exit. Though we already have filtering while choosing the candidate to yield_to, we can do better. Problem

Re: [PATCH v3 0/2] kvm: level irqfd and new eoifd

2012-07-11 Thread Avi Kivity
On 07/03/2012 10:21 PM, Alex Williamson wrote: Here's the latest iteration of adding an interface to assert and de-assert level interrupts from external drivers like vfio. These apply on top of the previous argument cleanup, documentation, and sanitization patches for irqfd. It would be

Re: [PATCH] kvm: Fix device assignment threaded irq handler

2012-07-11 Thread Avi Kivity
On 07/09/2012 07:53 PM, Alex Williamson wrote: The kernel no longer allows us to pass NULL for the hard handler without also specifying IRQF_ONESHOT. IRQF_ONESHOT imposes latency in the exit path that we don't need for MSI interrupts. Long term we'd like to inject these interrupts from the

Re: [PATCH] pci-assign: Switch to PCI_HOST_DEVADDR property

2012-07-11 Thread Avi Kivity
On 07/06/2012 07:22 PM, Jan Kiszka wrote: Replace the home-brewed qdev property for PCI host addresses with the new upstream version. Thanks, applied. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the

Re: [PATCH v3 0/2] kvm: level irqfd and new eoifd

2012-07-11 Thread Avi Kivity
On 07/11/2012 01:18 PM, Jan Kiszka wrote: On 2012-07-11 11:53, Avi Kivity wrote: On 07/03/2012 10:21 PM, Alex Williamson wrote: Here's the latest iteration of adding an interface to assert and de-assert level interrupts from external drivers like vfio. These apply on top of the previous

Re: [PATCH RFC 0/2] kvm: Improving directed yield in PLE handler

2012-07-11 Thread Avi Kivity
On 07/11/2012 01:17 PM, Christian Borntraeger wrote: On 11/07/12 11:06, Avi Kivity wrote: [...] Almost all s390 kernels use diag9c (directed yield to a given guest cpu) for spinlocks, though. Perhaps x86 should copy this. See arch/s390/lib/spinlock.c The basic idea is using several

Re: [PATCH RFC 1/2] kvm vcpu: Note down pause loop exit

2012-07-11 Thread Avi Kivity
On 07/11/2012 01:52 PM, Raghavendra K T wrote: On 07/11/2012 02:23 PM, Avi Kivity wrote: On 07/09/2012 09:20 AM, Raghavendra K T wrote: Signed-off-by: Raghavendra K Traghavendra...@linux.vnet.ibm.com Noting pause loop exited vcpu helps in filtering right candidate to yield. Yielding to same

Re: [PATCH RFC 0/2] kvm: Improving directed yield in PLE handler

2012-07-11 Thread Avi Kivity
On 07/11/2012 02:16 PM, Alexander Graf wrote: yes the data structure itself seems based on the algorithm and not on arch specific things. That should work. If we move that to common code then s390 will use that scheme automatically for the cases were we call kvm_vcpu_on_spin(). All

Re: [PATCH RFC 0/2] kvm: Improving directed yield in PLE handler

2012-07-11 Thread Avi Kivity
On 07/11/2012 02:18 PM, Christian Borntraeger wrote: On 11/07/12 13:04, Avi Kivity wrote: On 07/11/2012 01:17 PM, Christian Borntraeger wrote: On 11/07/12 11:06, Avi Kivity wrote: [...] Almost all s390 kernels use diag9c (directed yield to a given guest cpu) for spinlocks, though. Perhaps

Segfault starting vcpu thread

2012-07-11 Thread Avi Kivity
Current qemu-kvm master merged with latest upstream fails on startup: (gdb) bt #0 0x7fdcd4a047a0 in kvm_vcpu_ioctl (env=0x0, type=-1071075694) at /home/tlv/akivity/qemu/kvm-all.c:1602 #1 0x7fdcd49c9fda in kvm_apic_enable_tpr_reporting (s=0x7fdcd75af6c0, enable=false) at

<    4   5   6   7   8   9   10   11   12   13   >