[PATCH] KVM: MMU: fix huge page adapted on non-PAE host

2012-05-28 Thread Xiao Guangrong
The huge page size is 4M on non-PAE host, but 2M page size is used in transparent_hugepage_adjust(), so the page we get after adjust the mapping level is not the head page, the BUG_ON() will be triggered Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c |3 +-- 1 files changed, 1 insertio

Re: [PATCH v2] KVM: introduce readonly memory region

2012-05-28 Thread Gleb Natapov
On Fri, May 25, 2012 at 04:47:26PM +0800, Xiao Guangrong wrote: > By the way, a foolish question, what is ROMD? i did not find any explanation > on google. This is memory region that behaves like ROM on read and like a device on write. IIRC some flash chips are like that. --

Re: kvm: KVM internal error. Suberror: 1

2012-05-28 Thread Avi Kivity
On 05/27/2012 11:23 AM, Sasha Levin wrote: > On Sun, May 27, 2012 at 8:21 AM, Gleb Natapov wrote: >> On Sun, May 27, 2012 at 02:55:39AM +0200, Sasha Levin wrote: >>> On Fri, May 11, 2012 at 1:40 PM, Sasha Levin >>> wrote: >>> > I wasn't able to reproduce this issue so far. >>> >>> So I've manage

Re: [ANNOUNCE] qemu-kvm-1.1-rc3

2012-05-28 Thread Avi Kivity
On 05/25/2012 11:36 AM, Veruca Salt wrote: > > Avi- would love to test out 1.1, as we are currently using the ehci method > which has been frozen at 'experimental' for so long. > > Is there any user documentation on the xhci methods? Copying qemu-devel, where someone may know the answer. -- e

RE: [PATCH v3 4/4] Enabling Access bit when doing memory swapping

2012-05-28 Thread Hao, Xudong
> -Original Message- > From: Hao, Xudong > Sent: Wednesday, May 23, 2012 9:31 PM > To: a...@redhat.com > Cc: kvm@vger.kernel.org; linux-ker...@vger.kernel.org; mtosa...@redhat.com; > takuya.yoshik...@gmail.com; Zhang, Xiantao; Shan, Haitao > Subject: RE: [PATCH v3 4/4] Enabling Access bit w

Re: [PATCH v3 4/4] Enabling Access bit when doing memory swapping

2012-05-28 Thread Avi Kivity
On 05/23/2012 04:31 PM, Hao, Xudong wrote: > Hi, Avi > > Will these patches be accepted if no other comments? > I can't see the other patches (use git send-email if possible) but this one looks fine. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this li

Re: [PATCH] spapr: Add "memop" hypercall

2012-05-28 Thread Avi Kivity
On 05/25/2012 06:12 AM, Benjamin Herrenschmidt wrote: > > BTW. This is a qemu patch, and that hypercall isn't KVM related at all, > ie, it's implemented in qemu and is used with or without KVM, so > documenting it in the kernel tree makes little sense. Same goes with > H_RTAS. > > I'll add a doc

Re: [PATCH] KVM: MMU: fix huge page adapted on non-PAE host

2012-05-28 Thread Avi Kivity
On 05/28/2012 09:10 AM, Xiao Guangrong wrote: > The huge page size is 4M on non-PAE host, but 2M page size is used in > transparent_hugepage_adjust(), so the page we get after adjust the > mapping level is not the head page, the BUG_ON() will be triggered > > > diff --git a/arch/x86/kvm/mmu.c b/a

Re: [Qemu-devel] [PATCH v3 00/16] net: hub-based networking

2012-05-28 Thread Stefan Hajnoczi
On Fri, May 25, 2012 at 10:56:28AM -0300, Luiz Capitulino wrote: > On Fri, 25 May 2012 15:47:28 +0200 > Paolo Bonzini wrote: > > > Il 25/05/2012 15:43, Luiz Capitulino ha scritto: > > >> Yeah, VDE probably includes something like an hub. But then we could > > >> drop even "-net socket", "-net ud

