Re: [PATCH v3 2/2] virtio-ring: Allocate indirect buffers from cache when possible

2012-09-04 Thread Avi Kivity
On 09/04/2012 07:34 PM, Avi Kivity wrote: On 08/31/2012 12:56 PM, Michael S. Tsirkin wrote: On Fri, Aug 31, 2012 at 11:36:07AM +0200, Sasha Levin wrote: On 08/30/2012 03:38 PM, Michael S. Tsirkin wrote: +static unsigned int indirect_alloc_thresh = 16; Why 16? Please make is MAX_SG + 1

Re: [PATCH] KVM: VMX: invalidate vpid for invlpg instruction

2012-09-03 Thread Avi Kivity
On 09/03/2012 02:27 AM, Davidlohr Bueso wrote: On Fri, 2012-08-31 at 14:37 -0300, Marcelo Tosatti wrote: On Fri, Aug 31, 2012 at 06:10:48PM +0200, Davidlohr Bueso wrote: For processors that support VPIDs we should invalidate the page table entry specified by the lineal address. For this

Re: [RFC 0/5] Making KVM_GET_ONE_REG/KVM_SET_ONE_REG generic.

2012-09-03 Thread Avi Kivity
On 09/01/2012 03:35 PM, Rusty Russell wrote: Avi Kivity a...@redhat.com writes: -Capability: basic +Capability: KVM_CAP_REG_LIST Architectures: arm all OK, I guess that's to be true in future. Fixed. Type: vcpu ioctl -Parameters: struct kvm_msr_list (in/out) +Parameters: struct

Re: [PATCH] kvm/fpu: Enable fully eager restore kvm FPU

