Re: Early boot panic on machine with lots of memory

2012-06-15 Thread Sasha Levin
On Thu, 2012-06-14 at 19:21 -0700, Yinghai Lu wrote: > On Thu, Jun 14, 2012 at 5:59 PM, Sasha Levin wrote: > > On Thu, 2012-06-14 at 16:57 -0700, Yinghai Lu wrote: > >> can you please boot with "memtest" to see if there is any memory problem? > > > > The host got a memtest treatment, nothing found

Re: WARNING: at arch/x86/kernel/kvmclock.c:127

2012-06-15 Thread Sedat Dilek
On Tue, Jun 12, 2012 at 4:13 AM, Marcelo Tosatti wrote: > On Mon, Jun 11, 2012 at 06:10:34PM -0400, Eric B Munson wrote: >> On Mon, 11 Jun 2012 19:07:19 -0300, Marcelo Tosatti wrote: >> >On Mon, Jun 11, 2012 at 05:47:00PM -0400, Eric B Munson wrote: >> >>On Sun, 10 Jun 2012 17:47:24 +0200, Sedat D

Re: Credit-based scheduling in KVM?

2012-06-15 Thread Javier Guerra Giraldez
On Fri, Jun 15, 2012 at 4:08 AM, sguazt wrote: > I've found some suggestions here: > > http://forums.meulie.net/viewtopic.php?f=43&t=6436 > http://serverfault.com/questions/324265/equivalent-of-xen-capping-in-kvm > > but none of those are native to KVM. what do you mean 'native to KVM'? kvm is p

[RFC PATCH 0/4] KVM: Optimize MMU notifier's THP page invalidation

2012-06-15 Thread Takuya Yoshikawa
Takuya Yoshikawa (4): KVM: MMU: Use __gfn_to_rmap() to clean up kvm_handle_hva() KVM: Introduce hva_to_gfn() for kvm_handle_hva() KVM: MMU: Make kvm_handle_hva() handle range of addresses KVM: Introduce kvm_unmap_hva_range() for kvm_mmu_notifier_invalidate_range_start() arch/powerpc/incl

[PATCH 1/4] KVM: MMU: Use __gfn_to_rmap() to clean up kvm_handle_hva()

2012-06-15 Thread Takuya Yoshikawa
We can treat every level uniformly. Signed-off-by: Takuya Yoshikawa --- arch/x86/kvm/mmu.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 24dd43d..a2f3969 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @

[PATCH 2/4] KVM: Introduce hva_to_gfn() for kvm_handle_hva()

2012-06-15 Thread Takuya Yoshikawa
This restricts hva handling in mmu code and makes it easier to extend kvm_handle_hva() so that it can treat a range of addresses later in this patch series. Signed-off-by: Takuya Yoshikawa Cc: Alexander Graf Cc: Paul Mackerras --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 12 +--- arch/x

[PATCH 3/4] KVM: MMU: Make kvm_handle_hva() handle range of addresses

2012-06-15 Thread Takuya Yoshikawa
When guest's memory is backed by THP pages, MMU notifier needs to call kvm_unmap_hva(), which in turn leads to kvm_handle_hva(), in a loop to invalidate a range of pages which constitute one huge page: for each guest page for each memslot if page is in memslot unmap using rmap

[PATCH 1/2] kvm tools: set the HYPERVISOR flag in cpuid

2012-06-15 Thread Sasha Levin
We need to set the HYPERVISOR flag to let the kernel know we're running under a hypervisor. This makes the kernel enable all sorts of para-virtualization options such as kvm-clock. Signed-off-by: Sasha Levin --- tools/kvm/x86/cpuid.c |4 1 files changed, 4 insertions(+), 0 deletions(-)

[PATCH 2/2] kvm tools: support 9p flush command

2012-06-15 Thread Sasha Levin
While we process 9p requests serially, so there's no point for implementing flush, we still need to answer it to prevent guest kernel from hanging waiting for it. Signed-off-by: Sasha Levin --- tools/kvm/virtio/9p.c | 15 ++- 1 files changed, 14 insertions(+), 1 deletions(-) diff

[PATCH 4/4] KVM: Introduce kvm_unmap_hva_range() for kvm_mmu_notifier_invalidate_range_start()

2012-06-15 Thread Takuya Yoshikawa
When we tested KVM under memory pressure, with THP enabled on the host, we noticed that MMU notifier took a long time to invalidate huge pages. Since the invalidation was done with mmu_lock held, it not only wasted the CPU but also made the host harder to respond. This patch mitigates this by usi

