Re: [PATCH] KVM: mmu: allow page tables to be in read-only slots

2013-09-02 Thread Gleb Natapov
On Mon, Sep 02, 2013 at 06:05:10PM +0800, Xiao Guangrong wrote: > On 09/02/2013 05:49 PM, Gleb Natapov wrote: > > On Mon, Sep 02, 2013 at 05:42:25PM +0800, Xiao Guangrong wrote: > >> On 09/01/2013 05:17 PM, Gleb Natapov wrote: > >>> On Fri, Aug 30, 2013 at 02:41:3

Re: [PATCH] KVM: mmu: allow page tables to be in read-only slots

2013-09-02 Thread Gleb Natapov
On Mon, Sep 02, 2013 at 06:00:08PM +0200, Paolo Bonzini wrote: > Il 02/09/2013 11:25, Gleb Natapov ha scritto: > > On Mon, Sep 02, 2013 at 05:20:15PM +0800, Xiao Guangrong wrote: > >> On 08/30/2013 08:41 PM, Paolo Bonzini wrote: > >>> Page tables in a read-only memo

Re: [PATCH] KVM: mmu: allow page tables to be in read-only slots

2013-09-02 Thread Gleb Natapov
On Mon, Sep 02, 2013 at 05:56:07PM +0200, Paolo Bonzini wrote: > Il 02/09/2013 12:07, Gleb Natapov ha scritto: > > On Mon, Sep 02, 2013 at 06:00:39PM +0800, Xiao Guangrong wrote: > >> On 09/02/2013 05:25 PM, Gleb Natapov wrote: > >>> On Mon, Sep 02, 2013 at 05:20:15

Re: [PATCH] KVM: mmu: allow page tables to be in read-only slots

2013-09-02 Thread Gleb Natapov
On Mon, Sep 02, 2013 at 05:58:41PM +0200, Paolo Bonzini wrote: > Il 02/09/2013 12:11, Gleb Natapov ha scritto: > >> > > >> > Got it, thanks for your explanation. > >> > > >> > BTW, if you and Paolo are busy on other things, i am happy to fix

Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling

2013-09-03 Thread Gleb Natapov
On Mon, Sep 02, 2013 at 01:14:29PM +1000, Alexey Kardashevskiy wrote: > On 09/01/2013 10:06 PM, Gleb Natapov wrote: > > On Wed, Aug 28, 2013 at 06:50:41PM +1000, Alexey Kardashevskiy wrote: > >> This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT > >&g

[GIT PULL] KVM changes for 3.12

2013-09-03 Thread Gleb Natapov
ng in arch/mips/kvm/kvm_locore.S mips/kvm: Cleanup .push/.pop directives in kvm_locore.S mips/kvm: Make kvm_locore.S 64-bit buildable/safe. Dominik Dingel (1): KVM: s390: Make KVM_HVA_ERR_BAD usable on s390 Gleb Natapov (7): nVMX: reset rflags register cache during

Re: [PATCH v2] tile: support KVM for tilegx

2013-09-03 Thread Gleb Natapov
On Tue, Sep 03, 2013 at 01:32:22PM -0400, Chris Metcalf wrote: > On 8/26/2013 8:04 AM, Gleb Natapov wrote: > > On Sun, Aug 25, 2013 at 09:26:47PM -0400, Chris Metcalf wrote: > >> On 8/25/2013 7:39 AM, Gleb Natapov wrote: > >>> On Mon, Aug 12, 2013 at 04:24:1

Re: [RFC PATCH 3/3] kvm: Add VFIO device for handling IOMMU cache coherency

2013-09-29 Thread Gleb Natapov
On Thu, Sep 12, 2013 at 03:23:15PM -0600, Alex Williamson wrote: > So far we've succeeded at making KVM and VFIO mostly unaware of each > other, but there's any important point where that breaks down. Intel > VT-d hardware may or may not support snoop control. When snoop > control is available, i

Re: [RFC PATCH 3/3] kvm: Add VFIO device for handling IOMMU cache coherency

2013-09-29 Thread Gleb Natapov
On Sun, Sep 29, 2013 at 07:52:28AM -0600, Alex Williamson wrote: > On Sun, 2013-09-29 at 16:16 +0300, Gleb Natapov wrote: > > On Thu, Sep 12, 2013 at 03:23:15PM -0600, Alex Williamson wrote: > > > So far we've succeeded at making KVM and VFIO mostly unaware of each >

Re: [RFC/query] kvm async_pf anon pined pages migration

2013-09-30 Thread Gleb Natapov
On Mon, Sep 30, 2013 at 06:03:07PM +0800, chai wen wrote: > > Hi all > > Async page fault in kvm currently pin user pages via get_user_pages. > when doing page migration,the method can be found via > page->mmapping->a_ops->migratepage to offline old pages and migrate to > new pages. As to anonymo

Re: [RFC PATCH 3/3] kvm: Add VFIO device for handling IOMMU cache coherency

2013-09-30 Thread Gleb Natapov
On Sun, Sep 29, 2013 at 09:55:59AM -0600, Alex Williamson wrote: > On Sun, 2013-09-29 at 17:44 +0300, Gleb Natapov wrote: > > On Sun, Sep 29, 2013 at 07:52:28AM -0600, Alex Williamson wrote: > > > On Sun, 2013-09-29 at 16:16 +0300, Gleb Natapov wrote: > > > > On T

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-01 Thread Gleb Natapov
On Tue, Oct 01, 2013 at 06:34:26PM +1000, Michael Ellerman wrote: > On Thu, Sep 26, 2013 at 11:06:59AM +0200, Paolo Bonzini wrote: > > Il 26/09/2013 08:31, Michael Ellerman ha scritto: > > > Some powernv systems include a hwrng. Guests can access it via the > > > H_RANDOM hcall. > > > > Is there a

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-01 Thread Gleb Natapov
On Tue, Oct 01, 2013 at 07:23:20PM +1000, Paul Mackerras wrote: > On Tue, Oct 01, 2013 at 11:39:08AM +0300, Gleb Natapov wrote: > > On Tue, Oct 01, 2013 at 06:34:26PM +1000, Michael Ellerman wrote: > > > On Thu, Sep 26, 2013 at 11:06:59AM +0200, Paolo Bonzini wrote: > >

