[PATCH 07/14] MIPS: move ELF headers loading outside of load_elf_binary()

2015-07-30 Thread Andre Przywara
Refactor MIPS' load_elf_binary() implementation by not reading the ELF header itself, but using a pointer to a memory buffer instead. This prepares for removing the need to rewind the image file later. Signed-off-by: Andre Przywara --- mips/kvm.c

[PATCH 05/14] kvmtool: introduce pseek

2015-07-30 Thread Andre Przywara
amount of data. Signed-off-by: Andre Przywara --- include/kvm/read-write.h | 2 ++ util/read-write.c| 40 2 files changed, 42 insertions(+) diff --git a/include/kvm/read-write.h b/include/kvm/read-write.h index 67571f9..87eb167 100644 --- a/include

Re: [PATCH v2 14/15] KVM: arm64: implement MSI injection in ITS emulation

2015-08-02 Thread Andre Przywara
On 31/07/15 14:22, Eric Auger wrote: Salut Eric, > On 07/10/2015 04:21 PM, Andre Przywara wrote: >> When userland wants to inject a MSI into the guest, we have to use >> our data structures to find the LPI number and the VCPU to receive >> the interrupt. >> Use the w

Re: [PATCH v2 7/7] KVM: arm: implement kvm_set_msi by gsi direct mapping

2015-08-02 Thread Andre Przywara
On 31/07/15 13:59, Eric Auger wrote: > Hi Andre, > On 07/11/2015 01:17 AM, Andre Przywara wrote: >> On 09/07/15 09:22, Eric Auger wrote: >>> If the ITS modality is not available, let's simply support MSI >>> injection by transforming the MSI.data into an SPI I

Re: [PATCH v2 14/15] KVM: arm64: implement MSI injection in ITS emulation

