Re: [PATCH] KVM: take over co-maintainership from Marcelo, fix MAINTAINERS entry

2013-05-19 Thread Gleb Natapov
On Wed, May 15, 2013 at 07:02:24PM +0200, Paolo Bonzini wrote: > As announced last week by Marcelo Tosatti, I will be co-maintaining > KVM together with Gleb. > Applied, thanks. > Cc: Marcelo Tosatti > Cc: Gleb Natapov > Cc: k...@vger.kernel.org > Signed-

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

2013-05-19 Thread Gleb Natapov
On Fri, May 17, 2013 at 05:12:55AM +0800, Xiao Guangrong wrote: > The benchmark and the result can be found at: > http://www.spinics.net/lists/kvm/msg91391.html > I asked a couple of questions on some patches, but overall this looks good to me. Marcelo can you look at this too? > Changlog: > V6:

Re: [PATCH v6 2/7] KVM: MMU: delete shadow page from hash list in kvm_mmu_prepare_zap_page

2013-05-19 Thread Gleb Natapov
On Fri, May 17, 2013 at 05:12:57AM +0800, Xiao Guangrong wrote: > Move deletion shadow page from the hash list from kvm_mmu_commit_zap_page to > kvm_mmu_prepare_zap_page so that we can call kvm_mmu_commit_zap_page > once for multiple kvm_mmu_prepare_zap_page that can help us to avoid > unnecessary

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-19 Thread Gleb Natapov
On Fri, May 17, 2013 at 05:12:58AM +0800, Xiao Guangrong wrote: > The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to > walk and zap all shadow pages one by one, also it need to zap all guest > page's rmap and all shadow page's parent spte list. Particularly, things > become wors

Re: [PATCH v5 3/8] KVM: MMU: fast invalidate all pages