Re: [PATCH 0/3] KVM: Make kvm_lock non-raw

2013-09-22 Thread Gleb Natapov
k in the "raw" part and the > "non-raw" part. > > Paul, could you please provide your Tested-by? > Reviewed-by: Gleb Natapov But why should it go to stable? > Thanks, > > Paolo > > Paolo Bonzini (3): > KVM: cleanup (physical) CPU hotplug >

Re: [PATCH v2 2/3] KVM: x86: prevent setting unsupported XSAVE states

2013-09-22 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 04:26:30PM +0200, Paolo Bonzini wrote: > A guest can still attempt to save and restore XSAVE states even if they > have been masked in CPUID leaf 0Dh. This usually is not visible to > the guest, but is still wrong: "Any attempt to set a reserved bit (as > determined by the

Re: [PATCH 0/3] KVM: Make kvm_lock non-raw

2013-09-22 Thread Gleb Natapov
On Sun, Sep 22, 2013 at 10:53:14AM +0200, Paolo Bonzini wrote: > Il 22/09/2013 09:42, Gleb Natapov ha scritto: > > On Mon, Sep 16, 2013 at 04:06:10PM +0200, Paolo Bonzini wrote: > >> Paul Gortmaker reported a BUG on preempt-rt kernels, due to taking the > >> mmu_lock

Re: [PATCH v2 2/3] KVM: x86: prevent setting unsupported XSAVE states

2013-09-23 Thread Gleb Natapov
On Mon, Sep 23, 2013 at 12:22:37PM +0200, Paolo Bonzini wrote: > >> @@ -6940,6 +6948,9 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) > >> > >>vcpu->arch.ia32_tsc_adjust_msr = 0x0; > >>vcpu->arch.pv_time_enabled = false; > >> + > >> + vcpu->arch.supported_xcr0 = XSTATE_FPSSE; > >> + >

Re: [PATCH 0/3] KVM: Make kvm_lock non-raw

2013-09-23 Thread Gleb Natapov
On Mon, Sep 23, 2013 at 03:44:21PM +0200, Paolo Bonzini wrote: > Il 23/09/2013 15:36, Paul Gortmaker ha scritto: > >> > The change is not completely trivial, it splits lock. There is no > >> > obvious problem of course, otherwise you wouldn't send it and I > >> > would ack it :), but it does not me

Re: [PATCH 1/6] kvm: Add KVM_GET_EMULATED_CPUID

2013-09-24 Thread Gleb Natapov
On Tue, Sep 24, 2013 at 11:57:00AM +0200, Borislav Petkov wrote: > On Mon, September 23, 2013 6:28 pm, Eduardo Habkost wrote: > > On Sun, Sep 22, 2013 at 04:44:50PM +0200, Borislav Petkov wrote: > >> From: Borislav Petkov > >> > >> Add a kvm ioctl which states which system functionality kvm emulat

Re: [PATCH 1/1] arch/x86/kvm/cpuid.c: cpuid_maxphyaddr "bad" handling.

2012-12-02 Thread Gleb Natapov
On Fri, Nov 30, 2012 at 03:20:27PM -0200, Raphael S Carvalho wrote: > Well, the below function reports the physical-address width supported > by the processor. > It does its work very well, though I found a detail which it doesn't > handle at all. > > PS: The following function is not a patch. > i

Re: [RFC PATCH v3] Add rcu user eqs exception hooks for async page fault

2012-12-03 Thread Gleb Natapov
On Mon, Dec 03, 2012 at 10:08:32AM +0800, Li Zhong wrote: > On Fri, 2012-11-30 at 12:26 +0200, Gleb Natapov wrote: > > On Fri, Nov 30, 2012 at 05:18:41PM +0800, Li Zhong wrote: > > > This patch adds user eqs exception hooks for async page fault page not > > > present

Re: [RFC PATCH v3] Add rcu user eqs exception hooks for async page fault

2012-12-03 Thread Gleb Natapov
Please regenerate the patch against git://git.kernel.org/pub/scm/virt/kvm/kvm.git queue. On Fri, Nov 30, 2012 at 05:18:41PM +0800, Li Zhong wrote: > This patch adds user eqs exception hooks for async page fault page not > present code path, to exit the user eqs and re-enter it as necessary. > >

Re: [PATCH v9 1/2] x86/kexec: VMCLEAR VMCSs loaded on all cpus if necessary

2012-12-03 Thread Gleb Natapov
On Tue, Nov 27, 2012 at 02:18:47PM +0200, Gleb Natapov wrote: > Eric, can you ACK it? > Eric, ping. > On Tue, Nov 27, 2012 at 11:26:02AM +0800, Zhang Yanfei wrote: > > This patch provides a way to VMCLEAR VMCSs related to guests > > on all cpus before executing the VMXOFF w

Re: [RFC PATCH v3] Add rcu user eqs exception hooks for async page fault

2012-12-03 Thread Gleb Natapov
On Tue, Dec 04, 2012 at 10:36:02AM +0800, Li Zhong wrote: > On Mon, 2012-12-03 at 11:57 +0200, Gleb Natapov wrote: > > Please regenerate the patch against > > git://git.kernel.org/pub/scm/virt/kvm/kvm.git queue. > > Done. > > By the way, the included file is replaced

Re: [RFC PATCH 0/6] kvm: Growable memory slot array

2012-12-04 Thread Gleb Natapov
On Mon, Dec 03, 2012 at 04:39:05PM -0700, Alex Williamson wrote: > Memory slots are currently a fixed resource with a relatively small > limit. When using PCI device assignment in a qemu guest it's fairly > easy to exhaust the number of available slots. I posted patches > exploring growing the nu