2015-08-24 Thread Andre Przywara
Hi, On 03/08/15 18:06, Marc Zyngier wrote: > On 03/08/15 16:37, Eric Auger wrote: >> Andre, Pavel, >> On 08/03/2015 11:16 AM, Pavel Fedin wrote: >>> Hello! >>> Again the case that leaves me uncomfortable is the one where the userspace does not provide the devid whereas it must (GICv3 IT

Re: [PATCH v2 01/15] KVM: arm/arm64: VGIC: don't track used LRs in the distributor

2015-08-24 Thread Andre Przywara
Hi Eric, On 12/08/15 10:01, Eric Auger wrote: >> diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c >> index bc40137..394622c 100644 >> --- a/virt/kvm/arm/vgic.c >> +++ b/virt/kvm/arm/vgic.c >> @@ -79,7 +79,6 @@ >> #include "vgic.h" >> >> static void vgic_retire_disabled_irqs(struct k

Re: [PATCH v2 05/15] KVM: arm/arm64: make GIC frame address initialization model specific

2015-08-24 Thread Andre Przywara
Hi, On 12/08/15 14:02, Eric Auger wrote: > On 07/10/2015 04:21 PM, Andre Przywara wrote: >> Currently we initialize all the possible GIC frame addresses in one >> function, without looking at the specific GIC model we instantiate >> for the guest. >> As this gets co

Re: [PATCH v2 07/15] KVM: arm64: handle ITS related GICv3 redistributor registers

2015-08-24 Thread Andre Przywara
Hi Eric, On 13/08/15 13:17, Eric Auger wrote: > On 07/10/2015 04:21 PM, Andre Przywara wrote: >> In the GICv3 redistributor there are the PENDBASER and PROPBASER >> registers which we did not emulate so far, as they only make sense >> when having an ITS. In preparation for th

Re: [PATCH v2 12/15] arm/arm64: KVM: add virtual GICv3 distributor emulation

2014-09-05 Thread Andre Przywara
Hi wanghaibin, On 05/09/14 04:28, wanghaibin wrote: > On 2014/8/21 21:06, Andre Przywara wrote: > > >> +void vgic_v3_dispatch_sgi(struct kvm_vcpu *vcpu, u64 reg) >> +{ >> +struct kvm *kvm = vcpu->kvm; >> +struct kvm_vcpu *c_vcpu; >> +

Re: [PATCH v3 1/4] kvmtool: ARM: Use KVM_ARM_PREFERRED_TARGET vm ioctl to determine target cpu

2014-09-11 Thread Andre Przywara
Hi Anup, On 08/09/14 09:17, Anup Patel wrote: > Instead, of trying out each and every target type we should > use KVM_ARM_PREFERRED_TARGET vm ioctl to determine target type > for KVM ARM/ARM64. > > If KVM_ARM_PREFERRED_TARGET vm ioctl fails then we fallback to > old method of trying all known tar

Re: [PATCH v3 2/4] kvmtool: ARM64: Add target type potenza for aarch64

2014-09-11 Thread Andre Przywara
Anup, On 08/09/14 09:17, Anup Patel wrote: > The VCPU target type KVM_ARM_TARGET_XGENE_POTENZA is available > in latest Linux-3.16-rcX or higher hence register aarch64 target > type for it. > > This patch enables us to run KVMTOOL on X-Gene Potenza host. Why do you need this still if the previous

Re: [PATCH v3 3/4] kvmtool: Handle exit reason KVM_EXIT_SYSTEM_EVENT

2014-09-11 Thread Andre Przywara
On 08/09/14 09:17, Anup Patel wrote: > The KVM_EXIT_SYSTEM_EVENT exit reason was added to define > architecture independent system-wide events for a Guest. > > Currently, it is used by in-kernel PSCI-0.2 emulation of > KVM ARM/ARM64 to inform user space about PSCI SYSTEM_OFF > or PSCI SYSTEM_RESE

[PATCH] kvmtool/arm{,64}: fix ARM initrd functionality

2014-09-16 Thread Andre Przywara
node (and also match the address size we formely posted) and let Linux thus read the right values. Signed-off-by: Andre Przywara --- tools/kvm/arm/fdt.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/kvm/arm/fdt.c b/tools/kvm/arm/fdt.c index 186a718..1a76b07c 100644

Re: [PATCH v4 2/4] kvmtool: ARM64: Add target type potenza for aarch64

2014-09-29 Thread Andre Przywara
On 19/09/14 00:57, Anup Patel wrote: > The VCPU target type KVM_ARM_TARGET_XGENE_POTENZA is available > in latest Linux-3.16-rcX or higher hence register aarch64 target > type for it. > > This patch enables us to run KVMTOOL on X-Gene Potenza host. I still don't like the addition of another CPU,

Re: [PATCH v4 1/4] kvmtool: ARM: Use KVM_ARM_PREFERRED_TARGET vm ioctl to determine target cpu

2014-09-30 Thread Andre Przywara
Hi Anup, thanks for the re-spin and sorry for the delay. Looks better now, some minor comments below. On 19/09/14 00:57, Anup Patel wrote: > Instead, of trying out each and every target type we should > use KVM_ARM_PREFERRED_TARGET vm ioctl to determine target type > for KVM ARM/ARM64. > > If K

Re: [PATCH v4 4/4] kvmtool: ARM/ARM64: Provide PSCI-0.2 to guest when KVM supports it

2014-09-30 Thread Andre Przywara
_FDT(fdt_property(fdt, "compatible", > + compatible, sizeof(compatible))); > + if (kvm->cfg.arch.aarch32_guest) { > + fns = &psci_0_2_aarch32_fns; > + } else { > +

Re: [PATCH v4 3/4] kvmtool: Handle exit reason KVM_EXIT_SYSTEM_EVENT

2014-09-30 Thread Andre Przywara
+cpu->kvm_run->system_event.type); > + printf(" # Info: exiting KVMTOOL\n"); > + goto exit_kvm; > + }; > + break; > default: { > bool ret

Re: [PATCH v5 0/4] kvmtool: ARM/ARM64: Misc updates

2014-10-01 Thread Andre Przywara
> 3. PSCI v0.2 support for Aarch32 and Aarch64 guest > 4. System event exit reason Thanks for the quick respin. Looks fine now for me. For the whole v5 series: Reviewed-by: Andre Przywara Cheers, Andre. > Changes since v4: > - Avoid using magic '0' target for kvm arm gen

Re: [RFC PATCH] arm/arm64: KVM: Fix BE accesses to GICv2 EISR and ELRSR regs

2014-10-01 Thread Andre Przywara
Hi Christoffer, On 28/09/14 15:04, Christoffer Dall wrote: > The EIRSR and ELRSR registers are 32-bit registers on GICv2, and we > store these as an array of two such registers on the vgic vcpu struct. > However, we access them as a single 64-bit value or as a bitmap pointer > in the generic vgic

Re: [PATCH v2 00/15] KVM GICv3 emulation

2014-10-08 Thread Andre Przywara
On 08/10/14 05:08, wanghaibin wrote: > On 2014/8/21 21:06, Andre Przywara wrote: > > >> GICv3 is the ARM generic interrupt controller designed to overcome >> some limits of the prevalent GICv2. Most notably it lifts the 8-CPU >> limit. Though with recent patches fro

Re: [PATCH v2 03/15] arm/arm64: KVM: refactor vgic_handle_mmio() function

2014-10-31 Thread Andre Przywara
Hi Christoffer, On 15/10/14 17:25, Christoffer Dall wrote: > On Thu, Aug 21, 2014 at 02:06:44PM +0100, Andre Przywara wrote: >> Currently we only need to deal with one MMIO region for the GIC >> emulation, but we soon need to extend this. Refactor the existing >> code to all

Re: [PATCH v2 04/15] arm/arm64: KVM: wrap 64 bit MMIO accesses with two 32 bit ones

2014-10-31 Thread Andre Przywara
Hi Christoffer, On 15/10/14 17:26, Christoffer Dall wrote: > On Thu, Aug 21, 2014 at 02:06:45PM +0100, Andre Przywara wrote: >> Some GICv3 registers can and will be accessed as 64 bit registers. >> Currently the register handling code can only deal with 32 bit >> a

Re: [PATCH v2 05/15] arm/arm64: KVM: introduce per-VM ops

2014-10-31 Thread Andre Przywara
Hi Christoffer, On 15/10/14 17:27, Christoffer Dall wrote: > On Thu, Aug 21, 2014 at 02:06:46PM +0100, Andre Przywara wrote: >> Currently we only have one virtual GIC model supported, so all guests >> use the same emulation code. With the addition of another model we >>

Re: [PATCH v2 01/15] arm/arm64: KVM: rework MPIDR assignment and add accessors

2014-10-31 Thread Andre Przywara
Hi Christoffer, On 15/10/14 17:25, Christoffer Dall wrote: > On Thu, Aug 21, 2014 at 02:06:42PM +0100, Andre Przywara wrote: >> The virtual MPIDR registers (containing topology information) for the >> guest are currently mapped linearily to the vcpu_id. Improve this >> mappi

Re: [PATCH v2 06/15] arm/arm64: KVM: make the maximum number of vCPUs a per-VM value

2014-10-31 Thread Andre Przywara
On 15/10/14 17:27, Christoffer Dall wrote: > On Thu, Aug 21, 2014 at 02:06:47PM +0100, Andre Przywara wrote: >> Currently the maximum number of vCPUs supported is a global value >> limited by the used GIC model. GICv3 will lift this limit, but we >> still need to observe it f

Re: [RFC PATCH 1/4] ARM: KVM: on unhandled IO mem abort, route the call to the KVM MMIO bus

2014-11-13 Thread Andre Przywara
Hi Nikolay, On 13/11/14 11:37, Marc Zyngier wrote: > [fixing Andre's email address] > > On 13/11/14 11:20, Christoffer Dall wrote: >> On Thu, Nov 13, 2014 at 12:45:42PM +0200, Nikolay Nikolaev wrote: >> >> [...] >> > > Going through the vgic_handle_mmio we see that it will require large >

Re: [RFC PATCH 1/4] ARM: KVM: on unhandled IO mem abort, route the call to the KVM MMIO bus

2014-11-13 Thread Andre Przywara
Hi Nikolay, On 13/11/14 12:29, Nikolay Nikolaev wrote: > On Thu, Nov 13, 2014 at 1:52 PM, Andre Przywara > wrote: >> Hi Nikolay, >> >> On 13/11/14 11:37, Marc Zyngier wrote: >>> [fixing Andre's email address] >>> >>> On 13/11/14 11:20, Ch

Re: [RFC PATCH 1/4] ARM: KVM: on unhandled IO mem abort, route the call to the KVM MMIO bus

2014-11-13 Thread Andre Przywara
On 13/11/14 15:02, Nikolay Nikolaev wrote: > On Thu, Nov 13, 2014 at 4:23 PM, Eric Auger wrote: >> On 11/13/2014 03:16 PM, Eric Auger wrote: >>> On 11/13/2014 11:45 AM, Nikolay Nikolaev wrote: On Mon, Nov 10, 2014 at 6:27 PM, Christoffer Dall wrote: > On Mon, Nov 10, 2014 at 05:09

Re: [PATCH] arm/arm64: vgic: Remove unreachable irq_clear_pending

2014-11-24 Thread Andre Przywara
us > from ever reaching this bit of code. > > Remove the unreachable snippet. > > Signed-off-by: Christoffer Dall Acked-by: Andre Przywara I agree on this. Would it make sense to rewrite this function a bit to make it more clearer what happens? I find the nesting of the if-state

Re: [PATCH v4 0/3] irqfd support for arm/arm64

2014-11-24 Thread Andre Przywara
Hi, On 24/11/14 10:10, Eric Auger wrote: > On 11/24/2014 10:47 AM, Christoffer Dall wrote: >> On Sun, Nov 23, 2014 at 06:56:57PM +0100, Eric Auger wrote: >>> This patch series enables irqfd on arm and arm64. >>> >>> Irqfd framework enables to inject a virtual IRQ into a guest upon an >>> eventfd t

[PATCH 4/4] kvmtool: remove warning about bzImage on non-x86 architectures

2014-12-11 Thread Andre Przywara
Among the architectures supported by kvmtool, only x86 defines a bzImage format. So we shouldn't bother users of other architectures with a message about something that cannot work. Make the bzImage check dependent on compiling for x86. Signed-off-by: Andre Przywara --- tools/kvm/kvm.c |

[PATCH 2/4] kvmtool: ARM: allow level interrupts in device tree

2014-12-11 Thread Andre Przywara
Currently we describe every interrupt for each device in the FDT as being edge triggered. Add a parameter to the irq property generation to allow devices to specify their interrupts as level triggered if needed. Signed-off-by: Andre Przywara --- tools/kvm/arm/fdt.c|6

[PATCH 3/4] kvmtool: ARM: advertise 8250 IRQs as level-triggered

2014-12-11 Thread Andre Przywara
interrupts. This goes along the lines of a similar QEMU patch: http://git.qemu.org/?p=qemu.git;a=commitdiff;h=0be969a2d974971628fc4ed95834d22ecf0fd497 Signed-off-by: Andre Przywara --- tools/kvm/hw/serial.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kvm/hw/serial.c b

[PATCH 1/4] kvmtool: ARM: fix initrd functionality

2014-12-11 Thread Andre Przywara
node (and also match the address size we formely posted) and let Linux thus read the right values. This fixes initrd functionality for ARM and ARM64 guests. Signed-off-by: Andre Przywara Acked-by: Marc Zyngier --- tools/kvm/arm/fdt.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH 0/4] kvmtool: ARM: fixing initrd, serial IRQs and bzImage message

2014-12-11 Thread Andre Przywara
ys me every time ;-) Cheers, Andre. Andre Przywara (4): kvmtool: ARM: fix initrd functionality kvmtool: ARM: allow level interrupts in device tree kvmtool: ARM: advertise 8250 IRQs as level-triggered kvmtool: remove warning about bzImage on non-x86 architectures tools/kvm/arm/

Re: [PATCH 2/4] kvmtool: ARM: allow level interrupts in device tree

2014-12-12 Thread Andre Przywara
Hi, On 11/12/14 17:15, Will Deacon wrote: > On Thu, Dec 11, 2014 at 04:30:33PM +0000, Andre Przywara wrote: >> Currently we describe every interrupt for each device in the FDT >> as being edge triggered. >> Add a parameter to the irq property generation to allow device

[PATCH v4] ARM/KVM: save and restore generic timer registers

2013-12-10 Thread Andre Przywara
From: Andre Przywara For migration to work we need to save (and later restore) the state of each cores virtual generic timer. Since this is per VCPU, we can use the [gs]et_one_reg ioctl and export the three needed registers (control, counter, compare value). Though they live in cp15 space, we

Re: [PATCH v4] ARM/KVM: save and restore generic timer registers

2013-12-10 Thread Andre Przywara
On 12/10/2013 11:50 AM, Andre Przywara wrote: From: Andre Przywara Ooops, I managed to screw up the authorship :-( Can the committer please change this to: "Andre Przywara " (as in the signed-off-by?) Thanks, Andre. For migration to work we need to save (and later restore) th

Re: [PATCH v4] ARM/KVM: save and restore generic timer registers

2013-12-12 Thread Andre Przywara
On 12/12/2013 10:23 AM, Peter Maydell wrote: On 12 December 2013 02:28, Christoffer Dall wrote: diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index a30035d..9565e6a 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -1

[PATCH v5] ARM/KVM: save and restore generic timer registers

2013-12-13 Thread Andre Przywara
e existing list, since they need special accessor functions and the arch timer is optional. Signed-off-by: Andre Przywara Signed-off-by: Christoffer Dall --- Changes from v1: - move code out of coproc.c and into guest.c and arch_timer.c - present the registers with their native CP15 addresses, b

Re: [PATCH v5] ARM/KVM: save and restore generic timer registers

2013-12-13 Thread Andre Przywara
On 12/13/2013 09:10 PM, Christoffer Dall wrote: On Fri, Dec 13, 2013 at 02:23:26PM +0100, Andre Przywara wrote: For migration to work we need to save (and later restore) the state of each core's virtual generic timer. Since this is per VCPU, we can use the [gs]et_one_reg ioctl and expor

[PATCH v2 0/5] kvmtool: ARM: fixing initrd, serial IRQs and bzImage message

2014-12-17 Thread Andre Przywara
nnoys me every time ;-) Compared to the last post I inserted a new patch 2/5 to move from the GIC specific IRQ type defines to generic ones. That should address Will's comment on the last series. Cheers, Andre. Andre Przywara (5): kvmtool: ARM: fix initrd functionality kvmtool: r

[PATCH v2 5/5] kvmtool: remove warning about bzImage on non-x86 architectures

2014-12-17 Thread Andre Przywara
Among the architectures supported by kvmtool, only x86 defines a bzImage format. So we shouldn't bother users of other architectures with a message about something that cannot work. Make the bzImage check dependent on compiling for x86. Signed-off-by: Andre Przywara --- tools/kvm/kvm.c |

[PATCH v2 2/5] kvmtool: replace GIC specific IRQ type #defines

2014-12-17 Thread Andre Przywara
. Signed-off-by: Andre Przywara --- tools/kvm/arm/fdt.c|2 +- tools/kvm/arm/include/arm-common/gic.h |5 - tools/kvm/arm/pci.c|2 +- tools/kvm/arm/timer.c |8 tools/kvm/include/kvm/fdt.h|9 + 5

[PATCH v2 1/5] kvmtool: ARM: fix initrd functionality

2014-12-17 Thread Andre Przywara
node (and also match the address size we formely posted) and let Linux thus read the right values. This fixes initrd functionality for ARM and ARM64 guests. Signed-off-by: Andre Przywara Acked-by: Marc Zyngier --- tools/kvm/arm/fdt.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH v2 3/5] kvmtool: ARM: allow level interrupts in device tree

2014-12-17 Thread Andre Przywara
Currently we describe every interrupt for each device in the FDT as being edge triggered. Add a parameter to the irq property generation to allow devices to specify their interrupts as level triggered if needed. Signed-off-by: Andre Przywara --- tools/kvm/arm/fdt.c|6

[PATCH v2 4/5] kvmtool: ARM: advertise 8250 IRQs as level-triggered

2014-12-17 Thread Andre Przywara
interrupts. This goes along the lines of a similar QEMU patch: http://git.qemu.org/?p=qemu.git;a=commitdiff;h=0be969a2d974971628fc4ed95834d22ecf0fd497 Signed-off-by: Andre Przywara --- tools/kvm/hw/serial.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kvm/hw/serial.c b

[PATCH v3 2/5] kvmtool: replace GIC specific IRQ type #defines

2014-12-17 Thread Andre Przywara
Linux' include/linux/irq.h. Signed-off-by: Andre Przywara --- tools/kvm/arm/fdt.c|2 +- tools/kvm/arm/include/arm-common/gic.h |5 - tools/kvm/arm/pci.c|2 +- tools/kvm/arm/timer.c |8 tools/kvm/include/kvm/

[PATCH v3 3/5] kvmtool: ARM: allow level interrupts in device tree

2014-12-17 Thread Andre Przywara
Currently we describe every interrupt for each device in the FDT as being edge triggered. Add a parameter to the irq property generation to allow devices to specify their interrupts as level triggered if needed. Signed-off-by: Andre Przywara --- tools/kvm/arm/fdt.c|6

[PATCH v3 4/5] kvmtool: ARM: advertise 8250 IRQs as level-triggered

2014-12-17 Thread Andre Przywara
interrupts. This goes along the lines of a similar QEMU patch: http://git.qemu.org/?p=qemu.git;a=commitdiff;h=0be969a2d974971628fc4ed95834d22ecf0fd497 Signed-off-by: Andre Przywara --- tools/kvm/hw/serial.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kvm/hw/serial.c b

[PATCH v3 0/5] kvmtool: ARM: fixing initrd, serial IRQs and bzImage message

2014-12-17 Thread Andre Przywara
- use generic Linux #defines for IRQ types Cheers, Andre. Andre Przywara (5): kvmtool: ARM: fix initrd functionality kvmtool: replace GIC specific IRQ type #defines kvmtool: ARM: allow level interrupts in device tree kvmtool: ARM: advertise 8250 IRQs as level-triggered kvmtool: remove wa

[PATCH v3 5/5] kvmtool: remove warning about bzImage on non-x86 architectures

2014-12-17 Thread Andre Przywara
Among the architectures supported by kvmtool, only x86 defines a bzImage format. So we shouldn't bother users of other architectures with a message about something that cannot work. Make the bzImage check dependent on compiling for x86. Signed-off-by: Andre Przywara --- tools/kvm/kvm.c |

[PATCH v3 1/5] kvmtool: ARM: fix initrd functionality

2014-12-17 Thread Andre Przywara
node (and also match the address size we formely posted) and let Linux thus read the right values. This fixes initrd functionality for ARM and ARM64 guests. Signed-off-by: Andre Przywara Acked-by: Marc Zyngier --- tools/kvm/arm/fdt.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[RFC PATCH] KVM: introduce kvm_check_device

2015-01-06 Thread Andre Przywara
. This function will be later used by another patch set to check whether a KVM_CREATE_IRQCHIP ioctl is valid. Signed-off-by: Andre Przywara --- Hi, can people comment whether there is an easier way to detect KVM device registration _outside_ of virt/kvm/kvm_main.c? Using the

Re: [RFC PATCH] KVM: introduce kvm_check_device

2015-01-07 Thread Andre Przywara
Hi Scott, thanks for looking at the patch. On 06/01/15 20:52, Scott Wood wrote: > On Tue, 2015-01-06 at 16:12 +0000, Andre Przywara wrote: >> While we can easily register and unregister KVM devices, there is >> currently no easy way of checking whether a device has bee

Re: [RFC PATCH] KVM: introduce kvm_check_device

2015-01-07 Thread Andre Przywara
On 07/01/15 17:45, Scott Wood wrote: > On Wed, 2015-01-07 at 10:55 +0000, Andre Przywara wrote: >> Hi Scott, >> >> thanks for looking at the patch. >> >> On 06/01/15 20:52, Scott Wood wrote: >>> Out of curiosity, why do you need to test it from inside the

Re: [RFC PATCH] KVM: introduce kvm_check_device

2015-01-08 Thread Andre Przywara
Hi Scott, On 07/01/15 18:16, Scott Wood wrote: > On Wed, 2015-01-07 at 18:11 +0000, Andre Przywara wrote: >> On 07/01/15 17:45, Scott Wood wrote: >>> On Wed, 2015-01-07 at 10:55 +0000, Andre Przywara wrote: >>>> Hi Scott, >>>> >>>> thanks

[RFC PATCH] kvmtool: remove 8250 IRQ line reset on device_init

2015-01-09 Thread Andre Przywara
used IRQs, so we have to wait until all devices have been created and initialized. Since the in-kernel GIC emulation resets the IRQ line anyway and also QEMU gets away without resetting it, the easiest solution is to drop the IRQ line reset. Signed-off-by: Andre Przywara --- Hi Pekka, this patch

Re: [RFC PATCH] kvmtool: remove 8250 IRQ line reset on device_init

2015-01-12 Thread Andre Przywara
On 12/01/15 17:41, Will Deacon wrote: > On Fri, Jan 09, 2015 at 03:58:19PM +0000, Andre Przywara wrote: >> Currently we reset the KVM interrupt line on initializing the 8250 >> serial device emulation. >> For ARM this creates a problem where we use the in-kernel IRQ chip &

[PATCH 02/11] kvmtool: AArch64: Reserve two 64k pages for GIC CPU interface

2015-01-23 Thread Andre Przywara
: Andre Przywara --- tools/kvm/arm/aarch64/include/kvm/kvm-arch.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kvm/arm/aarch64/include/kvm/kvm-arch.h b/tools/kvm/arm/aarch64/include/kvm/kvm-arch.h index 2f08a26..4925736 100644 --- a/tools/kvm/arm/aarch64/include

[PATCH 03/11] kvmtool: AArch{32,64}: use KVM_CREATE_DEVICE & co to instanciate the GIC

2015-01-23 Thread Andre Przywara
between creation and initialisation more clearly.] Signed-off-by: Marc Zyngier Signed-off-by: Andre Przywara --- tools/kvm/arm/gic.c| 60 tools/kvm/arm/include/arm-common/gic.h |2 +- tools/kvm/arm/kvm.c|6 ++-- 3

