[PATCH v3 0/7] KVM: arm/arm64: gsi routing support

2015-08-03 Thread Eric Auger
With the advent of GICv3 ITS in-kernel emulation, KVM GSI routing appears to be requested. More specifically MSI routing is needed. irqchip routing does not sound to be really useful on arm but usage of MSI routing also mandates to integrate irqchip routing. The initial implementation of irqfd on

[PATCH v3 1/7] KVM: api: pass the devid in the msi routing entry

2015-08-03 Thread Eric Auger
On ARM, the MSI msg (address and data) comes along with out-of-band device ID information. The device ID encodes the device that writes the MSI msg. Let's convey the device id in kvm_irq_routing_msi and use KVM_MSI_VALID_DEVID flag value in kvm_irq_routing_entry to indicate the msi devid is

[PATCH v3 4/7] KVM: arm/arm64: enable irqchip routing

2015-08-03 Thread Eric Auger
This patch adds compilation and link against irqchip. On ARM, irqchip routing is not really useful since there is a single irqchip. However main motivation behind using irqchip code is to enable MSI routing code. With the support of in-kernel GICv3 ITS emulation, it now seems to be a MUST HAVE

[PATCH v3 7/7] KVM: arm: enable KVM_SIGNAL_MSI and MSI routing

2015-08-03 Thread Eric Auger
If the ITS modality is not available, let's simply support MSI injection by transforming the MSI.data into an SPI ID. This becomes possible to use KVM_SIGNAL_MSI ioctl and MSI routing for arm too. Signed-off-by: Eric Auger eric.au...@linaro.org --- v2 - v3: - reword the commit message - add

[PATCH v3 6/7] KVM: arm/arm64: enable MSI routing

2015-08-03 Thread Eric Auger
Up to now, only irqchip routing entries could be set. This patch adds the capability to insert MSI routing entries. For ARM64, let's also increase KVM_MAX_IRQ_ROUTES to 4096: this include SPI irqchip routes plus MSI routes. In the future this might be extended. Signed-off-by: Eric Auger

[PATCH v3 3/7] KVM: irqchip: convey devid to kvm_set_msi

2015-08-03 Thread Eric Auger
on ARM, a devid field is populated in kvm_msi struct in case the flag is set to KVM_MSI_VALID_DEVID. Let's propagate both flags and devid field in kvm_kernel_irq_routing_entry. Signed-off-by: Eric Auger eric.au...@linaro.org --- v2 - v3: - do not set the type to KVM_IRQ_ROUTING_EXTENDED_MSI

[PATCH v3 2/7] KVM: kvm_host: add devid in kvm_kernel_irq_routing_entry

2015-08-03 Thread Eric Auger
Extend kvm_kernel_irq_routing_entry to transport the device id field, devid. A new flags field makes possible to indicate the devid is valid. Those additions are used for ARM GICv3 ITS MSI injection. Signed-off-by: Eric Auger eric.au...@linaro.org --- v2 - v3: - add flags v1 - v2: - replace

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

2015-08-03 Thread Eric Auger
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 ITS case). Hypothetical broken userland which does not exist for now ? Yes but that's the rule to

[PATCH v3 5/7] KVM: arm/arm64: build a default routing table

2015-08-03 Thread Eric Auger
Implement a default routing table made of flat irqchip routing entries (gsi = irqchip.pin) covering the VGIC SPI indexes. This routing table is overwritten by the first user-space call to KVM_SET_GSI_ROUTING ioctl. Signed-off-by: Eric Auger eric.au...@linaro.org --- PATCH: creation ---

Re: [RFC PATCH 0/1] iommu: Detach device from domain when removed from group

2015-08-03 Thread Joerg Roedel
On Tue, Jul 28, 2015 at 07:55:55PM +0200, Gerald Schaefer wrote: On s390, this eventually leads to a kernel panic when binding the device again to its non-vfio PCI driver, because of the missing arch-specific cleanup in detach_dev. On x86, the detach_dev callback will also not be called