[PATCH v3 1/4] Add EPT A/D bits definitions.

2012-05-28 Thread Xudong Hao
Add EPT A/D bits definitions. Signed-off-by: Haitao Shan Signed-off-by: Xudong Hao --- arch/x86/include/asm/vmx.h |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h index 31f180c..de007c2 100644 --- a/arch/x86/incl

[PATCH v3 2/4] Add parameter to control A/D bits support, default is on.

2012-05-28 Thread Xudong Hao
Add kernel parameter to control A/D bits support, it's on by default. Signed-off-by: Haitao Shan Signed-off-by: Xudong Hao --- arch/x86/kvm/vmx.c | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index d2bd719..811a61e 1

[PATCH v3 3/4] Enable EPT A/D bits if supported by turning on relevant bit in EPTP.

2012-05-28 Thread Xudong Hao
In EPT page structure entry, Enable EPT A/D bits if processor supported. Signed-off-by: Haitao Shan Signed-off-by: Xudong Hao --- arch/x86/kvm/vmx.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 811a61e..89151a9 100644 --

RE: [PATCH v3 4/4] Enabling Access bit when doing memory swapping

2012-05-28 Thread Hao, Xudong
> -Original Message- > From: Avi Kivity [mailto:a...@redhat.com] > Sent: Monday, May 28, 2012 6:37 PM > To: Hao, Xudong > Cc: kvm@vger.kernel.org; linux-ker...@vger.kernel.org; mtosa...@redhat.com; > takuya.yoshik...@gmail.com; Zhang, Xiantao; Shan, Haitao > Subject: Re: [PATCH v3 4/4] Enab

Re: UDP problem with virtio...

2012-05-28 Thread Stefan Hajnoczi
On Sat, May 26, 2012 at 11:23 AM, Erik Brakkee wrote: > I have done some more experiments and it does work when using a Centos 6.2 > guest. Therefore, it is most likely a compatibility issues between the guest > and host virtio implementation. > I read somewhere there is some sort of compatibility

Re: [PATCH] KVM: MMU: fix huge page adapted on non-PAE host

2012-05-28 Thread Avi Kivity
On 05/28/2012 02:39 PM, Xiao Guangrong wrote: > On 05/28/2012 06:57 PM, Avi Kivity wrote: > >> On 05/28/2012 09:10 AM, Xiao Guangrong wrote: >>> The huge page size is 4M on non-PAE host, but 2M page size is used in >>> transparent_hugepage_adjust(), so the page we get after adjust the >>> mapping

Re: UDP problem with virtio...

2012-05-28 Thread Michael S. Tsirkin
On Fri, May 25, 2012 at 10:55:37PM +0200, Erik Brakkee wrote: > I also see in the instructions I should try running qemu with some > alternative switches, but I am not running qemu directly. I am using > virt-manager and a domain.xml to configure how qemu runs. How should I > modify the domain.xml

Re: [PATCH] PCI: Mark INTx masking support of Chelsio T310 10GbE NIC as broken

2012-05-28 Thread Michael S. Tsirkin
On Fri, May 25, 2012 at 11:02:13AM -0300, Jan Kiszka wrote: > According to Alexey, the T310 does not properly support INTx masking as > it fails to keep the PCI_STATUS_INTERRUPT bit updated once the interrupt > is masked. Mark this adapter as broken so that pci_intx_mask_supported > won't report it

Re: [Qemu-devel] [RFC PATCH] vfio: add fixup for broken PCI devices

2012-05-28 Thread Michael S. Tsirkin
On Fri, May 25, 2012 at 05:35:03PM +1000, Alexey Kardashevskiy wrote: > Some adapters (like NEC PCI USB controller) do not flush their config > on a sioftware reset and remember DMA config, etc. > > If we use such an adapter with QEMU, then crash QEMU (stop it with > ctrl-A ctrl-X), and try to use

