[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] 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 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: [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

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-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-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 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-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 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 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 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 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

[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 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 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] 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] 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: 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: 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 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 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 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 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: 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 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: [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 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 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] 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 2/7] KVM: MMU: delete shadow page from hash list in kvm_mmu_prepare_zap_page

2013-05-20 Thread Gleb Natapov
On Mon, May 20, 2013 at 05:19:26PM +0800, Xiao Guangrong wrote: > On 05/19/2013 06:47 PM, Gleb Natapov wrote: > > 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 >

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

2013-05-20 Thread Gleb Natapov
On Mon, May 20, 2013 at 04:46:24PM -0300, Marcelo Tosatti wrote: > 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 a

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

2013-05-21 Thread Gleb Natapov
On Mon, May 20, 2013 at 05:40:47PM -0300, Marcelo Tosatti wrote: > On Mon, May 20, 2013 at 11:15:45PM +0300, Gleb Natapov wrote: > > On Mon, May 20, 2013 at 04:46:24PM -0300, Marcelo Tosatti wrote: > > > On Fri, May 17, 2013 at 05:12:58AM +0800, Xiao Guangrong wrote: &

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

2013-05-21 Thread Gleb Natapov
On Tue, May 21, 2013 at 11:36:57AM +0800, Xiao Guangrong wrote: > > So its better to just > > > > if (need_resched()) { > > kvm_mmu_complete_zap_page(&list); > > is kvm_mmu_commit_zap_page()? > Also we need to check that someone waits on mmu_lock before entering here. > > cond_resched_

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

2013-05-21 Thread Gleb Natapov
On Mon, May 20, 2013 at 02:01:26PM -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_GET_MSRS/KVM_SET_MSRS mechanism as x86 does for its MSRs. > Have you looked at KVM_(GET|S

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

2013-05-21 Thread Gleb Natapov
On Tue, May 21, 2013 at 09:21:06AM -0700, David Daney wrote: > On 05/21/2013 08:37 AM, Gleb Natapov wrote: > >On Mon, May 20, 2013 at 02:01:26PM -0700, David Daney wrote: > >>From: David Daney > >> > >>Because not all 256 CP0 registers are ever implemente

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

2013-05-21 Thread Gleb Natapov
On Tue, May 21, 2013 at 10:33:30PM -0300, Marcelo Tosatti wrote: > On Tue, May 21, 2013 at 11:39:03AM +0300, Gleb Natapov wrote: > > > Any pages with stale information will be zapped by kvm_mmu_zap_all(). > > > When that happens, page faults will take place which will automat

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

2013-05-22 Thread Gleb Natapov
On Wed, May 22, 2013 at 04:46:04PM +0800, Xiao Guangrong wrote: > On 05/22/2013 02:34 PM, Gleb Natapov wrote: > > On Tue, May 21, 2013 at 10:33:30PM -0300, Marcelo Tosatti wrote: > >> On Tue, May 21, 2013 at 11:39:03AM +0300, Gleb Natapov wrote: > >>>> Any pag

Re: [PATCH v4 0/6] mips/kvm: Fix ABI for compatibility with 64-bit guests.

2013-05-22 Thread Gleb Natapov
On Tue, May 21, 2013 at 01:54:49PM -0700, David Daney wrote: > From: David Daney > > The initial patch set implementing MIPS KVM does not handle 64-bit > guests or use of the FPU. This patch set corrects these ABI issues, > and does some very minor clean up. > Sanjay, is this looks good to you.

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

2013-05-22 Thread Gleb Natapov
On Wed, May 22, 2013 at 05:41:10PM +0800, Xiao Guangrong wrote: > On 05/22/2013 04:54 PM, Gleb Natapov wrote: > > On Wed, May 22, 2013 at 04:46:04PM +0800, Xiao Guangrong wrote: > >> On 05/22/2013 02:34 PM, Gleb Natapov wrote: > >>> On Tue, May 21, 2013 at 10:33:30P

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

2013-05-22 Thread Gleb Natapov
On Wed, May 22, 2013 at 11:25:13PM +0800, Xiao Guangrong wrote: > On 05/22/2013 09:17 PM, Gleb Natapov wrote: > > On Wed, May 22, 2013 at 05:41:10PM +0800, Xiao Guangrong wrote: > >> On 05/22/2013 04:54 PM, Gleb Natapov wrote: > >>> On Wed, May 22, 2013 at 04:46:04

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-22 Thread Gleb Natapov
On Thu, May 23, 2013 at 03:55:58AM +0800, Xiao Guangrong wrote: > It is only used to zap the obsolete page. Since the obsolete page > will not be used, we need not spend time to find its unsync children > out. Also, we delete the page from shadow page cache so that the page > is completely isolated

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

2013-05-22 Thread Gleb Natapov
On Thu, May 23, 2013 at 03:55:59AM +0800, Xiao Guangrong wrote: > kvm_zap_obsolete_pages uses lock-break technique to zap pages, > it will flush tlb every time when it does lock-break > > We can reload mmu on all vcpus after updating the generation > number so that the obsolete pages are not used

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-22 Thread Gleb Natapov
On Thu, May 23, 2013 at 02:13:06PM +0800, Xiao Guangrong wrote: > On 05/23/2013 01:57 PM, Gleb Natapov wrote: > > On Thu, May 23, 2013 at 03:55:58AM +0800, Xiao Guangrong wrote: > >> It is only used to zap the obsolete page. Since the obsolete page > >> will not be used

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

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 02:26:57PM +0800, Xiao Guangrong wrote: > On 05/23/2013 02:12 PM, Gleb Natapov wrote: > > On Thu, May 23, 2013 at 03:55:59AM +0800, Xiao Guangrong wrote: > >> kvm_zap_obsolete_pages uses lock-break technique to zap pages, > >> it will flush tlb e

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 02:31:47PM +0800, Xiao Guangrong wrote: > On 05/23/2013 02:18 PM, Gleb Natapov wrote: > > On Thu, May 23, 2013 at 02:13:06PM +0800, Xiao Guangrong wrote: > >> On 05/23/2013 01:57 PM, Gleb Natapov wrote: > >>> On Thu, May 23, 2013 at 03:55:58

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

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 03:38:49PM +0800, Xiao Guangrong wrote: > On 05/23/2013 03:37 PM, Xiao Guangrong wrote: > > On 05/23/2013 03:24 PM, Gleb Natapov wrote: > >> On Thu, May 23, 2013 at 02:26:57PM +0800, Xiao Guangrong wrote: > >>> On 05/23/2013 02:12 PM, Gleb Nat

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 03:50:16PM +0800, Xiao Guangrong wrote: > On 05/23/2013 03:37 PM, Gleb Natapov wrote: > > On Thu, May 23, 2013 at 02:31:47PM +0800, Xiao Guangrong wrote: > >> On 05/23/2013 02:18 PM, Gleb Natapov wrote: > >>> On Thu, May 23, 2013 at 02:13:06

Re: [PATCH v5 0/6] mips/kvm: Fix ABI for compatibility with 64-bit guests.

2013-05-23 Thread Gleb Natapov
On Wed, May 22, 2013 at 11:43:50AM -0700, David Daney wrote: > From: David Daney > Please regenerate against master. arch/mips/include/asm/kvm.h does not exists any more. > The initial patch set implementing MIPS KVM does not handle 64-bit > guests or use of the FPU. This patch set corrects the

[GIT PULL] KVM fixes for 3.10-rc2

2013-05-23 Thread Gleb Natapov
Linus, Please pull from git://git.kernel.org/pub/scm/virt/kvm/kvm.git master To receive the following KVM bug fixes Paolo Bonzini (1): KVM: take over co-maintainership from Marcelo, fix MAINTAINERS entry Sanjay Lal (2): KVM/MIPS32: Move include/asm/kvm.h => include/uapi/asm/kvm.h

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 07:13:58PM +0800, Xiao Guangrong wrote: > On 05/23/2013 04:09 PM, Gleb Natapov wrote: > > On Thu, May 23, 2013 at 03:50:16PM +0800, Xiao Guangrong wrote: > >> On 05/23/2013 03:37 PM, Gleb Natapov wrote: > >>> On Thu, May 23, 2013 at 02:31:47

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 09:03:50PM +0800, Xiao Guangrong wrote: > On 05/23/2013 08:39 PM, Gleb Natapov wrote: > > On Thu, May 23, 2013 at 07:13:58PM +0800, Xiao Guangrong wrote: > >> On 05/23/2013 04:09 PM, Gleb Natapov wrote: > >>> On Thu, May 23, 2013 at 03:50:16

Re: [PATCH v5 0/6] mips/kvm: Fix ABI for compatibility with 64-bit guests.

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 09:58:00AM -0700, David Daney wrote: > On 05/23/2013 03:28 AM, Gleb Natapov wrote: > >On Wed, May 22, 2013 at 11:43:50AM -0700, David Daney wrote: > >>From: David Daney > >> > >Please regenerate against master. arch/mips/include/asm/

Re: [GIT PULL] KVM fixes for 3.10-rc2

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 09:20:22AM -0700, Linus Torvalds wrote: > On Thu, May 23, 2013 at 3:41 AM, Gleb Natapov wrote: > > > > MAINTAINERS |7 ++-- > > arch/mips/include/asm/kvm.h | 55 > > --- >

Re: [PATCH v7 03/11] KVM: MMU: fast invalidate all pages

2013-05-26 Thread Gleb Natapov
On Fri, May 24, 2013 at 05:23:07PM -0300, Marcelo Tosatti wrote: > Hi Xiao, > > On Thu, May 23, 2013 at 03:55:52AM +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 > >

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

2013-03-10 Thread Gleb Natapov
On Sat, Mar 09, 2013 at 07:48:33AM +0100, Paolo Bonzini wrote: > After receiving an INIT signal (either via the local APIC, or through > KVM_SET_MP_STATE), the bootstrap processor should reset immediately > and start execution at 0xfff0. Also, SIPIs have no effect on the > bootstrap processor.

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

2013-03-10 Thread Gleb Natapov
On Sun, Mar 10, 2013 at 03:53:54PM +0100, Paolo Bonzini wrote: > Il 10/03/2013 12:46, Gleb Natapov ha scritto: > > On Sat, Mar 09, 2013 at 07:48:33AM +0100, Paolo Bonzini wrote: > >> After receiving an INIT signal (either via the local APIC, or through > >> KVM_S

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

2013-03-10 Thread Gleb Natapov
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 effectively redefine the meaning of > >> > KVM_MP_STATE_INIT_RECEIVED and KVM_MP_STATE_SIPI_RECEIVED, respectively > >>

Re: [PATCH RFC 0/2] kvm: Better yield_to candidate using preemption notifiers

2013-03-11 Thread Gleb Natapov
On Mon, Mar 04, 2013 at 11:31:46PM +0530, Raghavendra K T wrote: > This patch series further filters better vcpu candidate to yield to > in PLE handler. The main idea is to record the preempted vcpus using > preempt notifiers and iterate only those preempted vcpus in the > handler. Note that the v

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 >

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] 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 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 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 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: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: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 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 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 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 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 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: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 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

[PATCH] perf/x86: disable PEBS on a guest entry.

2012-08-09 Thread Gleb Natapov
If PMU counter has PEBS enabled it is not enough to disable counter on a guest entry since PEBS memory write can overshoot guest entry and corrupt guest memory. Disabling PEBS during guest entry solves the problem. Tested-by: David Ahern Signed-off-by: Gleb Natapov diff --git a/arch/x86/kernel

Re: [PATCH repost] kvm: drop parameter validation

2012-08-13 Thread Gleb Natapov
On Mon, Aug 13, 2012 at 01:43:58PM +0300, Michael S. Tsirkin wrote: > We validate irq pin number when routing is setup, so > code handling illegal irq # in pic and ioapic on each injection > is never called. > Drop it. > I would leave BUG_ON there for a while. > Signed-off-by: Michael S. Tsirkin

Re: [PATCH repost] kvm: drop parameter validation

2012-08-13 Thread Gleb Natapov
On Mon, Aug 13, 2012 at 05:59:32PM -0300, Marcelo Tosatti wrote: > On Mon, Aug 13, 2012 at 05:30:53PM +0300, Gleb Natapov wrote: > > On Mon, Aug 13, 2012 at 01:43:58PM +0300, Michael S. Tsirkin wrote: > > > We validate irq pin number when routing is setup, so > > > cod

Re: [Qemu-devel] [PATCH v8] kvm: notify host when the guest is panicked

2012-08-14 Thread Gleb Natapov
On Mon, Aug 13, 2012 at 05:24:52PM -0300, Marcelo Tosatti wrote: > On Mon, Aug 13, 2012 at 01:48:39PM -0600, Eric Blake wrote: > > On 08/13/2012 12:21 PM, Marcelo Tosatti wrote: > > > On Wed, Aug 08, 2012 at 10:43:01AM +0800, Wen Congyang wrote: > > >> We can know the guest is panicked when the gue

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-14 Thread Gleb Natapov
On Tue, Aug 14, 2012 at 01:52:13AM +0300, Michael S. Tsirkin wrote: > > Using the EOI as a trigger to de-assert and potentially re-assert may be > > a hack, but it's about as close as we can come to following the behavior > > of hardware. > > It's actually quite similar to an apic re-sampling input

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-14 Thread Gleb Natapov
On Tue, Aug 14, 2012 at 01:10:15PM +0300, Gleb Natapov wrote: > On Tue, Aug 14, 2012 at 01:52:13AM +0300, Michael S. Tsirkin wrote: > > > Using the EOI as a trigger to de-assert and potentially re-assert may be > > > a hack, but it's about as close as we can come to follo

Re: [Qemu-devel] [PATCH v8] kvm: notify host when the guest is panicked

2012-08-14 Thread Gleb Natapov
On Tue, Aug 14, 2012 at 12:29:38PM -0300, Marcelo Tosatti wrote: > On Tue, Aug 14, 2012 at 10:47:48AM +0300, Gleb Natapov wrote: > > On Mon, Aug 13, 2012 at 05:24:52PM -0300, Marcelo Tosatti wrote: > > > On Mon, Aug 13, 2012 at 01:48:39PM -0600, Eric Blake wrote: > > &g

Re: [Qemu-devel] [PATCH v8] kvm: notify host when the guest is panicked

2012-08-15 Thread Gleb Natapov
On Tue, Aug 14, 2012 at 02:35:34PM -0500, Anthony Liguori wrote: > > Do you consider allowing support for Windows as overengineering? > > I don't think there is a way to hook BSOD on Windows so attempting to > engineer something that works with Windows seems odd, no? > Yan says in other email tha

Re: [PATCH v5 0/4] kvm: level irqfd and new eoifd

2012-07-22 Thread Gleb Natapov
On Fri, Jul 20, 2012 at 01:07:32PM +0300, Michael S. Tsirkin wrote: > On Thu, Jul 19, 2012 at 12:48:07PM -0600, Alex Williamson wrote: > > On Thu, 2012-07-19 at 20:45 +0300, Michael S. Tsirkin wrote: > > > On Thu, Jul 19, 2012 at 11:29:38AM -0600, Alex Williamson wrote: > > > > On Thu, 2012-07-19 a

Re: [RFC 0/2] virtio: provide a way for host to monitor critical events in the device

2012-07-24 Thread Gleb Natapov
On Mon, Jul 23, 2012 at 10:32:39PM +0200, Sasha Levin wrote: > As it was discussed recently, there's currently no way for the guest to notify > the host about panics. Further more, there's no reasonable way to notify the > host of other critical events such as an OOM kill. > > This short patch ser

Re: [RFC 0/2] virtio: provide a way for host to monitor critical events in the device

2012-07-24 Thread Gleb Natapov
On Tue, Jul 24, 2012 at 02:26:33PM +0200, Sasha Levin wrote: > On 07/24/2012 09:44 AM, Gleb Natapov wrote: > > On Mon, Jul 23, 2012 at 10:32:39PM +0200, Sasha Levin wrote: > >> As it was discussed recently, there's currently no way for the guest to > >> notify >

Re: [RFC 0/2] virtio: provide a way for host to monitor critical events in the device

2012-07-24 Thread Gleb Natapov
On Tue, Jul 24, 2012 at 02:31:25PM +0200, Sasha Levin wrote: > On 07/24/2012 02:28 PM, Gleb Natapov wrote: > > On Tue, Jul 24, 2012 at 02:26:33PM +0200, Sasha Levin wrote: > >> On 07/24/2012 09:44 AM, Gleb Natapov wrote: > >>> On Mon, Jul 23, 2012 at 10:32:39PM +0200

Re: [PATCH 1/2] KVM: X86: remove read buffer for mmio read

2012-07-09 Thread Gleb Natapov
On Mon, Jul 09, 2012 at 03:49:05PM +0300, Avi Kivity wrote: > On 07/09/2012 02:23 PM, Gleb Natapov wrote: > > > >> kvm-unit-tests.git has a test for xchg to mmio. Does it still work? > >> > >> I agree this code has to go, but it needs to be replaced by so

Re: [PATCH 1/2] KVM: X86: remove read buffer for mmio read

2012-07-09 Thread Gleb Natapov
On Mon, Jul 09, 2012 at 09:23:03PM +0800, Xiao Guangrong wrote: > On 07/09/2012 08:49 PM, Avi Kivity wrote: > > On 07/09/2012 02:23 PM, Gleb Natapov wrote: > >> > >>> kvm-unit-tests.git has a test for xchg to mmio. Does it still work? > >>> > >&g

Re: perf with precise attribute kills all KVM based VMs

2012-07-09 Thread Gleb Natapov
On Mon, Jul 09, 2012 at 08:12:40AM -0600, David Ahern wrote: > This is 100% reproducible with Fedora 17, 3.4.2-1.fc16.x86_64 kernel. > > Using the precise attribute (:p or :pp) with perf-record, eg, > > perf record -e cycles:p -ag -- sleep 10 > > All running VMs are killed. The VMs appear to be

Re: perf with precise attribute kills all KVM based VMs

2012-07-09 Thread Gleb Natapov
On Mon, Jul 09, 2012 at 04:24:04PM +0200, Peter Zijlstra wrote: > On Mon, 2012-07-09 at 17:19 +0300, Gleb Natapov wrote: > > Yes, this is knows problem that I can't find time to fix. The crash is > > cause by CPU using host PEBS virtual address while guest is running > >

Re: perf with precise attribute kills all KVM based VMs

2012-07-09 Thread Gleb Natapov
On Mon, Jul 09, 2012 at 05:51:29PM +0300, Avi Kivity wrote: > On 07/09/2012 05:49 PM, Peter Zijlstra wrote: > > On Mon, 2012-07-09 at 08:47 -0600, David Ahern wrote: > >> > >> I found this testing changes to perf-kvm, but found the problem extends > >> to just perf-record. With perf-record exclud

Re: perf with precise attribute kills all KVM based VMs

2012-07-09 Thread Gleb Natapov
On Mon, Jul 09, 2012 at 05:54:42PM +0300, Gleb Natapov wrote: > On Mon, Jul 09, 2012 at 05:51:29PM +0300, Avi Kivity wrote: > > On 07/09/2012 05:49 PM, Peter Zijlstra wrote: > > > On Mon, 2012-07-09 at 08:47 -0600, David Ahern wrote: > > >> > > >> I f

Re: [PATCH 1/2] KVM: X86: remove read buffer for mmio read

2012-07-10 Thread Gleb Natapov
On Mon, Jul 09, 2012 at 04:34:50PM +0300, Avi Kivity wrote: > On 07/09/2012 04:23 PM, Xiao Guangrong wrote: > > On 07/09/2012 08:49 PM, Avi Kivity wrote: > >> On 07/09/2012 02:23 PM, Gleb Natapov wrote: > >>> > >>>> kvm-unit-tests.git has

Re: [PATCH 1/2] KVM: X86: remove read buffer for mmio read

2012-07-10 Thread Gleb Natapov
On Tue, Jul 10, 2012 at 01:45:15PM +0300, Avi Kivity wrote: > On 07/10/2012 01:36 PM, Gleb Natapov wrote: > > On Mon, Jul 09, 2012 at 04:34:50PM +0300, Avi Kivity wrote: > > > On 07/09/2012 04:23 PM, Xiao Guangrong wrote: > > > > On 07/09/2012 08:49 PM, Avi Kivity wr

Re: [PATCH 1/2] KVM: X86: remove read buffer for mmio read

2012-07-10 Thread Gleb Natapov
On Tue, Jul 10, 2012 at 03:50:39PM +0300, Avi Kivity wrote: > On 07/10/2012 01:48 PM, Gleb Natapov wrote: > > > > > > > > > But the code is already here, why drop it? > > > > > > The read cache is not effective for multiple disjunct reads. > &g

Re: perf with precise attribute kills all KVM based VMs

2012-07-11 Thread Gleb Natapov
On Tue, Jul 10, 2012 at 05:38:40PM -0600, David Ahern wrote: > On 7/9/12 8:59 AM, Peter Zijlstra wrote: > >On Mon, 2012-07-09 at 17:51 +0300, Avi Kivity wrote: > >>On 07/09/2012 05:49 PM, Peter Zijlstra wrote: > >>>On Mon, 2012-07-09 at 08:47 -0600, David Ahern wrote: > > I found this test

Re: perf with precise attribute kills all KVM based VMs

2012-07-11 Thread Gleb Natapov
On Wed, Jul 11, 2012 at 11:49:47AM +0200, Peter Zijlstra wrote: > On Wed, 2012-07-11 at 10:10 +0300, Gleb Natapov wrote: > > > Looks like Avi is right about the overshoot. Can you test something like > > this? > > > > diff --git a/arch/x86/kernel/cpu/perf_event_

Re: perf with precise attribute kills all KVM based VMs

2012-07-11 Thread Gleb Natapov
On Wed, Jul 11, 2012 at 10:11:57PM -0600, David Ahern wrote: > On 7/11/12 3:53 AM, Gleb Natapov wrote: > >On Wed, Jul 11, 2012 at 11:49:47AM +0200, Peter Zijlstra wrote: > >>On Wed, 2012-07-11 at 10:10 +0300, Gleb Natapov wrote: > >> > >>>Looks like Avi is

Re: perf with precise attribute kills all KVM based VMs

2012-07-12 Thread Gleb Natapov
On Thu, Jul 12, 2012 at 09:20:53AM -0600, David Ahern wrote: > On 7/11/12 10:29 PM, Gleb Natapov wrote: > >On Wed, Jul 11, 2012 at 10:11:57PM -0600, David Ahern wrote: > >>On 7/11/12 3:53 AM, Gleb Natapov wrote: > >>>On Wed, Jul 11, 2012 at 11:49:47AM +0200, Pete

Re: perf with precise attribute kills all KVM based VMs

2012-07-12 Thread Gleb Natapov
On Thu, Jul 12, 2012 at 07:06:35PM +0300, Gleb Natapov wrote: > > > > So, is the idea of your patch to not enable the PEBS in guest mode? > > > Yes, the idea of my patch is to disable PEBS and the guest entry. > BTW what is you host cpu? My patch works only for those

<    1   2   3   4   5   6   7   8   >