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 levinsasha...@gmail.com 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,

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 mtosa...@redhat.com 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

[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()

[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 yoshikawa.tak...@oss.ntt.co.jp --- 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 ---

[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 yoshikawa.tak...@oss.ntt.co.jp Cc: Alexander Graf ag...@suse.de Cc: Paul Mackerras pau...@samba.org ---

[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 levinsasha...@gmail.com --- tools/kvm/x86/cpuid.c |4 1 files changed, 4

[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 levinsasha...@gmail.com --- tools/kvm/virtio/9p.c | 15 ++- 1 files changed, 14

[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

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

Re: Credit-based scheduling in KVM?

2012-06-15 Thread sguazt
On Fri, Jun 15, 2012 at 1:28 PM, Javier Guerra Giraldez jav...@guerrag.com wrote: On Fri, Jun 15, 2012 at 4:08 AM, sguazt marco.guazz...@gmail.com wrote: I've found some suggestions here: http://forums.meulie.net/viewtopic.php?f=43t=6436

Re: Credit-based scheduling in KVM?

2012-06-15 Thread Javier Guerra Giraldez
On Fri, Jun 15, 2012 at 6:39 AM, sguazt marco.guazz...@gmail.com 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

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. Since I

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 wrong

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 mtosa...@redhat.com 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

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

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

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/kvm.git)

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

2012-06-15 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com 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

[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); -

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

[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 c.d...@virtualopensystems.com

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

2012-06-15 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu 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

[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

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

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

2012-06-15 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu 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

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

2012-06-15 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu 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

[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 marc.zyng...@arm.com 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 marc.zyng...@arm.com Signed-off-by: Christoffer

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

2012-06-15 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com 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.

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

2012-06-15 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu 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

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

2012-06-15 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu 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

[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

[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

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

2012-06-15 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu 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

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 yoshikawa.tak...@oss.ntt.co.jp 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 +++

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 introduce

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

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

[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 luke-jr+linuxb...@utopios.org 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:

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 stefa...@gmail.com 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

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 verucasal...@hotmail.co.uk 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

Re: [Qemu-devel] [PATCH] trace: added ability to comment out events in the list

2012-06-15 Thread Stefan Hajnoczi
On Fri, Jun 15, 2012 at 5:36 AM, Alexey Kardashevskiy a...@ozlabs.ru wrote: On 14/06/12 23:18, Stefan Hajnoczi wrote: On Thu, Jun 14, 2012 at 02:41:40PM +1000, Alexey Kardashevskiy wrote: It is convenient for debug to be able to switch on/off some events easily. The only possibility now is to

[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 yoshikawa.tak...@oss.ntt.co.jp Cc: Alexander Graf ag...@suse.de Cc: Paul Mackerras pau...@samba.org ---

[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

-M g3beige KVM emulation failure on reset

2012-06-15 Thread Andreas Färber
Hello Alex, As mentioned recently, I can reproduce an emulation failure on POWER5 with PR KVM on openSUSE Factory a few seconds after reset: $ uname -a Linux power5 3.4.0-10-ppc64 #1 SMP Wed May 23 13:59:25 UTC 2012 (a3c5f2c) ppc64 ppc64 ppc64 GNU/Linux # ppc-softmmu/qemu-system-ppc -enable-kvm

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 yoshikawa.tak...@oss.ntt.co.jp 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 +++