Re: [Qemu-devel] [RFC PATCH] vfio: add fixup for broken PCI devices

2012-05-28 Thread Jan Kiszka
On 2012-05-28 14:44, Michael S. Tsirkin wrote: > On Fri, May 25, 2012 at 05:35:03PM +1000, Alexey Kardashevskiy wrote: >> Some adapters (like NEC PCI USB controller) do not flush their config >> on a sioftware reset and remember DMA config, etc. >> >> If we use such an adapter with QEMU, then crash

Re: [PATCH] PCI: Mark INTx masking support of Chelsio T310 10GbE NIC as broken

2012-05-28 Thread Jan Kiszka
On 2012-05-28 14:39, Michael S. Tsirkin wrote: > On Fri, May 25, 2012 at 11:02:13AM -0300, Jan Kiszka wrote: >> According to Alexey, the T310 does not properly support INTx masking as >> it fails to keep the PCI_STATUS_INTERRUPT bit updated once the interrupt >> is masked. Mark this adapter as brok

Re: [PATCH RFC] virtio-net: remove useless disable on freeze

2012-05-28 Thread Michael S. Tsirkin
On Wed, Apr 04, 2012 at 12:19:54PM +0300, Michael S. Tsirkin wrote: > disable_cb is just an optimization: it > can not guarantee that there are no callbacks. > > I didn't yet figure out whether a callback > in freeze will trigger a bug, but disable_cb > won't address it in any case. So let's remov

Re: [PATCH] KVM: MMU: fix huge page adapted on non-PAE host

2012-05-28 Thread Xiao Guangrong
On 05/28/2012 08:24 PM, Avi Kivity wrote: > On 05/28/2012 02:39 PM, Xiao Guangrong wrote: >> On 05/28/2012 06:57 PM, Avi Kivity wrote: >> >>> On 05/28/2012 09:10 AM, Xiao Guangrong wrote: The huge page size is 4M on non-PAE host, but 2M page size is used in transparent_hugepage_adjust(),

Re: [PATCH v2] KVM: introduce readonly memory region

2012-05-28 Thread Xiao Guangrong
On 05/28/2012 03:21 PM, Gleb Natapov wrote: > On Fri, May 25, 2012 at 04:47:26PM +0800, Xiao Guangrong wrote: >> By the way, a foolish question, what is ROMD? i did not find any explanation >> on google. > This is memory region that behaves like ROM on read and like a device on > write. IIRC some

[RFC][PATCH] pci-assign: Drop support for raw ioport access

2012-05-28 Thread Jan Kiszka
From: Jan Kiszka If the kernel does not support ioport access via sysfs, passthrough can only help if the unlikely case that a port <= 0x3ff is provided by the device. So drop this to simplify the code and to allow dropping the corresponding KVM infrastructure in preparation of upstream merge. S

Re: [PATCH] KVM: MMU: fix huge page adapted on non-PAE host

2012-05-28 Thread Avi Kivity
On 05/28/2012 03:56 PM, Xiao Guangrong wrote: > On 05/28/2012 08:24 PM, Avi Kivity wrote: > >> On 05/28/2012 02:39 PM, Xiao Guangrong wrote: >>> On 05/28/2012 06:57 PM, Avi Kivity wrote: >>> On 05/28/2012 09:10 AM, Xiao Guangrong wrote: > The huge page size is 4M on non-PAE host, but 2M p

Re: [Qemu-devel] [RFC PATCH] vfio: add fixup for broken PCI devices

2012-05-28 Thread Michael S. Tsirkin
On Mon, May 28, 2012 at 02:48:10PM +0200, Jan Kiszka wrote: > On 2012-05-28 14:44, Michael S. Tsirkin wrote: > > On Fri, May 25, 2012 at 05:35:03PM +1000, Alexey Kardashevskiy wrote: > >> Some adapters (like NEC PCI USB controller) do not flush their config > >> on a sioftware reset and remember DM

