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

2012-10-26 Thread Paolo Bonzini
Il 25/10/2012 21:40, Benjamin Herrenschmidt ha scritto: 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

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

2012-10-26 Thread Peter Maydell
On 26 October 2012 10:58, Paolo Bonzini pbonz...@redhat.com wrote: Wiring which MSI-X interrupts go to which source controllers. If you have one source controller per PCI bridge, you need to tell the kernel the mapping between MSI messages interrupts and PCI bridges, and update it whenever

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

2012-10-26 Thread Paolo Bonzini
Il 26/10/2012 12:09, Peter Maydell ha scritto: The other problem is configuring the redirection table. If you need 64 sources you need ioctls like KVM_GET/SET_IRQCHIP_ONE_REG. Why would you want an extra ONE_REG-like ioctl? The existing ONE_REG ioctls have plenty of space in the ID range

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

2012-10-26 Thread Jan Kiszka
On 2012-10-26 12:15, Paolo Bonzini wrote: Il 26/10/2012 12:09, Peter Maydell ha scritto: The other problem is configuring the redirection table. If you need 64 sources you need ioctls like KVM_GET/SET_IRQCHIP_ONE_REG. Why would you want an extra ONE_REG-like ioctl? The existing ONE_REG

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

2012-10-26 Thread Jan Kiszka
On 2012-10-25 11:22, Xiao Guangrong wrote: 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

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