[PATCH 11/11] kvmtool: add command line parameter to instantiate a vGICv3

2015-01-23 Thread Andre Przywara
Add the command line parameter "--gicv3" to request GICv3 emulation in the kernel. Connect that to the already existing GICv3 code. Signed-off-by: Andre Przywara --- tools/kvm/arm/aarch64/arm-cpu.c|5 - .../kvm/arm/aarch64/include/kvm/kvm-config-arch

[PATCH 00/11] kvmtool: Support new VGIC kernel features

2015-01-23 Thread Andre Przywara
e kvmtool-gicv3 branch of: git://linux-arm.org/linux-ap.git http://linux-arm.org/linux-ap.git Cheers, Andre. Andre Przywara (7): kvmtool: add new VGIC_GRP definition (pulled from 3.19-rc1) kvmtool: finish VGIC initialisation explicitly kvmtool: prepare for instantiating different IRQ chip de

[PATCH 01/11] kvmtool: add new VGIC_GRP definition (pulled from 3.19-rc1)

2015-01-23 Thread Andre Przywara
We are using the explicit VGIC_CTRL_INIT ioctl, which was introduced with 3.19-rc1, so at the moment we need to pull this patch from upstream Linux. This patch can be reverted as soon as a newer Linux tree is merged into kvmtool. Signed-off-by: Andre Przywara --- tools/kvm/arm/include/arm