[kvm-unit-tests PATCH 10/14] powerpc/ppc64: relocate linker VMAs

2015-08-03 Thread Andrew Jones
QEMU loads the unit test, but due to the way it translates the unit test's linker VMA to the LMA, we can't just link such that VMA == LMA. Thus, we link with VMA == 0x0, and then deal with relocation. Signed-off-by: Andrew Jones drjo...@redhat.com --- configure | 2 ++

[kvm-unit-tests PATCH 02/14] lib: share arm-selftest utility functions

2015-08-03 Thread Andrew Jones
arm-selftest has a couple utility functions that could be useful to other unit tests, even other architectures. So move them out. split_var moves to lib/util, where we can add other random utilities over time. assert_args inspires report_abort, which allows us to report a message, using the

[kvm-unit-tests PATCH 05/14] powerpc/pp64: ppc-ify makefiles and linker script

2015-08-03 Thread Andrew Jones
Signed-off-by: Andrew Jones drjo...@redhat.com --- powerpc/Makefile.common | 44 +--- powerpc/Makefile.ppc64 | 16 powerpc/flat.lds| 14 ++ 3 files changed, 31 insertions(+), 43 deletions(-) diff --git

[kvm-unit-tests PATCH 12/14] scripts: add exit code snooper

2015-08-03 Thread Andrew Jones
Add a function that reads test output streams and just forwards it on to stdout, except when a line is 'EXIT: STATUS=%d', at which point it grabs the status to use as the exit code. Tests that always exit with zero (due to how they inform QEMU to quit), can now return other status codes. Run with

[kvm-unit-tests PATCH 00/14] ppc64: initial drop