2012-10-26 Thread Benjamin Herrenschmidt
On Fri, 2012-10-26 at 11:58 +0200, Paolo Bonzini wrote: Il 25/10/2012 21:40, Benjamin Herrenschmidt ha scritto: Probably you do need a variant of KVM_CREATE_IRQCHIP to create the IOAPICs/source controllers (Paul's proposal at

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

2012-10-26 Thread Paolo Bonzini
Il 26/10/2012 12:37, Benjamin Herrenschmidt ha scritto: Wiring which MSI-X interrupts go to which source controllers. If you have one source controller per PCI bridge, you need to tell the kernel the mapping between MSI messages interrupts and PCI bridges, and update it whenever the MSI

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

2012-10-26 Thread Benjamin Herrenschmidt
On Fri, 2012-10-26 at 12:15 +0200, Paolo Bonzini wrote: Whether you want to do startup configuration and board wiring via the same ioctl that handles runtime state save/load/migration is a different question, of course. QEMU's MSI-X routing is not x86-specific, so it should use the same

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

2012-10-26 Thread Jan Kiszka
On 2012-10-26 12:44, Benjamin Herrenschmidt wrote: On Fri, 2012-10-26 at 12:15 +0200, Paolo Bonzini wrote: Whether you want to do startup configuration and board wiring via the same ioctl that handles runtime state save/load/migration is a different question, of course. QEMU's MSI-X routing

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

2012-10-26 Thread Benjamin Herrenschmidt
On Fri, 2012-10-26 at 13:00 +0200, Jan Kiszka wrote: And at latest there you will need the IRQ routing infrastructure of KVM. It tells KVM which virtual IRQ (badly named GSI) triggers which event at which input, e.g. a physical IRQ line at some IRQ controller or a specific message at some MSI

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

2012-10-26 Thread Benjamin Herrenschmidt
On Fri, 2012-10-26 at 12:40 +0200, Paolo Bonzini wrote: Il 26/10/2012 12:37, Benjamin Herrenschmidt ha scritto: Wiring which MSI-X interrupts go to which source controllers. If you have one source controller per PCI bridge, you need to tell the kernel the mapping between MSI messages

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

2012-10-26 Thread Peter Maydell
On 26 October 2012 11:44, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Fri, 2012-10-26 at 12:15 +0200, Paolo Bonzini wrote: QEMU's MSI-X routing is not x86-specific, so it should use the same KVM_SET_GSI_ROUTING ioctl that x86 uses. Well, that's the thing, I haven't managed to

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

2012-10-26 Thread Benjamin Herrenschmidt
On Fri, 2012-10-26 at 12:17 +0100, Peter Maydell wrote: Well, that's the thing, I haven't managed to figure that out so far, it looks very x86-specific to me. To begin with there's no such thing as a GSI in our world. This was roughly the feeling I had looking at these APIs. There

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

2012-10-26 Thread Paolo Bonzini
[snipping some parts that Jan answered about already] Il 26/10/2012 12:47, Benjamin Herrenschmidt ha scritto: Or do you mean the routing configured by the user ? IE. Affinity ? If yes, then that's indeed what the 64-bit per source is. Each interrupt source has some state including the

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

2012-10-26 Thread Peter Maydell
On 26 October 2012 12:57, Paolo Bonzini pbonz...@redhat.com wrote: If you exclude old-style PCI pass-through and limit yourself to vhost and VFIO, you can treat irqfd as the in-kernel source of the interrupt. Then you need a mapping between MSIs and numbers used in KVM_IRQFD (GSIs). This is

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

2012-10-26 Thread Jan Kiszka
On 2012-10-26 13:39, Benjamin Herrenschmidt wrote: On Fri, 2012-10-26 at 12:17 +0100, Peter Maydell wrote: Well, that's the thing, I haven't managed to figure that out so far, it looks very x86-specific to me. To begin with there's no such thing as a GSI in our world. This was roughly the

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

2012-10-26 Thread Jan Kiszka
On 2012-10-26 14:08, Peter Maydell wrote: On 26 October 2012 12:57, Paolo Bonzini pbonz...@redhat.com wrote: If you exclude old-style PCI pass-through and limit yourself to vhost and VFIO, you can treat irqfd as the in-kernel source of the interrupt. Then you need a mapping between MSIs and

[PATCH] x86, add hypervisor name to dump_stack() [v2]

2012-10-26 Thread Prarit Bhargava
Debugging crash, panics, stack trace WARN_ONs, etc., from both virtual and bare-metal boots can get difficult very quickly. While there are ways to decipher the output and determine if the output is from a virtual guest, the in-kernel hypervisors now have a single registration point and set

Re: [PATCH] x86, add hypervisor name to dump_stack() [v2]

2012-10-26 Thread Ingo Molnar
* Prarit Bhargava pra...@redhat.com wrote: Debugging crash, panics, stack trace WARN_ONs, etc., from both virtual and bare-metal boots can get difficult very quickly. While there are ways to decipher the output and determine if the output is from a virtual guest, the in-kernel hypervisors

[PATCH -next] kvm tools: remove duplicated include from builtin-setup.c

2012-10-26 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn Remove duplicated include. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- tools/kvm/builtin-setup.c | 4 1 file changed, 4 deletions(-) diff

Re: [PATCH -next] kvm tools: remove duplicated include from builtin-setup.c

2012-10-26 Thread Pekka Enberg
On Fri, 26 Oct 2012, Wei Yongjun wrote: From: Wei Yongjun yongjun_...@trendmicro.com.cn Remove duplicated include. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn ---

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

2012-10-26 Thread Pekka Enberg
On Thu, 25 Oct 2012, Sasha Levin wrote: 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:

Re: [BUG] lkvm crash on crashkernel boot

2012-10-26 Thread Pekka Enberg
On Thu, 25 Oct 2012, Sasha Levin wrote: I think we're seeing that because we don't handle VIRTIO_MSI_NO_VECTOR properly. We need to deal with the ability to remove GSI friends as well. I've added it to my workqueue (unless someone deals with it first). Any reason I shouldn't apply

Re: [BUG] lkvm crash on crashkernel boot

2012-10-26 Thread Cyrill Gorcunov
On Fri, Oct 26, 2012 at 06:31:00PM +0300, Pekka Enberg wrote: On Thu, 25 Oct 2012, Sasha Levin wrote: I think we're seeing that because we don't handle VIRTIO_MSI_NO_VECTOR properly. We need to deal with the ability to remove GSI friends as well. I've added it to my workqueue (unless

Re: [PULL stable-0.15] Stable-0.15 queue for qemu-kvm

2012-10-26 Thread Marcelo Tosatti
On Tue, Oct 09, 2012 at 08:08:47PM +0200, Andreas Färber wrote: Hello Marcelo, Here's a couple of backports for your stable-0.15 branch. Except for one (marked as backported) these were all clean cherry-picks. My proposal is to merge these KVM-only patches before qemu-stable-0.15.git,

Re: [PATCH 00/15] QEMU KVM_GET_SUPPORTED_CPUID cleanups and fixes

2012-10-26 Thread Marcelo Tosatti
On Thu, Oct 04, 2012 at 05:48:52PM -0300, Eduardo Habkost wrote: Most of this series are just cleanups that will help when making -cpu check/enforce work properly, with some fixes. In addition to code movements, the main changes are: - x2apic won't be enabled if in-kernel irqchip is

Re: [Qemu-devel] [QEMU PATCH] i386: cpu: add missing CPUID[EAX=7, ECX=0] flag names

2012-10-26 Thread Marcelo Tosatti
On Tue, Oct 09, 2012 at 12:43:52PM -0400, Don Slutz wrote: On 10/09/12 10:03, Eduardo Habkost wrote: This makes QEMU recognize the following CPU flag names: Flags| Corresponding KVM kernel commit -+ FSGSBASE |

Re: kvm-clock clocksource efficiency versus tsc...

2012-10-26 Thread Marcelo Tosatti
On Tue, Oct 16, 2012 at 10:54:59AM +0200, Erik Brakkee wrote: OS: Centos 6.2 KVM version: qemu-kvm-tools-0.12.1.2-2.209.el6_2.4.x86_64 qemu-kvm-0.12.1.2-2.209.el6_2.4.x86_64 uname -a: Linux myhost 2.6.32-220.7.1.el6.x86_64 #1 SMP Wed Mar 7 00:52:02 GMT 2012 x86_64 x86_64 x86_64

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

2012-10-26 Thread Benjamin Herrenschmidt
On Fri, 2012-10-26 at 13:57 +0200, Paolo Bonzini wrote: Il 26/10/2012 13:09, Benjamin Herrenschmidt ha scritto: The only cases I can think of are the association between a virtual interrupt (ie, an interrupt in the guest interrupt number space) and an in-kernel source for that interrupt,

Re: [PATCH] Added call parameter to track whether invocation originated with guest or elsewhere

2012-10-26 Thread Marcelo Tosatti
On Tue, Oct 23, 2012 at 07:56:54PM +, Auld, Will wrote: Having looked closer at the tacked of changing out the index and data fields in some function calls for a struct parameter with these and a originator field (host or guest) it is less attractive than I thought it would be. The only

Re: [PATCH] KVM: ia64: remove unused variable in kvm_release_vm_pages()

2012-10-26 Thread Marcelo Tosatti
On Wed, Oct 17, 2012 at 11:03:42PM +0800, Wei Yongjun wrote: From: Wei Yongjun yongjun_...@trendmicro.com.cn The variable base_gfn is initialized but never used otherwise, so remove the unused variable. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch)