[PATCH 08/11] kvmtool: public header definitions from GICv3 emulation patch series

2015-01-23 Thread Andre Przywara
This pulls the necessary defines for the GICv3 constants from the Linux tree into kvmtool for now. Should be obsolete as soon as the vGICv3 patches are upstream and kvmtool is rebased on top of it. Signed-off-by: Andre Przywara --- arch/arm64/include/uapi/asm/kvm.h |7 +++ include/uapi

[PATCH 04/11] kvmtool: irq: add irq__get_nr_allocated_lines

2015-01-23 Thread Andre Przywara
llocated so far. Signed-off-by: Marc Zyngier Signed-off-by: Andre Przywara --- tools/kvm/include/kvm/irq.h |1 + tools/kvm/irq.c |5 + 2 files changed, 6 insertions(+) diff --git a/tools/kvm/include/kvm/irq.h b/tools/kvm/include/kvm/irq.h index 4cec6f0..8a78e43 100644

[PATCH 07/11] kvmtool: prepare for instantiating different IRQ chip devices

2015-01-23 Thread Andre Przywara
Extend the vGIC handling code to deal with different IRQ chip devices instead of hard-coding the GICv2 in. Signed-off-by: Andre Przywara --- tools/kvm/arm/aarch32/arm-cpu.c|2 +- tools/kvm/arm/aarch64/arm-cpu.c|2 +- tools/kvm/arm/gic.c| 52