Re: [PATCH] PCI: Mark INTx masking support of Chelsio T310 10GbE NIC as broken

2012-05-28 Thread Michael S. Tsirkin
On Mon, May 28, 2012 at 02:51:25PM +0200, Jan Kiszka wrote: > On 2012-05-28 14:39, Michael S. Tsirkin wrote: > > On Fri, May 25, 2012 at 11:02:13AM -0300, Jan Kiszka wrote: > >> According to Alexey, the T310 does not properly support INTx masking as > >> it fails to keep the PCI_STATUS_INTERRUPT bi

Re: [PATCH] KVM: MMU: fix huge page adapted on non-PAE host

2012-05-28 Thread Xiao Guangrong
On 05/28/2012 06:57 PM, Avi Kivity wrote: > On 05/28/2012 09:10 AM, Xiao Guangrong wrote: >> The huge page size is 4M on non-PAE host, but 2M page size is used in >> transparent_hugepage_adjust(), so the page we get after adjust the >> mapping level is not the head page, the BUG_ON() will be trigg

Re: [Qemu-devel] [PATCH v3 00/16] net: hub-based networking

2012-05-28 Thread Luiz Capitulino
On Mon, 28 May 2012 12:17:04 +0100 Stefan Hajnoczi wrote: > What we need to decide is whether it's okay to drop QEMU "VLANs" > completely and change dump command-line syntax? I'd vote for dropping it. > I think vlan-hub doesn't hurt anyone because the code has been isolated > and we keep backwa

Re: [PATCH v2 0/5] Export offsets of VMCS fields as note information for kdump

2012-05-28 Thread Avi Kivity
On 05/28/2012 08:25 AM, Yanfei Zhang wrote: > > Dou you have any comments about this patch set? I still have a hard time understanding why it is needed. If the host crashes, there is no reason to look at guest state; the host should survive no matter what the guest does. -- error compiling co

Re: [PATCH] PCI: Mark INTx masking support of Chelsio T310 10GbE NIC as broken

2012-05-28 Thread Jan Kiszka
On 2012-05-28 15:21, Michael S. Tsirkin wrote: > On Mon, May 28, 2012 at 02:51:25PM +0200, Jan Kiszka wrote: >> On 2012-05-28 14:39, Michael S. Tsirkin wrote: >>> On Fri, May 25, 2012 at 11:02:13AM -0300, Jan Kiszka wrote: According to Alexey, the T310 does not properly support INTx masking as

Re: [PATCH] PCI: Mark INTx masking support of Chelsio T310 10GbE NIC as broken

2012-05-28 Thread Michael S. Tsirkin
On Mon, May 28, 2012 at 03:29:58PM +0200, Jan Kiszka wrote: > On 2012-05-28 15:21, Michael S. Tsirkin wrote: > > On Mon, May 28, 2012 at 02:51:25PM +0200, Jan Kiszka wrote: > >> On 2012-05-28 14:39, Michael S. Tsirkin wrote: > >>> On Fri, May 25, 2012 at 11:02:13AM -0300, Jan Kiszka wrote: > A

Re: [PATCH] KVM: MMU: fix huge page adapted on non-PAE host

2012-05-28 Thread Xiao Guangrong
On 05/28/2012 09:14 PM, Avi Kivity wrote: > On 05/28/2012 03:56 PM, Xiao Guangrong wrote: >> On 05/28/2012 08:24 PM, Avi Kivity wrote: >> >>> On 05/28/2012 02:39 PM, Xiao Guangrong wrote: On 05/28/2012 06:57 PM, Avi Kivity wrote: > On 05/28/2012 09:10 AM, Xiao Guangrong wrote: >>

Re: [PATCH] KVM: MMU: fix huge page adapted on non-PAE host

