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

2013-01-20 Thread Gleb Natapov
On Thu, Jan 17, 2013 at 12:36:28PM -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 5/5] fix kvm's use of __pa() on percpu areas

2013-01-21 Thread Gleb Natapov
On Mon, Jan 21, 2013 at 12:38:06PM -0600, H. Peter Anvin wrote: > Final question: are any of these done in frequent paths? (I believe no, > but...) > No, only during guest boot. > Dave Hansen wrote: > > > > >In short, it is illegal to call __pa() on an address holding > >a percpu variable. T

Re: [Bisected][-next-20130204+] [x86/kvm] udevd:[97]: segfault at ffffffffff5fd020 ip 00007fff069e277f sp 00007fff068c9ef8 error d

2013-02-13 Thread Gleb Natapov
On Tue, Feb 12, 2013 at 04:39:03PM -0800, H. Peter Anvin wrote: > On 02/12/2013 04:26 PM, Peter Hurley wrote: > > With -next-20130204+ in ubuntu 12.10 VM (so the 80x25 VGA > > device/console): > > > > [0.666410] udevd[97]: starting version 175 > > [0.674043] udevd[97]: udevd:[97]: segfault

Re: [PATCH] x86, kvm: Add MSR_AMD64_BU_CFG2 to the list of ignored MSRs

2013-02-13 Thread Gleb Natapov
port? With PV Linux traps #GP for all MSRs and it saves us in more than one places. > Signed-off-by: Borislav Petkov > Cc: Boris Ostrovsky > Cc: Andre Przywara > Cc: Marcelo Tosatti > Cc: Gleb Natapov > --- > arch/x86/kvm/x86.c | 16 +--- > 1 file change

Re: [PATCH] x86, kvm: Add MSR_AMD64_BU_CFG2 to the list of ignored MSRs

2013-02-13 Thread Gleb Natapov
On Wed, Feb 13, 2013 at 12:55:26PM +0100, Borislav Petkov wrote: > On Wed, Feb 13, 2013 at 01:47:47PM +0200, Gleb Natapov wrote: > > On Wed, Feb 13, 2013 at 12:42:41PM +0100, Borislav Petkov wrote: > > > From: Borislav Petkov > > > > > > The "x86,

Re: [PATCH] x86, kvm: Add MSR_AMD64_BU_CFG2 to the list of ignored MSRs

2013-02-13 Thread Gleb Natapov
On Wed, Feb 13, 2013 at 02:35:49PM +0100, Borislav Petkov wrote: > On Wed, Feb 13, 2013 at 02:10:02PM +0200, Gleb Natapov wrote: > > > > Is your guest compiled without PV support? With PV Linux traps #GP for > > > > all MSRs and it saves us in more than o

Re: [PATCH] x86, kvm: Add MSR_AMD64_BU_CFG2 to the list of ignored MSRs