2015-08-03 Thread Andrew Jones
This series is the first series of a series of series that will bring support to kvm-unit-tests for ppc64, and eventually ppc64le. (Yes, the word 'series' is four times in that sentence. And now I've typed 'series' five times! Wait, now six times! OK, moving on...) This series brings basic setup;

[kvm-unit-tests PATCH 01/14] lib: asm-generic: add missing casts

2015-08-03 Thread Andrew Jones
Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/asm-generic/io.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/asm-generic/io.h b/lib/asm-generic/io.h index a9939d3a5921f..abd245676e97a 100644 --- a/lib/asm-generic/io.h +++ b/lib/asm-generic/io.h @@

[kvm-unit-tests PATCH 09/14] powerpc/ppc64: adapt arm's setup

2015-08-03 Thread Andrew Jones
Copy arm's setup code (also DT based) over to powerpc, adapting it a bit. Also bring over arm's setup selftest, giving powerpc its first test. Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/setup.h | 27 lib/powerpc/setup.c | 82

[kvm-unit-tests PATCH 14/14] mkstandalone: add support for powerpc

2015-08-03 Thread Andrew Jones
PowerPC needs firmware and an exit code snooper. Signed-off-by: Andrew Jones drjo...@redhat.com --- configure | 3 +++ powerpc/run | 2 +- scripts/mkstandalone.sh | 50 + 3 files changed, 50 insertions(+), 5 deletions(-)

[kvm-unit-tests PATCH 07/14] powerpc/ppc64: add bootloader to bounce into memory

2015-08-03 Thread Andrew Jones
Committing the binary, since there's little point in rebuilding, and it requires SLOF's build_romfs tool, which is not part of this source repository. Signed-off-by: Andrew Jones drjo...@redhat.com --- powerpc/boot_rom.bin | Bin 0 - 280 bytes 1 file changed, 0 insertions(+), 0 deletions(-)

[kvm-unit-tests PATCH 04/14] powerpc/ppc64: start skeleton framework

2015-08-03 Thread Andrew Jones
Use the arm/arm64 framework as a template to start a skeleton for powerpc/ppc64. Copy the arm makefiles and linker script verbatim. We'll modify them for powerpc with the next patch, making it clear what needs to be changed. Signed-off-by: Andrew Jones drjo...@redhat.com --- configure

[kvm-unit-tests PATCH 08/14] powerpc/ppc64: add HV putchar

2015-08-03 Thread Andrew Jones
Add the hvcall for putchar and use it in puts. That, along with a couple more lines in start to prepare for C code, and a branch to main(), gets us hello world. Run with qemu-system-ppc64 -M pseries\ -bios powerpc/boot_rom.bin \ -display none -serial stdio \

[kvm-unit-tests PATCH 06/14] powerpc/ppc64: add boot rom source

2015-08-03 Thread Andrew Jones
Make a one line replacement for SLOF. This bootloader just jumps to 0x40, because we know the kernel will be there. This commit allows rebuilding of the bootloader, as long as the SLOF build_romfs tool is present, but since it would be a pain to require that tool for ever build, we'll just

[kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread Andrew Jones
Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27 lib/powerpc/io.c| 3 ++ lib/powerpc/rtas.c | 84 +

[kvm-unit-tests PATCH 03/14] config: no need to mix arch makefiles

2015-08-03 Thread Andrew Jones
Move the config/config-*.mak files to their own directories and rename to Makefile.* README is also updated to reflect the change, as well as to remove an optimistic reference to a non-existent docs directory. Signed-off-by: Andrew Jones drjo...@redhat.com --- Makefile

[kvm-unit-tests PATCH 13/14] powerpc/ppc64: add run script and unittests.cfg

2015-08-03 Thread Andrew Jones
Now that we have all the pieces, pull them together into the run script. To run a test do ./powerpc-run powerpc/test.elf To run all tests in unittests.cfg do ./run_tests.sh Signed-off-by: Andrew Jones drjo...@redhat.com --- powerpc/run | 57

Re: [kvm-unit-tests PATCH v5 11/11] new: arm/barrier-test for memory barriers

2015-08-03 Thread Alex Bennée
alvise rigo a.r...@virtualopensystems.com writes: On Mon, Aug 3, 2015 at 12:30 PM, Alex Bennée alex.ben...@linaro.org wrote: alvise rigo a.r...@virtualopensystems.com writes: Hi Alex, Nice set of tests, they are proving to be helpful. One question below. snip Why are we calling these

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread Alexander Graf
On 03.08.15 19:02, Andrew Jones wrote: On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com Why not use virtio-mmio +

Tracing guest process

2015-08-03 Thread Oscar Garcia
Hello, I have a problem where a vcpu is spinning over a EXIT_REASON_PAUSE_INSTRUCTION forever. This VMEXIT is caused by a spin-lock. The entire gust system blocks. As my code has not spin-locks, probably it is invoking a system call that invokes a spin-lock. I'm interested in knowing the

RE: [PATCH 1/2] KVM: x86: set TMR when the interrupt is accepted

2015-08-03 Thread Zhang, Yang Z
Paolo Bonzini wrote on 2015-08-03: On 03/08/2015 12:23, Zhang, Yang Z wrote: In any case, the TMR behavior introduced by the APICv patches is completely different from the hardware behavior, so it has to be fixed. But any real problem with it? It is a problem for split irqchip, where

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27 lib/powerpc/io.c| 3 ++ lib/powerpc/rtas.c |

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27 lib/powerpc/io.c| 3 ++ lib/powerpc/rtas.c |

Re: [kvm-unit-tests PATCH 10/14] powerpc/ppc64: relocate linker VMAs

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 04:41:27PM +0200, Andrew Jones wrote: QEMU loads the unit test, but due to the way it translates the unit test's linker VMA to the LMA, we can't just link such that VMA == LMA. Thus, we link with VMA == 0x0, and then deal with relocation. Signed-off-by: Andrew Jones

Re: [kvm-unit-tests PATCH 08/14] powerpc/ppc64: add HV putchar

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 04:41:25PM +0200, Andrew Jones wrote: Add the hvcall for putchar and use it in puts. That, along with a couple more lines in start to prepare for C code, and a branch to main(), gets us hello world. Run with qemu-system-ppc64 -M pseries\ -bios

Re: [RFC 0/2] VFIO: Add virtual MSI doorbell support.

2015-08-03 Thread Pranavkumar Sawargaonkar
Hi Bharat, On 28 July 2015 at 23:28, Alex Williamson alex.william...@redhat.com wrote: On Tue, 2015-07-28 at 17:23 +, Bhushan Bharat wrote: Hi Alex, -Original Message- From: Alex Williamson [mailto:alex.william...@redhat.com] Sent: Tuesday, July 28, 2015 9:52 PM To:

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com Why not use virtio-mmio + testdev on ppc as well? Similar

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

2015-08-03 Thread Pavel Fedin
Hello! Again the case that leaves me uncomfortable is the one where the userspace does not provide the devid whereas it must (GICv3 ITS case). Hypothetical broken userland which does not exist for now ? IMHO the userland should just know, that if it supports ITS, it has to provide devIDs.

RE: [PATCH 1/2] KVM: x86: set TMR when the interrupt is accepted

2015-08-03 Thread Zhang, Yang Z
Paolo Bonzini wrote on 2015-08-03: On 03/08/2015 04:37, Zhang, Yang Z wrote: Only virtualized APIC register reads use the virtual TMR registers (SDM 29.4.2 or 29.5), but these just read data from the corresponding field in the virtual APIC page. 24.11.4 Software Access to Related

Re: [kvm-unit-tests PATCH v5 11/11] new: arm/barrier-test for memory barriers

2015-08-03 Thread alvise rigo
On Mon, Aug 3, 2015 at 12:30 PM, Alex Bennée alex.ben...@linaro.org wrote: alvise rigo a.r...@virtualopensystems.com writes: Hi Alex, Nice set of tests, they are proving to be helpful. One question below. On Fri, Jul 31, 2015 at 5:54 PM, Alex Bennée alex.ben...@linaro.org wrote: From:

Re: [PATCH 1/2] KVM: x86: set TMR when the interrupt is accepted

2015-08-03 Thread Paolo Bonzini
On 03/08/2015 04:37, Zhang, Yang Z wrote: Only virtualized APIC register reads use the virtual TMR registers (SDM 29.4.2 or 29.5), but these just read data from the corresponding field in the virtual APIC page. 24.11.4 Software Access to Related Structures In addition to data in the

Re: [kvm-unit-tests PATCH v5 11/11] new: arm/barrier-test for memory barriers

2015-08-03 Thread alvise rigo
Hi Alex, Nice set of tests, they are proving to be helpful. One question below. On Fri, Jul 31, 2015 at 5:54 PM, Alex Bennée alex.ben...@linaro.org wrote: From: Alex Bennée a...@bennee.com This test has been written mainly to stress multi-threaded TCG behaviour but will demonstrate failure

Re: [kvm-unit-tests PATCH v5 11/11] new: arm/barrier-test for memory barriers

2015-08-03 Thread Alex Bennée
alvise rigo a.r...@virtualopensystems.com writes: Hi Alex, Nice set of tests, they are proving to be helpful. One question below. On Fri, Jul 31, 2015 at 5:54 PM, Alex Bennée alex.ben...@linaro.org wrote: From: Alex Bennée a...@bennee.com This test has been written mainly to stress

Re: [PATCH 1/2] KVM: x86: set TMR when the interrupt is accepted

2015-08-03 Thread Paolo Bonzini
On 03/08/2015 12:23, Zhang, Yang Z wrote: In any case, the TMR behavior introduced by the APICv patches is completely different from the hardware behavior, so it has to be fixed. But any real problem with it? It is a problem for split irqchip, where the EOI exit bitmap can be inferred

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

2015-08-03 Thread Pavel Fedin
Hi! When I reworked our code to only use a flag and not a separate routing type I ended up with the flag only guarding assignments, which wouldn't hurt if done unconditionally (since they are all u32's). So the whole usage of the flag is somewhat in jeopardy now. Either the eventual MSI

Votre quota de webmail a dépassé le quota, ce qui est de 2 Go

2015-08-03 Thread Victoire BONNET
Votre quota de webmail a dépassé le quota, ce qui est de 2 Go. ils s'élèvent actuellement à 2,3 Go. Pour faire revivre et augmenter sa part de messagerie web, cliquez sur le lien suivant ou copiez le lien pour mettre à jour votre compte de messagerie web Pour l'activer.

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

2015-08-03 Thread Eric Auger
Hi Andre, Pavel, On 08/03/2015 08:41 AM, Pavel Fedin wrote: Hi! When I reworked our code to only use a flag and not a separate routing type I ended up with the flag only guarding assignments, which wouldn't hurt if done unconditionally (since they are all u32's). So the whole usage of the