2012-05-28 Thread Avi Kivity
On 05/28/2012 04:41 PM, Xiao Guangrong wrote: > On 05/28/2012 09:14 PM, Avi Kivity wrote: > >> On 05/28/2012 03:56 PM, Xiao Guangrong wrote: >>> On 05/28/2012 08:24 PM, Avi Kivity wrote: >>> On 05/28/2012 02:39 PM, Xiao Guangrong wrote: > On 05/28/2012 06:57 PM, Avi Kivity wrote: > >>

Re: [PATCH] KVM: MMU: fix huge page adapted on non-PAE host

2012-05-28 Thread Xiao Guangrong
On 05/28/2012 09:53 PM, Avi Kivity wrote: > On 05/28/2012 04:41 PM, Xiao Guangrong wrote: >> On 05/28/2012 09:14 PM, Avi Kivity wrote: >> >>> On 05/28/2012 03:56 PM, Xiao Guangrong wrote: On 05/28/2012 08:24 PM, Avi Kivity wrote: > On 05/28/2012 02:39 PM, Xiao Guangrong wrote: >>

Re: [RFC][PATCH] pci-assign: Drop support for raw ioport access

2012-05-28 Thread Avi Kivity
On 05/28/2012 04:03 PM, Jan Kiszka wrote: > From: Jan Kiszka > > If the kernel does not support ioport access via sysfs, passthrough can > only help if the unlikely case that a port <= 0x3ff is provided by the > device. So drop this to simplify the code and to allow dropping the > corresponding K

Re: [PATCH] KVM: MMU: fix huge page adapted on non-PAE host

2012-05-28 Thread Avi Kivity
On 05/28/2012 05:05 PM, Xiao Guangrong wrote: >>> >>> >>> I think the reason we move refcount in current code is, we should increase >>> the >>> refcount of the page we will mapped into shadow page table, since we always >>> decrease its refcount after it is mapped. (That is this patch does.) >>>

Re: [PATCH] KVM: MMU: fix huge page adapted on non-PAE host

