[PATCH] kvm tools: Fix reported RTC century and year

2012-10-25 Thread Pekka Enberg
Commit 13d5097 (kvm tools: Fix reported year in RTC emulation) attempted to fix wrongly reported RTC year. However, as pointed out by hpa the proper way to deal with this is to support the RTC century field. Suggested-by: H. Peter Anvin h...@zytor.com Cc: Ingo Molnar mi...@kernel.org Cc: H. Peter

Re: [RFC 1/3] kvm tools: use mutex abstraction instead of pthread mutex

2012-10-25 Thread Pekka Enberg
On Wed, 24 Oct 2012, Sasha Levin wrote: We already have something to wrap pthread with mutex_[init,lock,unlock] calls. This patch creates a new struct mutex abstraction and moves everything to work with it. Signed-off-by: Sasha Levin sasha.le...@oracle.com I applied this patch from the RFC

Re: [PATCH 1/5] kvm tools: check ioctl return value for msi signal

2012-10-25 Thread Pekka Enberg
On Wed, 24 Oct 2012, William Dauchy wrote: Signed-off-by: William Dauchy will...@gandi.net --- tools/kvm/virtio/pci.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c index b6ac571..ab1119a 100644 ---

Re: [PATCH 2/5] kvm tools: use the correct config vector interrupt

2012-10-25 Thread Pekka Enberg
On Wed, 24 Oct 2012, William Dauchy wrote: when registering the config interrupt, the later is registered in vcpi-config_vector and not in vpci-vq_vector introduced in: a841f15 kvm tools: Use the new KVM_SIGNAL_MSI ioctl to inject interrupts directly. Signed-off-by: William Dauchy

Re: [PATCH 4/5] kvm tools: initialize msi flags to zero even is not used yet

2012-10-25 Thread Pekka Enberg
On Wed, 24 Oct 2012, William Dauchy wrote: kvm explictly checks if msi flags is equal to zero before going further; just make sure it is correctly initialized. Signed-off-by: William Dauchy will...@gandi.net --- tools/kvm/virtio/pci.c |1 + 1 file changed, 1 insertion(+) diff --git

Re: [PATCH 5/5] kvm tools: specify the amount to balloon is in MB

2012-10-25 Thread Pekka Enberg
Signed-off-by: William Dauchy will...@gandi.net --- tools/kvm/builtin-balloon.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/kvm/builtin-balloon.c b/tools/kvm/builtin-balloon.c index 5bd2291..d158ace 100644 --- a/tools/kvm/builtin-balloon.c +++

Re: [BUG] lkvm crash on crashkernel boot

2012-10-25 Thread Pekka Enberg
On Wed, Oct 24, 2012 at 6:27 PM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: Hi, I've tried to play with kexec using lkvm. Unfortunately, lkvm crashes when I try to switch to crashkernel. I use Linus tree + penberg/kvmtool/next + one x86 mm patch[1]. Kernel is defconfig +

Re: [Qemu-devel] [RFC PATCH v3 05/19] Implement dimm device abstraction

2012-10-25 Thread liu ping fan
On Thu, Oct 25, 2012 at 1:16 AM, Vasilis Liaskovitis vasilis.liaskovi...@profitbricks.com wrote: Hi, On Wed, Oct 24, 2012 at 12:15:17PM +0200, Stefan Hajnoczi wrote: On Wed, Oct 24, 2012 at 10:06 AM, liu ping fan qemul...@gmail.com wrote: On Tue, Oct 23, 2012 at 8:25 PM, Stefan Hajnoczi

Re: [RFC 2/3] lockdep: be nice about compiling from userspace

2012-10-25 Thread Ingo Molnar
* Sasha Levin sasha.le...@oracle.com wrote: We can rather easily make lockdep work from userspace, although 3 issues remain which I'm not sure about: - Kernel naming - we can just wrap init_utsname() to return kvmtool related utsname, is that what we want though? - static_obj() - I

Re: [PATCH 1/5] kvm tools: check ioctl return value for msi signal

2012-10-25 Thread William Dauchy
On Oct25 10:01, Pekka Enberg wrote: Is this something that happens on your machine? I wonder if it makes more sense to return the error from virtio_pci__signal_vq() and virtio_pci__signal_config() and make the callers deal with it. no but I thought it was worth not keeping a system call