2013-02-13 Thread Gleb Natapov
tkov > Cc: Boris Ostrovsky > Cc: Andre Przywara > Cc: Marcelo Tosatti > Cc: Gleb Natapov Acked-by: Gleb Natapov Ingo, MSR_AMD64_BU_CFG2 exists only on tip. Can you get this through the tip too? > --- > arch/x86/kvm/x86.c | 16 +--- > 1 file changed, 9 insertions(+

Re: [PATCH v11] kvm: notify host when the guest is panicked

2012-11-21 Thread Gleb Natapov
On Tue, Nov 20, 2012 at 07:33:49PM -0200, Marcelo Tosatti wrote: > On Tue, Nov 20, 2012 at 06:09:48PM +0800, Hu Tao wrote: > > Hi Marcelo, > > > > On Tue, Nov 13, 2012 at 12:19:08AM -0200, Marcelo Tosatti wrote: > > > On Fri, Nov 09, 2012 at 03:17:39PM -0500, Sasha Levin wrote: > > > > On Mon, Nov

Re: [PATCH v5 1/2] x86/kexec: VMCLEAR vmcss on all cpus if necessary

2012-11-21 Thread Gleb Natapov
On Wed, Nov 21, 2012 at 10:23:12AM +0800, Zhang Yanfei wrote: > This patch adds an atomic notifier list named crash_notifier_list. > When loading kvm-intel module, a notifier will be registered in > the list to enable vmcss loaded on all cpus to be VMCLEAR'd if > needed. > > Signed-off-by: Zhang Y

Re: [PATCH v5 2/2] KVM-INTEL: add a notifier and a bitmap to support VMCLEAR in kdump

2012-11-21 Thread Gleb Natapov
On Wed, Nov 21, 2012 at 10:26:35AM +0800, Zhang Yanfei wrote: > The notifier will be registered in crash_notifier_list when loading > kvm-intel module. And the bitmap indicates whether we should do > VMCLEAR operation in kdump. The bits in the bitmap are set/unset > according to different condition

Re: [PATCH v5 1/2] x86/kexec: VMCLEAR vmcss on all cpus if necessary

2012-11-22 Thread Gleb Natapov
On Thu, Nov 22, 2012 at 08:59:15AM +0800, Zhang Yanfei wrote: > 于 2012年11月21日 18:33, Gleb Natapov 写道: > > On Wed, Nov 21, 2012 at 10:23:12AM +0800, Zhang Yanfei wrote: > >> This patch adds an atomic notifier list named crash_notifier_list. > >> When loading kvm-intel

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

2012-11-25 Thread Gleb Natapov
On Thu, Nov 22, 2012 at 04:22:26PM +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: [PATCH v5 5/5] KVM: x86: improve reexecute_instruction

2013-01-10 Thread Gleb Natapov
On Thu, Jan 10, 2013 at 03:30:36PM -0200, Marcelo Tosatti wrote: > On Tue, Jan 08, 2013 at 02:38:36PM +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

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

2013-01-14 Thread Gleb Natapov
On Tue, Jan 08, 2013 at 07:42:38PM +0900, Takuya Yoshikawa wrote: > Changelog v1->v2: > The condition in patch 1 was changed like this: > npages && (mem->flags & KVM_MEM_LOG_DIRTY_PAGES) > > This patch set makes kvm_mmu_slot_remove_write_access() rmap based and > adds conditional reschedulin

Re: qemu-kvm hangs at start up under 3.8.0-rc3-00074-gb719f43 (works with CONFIG_LOCKDEP)

2013-01-14 Thread Gleb Natapov
On Sun, Jan 13, 2013 at 10:29:58PM +, Andrew Clayton wrote: > When running qemu-kvm under 64but Fedora 16 under current 3.8, it just > hangs at start up. Dong a ps -ef hangs the process at the point where it > would display the qemu process (trying to list the qemu-kvm /proc pid > directory con

Re: qemu-kvm hangs at start up under 3.8.0-rc3-00074-gb719f43 (works with CONFIG_LOCKDEP)

2013-01-14 Thread Gleb Natapov
Copying linux-mm. On Mon, Jan 14, 2013 at 06:24:49PM +, Andrew Clayton wrote: > On Mon, 14 Jan 2013 15:27:36 +0200, Gleb Natapov wrote: > > > On Sun, Jan 13, 2013 at 10:29:58PM +, Andrew Clayton wrote: > > > When running qemu-kvm under 64but Fedora 16 under curre

Re: [PATCH v2 00/10] kvm: memory slot cleanups, fix, and increase

2012-12-12 Thread Gleb Natapov
ws > us to support between 28 and 56 typical devices per VM. > > Tested on x86_64, compiled on ia64, powerpc, and s390. > > Thanks, > Alex > Reviewed-by: Gleb Natapov > --- > > Alex Williamson (10): > kvm: Restrict non-existing slot state transitions > kv

Re: BUG: MAX_LOCK_DEPTH too low!

2012-12-17 Thread Gleb Natapov
Copying Andrea. On Mon, Dec 17, 2012 at 10:14:47AM +0200, Kirill A. Shutemov wrote: > Hi, > > I've got this BUG on up-to-date Linus tree (aed606e): > > [ 1145.439071] BUG: MAX_LOCK_DEPTH too low! > [ 1145.439077] turning off the locking correctness validator. > [ 1145.439081] Pid: 4619, comm: kv

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

2012-12-17 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 RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-27 Thread Gleb Natapov
On Tue, Sep 25, 2012 at 10:54:21AM +0200, Avi Kivity wrote: > On 09/25/2012 10:09 AM, Raghavendra K T wrote: > > On 09/24/2012 09:36 PM, Avi Kivity wrote: > >> On 09/24/2012 05:41 PM, Avi Kivity wrote: > >>> > > case 2) > rq1 : vcpu1->wait(lockA) (spinning) > rq2 : vcpu3 (runnin

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-27 Thread Gleb Natapov
On Thu, Sep 27, 2012 at 10:59:21AM +0200, Avi Kivity wrote: > On 09/27/2012 09:44 AM, Gleb Natapov wrote: > > On Tue, Sep 25, 2012 at 10:54:21AM +0200, Avi Kivity wrote: > >> On 09/25/2012 10:09 AM, Raghavendra K T wrote: > >> > On 09/24/2012 09:36 PM, Avi Kivity wrot

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-27 Thread Gleb Natapov
On Thu, Sep 27, 2012 at 11:33:56AM +0200, Avi Kivity wrote: > On 09/27/2012 11:11 AM, Gleb Natapov wrote: > >> > >> User return notifier is per-cpu, not per-task. There is a new task_work > >> () that does what you want. With these > >> technicalities out

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-27 Thread Gleb Natapov
On Thu, Sep 27, 2012 at 12:04:58PM +0200, Avi Kivity wrote: > On 09/27/2012 11:58 AM, Gleb Natapov wrote: > > > >> > > >> >> btw, we can have secondary effects. A vcpu can be waiting for a lock in > >> >> the host kernel, or for a host page fa

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-30 Thread Gleb Natapov
On Sun, Sep 30, 2012 at 10:18:17AM +0200, Avi Kivity wrote: > On 09/28/2012 08:16 AM, Raghavendra K T wrote: > > > >> > >> +struct pv_sched_info { > >> + unsigned long sched_bitmap; > > > > Thinking, whether we need something similar to cpumask here? > > Only thing is we are repre

Re: [PATCH] kvm: close opened file

2013-01-16 Thread Gleb Natapov
Please use "kvmtool:" prefix at the subject line. On Wed, Jan 16, 2013 at 02:07:35AM +0100, Cong Ding wrote: > The file should be closed before return. > > Signed-off-by: Cong Ding > --- > tools/kvm/builtin-setup.c |6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git

[GIT PULL] KVM fixes for 3.8-rc3

2013-01-16 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 Christian Borntraeger (1): s390/kvm: Fix BUG in include/linux/kvm_host.h:745 arch/s390/kvm/kvm-s390.c |2 ++ 1 file changed, 2 insertions(+) --

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

2013-01-17 Thread Gleb Natapov
For the series: Reviewed-by: Gleb Natapov On Sun, Jan 13, 2013 at 11:44:12PM +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 ++---

Re: [ofa-general] Re: [patch 5/6] mmu_notifier: Support for drivers with revers maps (f.e. for XPmem)

2008-02-25 Thread Gleb Natapov
On Tue, Feb 26, 2008 at 05:11:32PM +1100, Nick Piggin wrote: > > You are missing one point here. The MPI specifications that have > > been out there for decades do not require the process use a library > > for allocating the buffer. I realize that is a horrible shortcoming, > > but that is the wo

Re: [ofa-general] Re: [patch 5/6] mmu_notifier: Support for drivers with revers maps (f.e. for XPmem)

2008-02-26 Thread Gleb Natapov
On Tue, Feb 26, 2008 at 07:52:41PM +1100, Nick Piggin wrote: > On Tuesday 26 February 2008 18:21, Gleb Natapov wrote: > > On Tue, Feb 26, 2008 at 05:11:32PM +1100, Nick Piggin wrote: > > > > You are missing one point here. The MPI specifications that have > > > >

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

2012-07-09 Thread Gleb Natapov
On Mon, Jul 09, 2012 at 02:15:37PM +0300, Avi Kivity wrote: > On 07/09/2012 12:02 PM, Xiao Guangrong wrote: > > After commit f78146b0f9230765c6315b2e14f56112513389ad: > > > > KVM: Fix page-crossing MMIO > > > > MMIO that are split across a page boundary are currently broken - the > > cod

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

2013-01-08 Thread Gleb Natapov
On Mon, Jan 07, 2013 at 06:11:46PM -0200, Marcelo Tosatti wrote: > 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

Re: linux-next: change contacts for the kvm tree

2013-01-09 Thread Gleb Natapov
On Thu, Jan 10, 2013 at 01:36:18PM +1100, Stephen Rothwell wrote: > Hi Marcelo, > > I have removed Avi as a contact for the kvm tree as the address I have > (Avi Kivity ) bounces. Please add Gleb Natapov instead. -- Gleb. -- To unsubscribe from this list: s

Re: linux-next: build warning after merge of the kvm tree

2013-01-09 Thread Gleb Natapov
On Thu, Jan 10, 2013 at 01:34:36PM +1100, Stephen Rothwell wrote: > Hi Marcelo, > > After merging the kvm tree, today's linux-next build (x86_64 allmodconfig) > produced this warning: > > In file included from arch/x86/kvm/mmu.c:3482:0: > arch/x86/kvm/paging_tmpl.h: In function 'paging64_walk_add

Re: [PATCH] hashed device lookup (Does NOT meet Linus' sumission policy!)

2001-01-07 Thread Gleb Natapov
On Sun, Jan 07, 2001 at 10:56:23AM -0500, jamal wrote: [snip] > > I used to be against VLANS being devices, i am withdrawing that comment; it's > a lot easier to look on them as devices if you want to run IP on them. And > in this case, it makes sense the possibilirt of over a thousand devices >

Re: [PATCH] hashed device lookup (Does NOT meet Linus' sumission policy!)

2001-01-07 Thread Gleb Natapov
On Sun, Jan 07, 2001 at 11:56:26AM -0500, jamal wrote: > > > On Sun, 7 Jan 2001, Chris Wedgwood wrote: > > > That said, if this was done -- how would things like routing daemons > > and bind cope? > > I dont know of any routing daemons that are taking advantage of the > alias interfaces today.

Re: routable interfaces WAS( Re: [PATCH] hashed device lookup (DoesNOT meet Linus' sumission policy!)

2001-01-07 Thread Gleb Natapov
On Sun, Jan 07, 2001 at 01:29:51PM -0500, jamal wrote: > > > On Sun, 7 Jan 2001, Ben Greear wrote: > > > > My thought was to have the vlan be attached on the interface ifa list and > > > just give it a different label since it is a "virtual interface" on top > > > of the "physical interface". N

Re: [openib-general] Re: [PATCH repost] PROT_DONTCOPY: ifiniband uverbs fork support

2005-08-10 Thread Gleb Natapov
On Tue, Aug 09, 2005 at 07:13:33PM +0100, Hugh Dickins wrote: > Even more I'd prefer one of these two solutions below, which sidestep > that uncleanliness - but both of these would be in mmap only, no clean > way to change afterwards (except by munmap or mmap MAP_FIXED): > > 1. Use the standard m

Re: [openib-general] Re: [PATCH repost] PROT_DONTCOPY: ifiniband uverbs fork support

2005-08-10 Thread Gleb Natapov
On Wed, Aug 10, 2005 at 02:22:40PM +0100, Hugh Dickins wrote: > On Wed, 10 Aug 2005, Gleb Natapov wrote: > > On Tue, Aug 09, 2005 at 07:13:33PM +0100, Hugh Dickins wrote: > > > Even more I'd prefer one of these two solutions below, which sidestep > > > that unclean

Re: [openib-general] Re: [PATCH repost] PROT_DONTCOPY: ifiniband uverbs fork support

2005-08-11 Thread Gleb Natapov
On Wed, Aug 10, 2005 at 04:27:31PM +0100, Hugh Dickins wrote: > On Wed, 10 Aug 2005, Gleb Natapov wrote: > > On Wed, Aug 10, 2005 at 02:22:40PM +0100, Hugh Dickins wrote: > > > > > > Your stack example is a good one: if we end up setting VM_DONTCOPY on > > >

Re: [openib-general] Re: [PATCH repost] PROT_DONTCOPY: ifiniband uverbs fork support

2005-08-11 Thread Gleb Natapov
On Thu, Aug 11, 2005 at 03:04:29PM +0100, Hugh Dickins wrote: > On Thu, 11 Aug 2005, Gleb Natapov wrote: > > What about the idea that was floating around about new VM flag that will > > instruct kernel to copy pages belonging to the vma on fork instead of mark > > them as co

Re: [openib-general] Re: [PATCH repost] PROT_DONTCOPY: ifiniband uverbs fork support

2005-08-16 Thread Gleb Natapov
On Mon, Aug 15, 2005 at 12:37:50PM -0400, Bill Jordan wrote: > On 8/11/05, Gleb Natapov <[EMAIL PROTECTED]> wrote: > > What about the idea that was floating around about new VM flag that will > > instruct kernel to copy pages belonging to the vma on fork instead of

Re: mmap/munmap bug

2005-03-22 Thread Gleb Natapov
On Mon, Mar 21, 2005 at 07:34:02PM +0100, Arjan van de Ven wrote: > On Mon, 2005-03-21 at 17:32 +0200, Hayim Shaul wrote: > > Hi all, > > > > I have an unexplained bug with mmap/munmap on 2.6.X. > > > > I'm writing a kernel module that gives super-fast access to the network. > > It does so by doi

Re: How to detect multi-core and/or HT-enabled CPUs in 2.4.x and 2.6.x kernels

2006-12-27 Thread Gleb Natapov
On Wed, Dec 27, 2006 at 04:13:00PM +0100, Arjan van de Ven wrote: > The original p4 HT to a large degree suffered from a too small cache > that now was shared. SMT in general isn't per se all that different in > performance than dual core, at least not on a fundamental level, it's > all a matter of

uio and DMA memory allocations

2006-12-17 Thread Gleb Natapov
Hi Hans, Will it be possible to allocate DMAable memory using uio framework (currently it isn't as far as I see). More specifically if a driver needs memory allocated with dma_alloc_coherent() will it be possible to allocate it and map into userspace using uio? -- Gleb

Re: [PATCH v3 1/3] uio: add ioctl support

2015-10-06 Thread Gleb Natapov
On Tue, Oct 06, 2015 at 05:19:22PM +0300, Michael S. Tsirkin wrote: > On Tue, Oct 06, 2015 at 11:33:56AM +0300, Vlad Zolotarov wrote: > > the solution u propose should be a matter of a separate patch and is > > obviously orthogonal to this series. > > Doesn't work this way, sorry. You want a patch

Re: [PATCH v3 1/3] uio: add ioctl support

2015-10-06 Thread Gleb Natapov
On Tue, Oct 06, 2015 at 06:19:34PM +0300, Michael S. Tsirkin wrote: > On Tue, Oct 06, 2015 at 05:30:31PM +0300, Gleb Natapov wrote: > > On Tue, Oct 06, 2015 at 05:19:22PM +0300, Michael S. Tsirkin wrote: > > > On Tue, Oct 06, 2015 at 11:33:56AM +0300, Vlad Zolotarov wrote: >

Re: [PATCH v3 0/3] uio: add MSI/MSI-X support to uio_pci_generic driver

2015-10-06 Thread Gleb Natapov
On Tue, Oct 06, 2015 at 06:15:54PM +0300, Michael S. Tsirkin wrote: > > While it is possible that userspace malfunctions and accidentally programs > > MSI incorrectly, the risk is dwarfed by the ability of userspace to program > > DMA incorrectly. > > That seems to imply that for the upstream kern

Re: [PATCH v3 2/3] uio_pci_generic: add MSI/MSI-X support

2015-10-07 Thread Gleb Natapov
On Thu, Oct 08, 2015 at 12:05:11AM +0300, Michael S. Tsirkin wrote: > On Wed, Oct 07, 2015 at 07:39:16PM +0300, Avi Kivity wrote: > > That's what I thought as well, but apparently adding msix support to the > > already insecure uio drivers is even worse. > > I'm glad you finally agree what these d

Re: [PATCH v3 2/3] uio_pci_generic: add MSI/MSI-X support

2015-10-08 Thread Gleb Natapov
On Thu, Oct 08, 2015 at 10:41:53AM +0300, Michael S. Tsirkin wrote: > On Thu, Oct 08, 2015 at 07:19:13AM +0300, Gleb Natapov wrote: > > Well > > the alternative is to add /dev/vfio/nommu like you've said, but what > > would be the difference between this and uio eludes

Re: [PATCH v3 2/3] uio_pci_generic: add MSI/MSI-X support

2015-10-08 Thread Gleb Natapov
On Thu, Oct 08, 2015 at 11:32:50AM +0300, Michael S. Tsirkin wrote: > On Thu, Oct 08, 2015 at 08:33:45AM +0300, Avi Kivity wrote: > > On 08/10/15 00:05, Michael S. Tsirkin wrote: > > >On Wed, Oct 07, 2015 at 07:39:16PM +0300, Avi Kivity wrote: > > >>That's what I thought as well, but apparently add

Re: [PATCH v5 3/4] kvm: Create kvm_clear_irq()

2012-07-17 Thread Gleb Natapov
On Tue, Jul 17, 2012 at 06:57:01PM +0300, Michael S. Tsirkin wrote: > On Tue, Jul 17, 2012 at 09:51:41AM -0600, Alex Williamson wrote: > > On Tue, 2012-07-17 at 18:36 +0300, Michael S. Tsirkin wrote: > > > On Tue, Jul 17, 2012 at 09:20:11AM -0600, Alex Williamson wrote: > > > > On Tue, 2012-07-17 a

Re: [PATCH v5 3/4] kvm: Create kvm_clear_irq()

2012-07-17 Thread Gleb Natapov
On Tue, Jul 17, 2012 at 07:36:49PM +0300, Michael S. Tsirkin wrote: > On Tue, Jul 17, 2012 at 10:08:21AM -0600, Alex Williamson wrote: > > On Tue, 2012-07-17 at 18:57 +0300, Michael S. Tsirkin wrote: > > > On Tue, Jul 17, 2012 at 09:51:41AM -0600, Alex Williamson wrote: > > > > On Tue, 2012-07-17 a

Re: [PATCH v5 3/4] kvm: Create kvm_clear_irq()

2012-07-17 Thread Gleb Natapov
On Tue, Jul 17, 2012 at 07:14:52PM +0300, Michael S. Tsirkin wrote: > > _Seems_ racy, or _is_ racy? Please identify the race. > > Look at this: > > static inline int kvm_irq_line_state(unsigned long *irq_state, > int irq_source_id, int level) > { > /*

Re: [PATCH v5 3/4] kvm: Create kvm_clear_irq()

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 01:20:29PM +0300, Michael S. Tsirkin wrote: > On Wed, Jul 18, 2012 at 09:27:42AM +0300, Gleb Natapov wrote: > > On Tue, Jul 17, 2012 at 07:14:52PM +0300, Michael S. Tsirkin wrote: > > > > _Seems_ racy, or _is_ racy? Please identify the race. >

Re: [PATCH v5 3/4] kvm: Create kvm_clear_irq()

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 01:33:35PM +0300, Michael S. Tsirkin wrote: > On Wed, Jul 18, 2012 at 01:27:39PM +0300, Gleb Natapov wrote: > > On Wed, Jul 18, 2012 at 01:20:29PM +0300, Michael S. Tsirkin wrote: > > > On Wed, Jul 18, 2012 at 09:27:42AM +0300, Gleb Natapov wrote: >

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 01:41:14PM +0300, Michael S. Tsirkin wrote: > On Mon, Jul 16, 2012 at 02:33:47PM -0600, Alex Williamson wrote: > > In order to inject a level interrupt from an external source using an > > irqfd, we need to allocate a new irq_source_id. This allows us to > > assert and (lat

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 01:48:44PM +0300, Michael S. Tsirkin wrote: > On Wed, Jul 18, 2012 at 01:44:29PM +0300, Gleb Natapov wrote: > > On Wed, Jul 18, 2012 at 01:41:14PM +0300, Michael S. Tsirkin wrote: > > > On Mon, Jul 16, 2012 at 02:33:47PM -0600, Alex Williamson wrote: &

Re: [PATCH v5 3/4] kvm: Create kvm_clear_irq()

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 01:51:05PM +0300, Michael S. Tsirkin wrote: > On Wed, Jul 18, 2012 at 01:36:08PM +0300, Gleb Natapov wrote: > > On Wed, Jul 18, 2012 at 01:33:35PM +0300, Michael S. Tsirkin wrote: > > > On Wed, Jul 18, 2012 at 01:27:39PM +0300, Gleb Natapov wrote: >

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 01:53:11PM +0300, Michael S. Tsirkin wrote: > On Wed, Jul 18, 2012 at 01:49:06PM +0300, Gleb Natapov wrote: > > On Wed, Jul 18, 2012 at 01:48:44PM +0300, Michael S. Tsirkin wrote: > > > On Wed, Jul 18, 2012 at 01:44:29PM +0300, Gleb Natapov wrote: >

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 02:39:10PM +0300, Michael S. Tsirkin wrote: > On Wed, Jul 18, 2012 at 02:22:19PM +0300, Michael S. Tsirkin wrote: > > > > > > > > So as was discussed kvm_set_irq under spinlock is bad for > > > > > > > > scalability > > > > > > > > with multiple VCPUs. Why do we need a spi

Re: [PATCH v5 3/4] kvm: Create kvm_clear_irq()

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 02:08:43PM +0300, Michael S. Tsirkin wrote: > On Wed, Jul 18, 2012 at 01:53:15PM +0300, Gleb Natapov wrote: > > On Wed, Jul 18, 2012 at 01:51:05PM +0300, Michael S. Tsirkin wrote: > > > On Wed, Jul 18, 2012 at 01:36:08PM +0300, Gleb Natapov wrote: >

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 03:42:09PM -0300, Marcelo Tosatti wrote: > On Wed, Jul 18, 2012 at 06:58:24PM +0300, Michael S. Tsirkin wrote: > > > > > > > Back to original point though current > > > > > > > situation is that calling kvm_set_irq() under spinlock is not > > > > > > > worse for > > > > > >

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Gleb Natapov
> > source ids. > > > > > > > > Fix by performing all irq_states bitmap handling under pic/ioapic lock. > > > > This also removes the need for atomics with irq_states handling. > > > > > > > > Reported-by: Gleb Natapov > >

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Gleb Natapov
> > > > > Now ioapic thinks the level is 0 but irq_state is not 0. > > > > > > Note that above is valid behaviour if CPU0 and CPU1 are using different > > > source ids. > > > > > > Fix by performing all irq_states bitmap handling under pic/ioapic lock. &

Re: [PATCH v3 00/15] KVM: MMU: locklessly write-protect

2013-11-03 Thread Gleb Natapov
Marcelo can you review it please? On Wed, Oct 23, 2013 at 09:29:18PM +0800, Xiao Guangrong wrote: > Changelog v3: > - the changes from Gleb's review: > 1) drop the patch which fixed the count of spte number in rmap since it > can not be easily fixed and it has gone after applying this patch

Re: [PATCH] KVM: x86: fix emulation of "movzbl %bpl, %eax"

2013-11-03 Thread Gleb Natapov
getting out of the invalid guest state. > > Because OpMem8 bypasses decode_modrm, the same handling of the REX prefix > must be applied to OpMem8. > > Reported-by: Michele Baldessari > Cc: sta...@vger.kernel.org > Cc: Gleb Natapov > Signed-off-by: Paolo Bonzini Applied, thank

Re: [PATCH v2] KVM: IOMMU: hva align mapping page size

2013-11-04 Thread Gleb Natapov
On Mon, Nov 04, 2013 at 09:08:12AM -0700, Greg Edwards wrote: > When determining the page size we could use to map with the IOMMU, the > page size should also be aligned with the hva, not just the gfn. The > gfn may not reflect the real alignment within the hugetlbfs file. > For some reason you d

Re: [patch 0/2] generic kernel watchdog reset at pvclock read (v2)

2013-11-05 Thread Gleb Natapov
On Fri, Oct 11, 2013 at 09:39:24PM -0300, Marcelo Tosatti wrote: > v2: > - do not create hung_task.h, move defines to sched.h (Don Zickus) > - switch patch order (Paolo) Applied, thanks. -- Gleb. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

Re: [PATCH 1/2] kvm: Delete prototype for non-existent function complete_pio

2013-11-06 Thread Gleb Natapov
On Sun, Oct 20, 2013 at 03:29:57PM +0100, Josh Triplett wrote: > complete_pio ceased to exist in commit > 7972995b0c346de76fe260ce0fd6bcc8ffab724a ("KVM: x86 emulator: Move > string pio emulation into emulator.c"), but the prototype remained. > Remove its prototype. > > Signed-off-by: Josh Triplet

Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-13 Thread Gleb Natapov
On Wed, Mar 12, 2014 at 06:20:01PM +0100, Paolo Bonzini wrote: > Il 12/03/2014 11:40, Radim Krčmář ha scritto: > >2014-03-11 22:05-0300, Marcelo Tosatti: > >>On Tue, Mar 11, 2014 at 07:11:18PM +0100, Radim Krčmář wrote: > >>>We always disable cr8 intercept in its handler, but only re-enable it > >>

Re: intel_pstate divide error with v3.13-rc4-256-gb7000ad

2014-01-07 Thread Gleb Natapov
On Mon, Jan 06, 2014 at 09:18:44AM -0800, Dirk Brandewie wrote: > On 01/03/2014 02:06 PM, Paolo Bonzini wrote: > >Il 03/01/2014 21:00, Dirk Brandewie ha scritto: > >>+case MSR_IA32_MPERF: > >>+case MSR_IA32_APERF: > > > OK I will spin the patch to only add MSR_PLATFORM_INFO. > > >These sho

Re: [PATCH v3 07/15] KVM: MMU: introduce nulls desc

2013-11-26 Thread Gleb Natapov
On Tue, Nov 26, 2013 at 11:21:37AM +0800, Xiao Guangrong wrote: > On 11/26/2013 02:12 AM, Marcelo Tosatti wrote: > > On Mon, Nov 25, 2013 at 02:29:03PM +0800, Xiao Guangrong wrote: > Also, there is no guarantee of termination (as long as sptes are > deleted with the correct timing). BTW,

Re: [PATCH v3 07/15] KVM: MMU: introduce nulls desc

2013-11-26 Thread Gleb Natapov
On Tue, Nov 26, 2013 at 11:10:19AM +0800, Xiao Guangrong wrote: > On 11/25/2013 10:23 PM, Marcelo Tosatti wrote: > > On Mon, Nov 25, 2013 at 02:48:37PM +0200, Avi Kivity wrote: > >> On Mon, Nov 25, 2013 at 8:11 AM, Xiao Guangrong > >> wrote: > >>> > >>> On Nov 23, 2013, at 3:14 AM, Marcelo Tosatti

Re: KVM/KGDB integration

2013-11-27 Thread Gleb Natapov
Copying KGDB maintainer to get some feedback. On Tue, Nov 19, 2013 at 04:53:28PM +0200, Dan Aloni wrote: > Hello, > > The following two patches address an integration issue between KVM and > KGDB. The issue described in the patches can be triggered with vanilla > kernels that enable KGDB and KVM

Re: [PATCH v2 12/15] KVM: MMU: allow locklessly access shadow page table out of vcpu thread

2013-10-16 Thread Gleb Natapov
On Tue, Oct 15, 2013 at 07:21:19PM -0300, Marcelo Tosatti wrote: > On Tue, Oct 15, 2013 at 06:57:05AM +0300, Gleb Natapov wrote: > > > > > > Why is it safe to allow access, by the lockless page write protect > > > side, to spt pointer for shadow page A th

Re: [PATCH, RFC] x86-64: properly handle FPU code/data selectors

2013-10-17 Thread Gleb Natapov
On Wed, Oct 16, 2013 at 05:13:40PM +0100, Jan Beulich wrote: > > It preserves *less* state, because the upper 32 bits of rip are now > > corrupted. Any 64-bit application that actually looks at the FP > > rip/rdp fields now get the WRONG VALUES. > > But again - this isn't being done for ordinary 6

Re: [PATCH, RFC] x86-64: properly handle FPU code/data selectors

2013-10-17 Thread Gleb Natapov
On Thu, Oct 17, 2013 at 10:33:33AM +0100, Jan Beulich wrote: > >>> On 17.10.13 at 11:27, Gleb Natapov wrote: > > On Wed, Oct 16, 2013 at 05:13:40PM +0100, Jan Beulich wrote: > >> > It preserves *less* state, because the upper 32 bits of rip are now > >> &

Re: [PATCH, RFC] x86-64: properly handle FPU code/data selectors

2013-10-17 Thread Gleb Natapov
On Thu, Oct 17, 2013 at 10:51:52AM +0100, Jan Beulich wrote: > >>> On 17.10.13 at 11:41, Gleb Natapov wrote: > > On Thu, Oct 17, 2013 at 10:33:33AM +0100, Jan Beulich wrote: > >> >>> On 17.10.13 at 11:27, Gleb Natapov wrote: > >> > On Wed, Oct

Re: [PATCH, RFC] x86-64: properly handle FPU code/data selectors

2013-10-17 Thread Gleb Natapov
On Thu, Oct 17, 2013 at 11:37:48AM +0100, Jan Beulich wrote: > >>> On 17.10.13 at 12:23, Gleb Natapov wrote: > > On Thu, Oct 17, 2013 at 10:51:52AM +0100, Jan Beulich wrote: > >> >>> On 17.10.13 at 11:41, Gleb Natapov wrote: > >> > KVM obviously

Re: linux-next: manual merge of the kvm-arm tree

2013-10-17 Thread Gleb Natapov
On Wed, Oct 16, 2013 at 12:02:08PM -0700, Christoffer Dall wrote: > On 16 October 2013 11:58, Marc Zyngier wrote: > > On 16/10/13 19:51, Thierry Reding wrote: > >> Today's linux-next merge of the kvm-arm tree got conflicts in > >> > >> arch/arm/kvm/reset.c > >> > >> caused by commits e8c2d99

Re: [PATCH] kvm: mmu: delay mmu audit activation

2013-11-20 Thread Gleb Natapov
On Tue, Nov 19, 2013 at 03:22:47PM -0500, Sasha Levin wrote: > We should not be using jump labels before they were initialized. Push back > the callback to until after jump label initialization. > > Signed-off-by: Sasha Levin Applied, thanks. > --- > arch/x86/kvm/mmu_audit.c |2 +- > 1 file

Re: [PATCH v3 07/15] KVM: MMU: introduce nulls desc

2013-11-25 Thread Gleb Natapov
On Mon, Nov 25, 2013 at 02:11:31PM +0800, Xiao Guangrong wrote: > > > > For example, nothing prevents lockless walker to move into some > > parent_ptes chain, right? > > No. > > The nulls can help us to detect this case, for parent_ptes, the nulls points > to "shadow page" but for rmaps, the nul

Re: [PATCH v3 07/15] KVM: MMU: introduce nulls desc

2013-11-25 Thread Gleb Natapov
On Mon, Nov 25, 2013 at 12:23:51PM -0200, Marcelo Tosatti wrote: > On Mon, Nov 25, 2013 at 02:48:37PM +0200, Avi Kivity wrote: > > On Mon, Nov 25, 2013 at 8:11 AM, Xiao Guangrong > > wrote: > > > > > > On Nov 23, 2013, at 3:14 AM, Marcelo Tosatti wrote: > > > > > > > > I'm not really following

Re: [PATCH v2 12/15] KVM: MMU: allow locklessly access shadow page table out of vcpu thread

2013-10-10 Thread Gleb Natapov
On Thu, Oct 10, 2013 at 06:03:01PM -0300, Marcelo Tosatti wrote: > On Thu, Oct 10, 2013 at 10:16:46PM +0300, Gleb Natapov wrote: > > On Thu, Oct 10, 2013 at 01:42:22PM -0300, Marcelo Tosatti wrote: > > > On Thu, Oct 10, 2013 at 03:08:45PM +0300, Gleb Natapov wrote: > > >

Re: [RFC][PATCH] Drop FOLL_GET in GUP when doing async_pf in kvm

2013-10-11 Thread Gleb Natapov
On Fri, Oct 11, 2013 at 06:08:16PM +0800, chai wen wrote: > On 10/10/2013 11:15 PM, Gleb Natapov wrote: > > On Thu, Oct 10, 2013 at 09:20:15PM +0800, chai wen wrote: > >> Hi Gleb > >> > >> Thanks for you explanation about async_pf in kvm. > >>

Re: [PATCH v2 12/15] KVM: MMU: allow locklessly access shadow page table out of vcpu thread

2013-10-11 Thread Gleb Natapov
On Fri, Oct 11, 2013 at 05:30:17PM -0300, Marcelo Tosatti wrote: > On Fri, Oct 11, 2013 at 08:38:31AM +0300, Gleb Natapov wrote: > > > n_max_mmu_pages is not a suitable limit to throttle freeing of pages via > > > RCU (its too large). If the free memory waterm

Re: [PATCH] kvm fix: Enable pvspinlock after jump_label_init() to avoid VM hang

2013-10-13 Thread Gleb Natapov
On Sun, Oct 13, 2013 at 01:38:57PM +0530, Raghavendra K T wrote: > On 10/09/2013 02:33 PM, Raghavendra K T wrote: > >We use jump label to enable pv-spinlock. With the changes in > >(442e0973e927 Merge branch 'x86/jumplabel'), the jump label behaviour has > >changed > >that would result in evntual

Re: [PATCH] Drop FOLL_GET in GUP when doing async_pf in kvm

2013-10-14 Thread Gleb Natapov
later.And we don't mind whether the GUP is failed or not.What we > need to do is to wake up guests process that is waitting on a page. > So drop the FOLL_GET flag in GUP, and do some simplifying in async_pf > check/clear processing. > thanks. > Have you tested it? Compiled it?

Re: [PATCH v2 12/15] KVM: MMU: allow locklessly access shadow page table out of vcpu thread

2013-10-14 Thread Gleb Natapov
On Mon, Oct 14, 2013 at 04:29:45PM -0300, Marcelo Tosatti wrote: > On Sat, Oct 12, 2013 at 08:53:56AM +0300, Gleb Natapov wrote: > > On Fri, Oct 11, 2013 at 05:30:17PM -0300, Marcelo Tosatti wrote: > > > On Fri, Oct 11, 2013 at 08:38:31AM +0300, Gleb Natapov wrote: > > >

Re: [PATCH RESEND] Drop-FOLL_GET-in-GUP-when-doing-async_pf-in-kvm

2013-10-15 Thread Gleb Natapov
_pf, it needs some memory stress in system > for doing swap pressure. I simply run some big block dd processes in system > before. And it works as I see some async_pf happening and the vm works well. > But I do not know the exact occasion of the async_pf happening. > Thanks. > Appl

[PULL] KVM fixes for 3.12-rc6

2013-10-15 Thread Gleb Natapov
Linus, Please pull one fix for pvspinlock below. The following changes since commit 9d05746e7b16d8565dddbe3200faa1e669d23bbf: vfs: allow O_PATH file descriptors for fstatfs() (2013-10-12 13:12:31 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/virt/kvm/kvm.git m

Re: RFC: paravirtualizing perf_clock

2013-10-28 Thread Gleb Natapov
On Sun, Oct 27, 2013 at 07:27:27PM -0600, David Ahern wrote: > Often when debugging performance problems in a virtualized > environment you need to correlate what is happening in the guest > with what is happening in the host. To correlate events you need a > common time basis (or the ability to di

Re: [PATCH 4/6] kvm, emulator: Add initial three-byte insns support

2013-10-29 Thread Gleb Natapov
On Sun, Sep 22, 2013 at 04:44:53PM +0200, Borislav Petkov wrote: > From: Borislav Petkov > > Add initial support for handling three-byte instructions in the > emulator. > > Signed-off-by: Borislav Petkov > --- > arch/x86/kvm/emulate.c | 30 ++ > 1 file changed, 30 i

Re: [PATCH 0/6] kvm: Emulate MOVBE, v3

2013-10-29 Thread Gleb Natapov
On Sun, Sep 22, 2013 at 04:44:49PM +0200, Borislav Petkov wrote: > From: Borislav Petkov > > Alriiight, > > here's another version of the patchset, hopefully addressing all review > feedback from last time. 6/6 is the respective qemu patch to handle > emulated features query, etc. > Except a sm

Re: [PATCH 4/6] kvm, emulator: Add initial three-byte insns support

2013-10-29 Thread Gleb Natapov
On Tue, Oct 29, 2013 at 11:04:57AM +0100, Borislav Petkov wrote: > On Tue, Oct 29, 2013 at 11:50:43AM +0200, Gleb Natapov wrote: > > There are two three opcode tables, so third_opcode_byte is ambiguous. > > Actually there's also 0F_3A and there are also other prefixes besides

Re: [PATCH 0/6] kvm: Emulate MOVBE, v3

2013-10-29 Thread Gleb Natapov
On Tue, Oct 29, 2013 at 11:30:03AM +0100, Borislav Petkov wrote: > On Tue, Oct 29, 2013 at 11:53:00AM +0200, Gleb Natapov wrote: > > Except a small nitpick for patch 4 this looks good to me. No need to > > wait for QEMU cpu parsing code to change to apply it. > > Ok, want

Re: [PATCH 0/6] kvm: Emulate MOVBE, v3

2013-10-29 Thread Gleb Natapov
On Tue, Oct 29, 2013 at 12:28:24PM +0100, Borislav Petkov wrote: > On Tue, Oct 29, 2013 at 12:35:24PM +0200, Gleb Natapov wrote: > > If everything still applies patch 4 resend should be fine. > > Which tree should they still apply to? > git://git.kernel.org/pub/scm/virt/kvm/kv

Re: [PATCH 01/11] asmlinkage, kvm: Make kvm_rebooting visible

2013-10-30 Thread Gleb Natapov
On Tue, Oct 22, 2013 at 09:12:16AM -0700, Andi Kleen wrote: > From: Andi Kleen > > kvm_rebooting is referenced from assembler code, thus > needs to be visible. > > Cc: g...@redhat.com > Cc: pbonz...@redhat.com > Cc: k...@vger.kernel.org > Signed-off-by: Andi Kl

Re: [PATCH 6/7] x86, asmlinkage, xen, kvm: Make {xen,kvm}_lock_spinning global and visible

2013-10-30 Thread Gleb Natapov
ff-by: Andi Kleen Acked-by: Gleb Natapov > --- > arch/x86/kernel/kvm.c | 2 +- > arch/x86/xen/spinlock.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c > index a0e2a8a..5d10bb5 100644 > --- a/

Re: [PATCH 1/4] kvm: Destroy & free KVM devices on release

2013-10-30 Thread Gleb Natapov
On Tue, Oct 29, 2013 at 10:13:22AM -0600, Alex Williamson wrote: > The KVM device interface allocates a struct kvm_device and calls > kvm_device_ops.create on it from KVM VM ioctl KVM_CREATE_DEVICE. > This returns a file descriptor to the user for them to set/get/check > further attributes. On clo

<    1   2   3   4   5   6   7   8   >