Re: [RFC PATCH v3] Add rcu user eqs exception hooks for async page fault

2012-12-04 Thread Gleb Natapov
On Tue, Dec 04, 2012 at 10:36:02AM +0800, Li Zhong wrote: > On Mon, 2012-12-03 at 11:57 +0200, Gleb Natapov wrote: > > Please regenerate the patch against > > git://git.kernel.org/pub/scm/virt/kvm/kvm.git queue. > > Done. > > By the way, the included file is replaced

Re: [RFC PATCH 0/6] kvm: Growable memory slot array

2012-12-04 Thread Gleb Natapov
On Tue, Dec 04, 2012 at 08:21:55AM -0700, Alex Williamson wrote: > On Tue, 2012-12-04 at 13:48 +0200, Gleb Natapov wrote: > > On Mon, Dec 03, 2012 at 04:39:05PM -0700, Alex Williamson wrote: > > > Memory slots are currently a fixed resource with a relatively small > >

Re: [RFC PATCH 0/6] kvm: Growable memory slot array

2012-12-04 Thread Gleb Natapov
On Tue, Dec 04, 2012 at 08:39:47AM -0700, Alex Williamson wrote: > On Tue, 2012-12-04 at 17:30 +0200, Gleb Natapov wrote: > > On Tue, Dec 04, 2012 at 08:21:55AM -0700, Alex Williamson wrote: > > > On Tue, 2012-12-04 at 13:48 +0200, Gleb Natapov wrote: > > > > On M

Re: [PATCH] kvm, async_pf: exit idleness when handling KVM_PV_REASON_PAGE_NOT_PRESENT

2012-10-21 Thread Gleb Natapov
_exclusive_wait+0xb0/0xb0 > [ 732.790032] [] ? prepare_to_wait+0x25/0x90 > [ 732.790032] [] do_async_page_fault+0x56/0xa0 > [ 732.790032] [] async_page_fault+0x28/0x30 > > Signed-off-by: Sasha Levin Acked-by: Gleb Natapov > --- > arch/x86/kernel/kvm.c | 3 +++ > 1 file changed,

Re: [PATCH] KVM: x86: fix vcpu->mmio_fragments overflow

2012-10-22 Thread Gleb Natapov
On Fri, Oct 19, 2012 at 03:37:32PM +0800, Xiao Guangrong wrote: > After commit b3356bf0dbb349 (KVM: emulator: optimize "rep ins" handling), > the pieces of io data can be collected and write them to the guest memory > or MMIO together. > > Unfortunately, kvm splits the mmio access into 8 bytes and

Re: [GIT PULL] Linux KVM tool for v3.7-rc0

2012-10-22 Thread Gleb Natapov
On Mon, Oct 22, 2012 at 11:24:19AM +0200, Avi Kivity wrote: > On 10/21/2012 05:39 PM, Pekka Enberg wrote: > > > > On Sun, Oct 21, 2012 at 5:02 PM, richard -rw- weinberger > > wrote: > >> qemu supports all these features. > >> E.g. to access the host fs use: > >> qemu ... \ > >> -fsdev > >> loc

Re: [PATCH] KVM: x86: fix vcpu->mmio_fragments overflow

2012-10-22 Thread Gleb Natapov
On Mon, Oct 22, 2012 at 07:09:38PM +0800, Xiao Guangrong wrote: > On 10/22/2012 05:16 PM, Gleb Natapov wrote: > > On Fri, Oct 19, 2012 at 03:37:32PM +0800, Xiao Guangrong wrote: > >> After commit b3356bf0dbb349 (KVM: emulator: optimize "rep ins" handling), >

Re: [PATCH] KVM: x86: fix vcpu->mmio_fragments overflow

2012-10-22 Thread Gleb Natapov
On Mon, Oct 22, 2012 at 01:35:56PM +0200, Jan Kiszka wrote: > On 2012-10-22 13:23, Gleb Natapov wrote: > > On Mon, Oct 22, 2012 at 07:09:38PM +0800, Xiao Guangrong wrote: > >> On 10/22/2012 05:16 PM, Gleb Natapov wrote: > >>> On Fri, Oct 19, 2012 at 03:37:32

Re: [PATCH] KVM: x86: fix vcpu->mmio_fragments overflow

2012-10-22 Thread Gleb Natapov
On Mon, Oct 22, 2012 at 02:45:37PM +0200, Jan Kiszka wrote: > On 2012-10-22 14:18, Avi Kivity wrote: > > On 10/22/2012 01:45 PM, Jan Kiszka wrote: > > > >>> Indeed. git pull, recheck and call for kvm_flush_coalesced_mmio_buffer() > >>> is gone. So this will break new userspace, not old. By global

Re: [PATCH] KVM: x86: fix vcpu->mmio_fragments overflow

2012-10-22 Thread Gleb Natapov
On Mon, Oct 22, 2012 at 02:55:14PM +0200, Jan Kiszka wrote: > On 2012-10-22 14:53, Gleb Natapov wrote: > > On Mon, Oct 22, 2012 at 02:45:37PM +0200, Jan Kiszka wrote: > >> On 2012-10-22 14:18, Avi Kivity wrote: > >>> On 10/22/2012 01:45 PM, Jan Kiszka wrote: > >

Re: [PATCH] KVM: x86: fix vcpu->mmio_fragments overflow

2012-10-22 Thread Gleb Natapov
On Mon, Oct 22, 2012 at 02:55:24PM +0200, Avi Kivity wrote: > On 10/22/2012 02:53 PM, Gleb Natapov wrote: > > On Mon, Oct 22, 2012 at 02:45:37PM +0200, Jan Kiszka wrote: > >> On 2012-10-22 14:18, Avi Kivity wrote: > >> > On 10/22/2012 01:45 PM, Jan Kiszka wrote: >

Re: [PATCH] KVM: x86: fix vcpu->mmio_fragments overflow