Re: [PATCH 1/2] kvm tools: set the HYPERVISOR flag in cpuid

2012-06-15 Thread Cyrill Gorcunov
On Fri, Jun 15, 2012 at 01:34:16PM +0200, Sasha Levin wrote: > We need to set the HYPERVISOR flag to let the kernel know we're running > under a hypervisor. > > This makes the kernel enable all sorts of para-virtualization options > such as kvm-clock. > > Signed-off-by: Sasha Levin OK, looks go

Re: Credit-based scheduling in KVM?

2012-06-15 Thread sguazt
On Fri, Jun 15, 2012 at 1:28 PM, Javier Guerra Giraldez wrote: > On Fri, Jun 15, 2012 at 4:08 AM, sguazt wrote: >> I've found some suggestions here: >> >> http://forums.meulie.net/viewtopic.php?f=43&t=6436 >> http://serverfault.com/questions/324265/equivalent-of-xen-capping-in-kvm >> >> but none

Re: Credit-based scheduling in KVM?

2012-06-15 Thread Javier Guerra Giraldez
On Fri, Jun 15, 2012 at 6:39 AM, sguazt wrote: > With "native" I meant that I'd like to have a credit-based scheduling > mechanism specifically targeted to VMs, without affecting the other > processes of the host machine. just put the VMs on their own cgroup -- Javier -- To unsubscribe from thi

Re: Credit-based scheduling in KVM?

2012-06-15 Thread sguazt
>> >> Is it possible with KVM? >> And if it is, how could it be done? > > You can do it in userspace. > > Put all VM's in a cgroup to ensure didicated cpu shares. > Remaining all house keeping processes, put in another group and > allocate some cpu shares. > Hi Pradeep and thank you for replying.

Re: [PATCH] KVM: Fix PCI header check on device assignment

2012-06-15 Thread Marcelo Tosatti
On Thu, Jun 14, 2012 at 01:48:28PM -0600, Alex Williamson wrote: > Avi, Marcelo, > > Can we get this in for 3.5 please? There's already an ack from me on > the list. Thanks, > > Alex Can you bounce it to me please ? > On Tue, 2012-06-05 at 10:37 +0200, Jan Kiszka wrote: > > The masking was wr

Re: WARNING: at arch/x86/kernel/kvmclock.c:127

2012-06-15 Thread Marcelo Tosatti
On Fri, Jun 15, 2012 at 11:35:58AM +0200, Sedat Dilek wrote: > On Tue, Jun 12, 2012 at 4:13 AM, Marcelo Tosatti wrote: > > On Mon, Jun 11, 2012 at 06:10:34PM -0400, Eric B Munson wrote: > >> On Mon, 11 Jun 2012 19:07:19 -0300, Marcelo Tosatti wrote: > >> >On Mon, Jun 11, 2012 at 05:47:00PM -0400,

UIP flag not cleared

2012-06-15 Thread nicolas . ochem
Hi list, I am having troubles porting my os to qemu/kvm environment. It's about the RTC (real-time clock) There is a flag (UIP flag) which is supposed to show when RTC can be read or not. We wait 10ms for that flag to be cleared, but sometimes it's not enough with qemu/kvm. Is it necess

git access via http to kvm-kmod

2012-06-15 Thread Juan
Hi, I cloned the KVM external module kit from http://git.kiszka.org/?p=kvm-kmod.git. Following the README, when I try to build it by running 'git submodule update', I get an error: $ git submodule initSubmodule 'linux' (http://git.kiszka.org/kvm.git) registered for path 'linux' $ git submodule up

Re: git access via http to kvm-kmod

2012-06-15 Thread Jan Kiszka
On 2012-06-15 17:54, Juan wrote: > Hi, > > I cloned the KVM external module kit from > http://git.kiszka.org/?p=kvm-kmod.git. > Following the README, when I try to build it by running 'git submodule > update', > I get an error: > > $ git submodule initSubmodule 'linux' (http://git.kiszka.org/kv

[PATCH v8 04/15] KVM: Guard mmu_notifier specific code with CONFIG_MMU_NOTIFIER

2012-06-15 Thread Christoffer Dall
From: Marc Zyngier In order to avoid compilation failure when KVM is not compiled in, guard the mmu_notifier specific sections with both CONFIG_MMU_NOTIFIER and KVM_ARCH_WANT_MMU_NOTIFIER, like it is being done in the rest of the KVM code. Signed-off-by: Marc Zyngier Signed-off-by: Christoffer