2012-05-28 Thread Andrea Arcangeli
Hi, On Mon, May 28, 2012 at 04:53:38PM +0300, Avi Kivity wrote: > As far as I can tell __get_user_pages_fast() will take the reference > count in the page head in the first place. mask = KVM_PAGES_PER_HPAGE(level) - 1; The BUG would trigger if the above KVM mask is 2M (that is the NPT/EPT pm

Re: [PATCH] KVM: MMU: fix huge page adapted on non-PAE host

2012-05-28 Thread Avi Kivity
On 05/28/2012 05:32 PM, Andrea Arcangeli wrote: > Hi, > > On Mon, May 28, 2012 at 04:53:38PM +0300, Avi Kivity wrote: >> As far as I can tell __get_user_pages_fast() will take the reference >> count in the page head in the first place. > > mask = KVM_PAGES_PER_HPAGE(level) - 1; > > The BUG w

Re: [PATCH] KVM: MMU: fix huge page adapted on non-PAE host

2012-05-28 Thread Andrea Arcangeli
On Mon, May 28, 2012 at 05:20:02PM +0300, Avi Kivity wrote: > The "right thing" we should be doing is running get_page() on every > small page within the frame (we asked for a small page but are > opportunistrically using the pages around it, without a proper ref). > That's a bit slow though, so we

Re: [PATCH] KVM: MMU: fix huge page adapted on non-PAE host

2012-05-28 Thread Andrea Arcangeli
On Mon, May 28, 2012 at 05:40:08PM +0300, Avi Kivity wrote: > Yes, I see it now. Adjusting mask is incorrect since we won't have the > same adjustment on release. I'll apply the patch for 3.5. Sounds great to me. One thing I'm not sure about is about the real need of the mmio check vs a stright

[Bug 43311] New: Windows XP Guest crashes when doing recursive grep in a Clearcase environment

2012-05-28 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=43311 Summary: Windows XP Guest crashes when doing recursive grep in a Clearcase environment Product: Virtualization Version: unspecified Kernel Version: 2.6.32-22 Platform: All O

KVM call agenda for Tuesday, May 29th

2012-05-28 Thread Juan Quintela
Hi Please send in any agenda items you are interested in covering. Thanks, Juan. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[Bug 43311] Windows XP Guest crashes when doing recursive grep in a Clearcase environment

2012-05-28 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=43311 Michael Tokarev changed: What|Removed |Added CC||m...@tls.msk.ru --- Comment #1 from

[PATCH v6 2/9] KVM: MMU: abstract spte write-protect

2012-05-28 Thread Xiao Guangrong
Introduce a common function to abstract spte write-protect to cleanup the code Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 58 +++ 1 files changed, 31 insertions(+), 27 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c

[PATCH v6 1/9] KVM: MMU: return bool in __rmap_write_protect

2012-05-28 Thread Xiao Guangrong
The reture value of __rmap_write_protect is either 1 or 0, use true/false instead of these Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 13 +++-- 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 72102e0..ddbf89f 1006

[PATCH v6 0/9] KVM: MMU: fast page fault

2012-05-28 Thread Xiao Guangrong
Changlog: - disable fast page fault for soft mmu, let it only works for direct sptes. - optimize spte_has_volatile_bits() and mmu_spte_update() Performance result: (The benchmark can be found at: http://www.spinics.net/lists/kvm/msg73011.html) beforeafte

[PATCH v6 3/9] KVM: VMX: export PFEC.P bit on ept

2012-05-28 Thread Xiao Guangrong
Export the present bit of page fault error code, the later patch will use it Signed-off-by: Xiao Guangrong --- arch/x86/kvm/vmx.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 32eb588..fe18fa3 100644 --- a/arch/x86/

[PATCH v6 4/9] KVM: MMU: fold tlb flush judgement into mmu_spte_update

2012-05-28 Thread Xiao Guangrong
mmu_spte_update() is the common function, we can easily audit the path Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 33 - 1 files changed, 20 insertions(+), 13 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 337ff0a..4810992 10

[PATCH v6 5/9] KVM: MMU: introduce SPTE_MMU_WRITEABLE bit

2012-05-28 Thread Xiao Guangrong
This bit indicates whether the spte can be writable on MMU, that means the corresponding gpte is writable and the corresponding gfn is not protected by shadow page protection Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 41 +++-- 1 files changed, 2

[PATCH v6 6/9] KVM: MMU: fast path of handling guest page fault

2012-05-28 Thread Xiao Guangrong
If the the present bit of page fault error code is set, it indicates the shadow page is populated on all levels, it means what we do is only modify the access bit which can be done out of mmu-lock Currently, in order to simplify the code, we only fix the page fault caused by write-protect on the f

[PATCH v6 7/9] KVM: MMU: trace fast page fault

2012-05-28 Thread Xiao Guangrong
To see what happen on this path and help us to optimize it Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c |2 ++ arch/x86/kvm/mmutrace.h | 38 ++ 2 files changed, 40 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm

[PATCH v6 8/9] KVM: MMU: fix kvm_mmu_pagetable_walk tracepoint

2012-05-28 Thread Xiao Guangrong
The P bit of page fault error code is missed in this tracepoint, fix it by passing the full error code Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmutrace.h|7 +++ arch/x86/kvm/paging_tmpl.h |3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/m

[PATCH v6 9/9] KVM: MMU: document mmu-lock and fast page fault

2012-05-28 Thread Xiao Guangrong
Document fast page fault and mmu-lock in locking.txt Signed-off-by: Xiao Guangrong --- Documentation/virtual/kvm/locking.txt | 134 - 1 files changed, 133 insertions(+), 1 deletions(-) diff --git a/Documentation/virtual/kvm/locking.txt b/Documentation/virtual/k