RE

2015-08-03 Thread Webmaster/localhost
Votre quota de webmail a dépassé le quota, ce qui est de 2 Go. ils s'élèvent actuellement à 2,3 Go. Pour faire revivre et augmenter sa part de messagerie web, cliquez sur le lien suivant ou copiez le lien pour mettre à jour votre compte de messagerie web Pour l'activer.

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

2015-08-03 Thread Eric Auger
On 08/02/2015 10:23 PM, Andre Przywara wrote: 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

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread Paolo Bonzini
On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com Why not use virtio-mmio + testdev on ppc as well? Similar to how we're not using PSCI on ARM or ACPI on x86. Paolo -- To

Re: [v3 0/5] KVM: irqfd consumer based on IRQ bypass manager

2015-08-03 Thread Eric Auger
Hi Feng, On 07/29/2015 10:46 AM, Feng Wu wrote: This series is based on Eric's https://lkml.org/lkml/2015/7/6/291;. Basically, I made the following chagnes: - Some changes based on Alex's irq bypass manager v2: https://lkml.org/lkml/2015/7/16/810 - Correct some minor erros and typo - Add

Re: [RFC PATCH 0/1] iommu: Detach device from domain when removed from group

2015-08-03 Thread Gerald Schaefer
On Mon, 3 Aug 2015 17:48:55 +0200 Joerg Roedel j...@8bytes.org wrote: On Tue, Jul 28, 2015 at 07:55:55PM +0200, Gerald Schaefer wrote: On s390, this eventually leads to a kernel panic when binding the device again to its non-vfio PCI driver, because of the missing arch-specific cleanup in