2012-10-22 Thread Gleb Natapov
On Mon, Oct 22, 2012 at 03:02:22PM +0200, Avi Kivity wrote: > On 10/22/2012 03:01 PM, Gleb Natapov wrote: > > >> It's time where the guest cannot take interrupts, and time in a high > >> priority guest thread that is spent processing low guest priority requests. >

Re: [PATCH] KVM: x86: fix vcpu->mmio_fragments overflow

2012-10-22 Thread Gleb Natapov
On Mon, Oct 22, 2012 at 03:05:58PM +0200, Jan Kiszka wrote: > On 2012-10-22 14:58, Avi Kivity wrote: > > On 10/22/2012 02:55 PM, Jan Kiszka wrote: > >>> Since the userspace change is needed the idea is dead, but if we could > >>> implement it I do not see how it can hurt the latency if it would be

Re: [PATCH] KVM: x86: fix vcpu->mmio_fragments overflow

2012-10-22 Thread Gleb Natapov
On Mon, Oct 22, 2012 at 03:25:49PM +0200, Jan Kiszka wrote: > On 2012-10-22 15:08, Gleb Natapov wrote: > > On Mon, Oct 22, 2012 at 03:05:58PM +0200, Jan Kiszka wrote: > >> On 2012-10-22 14:58, Avi Kivity wrote: > >>> On 10/22/2012 02:55 PM, Jan Kiszka wrote: > &g

Re: [PATCH] KVM: MMU: optimize for set_spte