Re: [PATCH v7 1/1] target-i386: Add missing kvm bits.

2012-10-26 Thread Marcelo Tosatti
On Fri, Oct 12, 2012 at 03:43:23PM -0400, Don Slutz wrote: Currently -cpu host,-kvmclock,-kvm_nopiodelay,-kvm_mmu does not turn off all bits in CPUID 0x4001 EAX. The missing ones are KVM_FEATURE_STEAL_TIME and KVM_FEATURE_CLOCKSOURCE_STABLE_BIT. This adds the names kvm_steal_time and

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

2012-10-26 Thread Benjamin Herrenschmidt
On Sat, 2012-10-27 at 07:45 +1100, Benjamin Herrenschmidt wrote: On Fri, 2012-10-26 at 14:39 +0200, Jan Kiszka wrote: But we are just talking about sending messages from A to B or soldering an input to an output pin. That's pretty generic. Give each output event a virtual IRQ number and

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

2012-10-26 Thread Paolo Bonzini
Il 25/10/2012 21:40, Benjamin Herrenschmidt ha scritto: 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

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

2012-10-26 Thread Peter Maydell
On 26 October 2012 10:58, Paolo Bonzini pbonz...@redhat.com wrote: Wiring which MSI-X interrupts go to which source controllers. If you have one source controller per PCI bridge, you need to tell the kernel the mapping between MSI messages interrupts and PCI bridges, and update it whenever

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

2012-10-26 Thread Paolo Bonzini
Il 26/10/2012 12:09, Peter Maydell ha scritto: The other problem is configuring the redirection table. If you need 64 sources you need ioctls like KVM_GET/SET_IRQCHIP_ONE_REG. Why would you want an extra ONE_REG-like ioctl? The existing ONE_REG ioctls have plenty of space in the ID range

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

2012-10-26 Thread Jan Kiszka
On 2012-10-26 12:15, Paolo Bonzini wrote: Il 26/10/2012 12:09, Peter Maydell ha scritto: The other problem is configuring the redirection table. If you need 64 sources you need ioctls like KVM_GET/SET_IRQCHIP_ONE_REG. Why would you want an extra ONE_REG-like ioctl? The existing ONE_REG

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