[PATCH 09/11] kvmtool: add required GICv3 defines also to ARM

2015-01-23 Thread Andre Przywara
header for the time being. Signed-off-by: Andre Przywara --- tools/kvm/arm/aarch32/include/kvm/kvm-arch.h |8 1 file changed, 8 insertions(+) diff --git a/tools/kvm/arm/aarch32/include/kvm/kvm-arch.h b/tools/kvm/arm/aarch32/include/kvm/kvm-arch.h index 1632e3c..11dc9a6 100644 --- a

[PATCH 10/11] kvmtool: add support for supplying GICv3 redistributor addresses

2015-01-23 Thread Andre Przywara
The code currently is assuming fixed sized memory regions for the distributor and CPU interface. GICv3 needs a dynamic allocation of it's redistributor region, since it's size depends on the number of vCPUs. Also add the necessary code to create a GICv3 IRQ chip instance. Signed-off

[PATCH 06/11] kvmtool: finish VGIC initialisation explicitly

2015-01-23 Thread Andre Przywara
-off-by: Andre Przywara --- tools/kvm/arm/gic.c | 25 ++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/tools/kvm/arm/gic.c b/tools/kvm/arm/gic.c index 6277af8..8d47562 100644 --- a/tools/kvm/arm/gic.c +++ b/tools/kvm/arm/gic.c @@ -89,24 +89,43 @@ int