2012-12-05 Thread Gleb Natapov
On Tue, Dec 04, 2012 at 07:17:11AM +0800, Xiao Guangrong wrote: > There are two cases we need to adjust page size in set_spte: > 1): the one is other vcpu creates new sp in the window between mapping_level() > and acquiring mmu-lock. > 2): the another case is the new sp is created by itself (pa

Re: [PATCH v10 0/2] x86: vmclear vmcss on all cpus when doing kdump if necessary

2012-12-06 Thread Gleb Natapov
Can you regenerate against current queue branch in git://git.kernel.org/pub/scm/virt/kvm/kvm.git please? On Wed, Dec 05, 2012 at 03:58:50PM +0800, Zhang Yanfei wrote: > Currently, kdump just makes all the logical processors leave VMX operation by > executing VMXOFF instruction, so any VMCSs active

Re: [PATCH v11 0/2] x86: vmclear vmcss on all cpus when doing kdump if necessary

2012-12-06 Thread Gleb Natapov
On Thu, Dec 06, 2012 at 11:36:48PM +0800, Zhang Yanfei wrote: > Currently, kdump just makes all the logical processors leave VMX operation by > executing VMXOFF instruction, so any VMCSs active on the logical processors > may > be corrupted. But, sometimes, we need the VMCSs to debug guest images

Re: [RFCv2][PATCH 1/3] create slow_virt_to_phys()

2012-12-09 Thread Gleb Natapov
Copying more people. Is this approach good? The alternative would be to allocate NR_CPUS sized arrays in KVM. On Fri, Dec 07, 2012 at 04:30:23PM -0500, Dave Hansen wrote: > > This is necessary because __pa() does not work on some kinds of > memory, like vmalloc() or the alloc_remap() areas on 32-

Re: [PATCH] kvm/vmx: fix the return value of handle_vmcall()

2012-12-10 Thread Gleb Natapov
On Mon, Dec 10, 2012 at 03:28:13PM -0600, Jesse Larrew wrote: > > The return value of kvm_emulate_hypercall() is intended to inform callers > whether or not we need to exit to userspace. However, handle_vmcall() > currently ignores the return value. > No, it it not. KVM does not handle vmcalls in

Re: [PATCH] x86/kexec: crash_vmclear_local_vmcss needs __rcu

2012-12-11 Thread Gleb Natapov
On Tue, Dec 11, 2012 at 04:04:55PM +0800, Zhang Yanfei wrote: > 于 2012年12月11日 04:30, Marcelo Tosatti 写道: > > On Fri, Dec 07, 2012 at 01:40:56PM +0800, Zhang Yanfei wrote: > >> This removes the sparse warning: > >> arch/x86/kernel/crash.c:49:32: sparse: incompatible types in comparison > >> express

Re: [PATCH 05/32] perf, kvm: Support the intx/intx_cp modifiers in KVM arch perfmon emulation v4

2012-11-12 Thread Gleb Natapov
On Fri, Nov 09, 2012 at 05:27:21PM -0800, Andi Kleen wrote: > From: Andi Kleen > > This is not arch perfmon, but older CPUs will just ignore it. This makes > it possible to do at least some TSX measurements from a KVM guest > > Cc: a...@redhat.com > Cc: g...@redhat.com > v2: Various fixes to add

Re: [PATCH] kvm: fix i8254 counter 0 wraparound

2012-12-18 Thread Gleb Natapov
On Sat, Dec 15, 2012 at 06:34:37AM -0500, Nickolai Zeldovich wrote: > The kvm i8254 emulation for counter 0 (but not for counters 1 and 2) > has at least two bugs in mode 0: > > 1. The OUT bit, computed by pit_get_out(), is never set high. > > 2. The counter value, computed by pit_get_count(), wr

Re: [ PATCH] Add rcu user eqs exception hooks for async page fault

2012-12-18 Thread Gleb Natapov
On Tue, Dec 04, 2012 at 10:35:13AM +0800, Li Zhong wrote: > This patch adds user eqs exception hooks for async page fault page not > present code path, to exit the user eqs and re-enter it as necessary. > > Async page fault is different from other exceptions that it may be > triggered from idle pr

Re: [PATCH 0/7] KVM: Alleviate mmu_lock hold time when we start dirty logging

2012-12-20 Thread Gleb Natapov
On Thu, Dec 20, 2012 at 10:59:46AM -0200, Marcelo Tosatti wrote: > On Thu, Dec 20, 2012 at 02:02:32PM +0900, Takuya Yoshikawa wrote: > > On Wed, 19 Dec 2012 08:42:57 -0700 > > Alex Williamson wrote: > > > > > Please let me know if you can identify one of these as the culprit. > > > They're all ve

Re: [PATCH 0/7] KVM: Alleviate mmu_lock hold time when we start dirty logging

2012-12-21 Thread Gleb Natapov
On Fri, Dec 21, 2012 at 05:02:50PM +0900, Takuya Yoshikawa wrote: > On Thu, 20 Dec 2012 07:55:43 -0700 > Alex Williamson wrote: > > > > Yes, the fix should work, but I do not want to update the > > > generation from outside of update_memslots(). > > > > Ok, then: > > > > diff --git a/include/lin

Re: [PATCH] kvm: Fix memory slot generation updates

2012-12-23 Thread Gleb Natapov
On Fri, Dec 21, 2012 at 08:20:16AM -0700, Alex Williamson wrote: > Previous patch "kvm: Minor memory slot optimization" overlooked the > generation field of the memory slots. Re-using the original memory > slots left us with with two slightly different memory slots with the > same generation. To

Re: [GIT PULL] perf changes for v3.8

2012-12-23 Thread Gleb Natapov
On Sat, Dec 22, 2012 at 12:30:35PM -0700, David Ahern wrote: > On 12/17/12 3:20 AM, Gleb Natapov wrote: > >Does the regression happen because of commit 20b279ddb38c. If it does I > >think it is safe to revert it. KVM disables PEBS during guest entry now, so > >VMs shouldn

Re: [PATCH v2 0/5] KVM: x86: improve reexecute_instruction

2012-12-23 Thread Gleb Natapov
On Fri, Dec 14, 2012 at 11:05:46PM -0200, Marcelo Tosatti wrote: > On Fri, Dec 14, 2012 at 12:50:09PM +0800, Xiao Guangrong wrote: > > >>> program a timer interrupt and #GP? > > >> > > >> Could you please explain the detail? > > > > > > Before the instruction which writes continuously to the page

Re: [PATCH v3 5/5] KVM: x86: improve reexecute_instruction

2012-12-23 Thread Gleb Natapov
On Sat, Dec 15, 2012 at 03:01:12PM +0800, Xiao Guangrong wrote: > The current reexecute_instruction can not well detect the failed instruction > emulation. It allows guest to retry all the instructions except it accesses > on error pfn > > For example, some cases are nested-write-protect - if the

Re: [GIT PULL] perf changes for v3.8

2012-12-24 Thread Gleb Natapov
On Sun, Dec 23, 2012 at 04:17:45PM -0700, David Ahern wrote: > On 12/23/12 2:23 AM, Gleb Natapov wrote: > >>Your patch alone was not enough. Start here: > >> https://lkml.org/lkml/2012/7/12/3 > >> > >I cannot reproduce this failure. I reverted 20b279ddb38c a

Re: [PATCH 1/7] KVM: Write protect the updated slot only when we start dirty logging

2012-12-24 Thread Gleb Natapov
On Tue, Dec 18, 2012 at 04:26:47PM +0900, Takuya Yoshikawa wrote: > This is needed to make kvm_mmu_slot_remove_write_access() rmap based: > otherwise we may end up using invalid rmap's. > > Signed-off-by: Takuya Yoshikawa > --- > arch/x86/kvm/x86.c |9 - > virt/kvm/kvm_main.c |1

Re: [PATCH 1/7] KVM: Write protect the updated slot only when we start dirty logging

2012-12-24 Thread Gleb Natapov
On Tue, Dec 25, 2012 at 01:08:40PM +0900, Takuya Yoshikawa wrote: > On Mon, 24 Dec 2012 15:27:17 +0200 > Gleb Natapov wrote: > > > > @@ -6897,7 +6897,14 @@ void kvm_arch_commit_memory_region(struct kvm *kvm, > > > spin_lock(&kvm->m

Re: [PATCH 1/3] KVM: x86: clean up reexecute_instruction

2012-11-20 Thread Gleb Natapov
On Tue, Nov 20, 2012 at 07:58:32AM +0800, Xiao Guangrong wrote: > Little cleanup for reexecute_instruction, also use gpa_to_gfn in > retry_instruction > > Signed-off-by: Xiao Guangrong > --- > arch/x86/kvm/x86.c | 13 ++--- > 1 files changed, 6 insertions(+), 7 deletions(-) > > diff -

[PATCH] KVM: taking co-maintenance

2012-11-20 Thread Gleb Natapov
Updating MAINTAINERS file. Signed-off-by: Gleb Natapov diff --git a/MAINTAINERS b/MAINTAINERS index 6b5b0b7..b273360 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4281,6 +4281,7 @@ F:include/linux/sunrpc/ KERNEL VIRTUAL MACHINE (KVM) M: Marcelo Tosatti +M: Gleb Natapov L

Re: [PATCH] kvm: Allow build-time configuration of KVM device assignment

2013-04-18 Thread Gleb Natapov
On Tue, Apr 16, 2013 at 01:49:18PM -0600, Alex Williamson wrote: > We hope to at some point deprecate KVM legacy device assignment in > favor of VFIO-based assignment. Towards that end, allow legacy > device assignment to be deconfigured. > > Signed-off-by: Alex Williamson

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-04-18 Thread Gleb Natapov
On Wed, Apr 17, 2013 at 05:39:04PM -0300, Marcelo Tosatti wrote: > On Fri, Mar 22, 2013 at 09:15:24PM +0200, Gleb Natapov wrote: > > On Fri, Mar 22, 2013 at 08:37:33PM +0800, Xiao Guangrong wrote: > > > On 03/22/2013 08:12 PM, Gleb Natapov wrote: > > > > On Fri, Ma

Re: [PATCH v3 08/15] KVM: MMU: allow unmap invalid rmap out of mmu-lock

2013-04-18 Thread Gleb Natapov
On Tue, Apr 16, 2013 at 02:32:46PM +0800, Xiao Guangrong wrote: > pte_list_clear_concurrently allows us to reset pte-desc entry > out of mmu-lock. We can reset spte out of mmu-lock if we can protect the > lifecycle of sp, we use this way to achieve the goal: > > unmap_memslot_rmap_nolock(): > for-

Re: [PATCH v3 08/15] KVM: MMU: allow unmap invalid rmap out of mmu-lock

2013-04-18 Thread Gleb Natapov
On Thu, Apr 18, 2013 at 07:22:23PM +0800, Xiao Guangrong wrote: > On 04/18/2013 07:00 PM, Gleb Natapov wrote: > > On Tue, Apr 16, 2013 at 02:32:46PM +0800, Xiao Guangrong wrote: > >> pte_list_clear_concurrently allows us to reset pte-desc entry > >> out of mmu-lock. W

Re: KVM VM(windows xp) reseted when running geekbench for about 2 days

2013-04-18 Thread Gleb Natapov
On Thu, Apr 18, 2013 at 12:00:49PM +, Zhanghaoyu (A) wrote: > I start 10 VMs(windows xp), then running geekbench tool on them, about 2 > days, one of them was reset, > I found the reset operation is done by > int kvm_cpu_exec(CPUArchState *env) > { > ... >switch (run->exit_reason)

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-04-18 Thread Gleb Natapov
On Thu, Apr 18, 2013 at 11:01:18AM -0300, Marcelo Tosatti wrote: > On Thu, Apr 18, 2013 at 12:42:39PM +0300, Gleb Natapov wrote: > > > > that, but if not then less code is better. > > > > > > The number of sp->role.invalid=1 pages is small (only shadow roots).

Re: KVM VM(windows xp) reseted when running geekbench for about 2 days

2013-04-19 Thread Gleb Natapov
On Fri, Apr 19, 2013 at 01:05:08AM +, Zhanghaoyu (A) wrote: > >> On Thu, Apr 18, 2013 at 12:00:49PM +, Zhanghaoyu (A) wrote: > >>> I start 10 VMs(windows xp), then running geekbench tool on them, > >>> about 2 days, one of them was reset, I found the reset operation is > >>> done by int k

Re: [PATCH v3 00/15] KVM: MMU: fast zap all shadow pages

2013-04-21 Thread Gleb Natapov
On Tue, Apr 16, 2013 at 02:32:38PM +0800, Xiao Guangrong wrote: > This patchset is based on my previous two patchset: > [PATCH 0/2] KVM: x86: avoid potential soft lockup and unneeded mmu reload > (https://lkml.org/lkml/2013/4/1/2) > > [PATCH v2 0/6] KVM: MMU: fast invalid all mmio sptes > (https:/

Re: [PATCH v3 00/15] KVM: MMU: fast zap all shadow pages

2013-04-22 Thread Gleb Natapov
On Sun, Apr 21, 2013 at 10:09:29PM +0800, Xiao Guangrong wrote: > On 04/21/2013 09:03 PM, Gleb Natapov wrote: > > On Tue, Apr 16, 2013 at 02:32:38PM +0800, Xiao Guangrong wrote: > >> This patchset is based on my previous two patchset: > >> [PATCH 0/2] KVM: x86: avoi

Re: [PATCH v3 00/15] KVM: MMU: fast zap all shadow pages

2013-04-22 Thread Gleb Natapov
On Sun, Apr 21, 2013 at 12:35:08PM -0300, Marcelo Tosatti wrote: > On Sun, Apr 21, 2013 at 12:27:51PM -0300, Marcelo Tosatti wrote: > > On Sun, Apr 21, 2013 at 04:03:46PM +0300, Gleb Natapov wrote: > > > On Tue, Apr 16, 2013 at 02:32:38PM +0800, Xiao Guangrong wrote: > > &g

Re: Preemptable Ticket Spinlock

2013-04-22 Thread Gleb Natapov
On Mon, Apr 22, 2013 at 07:08:06PM -0400, Rik van Riel wrote: > On 04/22/2013 04:55 PM, Peter Zijlstra wrote: > >On Mon, 2013-04-22 at 16:46 -0400, Jiannan Ouyang wrote: > > >>- pv-preemptable-lock has much less performance variance compare to > >>pv_lock, because it adapts to preemption within V

Re: [PATCH v3 00/15] KVM: MMU: fast zap all shadow pages

2013-04-22 Thread Gleb Natapov
On Tue, Apr 23, 2013 at 08:19:02AM +0800, Xiao Guangrong wrote: > On 04/22/2013 05:21 PM, Gleb Natapov wrote: > > On Sun, Apr 21, 2013 at 10:09:29PM +0800, Xiao Guangrong wrote: > >> On 04/21/2013 09:03 PM, Gleb Natapov wrote: > >>> On Tue, Apr 16, 2013 at 02:32:38

Re: [PATCH v3 00/15] KVM: MMU: fast zap all shadow pages

2013-04-23 Thread Gleb Natapov
On Tue, Apr 23, 2013 at 03:20:28PM +0800, Xiao Guangrong wrote: > On 04/23/2013 02:28 PM, Gleb Natapov wrote: > > On Tue, Apr 23, 2013 at 08:19:02AM +0800, Xiao Guangrong wrote: > >> On 04/22/2013 05:21 PM, Gleb Natapov wrote: > >>> On Sun, Apr 21, 2013 at 10:09:29

Re: KVM VM(windows xp) reseted when running geekbench for about 2 days

2013-04-23 Thread Gleb Natapov
On Tue, Apr 23, 2013 at 08:21:29AM +, Zhanghaoyu (A) wrote: > >> >> On Thu, Apr 18, 2013 at 12:00:49PM +, Zhanghaoyu (A) wrote: > >> >>> I start 10 VMs(windows xp), then running geekbench tool on them, > >> >>> about 2 days, one of them was reset, I found the reset operation > >> >>> is d

Re: [PATCH 08/15] perf, kvm: Support the intx/intx_cp modifiers in KVM arch perfmon emulation v5

2013-04-23 Thread Gleb Natapov
dress review feedback > v3: Ignore the bits when no CPUID. No #GP. Force raw events with TSX bits. > v4: Use reserved bits for #GP > v5: Remove obsolete argument > Signed-off-by: Andi Kleen Acked-by: Gleb Natapov > --- > arch/x86/include/asm/kvm_host.h |1 + &g

Re: [PATCH 1/1] KVM: add kvm_para_available to asm-generic/kvm_para.h

2013-06-04 Thread Gleb Natapov
ra_available() that can benefit from this is in sound/pci/intel8x0.c, but I do not see follow up patch to use it there. > Signed-off-by: James Hogan > Cc: Marcelo Tosatti > Cc: Gleb Natapov > Cc: Arnd Bergmann > --- > include/asm-generic/kvm_para.h | 5 + > 1 file changed

Re: [PATCH 1/2] KVM: x86: handle hardware breakpoints during emulation

2013-06-04 Thread Gleb Natapov
On Thu, May 30, 2013 at 06:00:30PM +0200, Paolo Bonzini wrote: > This lets debugging work better during emulation of invalid > guest state. > > The check is done before emulating the instruction, and (in the case > of guest debugging) reuses EMULATE_DO_MMIO to exit with KVM_EXIT_DEBUG. > > Signed

Re: [PATCH 1/2] KVM: x86: handle hardware breakpoints during emulation

2013-06-04 Thread Gleb Natapov
On Tue, Jun 04, 2013 at 01:33:20PM +0200, Paolo Bonzini wrote: > Il 04/06/2013 13:28, Gleb Natapov ha scritto: > > On Thu, May 30, 2013 at 06:00:30PM +0200, Paolo Bonzini wrote: > >> This lets debugging work better during emulation of invalid > >> guest state. > &g

[GIT PULL] KVM fixes for 3.10-rc4

2013-06-04 Thread Gleb Natapov
m: Use ARRAY_SIZE() instead of hardcoded constants in kvm_arch_vcpu_ioctl_{s,g}et_regs mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_ONE_REG mips/kvm: Use ENOIOCTLCMD to indicate unimplemented ioctls. Gleb Natapov (1): KVM: Fix race in apic->pendi

Re: [PATCH 1/2] KVM: x86: handle hardware breakpoints during emulation

2013-06-04 Thread Gleb Natapov
On Tue, Jun 04, 2013 at 02:19:13PM +0200, Paolo Bonzini wrote: > Il 04/06/2013 13:47, Gleb Natapov ha scritto: > > On Tue, Jun 04, 2013 at 01:33:20PM +0200, Paolo Bonzini wrote: > >> Il 04/06/2013 13:28, Gleb Natapov ha scritto: > >>> On Thu, May 30, 2013 at 06:00:3

Re: [PATCH v8 00/11] KVM: MMU: fast zap all shadow pages

2013-06-05 Thread Gleb Natapov
On Tue, Jun 04, 2013 at 10:26:01PM -0300, Marcelo Tosatti wrote: > On Fri, May 31, 2013 at 08:36:19AM +0800, Xiao Guangrong wrote: > > Hi Gleb, Paolo, Marcelo, > > > > I have putted the potential controversial patches to the latter that are > > patch 8 ~ 10, patch 11 depends on patch 9. Other patc

Re: [PATCH v8 00/11] KVM: MMU: fast zap all shadow pages

2013-06-05 Thread Gleb Natapov
On Fri, May 31, 2013 at 08:36:19AM +0800, Xiao Guangrong wrote: > Hi Gleb, Paolo, Marcelo, > > I have putted the potential controversial patches to the latter that are > patch 8 ~ 10, patch 11 depends on patch 9. Other patches are fully reviewed, > I think its are ready for being merged. If not lu

Re: [PATCH 1/1] KVM: add kvm_para_available to asm-generic/kvm_para.h

2013-06-05 Thread Gleb Natapov
On Tue, Jun 04, 2013 at 12:33:19PM +0100, James Hogan wrote: > On 4 June 2013 10:05, Gleb Natapov wrote: > > On Wed, May 22, 2013 at 12:29:22PM +0100, James Hogan wrote: > >> According to include/uapi/linux/kvm_para.h architectures should define > >> kvm_para_availabl

Re: [PATCH V2 1/1] kvm/vmx: Add a tracepoint write_tsc_offset

2013-06-06 Thread Gleb Natapov
at, I recommend to use a special > > instance for getting this event: > > > > 1. set a instance before booting a guest > > # cd /sys/kernel/debug/tracing/instances > > # mkdir tsc_offset > > # cd tsc_offset > > # echo x86-tsc > trace_clock > > # e

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-18 Thread Gleb Natapov
On Tue, Jun 18, 2013 at 04:13:02PM +0200, Paolo Bonzini wrote: > Il 09/06/2013 14:27, Gleb Natapov ha scritto: > > On Sun, Jun 09, 2013 at 08:17:19PM +0800, Xiao Guangrong wrote: > >> On 06/09/2013 07:56 PM, Gleb Natapov wrote: > >>> On Sun, Jun 09, 2013 at 07:44:03

Re: [PATCH v7 10/11] KVM: MMU: collapse TLB flushes when zap all pages

2013-05-29 Thread Gleb Natapov
On Wed, May 29, 2013 at 09:19:41PM +0800, Xiao Guangrong wrote: > On 05/29/2013 08:39 PM, Marcelo Tosatti wrote: > > On Wed, May 29, 2013 at 11:03:19AM +0800, Xiao Guangrong wrote: > > the pages since other vcpus may be doing locklessly shadow > > page walking > >>> > >>> Ah, yes, i agree w

Re: [PATCH RFC V9 0/19] Paravirtualized ticket spinlocks

2013-06-02 Thread Gleb Natapov
On Sun, Jun 02, 2013 at 12:51:25AM +0530, Raghavendra K T wrote: > > This series replaces the existing paravirtualized spinlock mechanism > with a paravirtualized ticketlock mechanism. The series provides > implementation for both Xen and KVM. > High level question here. We have a big hope for "P

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-02 Thread Gleb Natapov
On Thu, May 30, 2013 at 04:35:55PM +0200, Paolo Bonzini wrote: > The x86-64 extended low-byte registers were fetched correctly from reg, > but not from mod/rm. > > This fixes another bug in the boot of RHEL5.9 64-bit, but it is still > not enough. > Did I missed unit test patch? :) > Cc: gnata..

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Gleb Natapov
On Mon, Jun 03, 2013 at 08:27:57AM +0200, Paolo Bonzini wrote: > Il 02/06/2013 20:12, Gleb Natapov ha scritto: > > On Thu, May 30, 2013 at 04:35:55PM +0200, Paolo Bonzini wrote: > >> The x86-64 extended low-byte registers were fetched correctly from reg, > >> but not

Re: [PATCH] KVM: Emulate multibyte NOP

2013-06-03 Thread Gleb Natapov
On Thu, May 30, 2013 at 01:22:39PM +0200, Paolo Bonzini wrote: > This is encountered when booting RHEL5.9 64-bit. There is another bug > after this one that is not a simple emulation failure, but this one lets > the boot proceed a bit. > > Cc: # 3.9 > Signed-off-by: Paolo Bonzini Applied to mas

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Gleb Natapov
On Thu, May 30, 2013 at 04:35:55PM +0200, Paolo Bonzini wrote: > The x86-64 extended low-byte registers were fetched correctly from reg, > but not from mod/rm. > > This fixes another bug in the boot of RHEL5.9 64-bit, but it is still > not enough. > > Cc: gnata...@redhat.com > Cc: k...@vger.kerne

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Gleb Natapov
On Thu, May 30, 2013 at 05:34:21PM +0200, Paolo Bonzini wrote: > Il 30/05/2013 16:35, Paolo Bonzini ha scritto: > > The x86-64 extended low-byte registers were fetched correctly from reg, > > but not from mod/rm. > > > > This fixes another bug in the boot of RHEL5.9 64-bit, but it is still > > not

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Gleb Natapov
On Mon, Jun 03, 2013 at 06:42:11PM +0300, Avi Kivity wrote: > On Thu, May 30, 2013 at 7:34 PM, Paolo Bonzini wrote: > > Il 30/05/2013 17:34, Paolo Bonzini ha scritto: > >> Il 30/05/2013 16:35, Paolo Bonzini ha scritto: > >>> The x86-64 extended low-byte registers were fetched correctly from reg, >

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Gleb Natapov
On Mon, Jun 03, 2013 at 08:30:18PM +0300, Avi Kivity wrote: > On Jun 3, 2013 7:41 PM, "Gleb Natapov" wrote: > > > > On Mon, Jun 03, 2013 at 06:42:11PM +0300, Avi Kivity wrote: > > > On Thu, May 30, 2013 at 7:34 PM, Paolo Bonzini > wrote: > > > &

Re: [PATCH V3 0/1] kvm: Output TSC offset

2013-06-23 Thread Gleb Natapov
On Wed, Jun 12, 2013 at 04:43:41PM +0900, Yoshihiro YUNOMAE wrote: > Hi All, > Applied, thanks. > I'd like to propose a patch which adds a tracepoint at write_tsc_offset for > tracing guests TSC offset changes. It is required for sorting the trace data > of > a guest and the host in chronologica

Re: [PATCH] [BUGFIX] Fix build error caused by an undefinition of the kvm_write_tsc_offset tracepoint for x86_32

2013-06-25 Thread Gleb Natapov
>Fix build error caused by an undefinition of the kvm_write_tsc_offset > >tracepoint for x86_32. > >Since the tracepoint in trace.h was defined for CONFIG_X86_64, kernel build > >on i386 was failed. > > > >Signed-off-by: Yoshihiro YUNOMAE > >Cc: Joerg Roedel &

Re: [PATCH v5 5/6] mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_ONE_REG

2013-06-08 Thread Gleb Natapov
On Wed, May 22, 2013 at 11:43:55AM -0700, David Daney wrote: > From: David Daney > > Because not all 256 CP0 registers are ever implemented, we need a > different method of manipulating them. Use the > KVM_SET_ONE_REG/KVM_GET_ONE_REG mechanism. > > Now unused code and definitions are removed. >

Re: [PATCH 00/31] KVM/MIPS: Implement hardware virtualization via the MIPS-VZ extensions.

2013-06-09 Thread Gleb Natapov
On Fri, Jun 07, 2013 at 04:15:00PM -0700, David Daney wrote: > I should also add that I will shortly send patches for the kvm tool > required to drive this VM as well as a small set of patches that > create a para-virtualized MIPS/Linux guest kernel. > > The idea is that because there is no standa

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sat, Jun 08, 2013 at 11:15:37AM +0800, Xiao Guangrong wrote: > From: Xiao Guangrong > > Currently, memory synchronization is missed in emulator_fix_hypercall, > please see the commit 758ccc89b83 > (KVM: x86: drop calling kvm_mmu_zap_all in emulator_fix_hypercall) > > This patch fixes it by in

Re: [PATCH v8 00/11] KVM: MMU: fast zap all shadow pages

2013-06-09 Thread Gleb Natapov
; become worse if guest uses more memory or vcpus. It is not good for > scalability. > > * Idea > KVM maintains a global mmu invalid generation-number which is stored in > kvm->arch.mmu_valid_gen and every shadow page stores the current global > generation-number into sp->

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 04:56:42PM +0800, Xiao Guangrong wrote: > On 06/09/2013 04:45 PM, Gleb Natapov wrote: > > On Sat, Jun 08, 2013 at 11:15:37AM +0800, Xiao Guangrong wrote: > >> From: Xiao Guangrong > >> > >> Currently, memory synchronization is missed in

<    1   2   3   4   5   6   7   8   >