Re: [kvm-unit-tests PATCH 00/14] ppc64: initial drop

2015-08-03 Thread Paolo Bonzini
On 03/08/2015 16:41, Andrew Jones wrote: This series is the first series of a series of series that will bring support to kvm-unit-tests for ppc64, and eventually ppc64le. (Yes, the word 'series' is four times in that sentence. And now I've typed 'series' five times! Wait, now six times! OK,

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

2015-08-03 Thread Marc Zyngier
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 ITS case). Hypothetical broken userland which does not exist

[PATCH v4 0/5] KVM: irqfd consumer based on IRQ bypass manager

2015-08-03 Thread Eric Auger
This series transforms irqfd into an IRQ bypass consumer and introduce the infrastructure shared by Intel posted-interrupts and ARM forwarded IRQ series. The bypass manager gets compiled for x86 and arm/arm64 when KVM is used. A new kvm_irqfd.h header is created to externalize some irqfd

[PATCH v4 4/5] KVM: introduce kvm_arch functions for IRQ bypass

2015-08-03 Thread Eric Auger
This patch introduces - kvm_arch_irq_bypass_add_producer - kvm_arch_irq_bypass_del_producer - kvm_arch_irq_bypass_stop - kvm_arch_irq_bypass_start They make possible to specialize the KVM IRQ bypass consumer in case CONFIG_KVM_HAVE_IRQ_BYPASS is set. Signed-off-by: Eric Auger

[PATCH v4 1/5] KVM: x86: select IRQ_BYPASS_MANAGER

2015-08-03 Thread Eric Auger
From: Feng Wu feng...@intel.com Select IRQ_BYPASS_MANAGER for x86 when CONFIG_KVM is set Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/kvm/Kconfig | 2 ++ arch/x86/kvm/Makefile | 3 +++ 2 files changed, 5 insertions(+) diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index