[PATCH 05/11] kvmtool: AArch{32,64}: dynamically configure the number of GIC interrupts

2015-01-23 Thread Andre Przywara
gic__init_gic() to ease future expansion] Signed-off-by: Marc Zyngier Signed-off-by: Andre Przywara --- tools/kvm/arm/gic.c | 25 + 1 file changed, 25 insertions(+) diff --git a/tools/kvm/arm/gic.c b/tools/kvm/arm/gic.c index ce5f7fa..6277af8 100644 --- a/tools/kvm/arm

Re: [PATCH 11/11] kvmtool: add command line parameter to instantiate a vGICv3

2015-01-26 Thread Andre Przywara
Hi Will, On 26/01/15 11:30, Will Deacon wrote: > On Fri, Jan 23, 2015 at 04:35:10PM +0000, Andre Przywara wrote: >> Add the command line parameter "--gicv3" to request GICv3 emulation >> in the kernel. Connect that to the already existing GICv3 code. >> &

Re: [PATCH 03/11] kvmtool: AArch{32,64}: use KVM_CREATE_DEVICE & co to instanciate the GIC

2015-01-26 Thread Andre Przywara
On 26/01/15 11:26, Will Deacon wrote: > On Fri, Jan 23, 2015 at 04:35:02PM +0000, Andre Przywara wrote: >> From: Marc Zyngier >> >> As of 3.14, KVM/arm supports the creation/configuration of the GIC through >> a more generic device API, which is now the preferred way to

Re: [PATCH v3 3/5] KVM: ARM VGIC add kvm_io_bus_ frontend

2015-01-27 Thread Andre Przywara
Hi Nikolay, On 24/01/15 11:59, Nikolay Nikolaev wrote: > In io_mem_abort remove the call to vgic_handle_mmio. The target is to have > a single MMIO handling path - that is through the kvm_io_bus_ API. > > Register a kvm_io_device in kvm_vgic_init on the whole vGIC MMIO region. > Both read and wri

Re: [PATCH v3 3/5] KVM: ARM VGIC add kvm_io_bus_ frontend