Re: [PATCH 4/5] kvm tools: initialize msi flags to zero even is not used yet

2012-10-25 Thread William Dauchy
On Oct25 10:07, Pekka Enberg wrote: It is initialized to zero by default as per C struct initialization, isn't it? Does this fix a problem you are experiencing? no, just a security since kvm checks it. Anyway you can ignore this patch if you want. -- William signature.asc Description:

[PATCH v2 0/5] Qemu: implement readonly memory

2012-10-25 Thread Xiao Guangrong
This patch set make the readonly memory in qemu really readonly by using readonly memory slots feature in kvm to make qemu-kvm safer. Memory regions with readonly property would be plug into kvm as readonly memory slots. Below module can test this feature: static int rom_tester_probe(struct

[PATCH v2 1/5] KVM: define KVM_CAP_READONLY_MEM unconditionally

2012-10-25 Thread Xiao Guangrong
let it not depend on __KVM_HAVE_READONLY_MEM to make it friendly to userspace Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/x86.c |2 ++ include/linux/kvm.h |2 -- virt/kvm/kvm_main.c |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff

[PATCH v2 2/5] Qemu: update header files

2012-10-25 Thread Xiao Guangrong
Sync the header files by using scripts/update-linux-headers.sh Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- linux-headers/asm-powerpc/kvm.h | 59 ++ linux-headers/asm-powerpc/kvm_para.h |7 ++-- linux-headers/asm-x86/kvm.h

[PATCH v2 3/5] Qemu: do not mark bios readonly

2012-10-25 Thread Xiao Guangrong
In isapc, no i440x device exists in guest that means seabios can not make 0xc to 0x100 writable It works fine in current code since the guest can happily write readonly memory. In order to support readonly slot in Qemu, we do not make the bios readonly anymore Signed-off-by: Xiao

[PATCH v2 4/5] Qemu: implement readonly memory

2012-10-25 Thread Xiao Guangrong
As readonly memory is support in kvm, this patch supports this feature in qemu, mainly pluging the memory region with KVM_MEM_READONLY flag to kvm Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- kvm-all.c | 24 +--- 1 files changed, 17 insertions(+), 7

[PATCH v2 5/5] Qemu: mark pci rom readonly

2012-10-25 Thread Xiao Guangrong
Since it is ROM which is really readonly in the system Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- hw/pci.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 2ca6ff6..2a287bb 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -1803,6

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

2012-10-25 Thread zhangyanfei
Would anyone help review the patch, and give some comments, please ? Avi? 于 2012年10月19日 13:41, Zhang Yanfei 写道: 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,

Re: [Qemu-devel] [PATCH v2 2/5] Qemu: update header files

2012-10-25 Thread Peter Maydell
On 25 October 2012 10:21, Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com wrote: Sync the header files by using scripts/update-linux-headers.sh I think it would be good if this kind of patch included in the commit message the kernel tree/branch and commit hash that the sync was with. thanks --

Re: [kvmarm] [RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses

2012-10-25 Thread Jan Kiszka
On 2012-10-24 02:50, Paul Mackerras wrote: On Tue, Oct 23, 2012 at 12:48:28PM +0200, Jan Kiszka wrote: The current irqchip API is like this: KVM_CREATE_IRQCHIP (without any parameters) ... KVM_CREATE_VCPU KVM_SET_IRQCHIP (or the other way around) ... KVM_RUN The arguments you cannot

Re: [PATCH v2 1/5] KVM: define KVM_CAP_READONLY_MEM unconditionally

2012-10-25 Thread Jan Kiszka
On 2012-10-25 11:21, Xiao Guangrong wrote: let it not depend on __KVM_HAVE_READONLY_MEM to make it friendly to userspace Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/x86.c |2 ++ include/linux/kvm.h |2 -- virt/kvm/kvm_main.c |2 +- 3

Re: [BUG] lkvm crash on crashkernel boot

2012-10-25 Thread Kirill A. Shutemov
On Thu, Oct 25, 2012 at 10:17:27AM +0300, Pekka Enberg wrote: On Wed, Oct 24, 2012 at 6:27 PM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: Hi, I've tried to play with kexec using lkvm. Unfortunately, lkvm crashes when I try to switch to crashkernel. I use Linus tree +

Re: How to do fast accesses to LAPIC TPR under kvm?

2012-10-25 Thread Avi Kivity
On 10/24/2012 11:19 AM, Stefan Fritsch wrote: With the decode table fix I think it should work. It needs some more changes. The patch below did the trick for me. It is against 3.5, because I didn't want to build a whole new kernel (my test machine is a dead slow AMD E-350). The patch is

Re: [kvmarm] [RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses

2012-10-25 Thread Paolo Bonzini
Il 24/10/2012 02:50, Paul Mackerras ha scritto: So we could indeed use the existing KVM_CREATE_IRQCHIP to tell KVM to create a presentation controller per vcpu. But then how do we tell KVM how many source controllers we want and how many interrupts each source controller should handle? The

Re: [kvmarm] [RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses

2012-10-25 Thread Jan Kiszka
On 2012-10-25 18:14, Paolo Bonzini wrote: Il 24/10/2012 02:50, Paul Mackerras ha scritto: So we could indeed use the existing KVM_CREATE_IRQCHIP to tell KVM to create a presentation controller per vcpu. But then how do we tell KVM how many source controllers we want and how many interrupts

Re: [RFC 2/3] lockdep: be nice about compiling from userspace

2012-10-25 Thread Sasha Levin
On 10/25/2012 04:05 AM, Ingo Molnar wrote: * Sasha Levin sasha.le...@oracle.com wrote: We can rather easily make lockdep work from userspace, although 3 issues remain which I'm not sure about: - Kernel naming - we can just wrap init_utsname() to return kvmtool related utsname, is that

Re: [RFC 2/3] lockdep: be nice about compiling from userspace

2012-10-25 Thread Ingo Molnar
* Sasha Levin sasha.le...@oracle.com wrote: On 10/25/2012 04:05 AM, Ingo Molnar wrote: * Sasha Levin sasha.le...@oracle.com wrote: We can rather easily make lockdep work from userspace, although 3 issues remain which I'm not sure about: - Kernel naming - we can just wrap

Re: FW: cgroup blkio.weight working, but not for KVM guests

2012-10-25 Thread Avi Kivity
On 10/24/2012 08:10 AM, Stefan Hajnoczi wrote: 1. For aio=native QEMU uses the Linux AIO API. I think this results in kernel threads that process I/O on behalf of the userspace process. No, the request is submitted directly from io_submit(), and completion sets the eventfd from irq

Re: [kvmarm] [RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses

2012-10-25 Thread Paolo Bonzini
Il 25/10/2012 18:32, Jan Kiszka ha scritto: For wiring things together, I agree. But the IOAPIC has a fixed number of input lines per chip, Power needs to configure them. I don't think deriving this from addressed lines is the best solution. Some lines may be configured (too) late, when the

Re: [PATCH 1/5] kvm tools: check ioctl return value for msi signal

2012-10-25 Thread Sasha Levin
On Thu, Oct 25, 2012 at 5:15 AM, William Dauchy will...@gandi.net wrote: On Oct25 10:01, Pekka Enberg wrote: Is this something that happens on your machine? I wonder if it makes more sense to return the error from virtio_pci__signal_vq() and virtio_pci__signal_config() and make the callers

Re: [RFC 2/3] lockdep: be nice about compiling from userspace

2012-10-25 Thread Sasha Levin
On 10/25/2012 01:06 PM, Ingo Molnar wrote: * Sasha Levin sasha.le...@oracle.com wrote: Yes, we can wrap both static_obj() and debug_show_all_locks() with #ifndefs and let kvmtool provide it's own version of those two. Only static_obj() - I see no immediate reason why you shouldn't be

Re: [PATCH 2/5] kvm tools: use the correct config vector interrupt

2012-10-25 Thread Sasha Levin
On Thu, Oct 25, 2012 at 3:03 AM, Pekka Enberg penb...@kernel.org wrote: On Wed, 24 Oct 2012, William Dauchy wrote: when registering the config interrupt, the later is registered in vcpi-config_vector and not in vpci-vq_vector introduced in: a841f15 kvm tools: Use the new KVM_SIGNAL_MSI ioctl

Re: [BUG] lkvm crash on crashkernel boot

2012-10-25 Thread Sasha Levin
On Thu, Oct 25, 2012 at 8:16 AM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: On Thu, Oct 25, 2012 at 10:17:27AM +0300, Pekka Enberg wrote: On Wed, Oct 24, 2012 at 6:27 PM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: Hi, I've tried to play with kexec using lkvm.

Re: [kvmarm] [RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses

2012-10-25 Thread Benjamin Herrenschmidt
On Thu, 2012-10-25 at 18:14 +0200, Paolo Bonzini wrote: As Jan said, there's more than a few similarities between the x86 and PPC model. Taking inspiration from the x86 API, configuring the source controller seems to be more of a task for KVM_SET_GSI_ROUTING (a very x86-centric name, I must

Re: [kvmarm] [RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses

2012-10-25 Thread Benjamin Herrenschmidt
On Thu, 2012-10-25 at 20:27 +0200, Paolo Bonzini wrote: Probably you do need a variant of KVM_CREATE_IRQCHIP to create the IOAPICs/source controllers (Paul's proposal at http://permalink.gmane.org/gmane.comp.emulators.kvm.powerpc.devel/5674 for example), assign chip ids to them, set the number

Re: [PATCH 0/3] KVM: PPC: Book3S HV: More flexible allocator for linear memory

2012-10-25 Thread Paul Mackerras
On Fri, Sep 14, 2012 at 03:15:32PM +0200, Alexander Graf wrote: On 14.09.2012, at 14:45, Paul Mackerras wrote: On Fri, Sep 14, 2012 at 02:13:37PM +0200, Alexander Graf wrote: So do you think it makes more sense to reimplement a large page allocator in KVM, as this patch set does, or

Re: [kvmarm] [RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses

2012-10-25 Thread Jan Kiszka
On 2012-10-24 02:50, Paul Mackerras wrote: On Tue, Oct 23, 2012 at 12:48:28PM +0200, Jan Kiszka wrote: The current irqchip API is like this: KVM_CREATE_IRQCHIP (without any parameters) ... KVM_CREATE_VCPU KVM_SET_IRQCHIP (or the other way around) ... KVM_RUN The arguments you cannot

Re: [kvmarm] [RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses

2012-10-25 Thread Paolo Bonzini
Il 24/10/2012 02:50, Paul Mackerras ha scritto: So we could indeed use the existing KVM_CREATE_IRQCHIP to tell KVM to create a presentation controller per vcpu. But then how do we tell KVM how many source controllers we want and how many interrupts each source controller should handle? The

Re: [kvmarm] [RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses

2012-10-25 Thread Jan Kiszka
On 2012-10-25 18:14, Paolo Bonzini wrote: Il 24/10/2012 02:50, Paul Mackerras ha scritto: So we could indeed use the existing KVM_CREATE_IRQCHIP to tell KVM to create a presentation controller per vcpu. But then how do we tell KVM how many source controllers we want and how many interrupts

Re: [kvmarm] [RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses

2012-10-25 Thread Paolo Bonzini
Il 25/10/2012 18:32, Jan Kiszka ha scritto: For wiring things together, I agree. But the IOAPIC has a fixed number of input lines per chip, Power needs to configure them. I don't think deriving this from addressed lines is the best solution. Some lines may be configured (too) late, when the

Re: [kvmarm] [RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses

2012-10-25 Thread Benjamin Herrenschmidt
On Thu, 2012-10-25 at 20:27 +0200, Paolo Bonzini wrote: Probably you do need a variant of KVM_CREATE_IRQCHIP to create the IOAPICs/source controllers (Paul's proposal at http://permalink.gmane.org/gmane.comp.emulators.kvm.powerpc.devel/5674 for example), assign chip ids to them, set the number

Re: [PATCH 0/3] KVM: PPC: Book3S HV: More flexible allocator for linear memory

2012-10-25 Thread Paul Mackerras
On Fri, Sep 14, 2012 at 03:15:32PM +0200, Alexander Graf wrote: On 14.09.2012, at 14:45, Paul Mackerras wrote: On Fri, Sep 14, 2012 at 02:13:37PM +0200, Alexander Graf wrote: So do you think it makes more sense to reimplement a large page allocator in KVM, as this patch set does, or