[PATCH v8 06/15] ARM: KVM: Hypervisor identity mapping

2012-06-15 Thread Christoffer Dall
Adds support in the identity mapping feature that allows KVM to setup identity mapping for the Hyp mode with the AP[1] bit set as required by the specification and also supports freeing created sub pmd's after finished use. These two functions: - hyp_idmap_add(pgd, addr, end); - hyp_idmap_del(pg

[PATCH v8 00/15] KVM/ARM Implementation

2012-06-15 Thread Christoffer Dall
The following series implements KVM support for ARM processors, specifically on the Cortex A-15 platform. Work is done in collaboration between Columbia University, Virtual Open Systems and ARM/Linaro. The patch series applies to kvm/next, specifically commit: 25e531a988ea5a64bd97a72dc9d3c65ad585

[PATCH v8 03/15] KVM: Introduce __KVM_HAVE_IRQ_LINE

2012-06-15 Thread Christoffer Dall
This is a preparatory patch for the KVM/ARM implementation. KVM/ARM will use the KVM_IRQ_LINE ioctl, which is currently conditional on __KVM_HAVE_IOAPIC, but ARM obviously doesn't have any IOAPIC support and we need a separate define. Signed-off-by: Christoffer Dall --- arch/ia64/include/asm/kvm

[PATCH v8 05/15] ARM: KVM: Initial skeleton to compile KVM support

2012-06-15 Thread Christoffer Dall
From: Christoffer Dall Targets KVM support for Cortex A-15 processors. Contains no real functionality but all the framework components, make files, header files and some tracing functionality. “Nothing to see here. Move along, move along..." Most functionality is in arch/arm/kvm/* or arch/arm/

[PATCH v8 08/15] ARM: KVM: Module unloading support

2012-06-15 Thread Christoffer Dall
Current initialization code relies on the MMU-bit and TE-bit of the HSCTLR register to be cleared, so to support re-inserting the KVM module we must clear these bits when unloading the module. This is going to change in two ways: First, the init id-map code is going to go away in favor of section

[PATCH v8 07/15] ARM: KVM: Hypervisor inititalization

2012-06-15 Thread Christoffer Dall
Sets up the required registers to run code in HYP-mode from the kernel. By setting the HVBAR the kernel can execute code in Hyp-mode with the MMU disabled. The HVBAR initially points to initialization code, which initializes other Hyp-mode registers and enables the MMU for Hyp-mode. Afterwards, th

[PATCH v8 10/15] ARM: KVM: Inject IRQs and FIQs from userspace

2012-06-15 Thread Christoffer Dall
From: Christoffer Dall Userspace can inject IRQs and FIQs through the KVM_IRQ_LINE VM ioctl. This ioctl is used since the sematics are in fact two lines that can be either raised or lowered on the VCPU - the IRQ and FIQ lines. KVM needs to know which VCPU it must operate on and whether the FIQ o

[PATCH v8 09/15] ARM: KVM: Memory virtualization setup

2012-06-15 Thread Christoffer Dall
From: Christoffer Dall This commit introduces the framework for guest memory management through the use of 2nd stage translation. Each VM has a pointer to a level-1 table (the pgd field in struct kvm_arch) which is used for the 2nd stage translations. Entries are added when handling guest faults

[PATCH v8 02/15] KVM: use KVM_CAP_IRQ_ROUTING to protect the routing related code

2012-06-15 Thread Christoffer Dall
From: Marc Zyngier The KVM code sometimes uses CONFIG_HAVE_KVM_IRQCHIP to protect code that is related to IRQ routing, which not all in-kernel irqchips may support. Use KVM_CAP_IRQ_ROUTING instead. Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- include/linux/kvm_host.h |

[PATCH v8 01/15] ARM: add mem_type prot_pte accessor

2012-06-15 Thread Christoffer Dall
From: Marc Zyngier The KVM hypervisor mmu code requires requires access to the mem_type prot_pte field when setting up page tables pointing to a device. Unfortunately, the mem_type structure is opaque. Add an accessor (get_mem_type_prot_pte()) to retrieve the prot_pte value. Signed-off-by: Marc

[PATCH v8 12/15] ARM: KVM: Emulation framework and CP15 emulation

2012-06-15 Thread Christoffer Dall
From: Christoffer Dall Adds a new important function in the main KVM/ARM code called handle_exit() which is called from kvm_arch_vcpu_ioctl_run() on returns from guest execution. This function examines the Hyp-Syndrome-Register (HSR), which contains information telling KVM what caused the exit fr