2015-01-27 Thread Andre Przywara
Hi, On 27/01/15 17:26, Eric Auger wrote: > On 01/27/2015 05:51 PM, Nikolay Nikolaev wrote: >> Hi Andre, >> >> On Tue, Jan 27, 2015 at 3:31 PM, Andre Przywara >> wrote: >>> >>> Hi Nikolay, >>> >>> On 24/01/15 11:59, Nikolay Nikolaev

[PATCH] kvmtool: don't use PCI config space IRQ line field

2015-02-04 Thread Andre Przywara
-off-by: Andre Przywara --- Hi, this fixes the hangs we have seen with kvmtool and PCI in 3.19-rc1+. I scanned kvmtool's code for further usage of that config space field, but couldn't find anything relevant except pci-shmem.c, which is completely broken atm, so I didn't bother to fi

Reason for extra struct kvm_run parameter in MMIO handling?

2015-02-06 Thread Andre Przywara
Hi, while reworking the ARM vGIC emulation layer to use the kvm_io_bus framework, I wonder why the whole KVM MMIO handling always passes the pointer to struct kvm_run along with the struct kvm_vcpu pointer. As kvm_run is a member of kvm_vcpu, the vcpu alone should be sufficient, right? Also I see

Re: Reason for extra struct kvm_run parameter in MMIO handling?

2015-02-09 Thread Andre Przywara
Radim, Paolo, On 09/02/15 16:26, Paolo Bonzini wrote: > On 09/02/2015 17:21, Radim Krčmář wrote: >>> So is that just legacy code still lingering around from the dawn of time >>> and nobody dared to rework this or is there a particular reason for >>> doing so? >> >> Probably laziness in 9a2bb7f486d

stand-alone kvmtool

2015-02-13 Thread Andre Przywara
Hi, as I found it increasingly inconvenient to use kvmtool[1] as part of a Linux repository, I decided to give it a go and make it a stand-alone project. So I filtered all the respective commits, adjusted the paths in there (while keeping authorship and commit date, of course) and then added the m

Re: stand-alone kvmtool

2015-02-13 Thread Andre Przywara
Ciao Claudio, On 13/02/15 14:30, Claudio Fontana wrote: > Hello Andre, > > On 13.02.2015 11:39, Andre Przywara wrote: >> Hi, >> >> as I found it increasingly inconvenient to use kvmtool[1] as part of a >> Linux repository, I decided to give it a go and make

Re: stand-alone kvmtool

2015-02-23 Thread Andre Przywara
Hi Will, On 18/02/15 15:50, Will Deacon wrote: > Hi Andre, > > Thanks for doing this. Since it looks unlikely that kvmtool will ever be > merged back into the kernel tree, it makes sense to cut the dependency > in my opinion. > > On Fri, Feb 13, 2015 at 10:39:33AM +,

Re: stand-alone kvmtool

2015-02-23 Thread Andre Przywara
Hi Sasha, thanks for taking a look! On 19/02/15 10:56, Sasha Levin wrote: > On 02/13/2015 05:39 AM, Andre Przywara wrote: >> Hi, >> >> as I found it increasingly inconvenient to use kvmtool[1] as part of a >> Linux repository, I decided to give it a go and make it a s

Re: [PATCH] arm/arm64: KVM: fix missing unlock on error in kvm_vgic_create()

2015-02-27 Thread Andre Przywara
ulate_gicv2) { > + ret = -ENODEV; > + goto out; > + } Ah, good catch. Embarrassing that that could slip through ... Acked-by: Andre Przywara Out of curiosity: did you see it hang or was this just by looking at the code? I thought that I tested this case ... C

Re: [PATCH] arm/arm64: KVM: fix missing unlock on error in kvm_vgic_create()

2015-03-13 Thread Andre Przywara
Hej Christoffer, On 02/03/15 17:29, Christoffer Dall wrote: > On Fri, Feb 27, 2015 at 07:41:45PM +0800, weiyj...@163.com wrote: >> From: Wei Yongjun >> >> Add the missing unlock before return from function kvm_vgic_create() >> in the error handling case. >> >> Signed-off-by: Wei Yongjun > > Tha

[PATCH 03/12] KVM: arm/arm64: remove now unneeded include directory from Makefile

2015-03-13 Thread Andre Przywara
virt/kvm was never really a good include directory for anything else than locally included headers. With the move of iodev.h there is no need anymore to add this directory the compiler's include path, so remove it from the arm and arm64 kvm Makefile. Signed-off-by: Andre Przywara --- arc

[PATCH 12/12] KVM: arm/arm64: remove now obsolete VGIC specific MMIO handling code

2015-03-13 Thread Andre Przywara
With all of the virtual GIC emulation code now being registered with the kvm_io_bus, we can remove all of the old MMIO handling code and its dispatching functionality. Signed-off-by: Andre Przywara --- include/kvm/arm_vgic.h |2 -- virt/kvm/arm/vgic-v2-emul.c | 19 virt

[PATCH 08/12] KVM: arm/arm64: implement kvm_io_bus MMIO handling for the VGIC

2015-03-13 Thread Andre Przywara
patches. Signed-off-by: Andre Przywara --- include/kvm/arm_vgic.h |9 virt/kvm/arm/vgic.c| 111 virt/kvm/arm/vgic.h|7 +++ 3 files changed, 127 insertions(+) diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index

[PATCH 04/12] KVM: x86: remove now unneeded include directory from Makefile

2015-03-13 Thread Andre Przywara
virt/kvm was never really a good include directory for anything else than locally included headers. With the move of iodev.h there is no need anymore to add this directory the compiler's include path, so remove it from the x86 kvm Makefile. Signed-off-by: Andre Przywara --- arch/x8