2012-09-03 Thread Avi Kivity
On 08/23/2012 11:51 AM, Hao, Xudong wrote: -Original Message- From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf Of Avi Kivity Sent: Monday, August 20, 2012 6:43 PM To: Roedel, Joerg Cc: Hao, Xudong; kvm@vger.kernel.org; Zhang, Xiantao Subject: Re: [PATCH

Re: Recommended way access KVM data structures from other kernel subsystems ?

2012-09-03 Thread Avi Kivity
On 08/23/2012 10:49 AM, Pandarathil, Vijaymohan R wrote: Hi, I am looking for the recommended approach for accessing KVM driver data from other kernel components. In my case, I need to set some global variable/state in KVM driver from one of the NMI handlers. I see that using kvm_x86_ops

Re: NFSoRDMA not working with KVM when cache disabled

2012-09-03 Thread Avi Kivity
On 08/31/2012 08:05 PM, Andrew Holway wrote: Hi, I am trying to host KVM machines on an NFSoRDMA mount. This works: -drive file=/mnt/vm001.img,if=none,id=drive-virtio-disk0,format=raw -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0 This

Re: [PATCH v7 2/3] KVM: x86: trace mmio begin and complete

2012-09-03 Thread Avi Kivity
On 08/27/2012 12:51 PM, Dong Hao wrote: From: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com 'perf kvm stat record/report' will use kvm_exit and kvm_mmio(read...) to calculate mmio read emulated time for the old kernel, in order to trace mmio read event more exactly, we add kvm_mmio_begin

Re: [PATCH v7 1/3] KVM: x86: export svm/vmx exit code and vector code to userspace

2012-09-03 Thread Avi Kivity
On 08/27/2012 12:51 PM, Dong Hao wrote: From: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Exporting KVM exit information to userspace to be consumed by perf. [ Dong Hao haod...@linux.vnet.ibm.com: rebase it on acme's git tree ] Signed-off-by: Xiao Guangrong

Re: KVM call agenda for Tuesday, September 4th

2012-09-03 Thread Avi Kivity
On 09/03/2012 09:44 AM, Juan Quintela wrote: Hi Please send in any agenda items you are interested in covering. - protecting MemoryRegion::opaque during dispatch I'm guessing Ping won't make it due to timezone problems. Jan, if you will not participate, please remove the topic from the

Re: NFSoRDMA not working with KVM when cache disabled

2012-09-03 Thread Avi Kivity
On 09/03/2012 02:57 PM, Andrew Holway wrote: and report which (if any) of the output files (x1, x2, y1, y2) are corrupted, by comparing them against the original. This will tell us whether O_DIRECT is broken, or 512 byte block size, or neither. Looks like you were directly on the

Re: KVM on kernel 2.6.16

2012-09-03 Thread Avi Kivity
On 09/02/2012 07:08 PM, Lentes, Bernd wrote: Hi, i have several servers with SLES 10 SP4 and want to run kvm on them. SLES 10 has kernel 2.6.16. Is that possible ? Thanks for any answer. In general no. Please contact your server vendor though. -- error compiling committee.c: too

Re: KVM on kernel 2.6.16

2012-09-03 Thread Avi Kivity
On 09/03/2012 04:24 PM, Avi Kivity wrote: On 09/02/2012 07:08 PM, Lentes, Bernd wrote: Hi, i have several servers with SLES 10 SP4 and want to run kvm on them. SLES 10 has kernel 2.6.16. Is that possible ? Thanks for any answer. In general no. Please contact your server vendor

Re: [libvirt-users] vm pxe fail

2012-09-03 Thread Avi Kivity
On 08/31/2012 05:37 PM, Alex Jia wrote: Hi Andrew, Great, BTW, in fact, you may pxe boot via VF of Intel82576, however, Intel82576 SR-IOV network adapters don't provide a ROM BIOS for the cards virtual functions (VF), but an image of such a ROM is available, and with this ROM visible to

Re: KVM call agenda for Tuesday, September 4th

2012-09-03 Thread Avi Kivity
On 09/03/2012 04:35 PM, Jan Kiszka wrote: On 2012-09-03 13:48, Avi Kivity wrote: On 09/03/2012 09:44 AM, Juan Quintela wrote: Hi Please send in any agenda items you are interested in covering. - protecting MemoryRegion::opaque during dispatch I'm guessing Ping won't make it due

Re: [PATCH v4 0/8] KVM paravirt remote flush tlb

2012-09-03 Thread Avi Kivity
On 08/21/2012 02:25 PM, Nikunj A. Dadhania wrote: kernbench(lower is better) == base pvflushv4 %improvement 1VM48.5800 46.8513 3.55846 2VM 108.1823 104.6410 3.27346 3VM 183.2733 163.3547 10.86825

Re: [PATCH] Add a page cache-backed balloon device driver.

2012-09-03 Thread Avi Kivity
On 06/26/2012 11:32 PM, Frank Swiderski wrote: This implementation of a virtio balloon driver uses the page cache to store pages that have been released to the host. The communication (outside of target counts) is one way--the guest notifies the host when it adds a page to the page cache,

Re: [PATCH v4 0/8] KVM paravirt remote flush tlb

2012-09-03 Thread Avi Kivity
On 09/03/2012 05:33 PM, Avi Kivity wrote: On 08/21/2012 02:25 PM, Nikunj A. Dadhania wrote: kernbench(lower is better) == base pvflushv4 %improvement 1VM48.5800 46.8513 3.55846 2VM 108.1823 104.6410 3.27346 3VM

Re: [Qemu-devel] [PATCH 4/4] kvm: i386: Add classic PCI device assignment

2012-09-03 Thread Avi Kivity
On 08/29/2012 11:49 AM, Peter Maydell wrote: On 29 August 2012 09:47, Jan Kiszka jan.kis...@siemens.com wrote: On 2012-08-28 23:26, Peter Maydell wrote: Since this is arch-specific we should probably give the resulting device a more specific name than pci-assign, which implies that it is (a)

Re: [Qemu-devel] [PATCH 4/4] kvm: i386: Add classic PCI device assignment

2012-09-03 Thread Avi Kivity
On 08/28/2012 03:30 AM, Jan Kiszka wrote: Maybe add case 8: and default: with abort(), also below. PIO is never 8 bytes long, the generic layer protects us. Note: eventually the pio space will be mapped directly to mmio (instead of being bounced via cpu_inb() in the bridge's mmio handler),

Re: [Qemu-devel] [PATCH 4/4] kvm: i386: Add classic PCI device assignment

2012-09-03 Thread Avi Kivity
On 08/29/2012 11:27 AM, Markus Armbruster wrote: I don't see a point in making contributors avoid non-problems that might conceivably become trivial problems some day. Especially when there's no automated help with the avoiding. -Wpointer-arith -- error compiling committee.c: too many

Re: [RFC 1/5] KVM: Move KVM_SET_ONE_REG/KVM_GET_ONE_REG to generic code.

2012-09-01 Thread Avi Kivity
On 08/28/2012 04:45 PM, Rusty Russell wrote: Avi has indicated that this is the future. For now, make it dependent on KVM_HAVE_ONE_REG (and define that for PPC and S/390). I want GET_MULTI, really. But maybe iterating over ONE_REG isn't so bad since we do it so rarely.: Would all register

Re: [RFC 5/5] KVM: ARM: Access all registers via KVM_GET_ONE_REG/KVM_SET_ONE_REG.

2012-09-01 Thread Avi Kivity
On 08/29/2012 08:29 AM, Christoffer Dall wrote: On Tue, Aug 28, 2012 at 4:48 PM, Rusty Russell rusty.russ...@linaro.org wrote: No structures at all any more. I fail to see the great benefit of all this. The code is certainly not easier to read and it's certainly not more clear what is

Re: [RFC 5/5] KVM: ARM: Access all registers via KVM_GET_ONE_REG/KVM_SET_ONE_REG.

2012-09-01 Thread Avi Kivity
On 08/29/2012 11:21 AM, Rusty Russell wrote: + /* Coprocessor 0 means we want a core register. */ + if ((u32)reg-id KVM_REG_ARM_COPROC_START == 0) + return set_core_reg(vcpu, reg); ...but if we do go this path, you can't use coprocessor 0 to mean core

Re: [RFC 0/5] Making KVM_GET_ONE_REG/KVM_SET_ONE_REG generic.

2012-09-01 Thread Avi Kivity
On 08/29/2012 11:39 AM, Rusty Russell wrote: -4.76 KVM_VCPU_GET_MSR_INDEX_LIST +4.76 KVM_VCPU_GET_REG_LIST -Capability: basic +Capability: KVM_CAP_REG_LIST Architectures: arm all Type: vcpu ioctl -Parameters: struct kvm_msr_list (in/out) +Parameters: struct kvm_reg_list

Re: [RFC 1/5] KVM: Move KVM_SET_ONE_REG/KVM_GET_ONE_REG to generic code.

2012-09-01 Thread Avi Kivity
On 09/01/2012 03:18 AM, Peter Maydell wrote: On 1 September 2012 10:11, Avi Kivity a...@redhat.com wrote: Other x86 state: Control registers: ok. Should userspace be careful to set registers in legal ways only? i.e. cannot set cr3[0:11] if cr4.pae=0, or vice versa, so need three writes

Re: [PATCH RFC 0/3] Add guest cpu_entitlement reporting

2012-08-27 Thread Avi Kivity
On 08/23/2012 04:14 PM, Michael Wolf wrote: This is an RFC regarding the reporting of stealtime. In the case of where you have a system that is running with partial processors such as KVM the user may see steal time being reported in accounting tools such as top or vmstat. This can cause

Re: /dev/kvm not sufficiently restricted, and in ways I didn't think were possible

2012-08-27 Thread Avi Kivity
On 08/27/2012 01:11 PM, Henry Cejtin wrote: I'm completely confused about access to /dev/kvm. In particular, it looks like it is too open to access, but in a way that I don't understand. On my machine, /dev/kvm is owned by root.root and mode 660. Here is the output of ls:

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

2012-08-27 Thread Avi Kivity
On 08/26/2012 10:04 AM, Marcelo Tosatti wrote: On Thu, Aug 23, 2012 at 05:14:27AM -0300, Marcelo Tosatti wrote: On Sun, Aug 19, 2012 at 12:32:36PM +0300, Avi Kivity wrote: On 08/17/2012 08:29 PM, Marcelo Tosatti wrote: On Thu, Aug 16, 2012 at 05:54:49PM +0300, Avi Kivity wrote

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

2012-08-27 Thread Avi Kivity
On 08/27/2012 01:22 PM, Avi Kivity wrote: On 08/26/2012 10:04 AM, Marcelo Tosatti wrote: On Thu, Aug 23, 2012 at 05:14:27AM -0300, Marcelo Tosatti wrote: On Sun, Aug 19, 2012 at 12:32:36PM +0300, Avi Kivity wrote: On 08/17/2012 08:29 PM, Marcelo Tosatti wrote: On Thu, Aug 16, 2012

Re: [PATCH RFC 0/3] Add guest cpu_entitlement reporting

2012-08-27 Thread Avi Kivity
On 08/27/2012 01:23 PM, Michael Wolf wrote: How would a guest know what its entitlement is? Currently the Admin/management tool setting up the guests will put it on the qemu commandline. From this it is passed via an ioctl to the host. The guest will get the value from the host via

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

2012-08-27 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: [PATCH RFC 0/3] Add guest cpu_entitlement reporting

2012-08-27 Thread Avi Kivity
On 08/27/2012 02:27 PM, Michael Wolf wrote: On Mon, 2012-08-27 at 13:31 -0700, Avi Kivity wrote: On 08/27/2012 01:23 PM, Michael Wolf wrote: How would a guest know what its entitlement is? Currently the Admin/management tool setting up the guests will put

Re: perf uncore lkvm woes

2012-08-22 Thread Avi Kivity
On 08/21/2012 01:35 PM, Peter Zijlstra wrote: On Tue, 2012-08-21 at 11:34 +0300, Avi Kivity wrote: On 08/21/2012 10:11 AM, Peter Zijlstra wrote: On Sun, 2012-08-19 at 12:55 +0300, Avi Kivity wrote: I think Avi prefers the method where KVM 'fakes' the MSRs and we have to detect

Re: Windows slow boot: contractor wanted

2012-08-22 Thread Avi Kivity
On 08/21/2012 06:21 PM, Richard Davies wrote: Avi Kivity wrote: Richard Davies wrote: We're running host kernel 3.5.1 and qemu-kvm 1.1.1. I hadn't though about it, but I agree this is related to cpu overcommit. The slow boots are intermittent (and infrequent) with cpu overcommit

Re: [Qemu-devel] x86, nops settings result in kernel crash

2012-08-22 Thread Avi Kivity
On 08/21/2012 12:28 PM, Tomas Racek wrote: http://fi.muni.cz/~xracek/debian2.img.bz2 Other things are the same. The runtest.sh sets environment for xfstests and runs test 285 which I wrote and and which should test if FS sends discard requests only on free sectors: 285: 1. Create loop

Re: [PATCH v6 01/12] KVM: x86: fix possible infinite loop caused by reexecute_instruction

2012-08-22 Thread Avi Kivity
On 08/21/2012 05:57 AM, Xiao Guangrong wrote: Currently, we reexecute all unhandleable instructions if they do not access on the mmio, however, it can not work if host map the readonly memory to guest. If the instruction try to write this kind of memory, it will fault again when guest retry

Re: [PATCH v6 12/12] KVM: indicate readonly access fault

2012-08-22 Thread Avi Kivity
On 08/21/2012 06:03 AM, Xiao Guangrong wrote: Introduce write_readonly_mem in mmio-exit-info to indicate this exit is caused by write access on readonly memslot Please document this in chapter 5 of apic.txt. -- error compiling committee.c: too many arguments to function -- To unsubscribe from

Re: [PATCH v6 00/12] KVM: introduce readonly memslot

2012-08-22 Thread Avi Kivity
On 08/21/2012 05:57 AM, Xiao Guangrong wrote: Changelog: - fix endless retrying for unhandleable instruction which accesses on readonly host memory - divide slot-flags by 16:16, the lower part is visible for userspace, the reset is internally used in kvm, and document this in the code -

Re: [PATCH RESEND] kvm: Fix nonsense handling of compat ioctl

2012-08-22 Thread Avi Kivity
On 08/20/2012 05:43 PM, Alan Cox wrote: From: Alan Cox a...@linux.intel.com KVM_SET_SIGNAL_MASK passed a NULL argument leaves the on stack signal sets uninitialized. It then passes them through to kvm_vcpu_ioctl_set_sigmask. We should be passing a NULL in this case not translated garbage.

Re: [PATCH v2] KVM: MMU: Fix mmu_shrink() so that it can free mmu pages as intended

2012-08-22 Thread Avi Kivity
On 08/20/2012 12:35 PM, Takuya Yoshikawa wrote: Although the possible race described in commit 85b7059169e128c57a3a8a3e588fb89cb2031da1 KVM: MMU: fix shrinking page from the empty mmu was correct, the real cause of that issue was a more trivial bug of mmu_shrink() introduced by

Re: Windows slow boot: contractor wanted

2012-08-22 Thread Avi Kivity
On 08/22/2012 03:40 PM, Richard Davies wrote: I can trigger the slow boots without KSM and they have the same profile, with _raw_spin_lock_irqsave and isolate_freepages_block at the top. I reduced to 3x 20GB 8-core VMs on a 128GB host (rather than 3x 40GB 8-core VMs), and haven't managed

[PATCH kvm-unit-tests] x86: add explicit ENTRY() declaration to linker scripts

2012-08-22 Thread Avi Kivity
It appears that some toolchain update caused the entry address in the elf image to be zero. Add explicit ENTRY() declarations as a workaround. Signed-off-by: Avi Kivity a...@redhat.com --- flat.lds | 1 + x86/realmode.lds | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff

Re: Windows slow boot: contractor wanted

2012-08-22 Thread Avi Kivity
On 08/22/2012 05:41 PM, Richard Davies wrote: Avi Kivity wrote: Richard Davies wrote: I can trigger the slow boots without KSM and they have the same profile, with _raw_spin_lock_irqsave and isolate_freepages_block at the top. I reduced to 3x 20GB 8-core VMs on a 128GB host (rather than

[PATCH kvm-unit-tests] realmode: test that stack operations ignore the high word of %esp if ss.b is set

2012-08-22 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- x86/realmode.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/x86/realmode.c b/x86/realmode.c index 710a06b..82a66b3 100644 --- a/x86/realmode.c +++ b/x86/realmode.c @@ -554,6 +554,11 @@ void test_push_pop

Re: perf uncore lkvm woes

2012-08-21 Thread Avi Kivity
On 08/21/2012 04:11 AM, Yan, Zheng wrote: There is only one kvm_pmu structure in struct kvm_vcpu_arch, but the uncore driver may define dozens of PMUs. Besides the uncore PMUs make extensive use of extra registers, I don't think we can store these information in kvm_pmu structure. We don't

Re: perf uncore lkvm woes

2012-08-21 Thread Avi Kivity
On 08/21/2012 10:11 AM, Peter Zijlstra wrote: On Sun, 2012-08-19 at 12:55 +0300, Avi Kivity wrote: I think Avi prefers the method where KVM 'fakes' the MSRs and we have to detect if the MSRs actually work or not. s/we have/we don't have/. So for the 'normal' PMU we actually do check

Re: Windows slow boot: contractor wanted

2012-08-21 Thread Avi Kivity
On 08/20/2012 04:56 PM, Richard Davies wrote: We're running host kernel 3.5.1 and qemu-kvm 1.1.1. I hadn't though about it, but I agree this is related to cpu overcommit. The slow boots are intermittent (and infrequent) with cpu overcommit whereas I don't think it occurs without cpu

[PATCH 00/13] Big real mode fixes

2012-08-21 Thread Avi Kivity
conditions). This both speeds up big real mode, and makes it more robust, since fewer instructions need to be emulated. I think this patchset means we can remove emulate_invalid_guest_state=0, since it offers no advantages now. Avi Kivity (13): KVM: VMX: Separate saving pre-realmode state from

[PATCH 01/13] KVM: VMX: Separate saving pre-realmode state from setting segments

2012-08-21 Thread Avi Kivity
the save area for us to restore when returning to protected mode or to return in vmx_get_segment(). Move saving the segment into a new function, save_rmode_seg(), and call it just during the transition. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 20 +--- 1

[PATCH 02/13] KVM: VMX: Fix incorrect lookup of segment S flag in fix_pmode_dataseg()

2012-08-21 Thread Avi Kivity
fix_pmode_dataseg() looks up S in -base instead of -ar_bytes. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index bd6e06e..6865ec5 100644 --- a/arch/x86/kvm/vmx.c

[PATCH 04/13] KVM: VMX: Retain limit and attributes when entering protected mode

2012-08-21 Thread Avi Kivity
Real processors don't change segment limits and attributes while in real mode. Mimic that behaviour. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index

[PATCH 05/13] KVM: VMX: Allow real mode emulation using vm86 with dpl=0

2012-08-21 Thread Avi Kivity
Real mode is always entered from protected mode with dpl=0. Since the dpl doesn't affect execution, and we already override it to 3 in the vmcs (as vmx requires), we can allow execution in that state. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 2 +- 1 file changed, 1

[PATCH 06/13] KVM: VMX: Allow vm86 virtualization of big real mode

2012-08-21 Thread Avi Kivity
, which we will trap and forward to the emulator. This results in significantly faster execution, and less risk of hitting an unemulated instruction. If the limit is less than 0x, we retain the existing behaviour. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 2 +- 1 file

[PATCH 07/13] KVM: x86 emulator: Leave segment limit and attributs alone in real mode

2012-08-21 Thread Avi Kivity
When loading a segment in real mode, only the base and selector must be modified. The limit needs to be left alone, otherwise big real mode users will hit a #GP due to limit checking (currently this is suppressed because we don't check limits in real mode). Signed-off-by: Avi Kivity

[PATCH 08/13] KVM: x86 emulator: Check segment limits in real mode too

2012-08-21 Thread Avi Kivity
Segment limits are verified in real mode, not just protected mode. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/emulate.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 7281ff8..67da0ac 100644

[PATCH 09/13] KVM: x86 emulator: Fix #GP error code during linearization

2012-08-21 Thread Avi Kivity
We want the segment selector, nor segment number. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/emulate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 67da0ac..9001b1c 100644 --- a/arch/x86/kvm

[PATCH 10/13] KVM: VMX: Return real real-mode segment data even if emulate_invalid_guest_state=1

2012-08-21 Thread Avi Kivity
emulate_invalid_guest_state=1 doesn't mean we don't munge the segments in the vmcs; we do. So we need to return the real ones (maintained by vmx_set_segment). Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH 11/13] KVM: VMX: Preserve segment limit and access rights in real mode

2012-08-21 Thread Avi Kivity
While this is undocumented, real processors do not reload the segment limit and access rights when loading a segment register in real mode. Real programs rely on it so we need to comply with this behaviour. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 3 +++ 1 file changed

[PATCH 12/13] KVM: VMX: Save all segment data in real mode

2012-08-21 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index c16b375..4649618 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -3217,6 +3217,7 @@ static void vmx_set_segment(struct

[PATCH 13/13] KVM: VMX: Ignore segment G and D bits when considering whether we can virtualize

2012-08-21 Thread Avi Kivity
We will enter the guest with G and D cleared; as real hardware ignores D in real mode, and G is taken care of by the limit test, we allow more code to run in vm86 mode. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: perf uncore lkvm woes

2012-08-20 Thread Avi Kivity
On 08/20/2012 08:30 AM, Yan, Zheng wrote: On 08/19/2012 05:55 PM, Avi Kivity wrote: On 08/17/2012 09:56 AM, Peter Zijlstra wrote: On Fri, 2012-08-17 at 09:40 +0800, Yan, Zheng wrote: Peter, do I need to submit a patch disables uncore on virtualized CPU? I think Avi prefers the method where

Re: perf uncore lkvm woes

2012-08-20 Thread Avi Kivity
On 08/20/2012 07:15 AM, Yan, Zheng wrote: On 08/19/2012 05:55 PM, Avi Kivity wrote: On 08/17/2012 09:56 AM, Peter Zijlstra wrote: On Fri, 2012-08-17 at 09:40 +0800, Yan, Zheng wrote: Peter, do I need to submit a patch disables uncore on virtualized CPU? I think Avi prefers the method where

Re: [PATCH] kvm/fpu: Enable fully eager restore kvm FPU

2012-08-20 Thread Avi Kivity
On 08/20/2012 12:24 PM, Roedel, Joerg wrote: (Back from vacation) On Thu, Aug 16, 2012 at 01:59:02PM +0300, Avi Kivity wrote: Ok. Please check that ~KVM_XSTATE_LAZY expands to 64-bits correctly, maybe we need to cast it to u64 before negating it. Note that we limit xcr0 to the bits

Re: [PATCH] kvm/fpu: Enable fully eager restore kvm FPU

2012-08-20 Thread Avi Kivity
On 08/20/2012 01:14 PM, Roedel, Joerg wrote: On Mon, Aug 20, 2012 at 01:08:14PM +0300, Avi Kivity wrote: On 08/20/2012 12:24 PM, Roedel, Joerg wrote: So it was broken all along? Yikes. There is no LWP support in the kernel and thus KVM can't expose it to guests. So for now nothing should

Re: when will kvm merge update from upstream linux?

2012-08-20 Thread Avi Kivity
On 08/20/2012 01:32 PM, Ren, Yongjie wrote: Hi Avi, With latest kvm.git tree, igb VF can't be enabled. But it can work fine with upstream linux.git tree. When will kvm merge the latest update in upstream linux? The following commit in upstream linux.git should be the fix. It is in

Re: Windows slow boot: contractor wanted

2012-08-19 Thread Avi Kivity
On 08/17/2012 03:36 PM, Richard Davies wrote: Hi Avi, Thanks to you and several others for offering help. We will work with Avi at first, but are grateful for all the other offers of help. We have a number of other qemu-related projects which we'd be interested in getting done, and will get

Re: [PATCH 37/74] lto, KVM: Don't assume asm statements end up in the same assembler file

2012-08-19 Thread Avi Kivity
On 08/19/2012 05:56 AM, Andi Kleen wrote: From: Andi Kleen a...@linux.intel.com The VMX code references a local assembler label between two inline assembler statements. This assumes they both end up in the same assembler files. In some experimental builds of gcc this is not necessarily

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

2012-08-19 Thread Avi Kivity
On 08/17/2012 08:29 PM, Marcelo Tosatti wrote: On Thu, Aug 16, 2012 at 05:54:49PM +0300, Avi Kivity wrote: 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

Re: [PATCH 3/5] KVM: PPC: Book3S HV: Handle memory slot deletion and modification correctly

2012-08-19 Thread Avi Kivity
On 08/17/2012 09:39 PM, Marcelo Tosatti wrote: Yes. Well, Avi mentioned earlier that there are users for change of GPA base. But, if my understanding is correct, the code that emulates change of BAR in QEMU is: /* now do the real mapping */ if (r-addr != PCI_BAR_UNMAPPED)

Re: qemu-kvm-1.0.1 - unable to exit if vcpu is in infinite loop

2012-08-19 Thread Avi Kivity
On 08/17/2012 06:04 PM, Jan Kiszka wrote: Can anyone imagine that such a barrier may actually be required? If it is currently possible that env-stop is evaluated before we called into sigtimedwait in qemu_kvm_eat_signals, then we could actually eat the signal without properly processing its

Re: [PATCH v3 2/7] memory: Flush coalesced MMIO on selected region access

2012-08-19 Thread Avi Kivity
On 08/17/2012 01:55 PM, Jan Kiszka wrote: On 2012-07-10 12:41, Jan Kiszka wrote: On 2012-07-02 11:07, Avi Kivity wrote: On 06/29/2012 07:37 PM, Jan Kiszka wrote: Instead of flushing pending coalesced MMIO requests on every vmexit, this provides a mechanism to selectively flush when memory

Re: perf uncore lkvm woes

2012-08-19 Thread Avi Kivity
On 08/17/2012 09:56 AM, Peter Zijlstra wrote: On Fri, 2012-08-17 at 09:40 +0800, Yan, Zheng wrote: Peter, do I need to submit a patch disables uncore on virtualized CPU? I think Avi prefers the method where KVM 'fakes' the MSRs and we have to detect if the MSRs actually work or not. s/we

[PATCH 3.6] KVM: x86 emulator: use stack size attribute to mask rsp in stack ops

2012-08-19 Thread Avi Kivity
was exposed by a combination of a27685c33ae (emulate invalid guest state by default), which causes many more instructions to be emulated, and a seabios change (possibly a bug) which causes the high 16 bits of esp to become polluted across calls to real mode software interrupts. Signed-off-by: Avi

Re: [kvmarm] [PATCH v10 07/14] KVM: ARM: Memory virtualization setup

2012-08-19 Thread Avi Kivity
On 08/19/2012 12:38 PM, Peter Maydell wrote: On 19 August 2012 05:34, Christoffer Dall c.d...@virtualopensystems.com wrote: On Thu, Aug 16, 2012 at 2:25 PM, Alexander Graf ag...@suse.de wrote: A single hva can have multiple gpas mapped, no? At least that's what I gathered from the

Re: Windows slow boot: contractor wanted

2012-08-19 Thread Avi Kivity
On 08/17/2012 03:36 PM, Richard Davies wrote: Hi Avi, Thanks to you and several others for offering help. We will work with Avi at first, but are grateful for all the other offers of help. We have a number of other qemu-related projects which we'd be interested in getting done, and will get

Big real mode use in ipxe

2012-08-19 Thread Avi Kivity
ipxe contains the following snippet: /* Copy ROM to image source PMM block */ pushw %es xorw%ax, %ax movw%ax, %es movl%esi, %edi xorl%esi, %esi movzbl romheader_size, %ecx shll$9, %ecx addr32 rep movsb

Re: [PATCH 37/74] lto, KVM: Don't assume asm statements end up in the same assembler file

2012-08-19 Thread Avi Kivity
On 08/19/2012 06:09 PM, Andi Kleen wrote: The reason we use a local label is so that we the function isn't split into two from the profiler's point of view. See cd2276a795b013d1. Hmm that commit message is not very enlightening. The goal was to force a compiler error? No, the goal was to

Re: [ipxe-devel] Big real mode use in ipxe

2012-08-19 Thread Avi Kivity
On 08/19/2012 06:34 PM, Michael Brown wrote: On Sunday 19 Aug 2012 16:07:05 Avi Kivity wrote: Which is exactly what happens here. My understanding of big real mode is that to achieve a segment limit != 0x, you must go into 32-bit protected mode, load a segment with a larger limit

Re: [Qemu-devel] Big real mode use in ipxe

2012-08-19 Thread Avi Kivity
On 08/19/2012 06:44 PM, Kevin O'Connor wrote: On Sun, Aug 19, 2012 at 06:07:05PM +0300, Avi Kivity wrote: ipxe contains the following snippet: /* Copy ROM to image source PMM block */ pushw %es xorw%ax, %ax movw%ax, %es movl%esi, %edi xorl

Re: [PATCH 3/5] KVM: PPC: Book3S HV: Handle memory slot deletion and modification correctly

2012-08-19 Thread Avi Kivity
On 08/17/2012 09:39 PM, Marcelo Tosatti wrote: Yes. Well, Avi mentioned earlier that there are users for change of GPA base. But, if my understanding is correct, the code that emulates change of BAR in QEMU is: /* now do the real mapping */ if (r-addr != PCI_BAR_UNMAPPED)

Re: perf uncore lkvm woes

2012-08-16 Thread Avi Kivity
On 08/16/2012 10:41 AM, Pekka Enberg wrote: On 08/16/2012 03:19 PM, Peter Zijlstra wrote: On Thu, 2012-08-16 at 10:01 +0300, Pekka Enberg wrote: Has anyone seen this? It's kvmtool/next with 3.6.0-rc1. Looks like we are doing uncore_init() on virtualized CPU which breaks boot. I think you're

Re: perf uncore lkvm woes

2012-08-16 Thread Avi Kivity
On 08/16/2012 10:46 AM, Cyrill Gorcunov wrote: On Thu, Aug 16, 2012 at 10:41:53AM +0300, Pekka Enberg wrote: On 08/16/2012 03:19 PM, Peter Zijlstra wrote: On Thu, 2012-08-16 at 10:01 +0300, Pekka Enberg wrote: Has anyone seen this? It's kvmtool/next with 3.6.0-rc1. Looks like we are doing

Re: [PATCH v5 00/12] KVM: introduce readonly memslot

2012-08-16 Thread Avi Kivity
On 08/15/2012 08:53 PM, Marcelo Tosatti wrote: On Wed, Aug 15, 2012 at 01:44:14PM +0300, Avi Kivity wrote: On 08/14/2012 06:51 PM, Marcelo Tosatti wrote: Userspace may want to modify the ROM (for example, when programming a flash device). It is also possible to map an hva range rw

Re: [PATCH] kvm/fpu: Enable fully eager restore kvm FPU

2012-08-16 Thread Avi Kivity
On 08/16/2012 08:14 AM, Xudong Hao wrote: Enable KVM FPU fully eager restore, if there is other FPU state which isn't tracked by CR0.TS bit. Tested with these cases: 1) SpecCPU2000 workload( 1 VM, 2 VMs) 2) Program for floating point caculate Is the motivation performance or correctness?

Re: [PATCH 1/2] KVM: PPC: 440: Implement mtdcrx

2012-08-16 Thread Avi Kivity
On 08/16/2012 01:42 AM, Alexander Graf wrote: Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/44x_emulate.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kvm/44x_emulate.c b/arch/powerpc/kvm/44x_emulate.c index c8c6157..ea57631

Re: perf uncore lkvm woes

2012-08-16 Thread Avi Kivity
On 08/16/2012 11:40 AM, Avi Kivity wrote: On 08/16/2012 10:41 AM, Pekka Enberg wrote: On 08/16/2012 03:19 PM, Peter Zijlstra wrote: On Thu, 2012-08-16 at 10:01 +0300, Pekka Enberg wrote: Has anyone seen this? It's kvmtool/next with 3.6.0-rc1. Looks like we are doing uncore_init

Re: [PATCH] kvm/fpu: Enable fully eager restore kvm FPU

2012-08-16 Thread Avi Kivity
On 08/16/2012 12:48 PM, Hao, Xudong wrote: -Original Message- From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf Of Avi Kivity Sent: Thursday, August 16, 2012 5:08 PM To: Hao, Xudong Cc: kvm@vger.kernel.org; Zhang, Xiantao Subject: Re: [PATCH] kvm/fpu

Re: perf uncore lkvm woes

2012-08-16 Thread Avi Kivity
On 08/16/2012 02:17 PM, Peter Zijlstra wrote: On Thu, 2012-08-16 at 14:06 +0300, Avi Kivity wrote: Another option is to deal with them on the host side. That has the benefit of working with non-Linux guests too. Right, its an insane amount of MSRs though, but it could be done if someone

Re: Windows slow boot: contractor wanted

2012-08-16 Thread Avi Kivity
On 08/16/2012 01:47 PM, Richard Davies wrote: Hi, We run a cloud hosting provider using qemu-kvm 1.1, and are keen to find a contractor to track down and fix problems we have with large memory Windows guests booting very slowly - they can take several hours. We previously reported these

Re: [PATCH 00/19] pci-assign: Refactor for upstream merge

2012-08-16 Thread Avi Kivity
On 08/16/2012 04:54 PM, Jan Kiszka wrote: With this series, we are getting very close to obsoleting qemu-kvm. It refactors hw/device-assignment.c and the associated KVM helper functions into a form that should allow merging them into QEMU. Once the series is acceptable for qemu-kvm, I will

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

2012-08-16 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: [User question] Huge buffer size on KVM host

2012-08-16 Thread Avi Kivity
On 08/16/2012 05:54 PM, Martin Wawro wrote: On Aug 15, 2012, at 2:57 PM, Avi Kivity wrote: We are using logical volumes and the cache is set to 'none'. Strange, that should work without any buffering. What the contents of /sys/block/sda/queue/hw_sector_size and /sys/block

Re: [PATCH v5 00/12] KVM: introduce readonly memslot

2012-08-16 Thread Avi Kivity
On 08/16/2012 06:57 PM, Marcelo Tosatti wrote: Correct. But the chipset is also able to to write-protect some ranges in the 0xc-0x10 area via the PAM. It is able to write-protect both RAM and PCI memory (usually mapped to flash). You are convinced that adding read-write

Re: [PATCH v8 0/6] kvm: level irqfd support

2012-08-16 Thread Avi Kivity
On 08/11/2012 01:37 AM, Alex Williamson wrote: v8: Trying a new approach. Nobody seems to like the internal IRQ source ID object and the interactions it implies between irqfd and eoifd, so let's get rid of it. Instead, simply expose IRQ source IDs to userspace. This lets the user be in

Re: [PATCH v8 0/6] kvm: level irqfd support

2012-08-16 Thread Avi Kivity
On 08/15/2012 10:22 PM, Michael S. Tsirkin wrote: On Wed, Aug 15, 2012 at 11:36:31AM -0600, Alex Williamson wrote: On Wed, 2012-08-15 at 17:28 +0300, Michael S. Tsirkin wrote: On Fri, Aug 10, 2012 at 04:37:08PM -0600, Alex Williamson wrote: v8: Trying a new approach. Nobody seems to

Re: [PATCH v8 0/6] kvm: level irqfd support

2012-08-16 Thread Avi Kivity
On 08/16/2012 07:54 PM, Michael S. Tsirkin wrote: On Thu, Aug 16, 2012 at 07:39:35PM +0300, Avi Kivity wrote: On 08/16/2012 07:36 PM, Michael S. Tsirkin wrote: What if a level irqfd shares a line with a KVM_IRQ_LINE ioctl? Then an EOI can de-assert the irqfd source, but the line is kept

Re: [PATCH v8 0/6] kvm: level irqfd support

2012-08-16 Thread Avi Kivity
On 08/16/2012 07:36 PM, Michael S. Tsirkin wrote: What if a level irqfd shares a line with a KVM_IRQ_LINE ioctl? Then an EOI can de-assert the irqfd source, but the line is kept high by the last KVM_IRQ_LINE invocation. Exactly. So 1 ID for userspace and 1 for irqfd. Gaa, this mess

Re: [PATCH 10/19] pci-assign: Replace kvm_assign_set_msix_entry with kvm_device_msix_set_vector

2012-08-16 Thread Avi Kivity
On 08/16/2012 07:21 PM, Alex Williamson wrote: +int kvm_device_msix_set_vector(KVMState *s, uint32_t dev_id, uint32_t vector, + int virq) +{ +struct kvm_assigned_msix_entry msix_entry = { +.assigned_dev_id = dev_id, +.gsi = virq, +

Re: [PATCH 2/3] vfio: vfio-pci device assignment driver

2012-08-15 Thread Avi Kivity
On 08/14/2012 08:23 PM, Alex Williamson wrote: Unrelated nit: memcmp() doesn't return a boolean or a count, so !memcmp() is really unintuitive, at least to me. I figure we're all pretty used to it growing up on !strcmp though. I hate that one too. + +/* XXX This should move to msi.c

Re: [PATCH 3/5] KVM: PPC: Book3S HV: Handle memory slot deletion and modification correctly

2012-08-15 Thread Avi Kivity
On 08/13/2012 07:34 PM, Marcelo Tosatti wrote: Avi, Gleb, Alex, do you know why it is necessary to support change of GPA base again? BAR moving around. Without taking into consideration backwards compatibility, userspace can first delete the slot and later create a new one. Current qemu

<    1   2   3   4   5   6   7   8   9   10   >