2013-05-16 Thread Gleb Natapov
On Fri, May 17, 2013 at 02:39:07AM +0800, Xiao Guangrong wrote: > On 05/16/2013 11:57 PM, Gleb Natapov wrote: > > > One more thought. With current patch if zap_invalid_page() will be > > called second time while another zap_invalid_page() is still running > > (can that hap

Re: Drop WARN on AMD lack of perfctrs

2013-05-16 Thread Gleb Natapov
On Thu, May 16, 2013 at 07:51:17PM +0200, Peter Zijlstra wrote: > On Thu, May 16, 2013 at 11:10:26AM -0400, Josh Boyer wrote: > > Hi All, > > > > If you boot a KVM guest on an AMD family 15h and specify -cpu host, > > you'll get the following splat: > > > > [0.031000] [ cut here ]

Re: [PATCH v5 4/8] KVM: x86: use the fast way to invalidate all pages

2013-05-16 Thread Gleb Natapov
On Thu, May 16, 2013 at 08:17:49PM +0800, Xiao Guangrong wrote: > Replace kvm_mmu_zap_all by kvm_mmu_invalidate_memslot_pages except on > the path of mmu_notifier->release() which will be fixed in > the later patch > Why ->release() cannot use kvm_mmu_invalidate_memslot_pages()? > Signed-off-by:

Re: [PATCH v5 3/8] KVM: MMU: fast invalidate all pages

2013-05-16 Thread Gleb Natapov
On Thu, May 16, 2013 at 08:17:48PM +0800, Xiao Guangrong wrote: > The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to > walk and zap all shadow pages one by one, also it need to zap all guest > page's rmap and all shadow page's parent spte list. Particularly, things > become wors

Re: [PATCH v5 3/8] KVM: MMU: fast invalidate all pages

2013-05-16 Thread Gleb Natapov
On Thu, May 16, 2013 at 04:43:21PM +0300, Gleb Natapov wrote: > On Thu, May 16, 2013 at 09:25:28PM +0800, Xiao Guangrong wrote: > > On 05/16/2013 08:43 PM, Gleb Natapov wrote: > > > On Thu, May 16, 2013 at 08:17:48PM +0800, Xiao Guangrong wrote: > > >> The current

Re: [PATCH v5 3/8] KVM: MMU: fast invalidate all pages

2013-05-16 Thread Gleb Natapov
On Thu, May 16, 2013 at 09:25:28PM +0800, Xiao Guangrong wrote: > On 05/16/2013 08:43 PM, Gleb Natapov wrote: > > On Thu, May 16, 2013 at 08:17:48PM +0800, Xiao Guangrong wrote: > >> The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to > >> walk and

Re: [PATCH v5 3/8] KVM: MMU: fast invalidate all pages

2013-05-16 Thread Gleb Natapov
On Thu, May 16, 2013 at 03:14:35PM +0200, Paolo Bonzini wrote: > Il 16/05/2013 14:43, Gleb Natapov ha scritto: > >> > +restart: > >> > +list_for_each_entry_safe(sp, node, &kvm->arch.active_mmu_pages, > >> > link) { >

Re: [PATCH v5 3/8] KVM: MMU: fast invalidate all pages

2013-05-16 Thread Gleb Natapov
On Thu, May 16, 2013 at 08:17:48PM +0800, Xiao Guangrong wrote: > The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to > walk and zap all shadow pages one by one, also it need to zap all guest > page's rmap and all shadow page's parent spte list. Particularly, things > become wors

Re: [PATCH 0/9] perf: Adding better precise_ip field handling

2013-05-14 Thread Gleb Natapov
On Mon, May 13, 2013 at 09:43:13PM +0200, Ingo Molnar wrote: > Note that at least for user-space, REP MOVS is getting rarer. libc uses > SSE based memcpy/memset variants - which is not miscounted by PEBS. The > kernel still uses REP MOVS - but it's a special case because it cannot > cheaply use

Re: [PATCH 00/13] perf: kvm live mode

2013-05-13 Thread Gleb Natapov
On Thu, May 09, 2013 at 08:53:24PM +0800, Xiao Guangrong wrote: > CC kvm list. > > On 05/09/2013 12:31 PM, David Ahern wrote: > > With the consolidation of the open counters code in December 2012 > > (late to the party figuring that out) I think all of the past > > comments on the live mode for pe

[GIT PULL] KVM fixes for the 3.10 merge window

2013-05-09 Thread Gleb Natapov
fixed and corruption of xcr0 register. Asias He (1): KVM: Fix kvm_irqfd_init initialization Gleb Natapov (1): KVM: VMX: fix halt emulation while emulating invalid guest sate Marcelo Tosatti (1): KVM: x86: fix maintenance of guest/host xcr0 state Paolo Bonzini (3): KVM

Re: [PATCH v2 0/3] KVM: emulate AAM, XLAT, SALC

2013-05-09 Thread Gleb Natapov
On Thu, May 09, 2013 at 11:32:48AM +0200, Paolo Bonzini wrote: > These three instructions are not emulated, but can be found in > real mode code. > > These are also good for stable, but they conflict before 3.9 and are > not really useful since emulate_invalid_guest_state defaulted to false. > So

Re: [PATCH v2 2/3] KVM: emulator: emulate XLAT

2013-05-09 Thread Gleb Natapov
On Thu, May 09, 2013 at 11:32:50AM +0200, Paolo Bonzini wrote: > This is used by SGABIOS, KVM breaks with emulate_invalid_guest_state=1. > It is just a MOV in disguise, with a funny source address. > > Reported-by: Jun'ichi Nomura > Cc: sta...@vger.kernel.org # 3.9 > Signed-off-by: Paolo Bonzini

Re: [PATCH 3/3] KVM: emulator: emulate SALC

2013-05-09 Thread Gleb Natapov
On Thu, May 09, 2013 at 11:30:27AM +0200, Paolo Bonzini wrote: > Il 09/05/2013 11:25, Gleb Natapov ha scritto: > > On Thu, May 09, 2013 at 11:16:07AM +0200, Paolo Bonzini wrote: > >> This is an almost-undocumented instruction available in 32-bit mode. > >> I say "

Re: [PATCH 3/3] KVM: emulator: emulate SALC

2013-05-09 Thread Gleb Natapov
On Thu, May 09, 2013 at 11:16:07AM +0200, Paolo Bonzini wrote: > This is an almost-undocumented instruction available in 32-bit mode. > I say "almost" undocumented because AMD documents it in their opcode > maps just to say that it is unavailable in 64-bit mode (sections > "A.2.1 One-Byte Opcodes"

Re: [PATCH v4 4/6] KVM: MMU: fast invalid all shadow pages

2013-05-08 Thread Gleb Natapov
On Tue, May 07, 2013 at 12:09:29PM -0300, Marcelo Tosatti wrote: > On Tue, May 07, 2013 at 05:56:08PM +0300, Gleb Natapov wrote: > > > > Yes, I am missing what Marcelo means there too. We cannot free memslot > > > > until we unmap its rmap one way or the other. >

Re: [PATCH v4 4/6] KVM: MMU: fast invalid all shadow pages

2013-05-07 Thread Gleb Natapov
On Tue, May 07, 2013 at 11:33:29AM -0300, Marcelo Tosatti wrote: > On Tue, May 07, 2013 at 01:00:51PM +0300, Gleb Natapov wrote: > > On Tue, May 07, 2013 at 05:41:35PM +0800, Xiao Guangrong wrote: > > > On 05/07/2013 04:58 PM, Gleb Natapov wrote: > > > > On Tue, Ma

Re: [PATCH v4 4/6] KVM: MMU: fast invalid all shadow pages

2013-05-07 Thread Gleb Natapov
On Tue, May 07, 2013 at 05:41:35PM +0800, Xiao Guangrong wrote: > On 05/07/2013 04:58 PM, Gleb Natapov wrote: > > On Tue, May 07, 2013 at 01:45:52AM +0800, Xiao Guangrong wrote: > >> On 05/07/2013 01:24 AM, Gleb Natapov wrote: > >>> On Mon, May 06, 2013 at 09:10:11

Re: [PATCH v4 4/6] KVM: MMU: fast invalid all shadow pages

2013-05-07 Thread Gleb Natapov
On Tue, May 07, 2013 at 01:45:52AM +0800, Xiao Guangrong wrote: > On 05/07/2013 01:24 AM, Gleb Natapov wrote: > > On Mon, May 06, 2013 at 09:10:11PM +0800, Xiao Guangrong wrote: > >> On 05/06/2013 08:36 PM, Gleb Natapov wrote: > >> > >>>>> Step

Re: [PATCH v4 4/6] KVM: MMU: fast invalid all shadow pages

2013-05-06 Thread Gleb Natapov
On Mon, May 06, 2013 at 09:10:11PM +0800, Xiao Guangrong wrote: > On 05/06/2013 08:36 PM, Gleb Natapov wrote: > > >>> Step 1) Fix kvm_mmu_zap_all's behaviour: introduce lockbreak via > >>> spin_needbreak. Use generation numbers so that in case kvm_mmu_z

Re: [PATCH v4 4/6] KVM: MMU: fast invalid all shadow pages

2013-05-06 Thread Gleb Natapov
On Mon, May 06, 2013 at 11:39:11AM +0800, Xiao Guangrong wrote: > On 05/04/2013 08:52 AM, Marcelo Tosatti wrote: > > On Sat, May 04, 2013 at 12:51:06AM +0800, Xiao Guangrong wrote: > >> On 05/03/2013 11:53 PM, Marcelo Tosatti wrote: > >>> On Fri, May 03, 2013 at 01:52:07PM +0800, Xiao Guangrong wro

[GIT PULL] KVM updates for the 3.10 merge window

2013-05-05 Thread Gleb Natapov
ations out of x86 KVM: Make local routines static KVM: Move kvm_spurious_fault to x86.c KVM: Move kvm_rebooting declaration out of x86 Gleb Natapov (10): Merge 'git://github.com/agraf/linux-2.6.git kvm-ppc-next' into queue KVM: emulator: fix unimplemented instr

Re: linux-next: Tree for Apr 29 (kvm)

2013-04-29 Thread Gleb Natapov
On Mon, Apr 29, 2013 at 08:52:56AM -0700, Randy Dunlap wrote: > On 04/29/13 02:17, Stephen Rothwell wrote: > > Hi all, > > > > Changes since 20130426: > > > > > on x86_64: > > arch/x86/kvm/x86.c: In function 'kvm_dev_ioctl_check_extension': > arch/x86/kvm/x86.c:2547:22: error: 'pci_bus_type' u

Re: [PATCH] KVM: x86: Increase the "hard" max VCPU limit

2013-04-28 Thread Gleb Natapov
mit for > VCPUS can be increased from 254 to 255. (This was confirmed by Gleb Natapov > http://article.gmane.org/gmane.comp.emulators.kvm.devel/99713 ) > > Signed-off-by: Chegu Vinod Applied, thanks. > --- > arch/x86/include/asm/kvm_host.h |2 +- > 1 files changed, 1

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

2013-04-28 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 Applied, thanks. > --

Re: [PATCH] kvm, svm: Fix typo in printk message

2013-04-28 Thread Gleb Natapov
On Fri, Apr 26, 2013 at 12:22:01AM +0200, Borislav Petkov wrote: > From: Borislav Petkov > > It is "exit_int_info". It is actually EXITINTINFO in the official docs > but we don't like screaming docs. > > Signed-off-by: Borislav Petkov Applied, thanks. > --- > arch/x86/kvm/svm.c | 2 +- > 1 fi

Re: [PATCH v2 3/6] KVM: MMU: make return value of mmio page fault handler more readable

2013-04-24 Thread Gleb Natapov
On Mon, Apr 01, 2013 at 05:56:46PM +0800, Xiao Guangrong wrote: > Define some meaningful names instead of raw code > > Signed-off-by: Xiao Guangrong > --- > arch/x86/kvm/mmu.c | 15 +-- > arch/x86/kvm/mmu.h | 14 ++ > arch/x86/kvm/vmx.c |4 ++-- > 3 files changed,

Re: [PATCH v2 6/6] KVM: MMU: init kvm generation close to mmio wrap-around value

2013-04-24 Thread Gleb Natapov
On Mon, Apr 01, 2013 at 05:56:49PM +0800, Xiao Guangrong wrote: > Then it has chance to trigger mmio generation number wrap-around > > Signed-off-by: Xiao Guangrong > --- > arch/x86/include/asm/kvm_host.h |1 + > arch/x86/kvm/mmu.c |8 > virt/kvm/kvm_main.c

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: 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 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: [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: 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 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: [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-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: 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 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-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 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: [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 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] 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] kvm: nVMX: check vmcs12 for valid activity state

2013-04-15 Thread Gleb Natapov
> "active". > > Since the value will always be the same for L1 and L2, we do not need > to read and write the corresponding VMCS field on L1/L2 transitions, > either. > > Signed-off-by: Paolo Bonzini Perfect, thanks! Reviewed-by: Gleb Natapov > ---

Re: [PATCH] kvm: fix MMIO/PIO collision misdetection

2013-04-07 Thread Gleb Natapov
On Thu, Apr 04, 2013 at 01:27:21PM +0300, Michael S. Tsirkin wrote: > PIO and MMIO are separate address spaces, but > ioeventfd registration code mistakenly detected > two eventfds as duplicate if they use the same address, > even if one is PIO and another one MMIO. > > Signed-off-by: Michael S. T

[GIT PULL] KVM fixes for 3.9-rc5

2013-04-07 Thread Gleb Natapov
Linus, Please pull from git://git.kernel.org/pub/scm/virt/kvm/kvm.git master To receive the bugfix for the regression introduced by c300aa64ddf57. Andrew Honig (1): KVM: Allow cross page reads and writes from cached translations. arch/x86/kvm/lapic.c |2 - arch/x86/kvm/x86.c

Re: [PATCH RFC] kvm: add PV MMIO EVENTFD

2013-04-07 Thread Gleb Natapov
On Thu, Apr 04, 2013 at 04:14:57PM +0300, Gleb Natapov wrote: > > > > > >>> is to move to MMIO only when PIO address space is exhausted. For PCI it > > >>> will be never, for PCI-e it will be after ~16 devices. > > >> > > >> Ok,

Re: [PATCH RFC] kvm: add PV MMIO EVENTFD

2013-04-04 Thread Gleb Natapov
On Thu, Apr 04, 2013 at 06:36:30PM +0300, Michael S. Tsirkin wrote: > > processor : 0 > > vendor_id : AuthenticAMD > > cpu family : 16 > > model : 8 > > model name : Six-Core AMD Opteron(tm) Processor 8435 > > stepping: 0 > > cpu MHz : 800.000 > > cache size : 5

Re: [PATCH RFC] kvm: add PV MMIO EVENTFD

2013-04-04 Thread Gleb Natapov
On Thu, Apr 04, 2013 at 05:36:40PM +0200, Alexander Graf wrote: > > > > #define GOAL (1ull << 30) > > > >do { > >iterations *= 2; > >t1 = rdtsc(); > > > >for (i = 0; i < iterations; ++i) > >func(); >

Re: [PATCH RFC] kvm: add PV MMIO EVENTFD

2013-04-04 Thread Gleb Natapov
On Thu, Apr 04, 2013 at 03:06:42PM +0200, Alexander Graf wrote: > > On 04.04.2013, at 14:56, Gleb Natapov wrote: > > > On Thu, Apr 04, 2013 at 02:49:39PM +0200, Alexander Graf wrote: > >> > >> On 04.04.2013, at 14:45, Gleb Natapov wrote: > >> >

Re: [PATCH RFC] kvm: add PV MMIO EVENTFD

2013-04-04 Thread Gleb Natapov
On Thu, Apr 04, 2013 at 02:49:39PM +0200, Alexander Graf wrote: > > On 04.04.2013, at 14:45, Gleb Natapov wrote: > > > On Thu, Apr 04, 2013 at 02:39:51PM +0200, Alexander Graf wrote: > >> > >> On 04.04.2013, at 14:38, Gleb Natapov wrote: > >> >

Re: [PATCH RFC] kvm: add PV MMIO EVENTFD

2013-04-04 Thread Gleb Natapov
On Thu, Apr 04, 2013 at 02:39:51PM +0200, Alexander Graf wrote: > > On 04.04.2013, at 14:38, Gleb Natapov wrote: > > > On Thu, Apr 04, 2013 at 02:32:08PM +0200, Alexander Graf wrote: > >> > >> On 04.04.2013, at 14:08, Gleb Natapov wrote: > >> >

Re: [PATCH RFC] kvm: add PV MMIO EVENTFD

2013-04-04 Thread Gleb Natapov
On Thu, Apr 04, 2013 at 02:32:08PM +0200, Alexander Graf wrote: > > On 04.04.2013, at 14:08, Gleb Natapov wrote: > > > On Thu, Apr 04, 2013 at 01:57:34PM +0200, Alexander Graf wrote: > >> > >> On 04.04.2013, at 12:50, Michael S. Tsirkin wrote: > >> &g

Re: [PATCH RFC] kvm: add PV MMIO EVENTFD

2013-04-04 Thread Gleb Natapov
On Thu, Apr 04, 2013 at 02:22:09PM +0200, Alexander Graf wrote: > > On 04.04.2013, at 14:08, Gleb Natapov wrote: > > > On Thu, Apr 04, 2013 at 01:57:34PM +0200, Alexander Graf wrote: > >> > >> On 04.04.2013, at 12:50, Michael S. Tsirkin wrote: > >> &g

Re: [PATCH RFC] kvm: add PV MMIO EVENTFD

2013-04-04 Thread Gleb Natapov
On Thu, Apr 04, 2013 at 02:09:53PM +0200, Alexander Graf wrote: > > On 04.04.2013, at 13:04, Michael S. Tsirkin wrote: > > > On Thu, Apr 04, 2013 at 01:57:34PM +0200, Alexander Graf wrote: > >> > >> On 04.04.2013, at 12:50, Michael S. Tsirkin wrote: > >> > >>> With KVM, MMIO is much slower than

Re: [PATCH RFC] kvm: add PV MMIO EVENTFD

2013-04-04 Thread Gleb Natapov
On Thu, Apr 04, 2013 at 01:57:34PM +0200, Alexander Graf wrote: > > On 04.04.2013, at 12:50, Michael S. Tsirkin wrote: > > > With KVM, MMIO is much slower than PIO, due to the need to > > do page walk and emulation. But with EPT, it does not have to be: we > > know the address from the VMCS so if

Re: [PATCH] KVM: allow host header to be included even for !CONFIG_KVM

2013-04-02 Thread Gleb Natapov
On Mon, Mar 25, 2013 at 02:14:20PM -0700, Kevin Hilman wrote: > Gleb Natapov writes: > > > On Sun, Mar 24, 2013 at 02:44:26PM +0100, Frederic Weisbecker wrote: > >> 2013/3/21 Gleb Natapov : > >> > Isn't is simpler for kernel/context_tracking.c to define emp

Re: [PATCH] KVM: allow host header to be included even for !CONFIG_KVM

2013-03-24 Thread Gleb Natapov
On Sun, Mar 24, 2013 at 02:44:26PM +0100, Frederic Weisbecker wrote: > 2013/3/21 Gleb Natapov : > > Isn't is simpler for kernel/context_tracking.c to define empty > > __guest_enter()/__guest_exit() if !CONFIG_KVM. > > That doesn't look right. Off-cases are usu

Re: [PATCH] KVM: allow host header to be included even for !CONFIG_KVM

2013-03-24 Thread Gleb Natapov
On Thu, Mar 21, 2013 at 05:02:15PM -0700, Kevin Hilman wrote: > Gleb Natapov writes: > > > On Thu, Mar 21, 2013 at 02:33:13PM -0500, Scott Wood wrote: > >> On 03/21/2013 02:16:00 PM, Gleb Natapov wrote: > >> >On Thu, Mar 21, 2013 at 01:42:34PM -0500, Scott Wood w

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

2013-03-22 Thread Gleb Natapov
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, Mar 22, 2013 at 08:03:04PM +0800, Xiao Guangrong wrote: > >> On 03/22/2013 07:47 PM, Gleb Natapov wrote: > >>> On Fri, Mar 22, 2013 at 07:39:24

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

2013-03-22 Thread Gleb Natapov
On Fri, Mar 22, 2013 at 08:03:04PM +0800, Xiao Guangrong wrote: > On 03/22/2013 07:47 PM, Gleb Natapov wrote: > > On Fri, Mar 22, 2013 at 07:39:24PM +0800, Xiao Guangrong wrote: > >> On 03/22/2013 07:28 PM, Gleb Natapov wrote: > >>> On Fri, Mar 22, 2013 at 07:10:44

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

2013-03-22 Thread Gleb Natapov
On Fri, Mar 22, 2013 at 07:39:24PM +0800, Xiao Guangrong wrote: > On 03/22/2013 07:28 PM, Gleb Natapov wrote: > > On Fri, Mar 22, 2013 at 07:10:44PM +0800, Xiao Guangrong wrote: > >> On 03/22/2013 06:54 PM, Marcelo Tosatti wrote: > >> > >>>> > >>&

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

2013-03-22 Thread Gleb Natapov
On Fri, Mar 22, 2013 at 07:10:44PM +0800, Xiao Guangrong wrote: > On 03/22/2013 06:54 PM, Marcelo Tosatti wrote: > > >> > >>> > >>> And then have codepaths that nuke shadow pages break from the spinlock, > >> > >> I think this is not needed any more. We can let mmu_notify use the > >> generation

Re: [PATCH] KVM: fix powerpc build error for !CONFIG_KVM

2013-03-22 Thread Gleb Natapov
On Fri, Mar 22, 2013 at 02:35:50PM +1100, Stephen Rothwell wrote: > Fixes these build error when CONFIG_KVM is not defined: > > In file included from arch/powerpc/include/asm/kvm_ppc.h:33:0, > from arch/powerpc/kernel/setup_64.c:67: > arch/powerpc/include/asm/kvm_book3s.h:65:20: e

Re: [PATCH] KVM: allow host header to be included even for !CONFIG_KVM

2013-03-21 Thread Gleb Natapov
On Thu, Mar 21, 2013 at 02:33:13PM -0500, Scott Wood wrote: > On 03/21/2013 02:16:00 PM, Gleb Natapov wrote: > >On Thu, Mar 21, 2013 at 01:42:34PM -0500, Scott Wood wrote: > >> On 03/21/2013 09:27:14 AM, Kevin Hilman wrote: > >> >Gleb Natapov writes: > >>

Re: [PATCH] KVM: allow host header to be included even for !CONFIG_KVM

2013-03-21 Thread Gleb Natapov
On Thu, Mar 21, 2013 at 01:42:34PM -0500, Scott Wood wrote: > On 03/21/2013 09:27:14 AM, Kevin Hilman wrote: > >Gleb Natapov writes: > > > >> On Wed, Mar 20, 2013 at 06:58:41PM -0500, Scott Wood wrote: > >>> On 03/14/2013 07:13:46 PM, Kevin Hilman wrote: >

Re: [PATCH v2 4/7] KVM: MMU: delete shadow page from hash list in kvm_mmu_prepare_zap_page

2013-03-21 Thread Gleb Natapov
On Wed, Mar 20, 2013 at 04:30:24PM +0800, Xiao Guangrong wrote: > Move deletion shadow page from the hash list from kvm_mmu_commit_zap_page to > kvm_mmu_prepare_zap_page, we that we can free the shadow page out of mmu-lock. > > Also, delete the invalid shadow page from the hash list since this pag

Re: [PATCH] KVM: allow host header to be included even for !CONFIG_KVM

2013-03-21 Thread Gleb Natapov
On Wed, Mar 20, 2013 at 06:58:41PM -0500, Scott Wood wrote: > On 03/14/2013 07:13:46 PM, Kevin Hilman wrote: > >The new context tracking subsystem unconditionally includes kvm_host.h > >headers for the guest enter/exit macros. This causes a compile > >failure when KVM is not enabled. > > > >Fix by

Re: [PATCH] x86: let userspace inject interrupts into the local APIC

2013-03-20 Thread Gleb Natapov
On Tue, Mar 19, 2013 at 09:22:33PM +0100, Paolo Bonzini wrote: > Il 19/03/2013 19:50, Gleb Natapov ha scritto: > > On Tue, Mar 19, 2013 at 07:39:24PM +0100, Paolo Bonzini wrote: > >> Il 19/03/2013 19:13, Gleb Natapov ha scritto: > >>>>> There is no way for u

Re: [PATCH] x86: let userspace inject interrupts into the local APIC

2013-03-19 Thread Gleb Natapov
On Tue, Mar 19, 2013 at 07:39:24PM +0100, Paolo Bonzini wrote: > Il 19/03/2013 19:13, Gleb Natapov ha scritto: > >> > There is no way for userspace to inject interrupts into a VCPU's > >> > local APIC, which is important in order to inject INITs coming from >

Re: [PATCH] x86: let userspace inject interrupts into the local APIC

2013-03-19 Thread Gleb Natapov
On Tue, Mar 19, 2013 at 04:51:13PM +0100, Paolo Bonzini wrote: > There is no way for userspace to inject interrupts into a VCPU's > local APIC, which is important in order to inject INITs coming from > the chipset. KVM_INTERRUPT is currently disabled when the in-kernel > local APIC is used, so we

Re: [PATCH] x86: correctly initialize the CS base on reset

2013-03-19 Thread Gleb Natapov
On Tue, Mar 19, 2013 at 05:41:45PM +0100, Jan Kiszka wrote: > On 2013-03-19 16:43, Gleb Natapov wrote: > > On Tue, Mar 19, 2013 at 04:30:26PM +0100, Paolo Bonzini wrote: > >> The CS base was initialized to 0 on VMX (wrong, but usually overridden > >> by userspace before

Re: [PATCH] x86: correctly initialize the CS base on reset

2013-03-19 Thread Gleb Natapov
d-off-by: Paolo Bonzini Reviewed-by: Gleb Natapov > --- > arch/x86/kvm/svm.c | 8 +--- > arch/x86/kvm/vmx.c | 1 + > 2 files changed, 2 insertions(+), 7 deletions(-) > > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index 7219a40..7a46c1f 100644 > --- a/arch/x

Re: [PATCH 5/5] KVM: MMU: fast invalid all mmio sptes

2013-03-19 Thread Gleb Natapov
On Tue, Mar 19, 2013 at 11:15:36AM +0800, Xiao Guangrong wrote: > On 03/19/2013 06:16 AM, Eric Northup wrote: > > On Fri, Mar 15, 2013 at 8:29 AM, Xiao Guangrong > > wrote: > >> This patch tries to introduce a very simple and scale way to invalid all > >> mmio sptes - it need not walk any shadow p

Re: [PATCH 5/5] KVM: MMU: fast invalid all mmio sptes

2013-03-18 Thread Gleb Natapov
On Mon, Mar 18, 2013 at 09:25:10PM +0800, Xiao Guangrong wrote: > On 03/18/2013 09:19 PM, Gleb Natapov wrote: > > On Mon, Mar 18, 2013 at 09:09:43PM +0800, Xiao Guangrong wrote: > >> On 03/18/2013 08:46 PM, Gleb Natapov wrote: > >>> On Mon, Mar 18, 2013 at 08:29:29

Re: [PATCH 5/5] KVM: MMU: fast invalid all mmio sptes

2013-03-18 Thread Gleb Natapov
On Mon, Mar 18, 2013 at 09:09:43PM +0800, Xiao Guangrong wrote: > On 03/18/2013 08:46 PM, Gleb Natapov wrote: > > On Mon, Mar 18, 2013 at 08:29:29PM +0800, Xiao Guangrong wrote: > >> On 03/18/2013 05:13 PM, Gleb Natapov wrote: > >>> On Mon, Mar 18, 2013 at 04:08:50

Re: [PATCH 4/5] KVM: MMU: store generation-number into mmio spte

2013-03-18 Thread Gleb Natapov
On Mon, Mar 18, 2013 at 08:42:09PM +0800, Xiao Guangrong wrote: > On 03/18/2013 07:19 PM, Paolo Bonzini wrote: > > Il 15/03/2013 16:29, Xiao Guangrong ha scritto: > >> +/* > >> + * spte bits of bit 3 ~ bit 11 are used as low 9 bits of > >> + * generation, the bits of bits 52 ~ bit 61 are used as >

Re: [PATCH 5/5] KVM: MMU: fast invalid all mmio sptes

2013-03-18 Thread Gleb Natapov
On Mon, Mar 18, 2013 at 08:29:29PM +0800, Xiao Guangrong wrote: > On 03/18/2013 05:13 PM, Gleb Natapov wrote: > > On Mon, Mar 18, 2013 at 04:08:50PM +0800, Xiao Guangrong wrote: > >> On 03/17/2013 11:02 PM, Gleb Natapov wrote: > >>> On Fri, Mar 15, 2013 at 11:29:53

Re: [PATCH 5/5] KVM: MMU: fast invalid all mmio sptes

2013-03-18 Thread Gleb Natapov
On Mon, Mar 18, 2013 at 04:08:50PM +0800, Xiao Guangrong wrote: > On 03/17/2013 11:02 PM, Gleb Natapov wrote: > > On Fri, Mar 15, 2013 at 11:29:53PM +0800, Xiao Guangrong wrote: > >> This patch tries to introduce a very simple and scale way to invalid all > >> mmio s

Re: [PATCH 5/5] KVM: MMU: fast invalid all mmio sptes

2013-03-17 Thread Gleb Natapov
On Fri, Mar 15, 2013 at 11:29:53PM +0800, Xiao Guangrong wrote: > This patch tries to introduce a very simple and scale way to invalid all > mmio sptes - it need not walk any shadow pages and hold mmu-lock > > KVM maintains a global mmio invalid generation-number which is stored in > kvm->arch.mmi

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-12 Thread Gleb Natapov
On Tue, Mar 12, 2013 at 10:25:35AM +0100, Jan Kiszka wrote: > On 2013-03-11 20:30, Gleb Natapov wrote: > > On Mon, Mar 11, 2013 at 08:01:30PM +0100, Jan Kiszka wrote: > >> On 2013-03-11 19:51, Gleb Natapov wrote: > >>>>> On Intel: > >>>>>

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-11 Thread Gleb Natapov
On Mon, Mar 11, 2013 at 08:01:30PM +0100, Jan Kiszka wrote: > On 2013-03-11 19:51, Gleb Natapov wrote: > >>> On Intel: > >>> CPU 1 CPU 2 in a guest mode > >>> send INIT > >>> send SIP

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-11 Thread Gleb Natapov
On Mon, Mar 11, 2013 at 07:47:03PM +0100, Jan Kiszka wrote: > On 2013-03-11 19:39, Gleb Natapov wrote: > > On Mon, Mar 11, 2013 at 07:27:44PM +0100, Jan Kiszka wrote: > >> On 2013-03-11 19:13, Gleb Natapov wrote: > >>> On Mon, Mar 11, 2013 at 07:05:48PM +0100, Jan K

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-11 Thread Gleb Natapov
On Mon, Mar 11, 2013 at 07:27:44PM +0100, Jan Kiszka wrote: > On 2013-03-11 19:13, Gleb Natapov wrote: > > On Mon, Mar 11, 2013 at 07:05:48PM +0100, Jan Kiszka wrote: > >> On 2013-03-11 18:41, Gleb Natapov wrote: > >>> On Mon, Mar 11, 2013 at 06:34:03PM +0100, Jan K

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-11 Thread Gleb Natapov
On Mon, Mar 11, 2013 at 07:05:48PM +0100, Jan Kiszka wrote: > On 2013-03-11 18:41, Gleb Natapov wrote: > > On Mon, Mar 11, 2013 at 06:34:03PM +0100, Jan Kiszka wrote: > >> On 2013-03-11 18:23, Gleb Natapov wrote: > >>> On Mon, Mar 11, 2013 at 04:36:33PM +0100, Jan K

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-11 Thread Gleb Natapov
On Mon, Mar 11, 2013 at 06:39:44PM +0100, Paolo Bonzini wrote: > Il 11/03/2013 18:20, Gleb Natapov ha scritto: > > On Mon, Mar 11, 2013 at 03:28:03PM +0100, Paolo Bonzini wrote: > >> Il 11/03/2013 14:54, Gleb Natapov ha scritto: > >>>> Setting the mp_state to INI

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-11 Thread Gleb Natapov
On Mon, Mar 11, 2013 at 06:34:03PM +0100, Jan Kiszka wrote: > On 2013-03-11 18:23, Gleb Natapov wrote: > > On Mon, Mar 11, 2013 at 04:36:33PM +0100, Jan Kiszka wrote: > >> On 2013-03-11 15:23, Paolo Bonzini wrote: > >>> Il 11/03/2013 15:05, Gleb Natapov ha scritto:

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-11 Thread Gleb Natapov
On Mon, Mar 11, 2013 at 04:36:33PM +0100, Jan Kiszka wrote: > On 2013-03-11 15:23, Paolo Bonzini wrote: > > Il 11/03/2013 15:05, Gleb Natapov ha scritto: > >> On Mon, Mar 11, 2013 at 03:01:40PM +0100, Jan Kiszka wrote: > >>>> We are not moving away from mp_sta

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-11 Thread Gleb Natapov
On Mon, Mar 11, 2013 at 03:28:03PM +0100, Paolo Bonzini wrote: > Il 11/03/2013 14:54, Gleb Natapov ha scritto: > >> Setting the mp_state to INIT_RECEIVED is that interface, and it already > >> works, for APs at least. This patch extends it to work for the BSP as > >

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-11 Thread Gleb Natapov
On Mon, Mar 11, 2013 at 03:10:45PM +0100, Jan Kiszka wrote: > On 2013-03-11 15:09, Gleb Natapov wrote: > > On Mon, Mar 11, 2013 at 03:06:18PM +0100, Jan Kiszka wrote: > >> On 2013-03-11 15:05, Gleb Natapov wrote: > >>> On Mon, Mar 11, 2013 at 03:01:40PM +0100, Jan Ki

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-11 Thread Gleb Natapov
On Mon, Mar 11, 2013 at 03:06:18PM +0100, Jan Kiszka wrote: > On 2013-03-11 15:05, Gleb Natapov wrote: > > On Mon, Mar 11, 2013 at 03:01:40PM +0100, Jan Kiszka wrote: > >>> We are not moving away from mp_state, we are moving away from using > >>> mp_state for s

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-11 Thread Gleb Natapov
On Mon, Mar 11, 2013 at 03:01:40PM +0100, Jan Kiszka wrote: > > We are not moving away from mp_state, we are moving away from using > > mp_state for signaling because with nested virt INIT does not always > > change mp_state, not only that it can change mp_state long after signal > > is received af

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-11 Thread Gleb Natapov
On Mon, Mar 11, 2013 at 02:31:46PM +0100, Paolo Bonzini wrote: > Il 11/03/2013 12:51, Gleb Natapov ha scritto: > >> > > >> > Agreed, but we still have the problem of how to signal from userspace. > >> > For that do you have any other suggestion than mp_st

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-11 Thread Gleb Natapov
On Mon, Mar 11, 2013 at 12:25:57PM +0100, Paolo Bonzini wrote: > Il 11/03/2013 11:28, Gleb Natapov ha scritto: > >> Not really true---we do exit with that state and EINTR when we get a > >> SIPI. Perhaps that can be changed. > > > > That's implementation d

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-11 Thread Gleb Natapov
On Mon, Mar 11, 2013 at 11:14:39AM +0100, Paolo Bonzini wrote: > Il 10/03/2013 19:10, Gleb Natapov ha scritto: > > On Sun, Mar 10, 2013 at 06:19:07PM +0100, Paolo Bonzini wrote: > >> Il 10/03/2013 16:35, Gleb Natapov ha scritto: > >>>>> However, it would

Re: [PATCH] kvm: remove cast for kmalloc return value

2013-03-11 Thread Gleb Natapov
On Sun, Mar 10, 2013 at 03:46:00PM +0200, Ioan Orghici wrote: > Signed-off-by: Ioan Orghici > --- > arch/x86/kvm/vmx.c |3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 7cc566b..35c2c8f 100644 > --- a/arch/x86/kvm/vmx.c >

<    1   2   3   4   5   6   7   8   >