[PATCH 07/12] KVM: arm/arm64: simplify vgic_find_range() and callers

2015-03-13 Thread Andre Przywara
e function directly. Signed-off-by: Andre Przywara --- virt/kvm/arm/vgic-v2-emul.c |2 +- virt/kvm/arm/vgic.c | 22 -- virt/kvm/arm/vgic.h |3 +-- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/virt/kvm/arm/vgic-v2-emul.c b/virt/kvm/a

[PATCH 02/12] KVM: move iodev.h from virt/kvm/ to include/kvm

2015-03-13 Thread Andre Przywara
move the file into include/kvm, so that a more natural "#include " can be used by all of the code. This also solves a problem later when using struct kvm_io_device in arm_vgic.h. Fixing up the FSF address in the GPL header and a wrong include path on the way. Signed-off-by: Andre Przy

[PATCH 10/12] KVM: arm/arm64: prepare GICv3 emulation to use kvm_io_bus MMIO handling

2015-03-13 Thread Andre Przywara
: VCPU) they are connected with. We use the kvm_io_bus framework to register two devices per VCPU, as each block is handled independently by the VGIC code. Signed-off-by: Andre Przywara --- include/kvm/arm_vgic.h |1 + virt/kvm/arm/vgic-v3-emul.c | 32

[PATCH 09/12] KVM: arm/arm64: prepare GICv2 emulation to be handled by kvm_io_bus

2015-03-13 Thread Andre Przywara
Using the framework provided by the recent vgic.c changes we register a kvm_io_bus device when initializing the virtual GICv2. Signed-off-by: Andre Przywara --- include/kvm/arm_vgic.h |1 + virt/kvm/arm/vgic-v2-emul.c | 13 + virt/kvm/arm/vgic.c | 16

[PATCH 06/12] KVM: mark kvm->buses as empty once they were destroyed

2015-03-13 Thread Andre Przywara
tdown with the VGIC using the kvm_io_bus later (the unregistering is in there to be able to roll back a faulting init). Signed-off-by: Andre Przywara --- virt/kvm/kvm_main.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 8c

[PATCH 00/12] KVM: arm/arm64: move VGIC MMIO to kvm_io_bus

2015-03-13 Thread Andre Przywara
Cv3 guest and on Midway (GICv2 guest). Cheers, Andre. [1] https://lists.cs.columbia.edu/pipermail/kvmarm/2015-January/013379.html Andre Przywara (10): KVM: move iodev.h from virt/kvm/ to include/kvm KVM: arm/arm64: remove now unneeded include directory from Makefile KVM: x86: remove now u

[PATCH 05/12] KVM: arm/arm64: rename struct kvm_mmio_range to vgic_io_range

2015-03-13 Thread Andre Przywara
The name "kvm_mmio_range" is a bit bold, given that it only covers the VGIC's MMIO ranges. To avoid confusion with kvm_io_range, rename it to vgic_io_range. Signed-off-by: Andre Przywara --- virt/kvm/arm/vgic-v2-emul.c |6 +++--- virt/kvm/arm/vgic-v3-emul.c |8 ---

[PATCH 01/12] KVM: Redesign kvm_io_bus_ API to pass VCPU structure to the callbacks.

2015-03-13 Thread Andre Przywara
From: Nikolay Nikolaev This is needed in e.g. ARM vGIC emulation, where the MMIO handling depends on the VCPU that does the access. Signed-off-by: Nikolay Nikolaev Signed-off-by: Andre Przywara Acked-by: Paolo Bonzini --- arch/powerpc/kvm/mpic.c| 10 ++ arch/powerpc/kvm

[PATCH 11/12] KVM: ARM: on IO mem abort - route the call to KVM MMIO bus

2015-03-13 Thread Andre Przywara
-off-by: Nikolay Nikolaev Signed-off-by: Andre Przywara --- arch/arm/kvm/mmio.c| 32 +++- include/kvm/arm_vgic.h |2 -- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/arch/arm/kvm/mmio.c b/arch/arm/kvm/mmio.c index 5d3bfc0..8dc2fde 100644 --- a

Re: [PATCH 09/12] KVM: arm/arm64: prepare GICv2 emulation to be handled by kvm_io_bus

2015-03-17 Thread Andre Przywara
Hej, On 14/03/15 14:30, Christoffer Dall wrote: > On Fri, Mar 13, 2015 at 04:10:09PM +0000, Andre Przywara wrote: >> Using the framework provided by the recent vgic.c changes we register >> a kvm_io_bus device when initializing the virtual GICv2. >> >> Si

Re: [PATCH 08/12] KVM: arm/arm64: implement kvm_io_bus MMIO handling for the VGIC

2015-03-19 Thread Andre Przywara
Hej Christoffer, On 14/03/15 14:27, Christoffer Dall wrote: > On Fri, Mar 13, 2015 at 04:10:08PM +0000, Andre Przywara wrote: >> Currently we use a lot of VGIC specific code to do the MMIO >> dispatching. >> Use the previous reworks to add kvm_io_bus style MMIO handlers. &g

Re: [PATCH 08/12] KVM: arm/arm64: implement kvm_io_bus MMIO handling for the VGIC

2015-03-20 Thread Andre Przywara
On 03/19/2015 03:44 PM, Andre Przywara wrote: > Hej Christoffer, > [ ... ] >>> +static int vgic_handle_mmio_access(struct kvm_vcpu *vcpu, >>> + struct kvm_io_device *this, gpa_t addr, >>> +

<    1   2   3   4   5   6   7   >