2012-10-26 Thread Benjamin Herrenschmidt
On Fri, 2012-10-26 at 11:58 +0200, Paolo Bonzini wrote: Il 25/10/2012 21:40, Benjamin Herrenschmidt ha scritto: Probably you do need a variant of KVM_CREATE_IRQCHIP to create the IOAPICs/source controllers (Paul's proposal at

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

2012-10-26 Thread Paolo Bonzini
Il 26/10/2012 12:37, Benjamin Herrenschmidt ha scritto: Wiring which MSI-X interrupts go to which source controllers. If you have one source controller per PCI bridge, you need to tell the kernel the mapping between MSI messages interrupts and PCI bridges, and update it whenever the MSI

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

2012-10-26 Thread Benjamin Herrenschmidt
On Fri, 2012-10-26 at 12:15 +0200, Paolo Bonzini wrote: Whether you want to do startup configuration and board wiring via the same ioctl that handles runtime state save/load/migration is a different question, of course. QEMU's MSI-X routing is not x86-specific, so it should use the same

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

2012-10-26 Thread Benjamin Herrenschmidt
On Fri, 2012-10-26 at 13:00 +0200, Jan Kiszka wrote: And at latest there you will need the IRQ routing infrastructure of KVM. It tells KVM which virtual IRQ (badly named GSI) triggers which event at which input, e.g. a physical IRQ line at some IRQ controller or a specific message at some MSI

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

2012-10-26 Thread Benjamin Herrenschmidt
On Fri, 2012-10-26 at 12:17 +0100, Peter Maydell wrote: Well, that's the thing, I haven't managed to figure that out so far, it looks very x86-specific to me. To begin with there's no such thing as a GSI in our world. This was roughly the feeling I had looking at these APIs. There

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

2012-10-26 Thread Paolo Bonzini
[snipping some parts that Jan answered about already] Il 26/10/2012 12:47, Benjamin Herrenschmidt ha scritto: Or do you mean the routing configured by the user ? IE. Affinity ? If yes, then that's indeed what the 64-bit per source is. Each interrupt source has some state including the

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

2012-10-26 Thread Paolo Bonzini
Il 26/10/2012 13:09, Benjamin Herrenschmidt ha scritto: The only cases I can think of are the association between a virtual interrupt (ie, an interrupt in the guest interrupt number space) and an in-kernel source for that interrupt, ie, vhost and PCI pass-through essentially. If you exclude

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

2012-10-26 Thread Peter Maydell
On 26 October 2012 12:57, Paolo Bonzini pbonz...@redhat.com wrote: If you exclude old-style PCI pass-through and limit yourself to vhost and VFIO, you can treat irqfd as the in-kernel source of the interrupt. Then you need a mapping between MSIs and numbers used in KVM_IRQFD (GSIs). This is

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

2012-10-26 Thread Jan Kiszka
On 2012-10-26 13:39, Benjamin Herrenschmidt wrote: On Fri, 2012-10-26 at 12:17 +0100, Peter Maydell wrote: Well, that's the thing, I haven't managed to figure that out so far, it looks very x86-specific to me. To begin with there's no such thing as a GSI in our world. This was roughly the

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

2012-10-26 Thread Jan Kiszka
On 2012-10-26 14:08, Peter Maydell wrote: On 26 October 2012 12:57, Paolo Bonzini pbonz...@redhat.com wrote: If you exclude old-style PCI pass-through and limit yourself to vhost and VFIO, you can treat irqfd as the in-kernel source of the interrupt. Then you need a mapping between MSIs and

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

2012-10-26 Thread Benjamin Herrenschmidt
On Fri, 2012-10-26 at 14:39 +0200, Jan Kiszka wrote: But we are just talking about sending messages from A to B or soldering an input to an output pin. That's pretty generic. Give each output event a virtual IRQ number and define where its output line should be linked to (input pin of target

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

2012-10-26 Thread Benjamin Herrenschmidt
On Sat, 2012-10-27 at 07:45 +1100, Benjamin Herrenschmidt wrote: On Fri, 2012-10-26 at 14:39 +0200, Jan Kiszka wrote: But we are just talking about sending messages from A to B or soldering an input to an output pin. That's pretty generic. Give each output event a virtual IRQ number and