[PATCH v4 2/5] KVM: arm/arm64: select IRQ_BYPASS_MANAGER

2015-08-03 Thread Eric Auger
Select IRQ_BYPASS_MANAGER when CONFIG_KVM is set Also add compilation of virt/lib. Signed-off-by: Eric Auger eric.au...@linaro.org Signed-off-by: Feng Wu feng...@intel.com --- v3 - v4: - add compilation of virt/lib in arm/arm64 KVM v2 - v3: - [Feng Wu] Correct a typo in

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread Andrew Jones
On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com Why not use virtio-mmio + testdev on ppc as well? Similar

[PATCH v4 3/5] KVM: create kvm_irqfd.h

2015-08-03 Thread Eric Auger
Move _irqfd_resampler and _irqfd struct declarations in a new public header: kvm_irqfd.h. They are respectively renamed into kvm_kernel_irqfd_resampler and kvm_kernel_irqfd. Those datatypes will be used by architecture specific code, in the context of IRQ bypass manager integration.

[PATCH v4 5/5] KVM: eventfd: add irq bypass consumer management

2015-08-03 Thread Eric Auger
This patch adds the registration/unregistration of an irq_bypass_consumer on irqfd assignment/deassignment. Signed-off-by: Eric Auger eric.au...@linaro.org Signed-off-by: Feng Wu feng...@intel.com --- v2 - v3 (Feng Wu): - Use kvm_arch_irq_bypass_start - Remove kvm_arch_irq_bypass_update - Add

[kvm-unit-tests PATCH 3/3] arm/run: use ACCEL to choose between kvm and tcg

2015-08-03 Thread Andrew Jones
Inspired by a patch by Alex Bennée. This version uses a new unittests.cfg variable and includes support for DRYRUN. Signed-off-by: Andrew Jones drjo...@redhat.com --- Another difference with Alex's patch is we no longer output 'Running with TCG', as I don't think it's necessary. The command line

[kvm-unit-tests PATCH 0/3] tcg is becoming a first class citizen

2015-08-03 Thread Andrew Jones
At least on the ARM side of things we're making sure unit tests can be used for [MT]TCG, as well as for KVM. This series adds support to unittests.cfg to allow us to specify kvm vs. tcg, as not all tests will be able to run on both. The first patch is a repost of one of Alex's pending patches, as

[kvm-unit-tests PATCH 2/3] run_tests: pass test name to run script

2015-08-03 Thread Andrew Jones
With this $TEST_DIR/run can output test specific error messages. Signed-off-by: Andrew Jones drjo...@redhat.com --- run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_tests.sh b/run_tests.sh index ebb7e9fe6fdfc..80b87823c3358 100755 --- a/run_tests.sh +++

[kvm-unit-tests PATCH 1/3] configure: emit HOST=$host to config.mak

2015-08-03 Thread Andrew Jones
From: Alex Bennée alex.ben...@linaro.org From: Alex Bennée alex.ben...@linaro.org This is useful information for the run scripts to know, especially if they want to drop to using TCG. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: Andrew Jones drjo...@redhat.com --- configure |

Re: [RFC PATCH 0/1] iommu: Detach device from domain when removed from group

2015-08-03 Thread Gerald Schaefer
On Tue, 28 Jul 2015 19:55:55 +0200 Gerald Schaefer gerald.schae...@de.ibm.com wrote: Hi, during IOMMU API function testing on s390 I hit the following scenario: After binding a device to vfio-pci, the user completes the VFIO_SET_IOMMU ioctl and stops, see the sample C program below. Now

Re: [PATCH 04/18] KVM: ARM64: Add reset and access handlers for PMCR_EL0 register

2015-08-03 Thread Christoffer Dall
On Tue, Jul 21, 2015 at 09:16:57AM +0800, Shannon Zhao wrote: On 2015/7/17 18:21, Christoffer Dall wrote: On Fri, Jul 17, 2015 at 04:45:44PM +0800, Shannon Zhao wrote: On 2015/7/17 3:55, Christoffer Dall wrote: On Mon, Jul 06, 2015 at 10:17:34AM +0800, shannon.z...@linaro.org wrote:

Re: [PATCH 07/18] KVM: ARM64: PMU: Add perf event map and introduce perf event creating function

2015-08-03 Thread Christoffer Dall
On Tue, Jul 21, 2015 at 09:35:03AM +0800, Shannon Zhao wrote: On 2015/7/17 22:30, Christoffer Dall wrote: On Mon, Jul 06, 2015 at 10:17:37AM +0800, shannon.z...@linaro.org wrote: From: Shannon Zhao shannon.z...@linaro.org When we use tools like perf on host, perf passes the event type

[kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread Andrew Jones
Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27 lib/powerpc/io.c| 3 ++ lib/powerpc/rtas.c | 84 +

[kvm-unit-tests PATCH 04/14] powerpc/ppc64: start skeleton framework

2015-08-03 Thread Andrew Jones
Use the arm/arm64 framework as a template to start a skeleton for powerpc/ppc64. Copy the arm makefiles and linker script verbatim. We'll modify them for powerpc with the next patch, making it clear what needs to be changed. Signed-off-by: Andrew Jones drjo...@redhat.com --- configure

[kvm-unit-tests PATCH 05/14] powerpc/pp64: ppc-ify makefiles and linker script

2015-08-03 Thread Andrew Jones
Signed-off-by: Andrew Jones drjo...@redhat.com --- powerpc/Makefile.common | 44 +--- powerpc/Makefile.ppc64 | 16 powerpc/flat.lds| 14 ++ 3 files changed, 31 insertions(+), 43 deletions(-) diff --git

[kvm-unit-tests PATCH 07/14] powerpc/ppc64: add bootloader to bounce into memory

2015-08-03 Thread Andrew Jones
Committing the binary, since there's little point in rebuilding, and it requires SLOF's build_romfs tool, which is not part of this source repository. Signed-off-by: Andrew Jones drjo...@redhat.com --- powerpc/boot_rom.bin | Bin 0 - 280 bytes 1 file changed, 0 insertions(+), 0 deletions(-)

[kvm-unit-tests PATCH 02/14] lib: share arm-selftest utility functions

2015-08-03 Thread Andrew Jones
arm-selftest has a couple utility functions that could be useful to other unit tests, even other architectures. So move them out. split_var moves to lib/util, where we can add other random utilities over time. assert_args inspires report_abort, which allows us to report a message, using the

[kvm-unit-tests PATCH 14/14] mkstandalone: add support for powerpc

2015-08-03 Thread Andrew Jones
PowerPC needs firmware and an exit code snooper. Signed-off-by: Andrew Jones drjo...@redhat.com --- configure | 3 +++ powerpc/run | 2 +- scripts/mkstandalone.sh | 50 + 3 files changed, 50 insertions(+), 5 deletions(-)

[kvm-unit-tests PATCH 10/14] powerpc/ppc64: relocate linker VMAs

2015-08-03 Thread Andrew Jones
QEMU loads the unit test, but due to the way it translates the unit test's linker VMA to the LMA, we can't just link such that VMA == LMA. Thus, we link with VMA == 0x0, and then deal with relocation. Signed-off-by: Andrew Jones drjo...@redhat.com --- configure | 2 ++

[kvm-unit-tests PATCH 00/14] ppc64: initial drop

2015-08-03 Thread Andrew Jones
This series is the first series of a series of series that will bring support to kvm-unit-tests for ppc64, and eventually ppc64le. (Yes, the word 'series' is four times in that sentence. And now I've typed 'series' five times! Wait, now six times! OK, moving on...) This series brings basic setup;

[kvm-unit-tests PATCH 01/14] lib: asm-generic: add missing casts

2015-08-03 Thread Andrew Jones
Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/asm-generic/io.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/asm-generic/io.h b/lib/asm-generic/io.h index a9939d3a5921f..abd245676e97a 100644 --- a/lib/asm-generic/io.h +++ b/lib/asm-generic/io.h @@

[kvm-unit-tests PATCH 13/14] powerpc/ppc64: add run script and unittests.cfg

2015-08-03 Thread Andrew Jones
Now that we have all the pieces, pull them together into the run script. To run a test do ./powerpc-run powerpc/test.elf To run all tests in unittests.cfg do ./run_tests.sh Signed-off-by: Andrew Jones drjo...@redhat.com --- powerpc/run | 57

[kvm-unit-tests PATCH 06/14] powerpc/ppc64: add boot rom source

2015-08-03 Thread Andrew Jones
Make a one line replacement for SLOF. This bootloader just jumps to 0x40, because we know the kernel will be there. This commit allows rebuilding of the bootloader, as long as the SLOF build_romfs tool is present, but since it would be a pain to require that tool for ever build, we'll just

[kvm-unit-tests PATCH 08/14] powerpc/ppc64: add HV putchar

2015-08-03 Thread Andrew Jones
Add the hvcall for putchar and use it in puts. That, along with a couple more lines in start to prepare for C code, and a branch to main(), gets us hello world. Run with qemu-system-ppc64 -M pseries\ -bios powerpc/boot_rom.bin \ -display none -serial stdio \

[kvm-unit-tests PATCH 03/14] config: no need to mix arch makefiles

2015-08-03 Thread Andrew Jones
Move the config/config-*.mak files to their own directories and rename to Makefile.* README is also updated to reflect the change, as well as to remove an optimistic reference to a non-existent docs directory. Signed-off-by: Andrew Jones drjo...@redhat.com --- Makefile

[kvm-unit-tests PATCH 09/14] powerpc/ppc64: adapt arm's setup

2015-08-03 Thread Andrew Jones
Copy arm's setup code (also DT based) over to powerpc, adapting it a bit. Also bring over arm's setup selftest, giving powerpc its first test. Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/setup.h | 27 lib/powerpc/setup.c | 82

[kvm-unit-tests PATCH 12/14] scripts: add exit code snooper

2015-08-03 Thread Andrew Jones
Add a function that reads test output streams and just forwards it on to stdout, except when a line is 'EXIT: STATUS=%d', at which point it grabs the status to use as the exit code. Tests that always exit with zero (due to how they inform QEMU to quit), can now return other status codes. Run with

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread Alexander Graf
On 03.08.15 19:02, Andrew Jones wrote: On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com Why not use virtio-mmio +

Re: [kvm-unit-tests PATCH 10/14] powerpc/ppc64: relocate linker VMAs

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 04:41:27PM +0200, Andrew Jones wrote: QEMU loads the unit test, but due to the way it translates the unit test's linker VMA to the LMA, we can't just link such that VMA == LMA. Thus, we link with VMA == 0x0, and then deal with relocation. Signed-off-by: Andrew Jones

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27 lib/powerpc/io.c| 3 ++ lib/powerpc/rtas.c |

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27 lib/powerpc/io.c| 3 ++ lib/powerpc/rtas.c |

Re: [kvm-unit-tests PATCH 08/14] powerpc/ppc64: add HV putchar

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 04:41:25PM +0200, Andrew Jones wrote: Add the hvcall for putchar and use it in puts. That, along with a couple more lines in start to prepare for C code, and a branch to main(), gets us hello world. Run with qemu-system-ppc64 -M pseries\ -bios

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com Why not use virtio-mmio + testdev on ppc as well? Similar

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread Paolo Bonzini
On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com Why not use virtio-mmio + testdev on ppc as well? Similar to how we're not using PSCI on ARM or ACPI on x86. Paolo -- To

Re: [kvm-unit-tests PATCH 00/14] ppc64: initial drop

2015-08-03 Thread Paolo Bonzini
On 03/08/2015 16:41, Andrew Jones wrote: This series is the first series of a series of series that will bring support to kvm-unit-tests for ppc64, and eventually ppc64le. (Yes, the word 'series' is four times in that sentence. And now I've typed 'series' five times! Wait, now six times! OK,

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread Andrew Jones
On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com Why not use virtio-mmio + testdev on ppc as well? Similar