[PATCH v8 13/15] ARM: KVM: Handle guest faults in KVM

2012-06-15 Thread Christoffer Dall
From: Christoffer Dall Handles the guest faults in KVM by mapping in corresponding user pages in the 2nd stage page tables. Introduces new ARM-specific kernel memory types, PAGE_KVM_GUEST and pgprot_guest variables used to map 2nd stage memory for KVM guests. Leverages MMU notifiers on KVM/ARM

[PATCH v8 11/15] ARM: KVM: World-switch implementation

2012-06-15 Thread Christoffer Dall
Provides complete world-switch implementation to switch to other guests running in non-secure modes. Includes Hyp exception handlers that capture necessary exception information and stores the information on the VCPU and KVM structures. Switching to Hyp mode is done through a simple HVC instructio

[PATCH v8 14/15] ARM: KVM: Handle I/O aborts

2012-06-15 Thread Christoffer Dall
When the guest accesses I/O memory this will create data abort exceptions and they are handled by decoding the HSR information (physical address, read/write, length, register) and forwarding reads and writes to QEMU which performs the device emulation. Certain classes of load/store operations do n

[PATCH v8 15/15] ARM: KVM: Guest wait-for-interrupts (WFI) support

2012-06-15 Thread Christoffer Dall
From: Christoffer Dall When the guest executes a WFI instruction the operation is trapped to KVM, which emulates the instruction in software. There is no correlation between a guest executing a WFI instruction and actually putting the hardware into a low-power mode, since a KVM guest is essential

Re: [PATCH 2/4] KVM: Introduce hva_to_gfn() for kvm_handle_hva()

2012-06-15 Thread Takuya Yoshikawa
On Fri, 15 Jun 2012 20:31:44 +0900 Takuya Yoshikawa wrote: ... > diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c > b/arch/powerpc/kvm/book3s_64_mmu_hv.c > index d03eb6f..53716dd 100644 > --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c > +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c > @@ -767,15 +767,13

Re: [PATCH v3 6/6] KVM: introduce readonly memslot

2012-06-15 Thread Marcelo Tosatti
On Tue, Jun 12, 2012 at 10:49:31AM +0800, Xiao Guangrong wrote: > In current code, if we map a readonly memory space from host to guest > and the page is not currently mapped in the host, we will get a fault-pfn > and async is not allowed, then the vm will crash > > Address Avi's idea, we introduc

Re: [PATCH v4] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-06-15 Thread Marcelo Tosatti
On Thu, Jun 14, 2012 at 02:04:25AM +, Mao, Junjie wrote: > This patch handles PCID/INVPCID for guests. > > Process-context identifiers (PCIDs) are a facility by which a logical > processor > may cache information for multiple linear-address spaces so that the processor > may retain cached inf

Re: [PATCH] KVM: Fix PCI header check on device assignment

2012-06-15 Thread Marcelo Tosatti
On Fri, Jun 15, 2012 at 07:56:20AM -0600, Jan Kiszka wrote: > The masking was wrong (must have been 0x7f), and there is no need to > re-read the value as pci_setup_device already does this for us. > > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=43339 > Signed-off-by: Jan Kiszka Applied

[Bug 42980] BUG in gfn_to_pfn_prot

2012-06-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=42980 --- Comment #10 from Luke-Jr 2012-06-16 03:16:44 --- For what it's worth, no crashes in over a month. But it wasn't common enough that it can't be coincidence either... -- Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=em

Re: Bug? 100% load on core after physically removing USB storage from host

2012-06-15 Thread Emmanuel Noobadmin
On 6/13/12, Stefan Hajnoczi wrote: >Since system time is a large chunk you could use strace -f -p $(pgrep >qemu-kvm) or other system call tracing tools to see what the qemu-kvm >process is doing. The command you gave didn't work so I replace $(pgrep) with PID of the process running the VM after c

Re: Bug? 100% load on core after physically removing USB storage from host

2012-06-15 Thread Emmanuel Noobadmin
On 6/14/12, Veruca Salt wrote: >> >>> qemu-kvm-0.12.1.2-2.209.el6_2.4.x86_64 > > We had the same problem with 0.13 > We were using it on Sandy Bridge motherboards when it happened. It was an > issue then, but we hanged to 1.0 a long time ago. > Why are you using 0.12 years after it was replaced?