[PATCH 0/2] kvmtool: replace documentations stubs with manpage

2015-12-22 Thread Andre Przywara
currently is not documented at all (networking comes to mind). Cheers, Andre. Andre Przywara (2): Add a rudimentary manpage Documentation: remove documentation stubs and common-cmds.h generation .gitignore| 1 - Documentation/kvm-balloon.txt | 24 - Documentation/kvm

[PATCH 2/2] Documentation: remove documentation stubs and common-cmds.h generation

2015-12-22 Thread Andre Przywara
generated with the current HEAD into the source tree. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- .gitignore| 1 - Documentation/kvm-balloon.txt | 24 - Documentation/kvm-debug.txt | 16 --- Documentation/kvm-list.txt

[PATCH 1/2] Add a rudimentary manpage

2015-12-22 Thread Andre Przywara
and should be subject to extension. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- Documentation/kvmtool.1 | 222 1 file changed, 222 insertions(+) create mode 100644 Documentation/kvmtool.1 diff --git a/Documentation/kvmto

Re: [PATCH 0/7] kvmtool: Cleanup kernel loading

2015-11-18 Thread Andre Przywara
Hi Will, On 02/11/15 14:58, Will Deacon wrote: > On Fri, Oct 30, 2015 at 06:26:53PM +0000, Andre Przywara wrote: >> Hi, > > Hello Andre, > >> this series cleans up kvmtool's kernel loading functionality a bit. >> It has been broken out of a previous series I

Re: [PATCH 0/7] kvmtool: Cleanup kernel loading

2015-11-18 Thread Andre Przywara
Hi Will, On 02/11/15 14:58, Will Deacon wrote: > On Fri, Oct 30, 2015 at 06:26:53PM +0000, Andre Przywara wrote: >> Hi, > > Hello Andre, > >> this series cleans up kvmtool's kernel loading functionality a bit. >> It has been broken out of a previous series I

[PATCH] kvmtool: Makefile: remove LDFLAGS from guest_init linking

2015-11-08 Thread Andre Przywara
, let's reinstantiate the previous state by removing the LDFLAGS variable from those linking steps. This allows LDFLAGS to be used for linking the actual kvmtool binary only and helps to re-merge commit d0e2772b93a ("Makefile: allow overriding CFLAGS on the command line"). Signed-off

Re: [PATCH 1/2] Makefile: allow overriding CFLAGS on the command line

2015-11-04 Thread Andre Przywara
Hi Riku, On 04/11/15 10:02, Riku Voipio wrote: > On 30 October 2015 at 19:20, Andre Przywara <andre.przyw...@arm.com> wrote: >> When a Makefile variable is set on the make command line, all >> Makefile-internal assignments to that very variable are _ignored_. >> Since

Re: [PATCH 0/7] kvmtool: Cleanup kernel loading

2015-11-02 Thread Andre Przywara
Hi Dimitri, On 02/11/15 15:17, Dimitri John Ledkov wrote: > On 2 November 2015 at 14:58, Will Deacon <will.dea...@arm.com> wrote: >> On Fri, Oct 30, 2015 at 06:26:53PM +, Andre Przywara wrote: >>> Hi, >> >> Hello Andre, >> >>> this series cle

Re: [PATCH 0/7] kvmtool: Cleanup kernel loading

2015-11-02 Thread Andre Przywara
Hi Dimitri, On 02/11/15 15:17, Dimitri John Ledkov wrote: > On 2 November 2015 at 14:58, Will Deacon <will.dea...@arm.com> wrote: >> On Fri, Oct 30, 2015 at 06:26:53PM +, Andre Przywara wrote: >>> Hi, >> >> Hello Andre, >> >>> this series cle

[PATCH 2/2] Makefile: consider LDFLAGS on feature tests and when linking executables

2015-10-30 Thread Andre Przywara
. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- Makefile | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 77a7c9f..eac1220 100644 --- a/Makefile +++ b/Makefile @@ -196,12 +196,12 @@ endif # On a given

[PATCH 1/2] Makefile: allow overriding CFLAGS on the command line

2015-10-30 Thread Andre Przywara
ective, so that a user can use: $ make CFLAGS=/path/to/my/include/dir to teach kvmtool about non-standard header file locations (helpful for cross-compilation) or to tweak other compiler options. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> [1] https://www.gnu.org/software/make/manual/ht

[PATCH 0/2] kvmtool: allow CFLAGS and LDFLAGS override

2015-10-30 Thread Andre Przywara
on the make command line and those will not overwrite kvmtool's vital internal assignments. Cheers, Andre. Andre Przywara (2): Makefile: allow overriding CFLAGS on the command line Makefile: consider LDFLAGS on feature tests and when linking executables Makefile | 45

[PATCH 5/7] x86: use read wrappers in kernel loading

2015-10-30 Thread Andre Przywara
Replace the unsafe read-loops in the x86 kernel image loading functions with our safe read_file() and read_in_full() wrappers. This should fix random fails in kernel image loading, especially from pipes and sockets. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- x86/kvm.

[PATCH 6/7] arm/arm64: use read_file() in kernel and initrd loading

2015-10-30 Thread Andre Przywara
Use the new read_file() wrapper in our arm/arm64 kernel image loading function instead of the private implementation. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- arm/fdt.c | 40 ++-- 1 file changed, 18 insertions(+), 22 deletions(-) diff

[PATCH 7/7] arm: move kernel loading into arm/kvm.c

2015-10-30 Thread Andre Przywara
string. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- arm/fdt.c | 95 +-- arm/kvm.c | 88 ++ 2 files changed, 89 insertions(+), 94 deletions(-) diff --git a/arm/f

[PATCH 1/7] Refactor kernel image loading

2015-10-30 Thread Andre Przywara
for MIPS as special cases for those architectures (removing the arch specific code from the generic kvm.c file on the way) and rename the existing "flat binary" loader functions for the other architectures to the new name. Signed-off-by: Andre Przywara <andre.przyw...@arm.com>

[PATCH 3/7] powerpc: use read_file() in kernel and initrd loading

2015-10-30 Thread Andre Przywara
Replace the unsafe read-loops in the powerpc kernel image loading function with our new and safe read_file() wrapper. This should fix random fails in kernel image loading, especially from pipes and sockets. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- powerpc/kvm.

[PATCH 4/7] MIPS: use read wrappers in kernel loading

2015-10-30 Thread Andre Przywara
Replace the unsafe read-loops used in the MIPS kernel image loading with our safe read_file() and read_in_full() wrappers. This should fix random fails in kernel image loading, especially from pipes and sockets. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- mips/kvm.

[PATCH 6/7] arm/arm64: use read_file() in kernel and initrd loading

2015-10-30 Thread Andre Przywara
Use the new read_file() wrapper in our arm/arm64 kernel image loading function instead of the private implementation. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- arm/fdt.c | 40 ++-- 1 file changed, 18 insertions(+), 22 deletions(-) diff

[PATCH 7/7] arm: move kernel loading into arm/kvm.c

2015-10-30 Thread Andre Przywara
string. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- arm/fdt.c | 95 +-- arm/kvm.c | 88 ++ 2 files changed, 89 insertions(+), 94 deletions(-) diff --git a/arm/f

[PATCH 3/7] powerpc: use read_file() in kernel and initrd loading

2015-10-30 Thread Andre Przywara
Replace the unsafe read-loops in the powerpc kernel image loading function with our new and safe read_file() wrapper. This should fix random fails in kernel image loading, especially from pipes and sockets. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- powerpc/kvm.

[PATCH 5/7] x86: use read wrappers in kernel loading

2015-10-30 Thread Andre Przywara
Replace the unsafe read-loops in the x86 kernel image loading functions with our safe read_file() and read_in_full() wrappers. This should fix random fails in kernel image loading, especially from pipes and sockets. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- x86/kvm.

[PATCH 0/7] kvmtool: Cleanup kernel loading

2015-10-30 Thread Andre Przywara
, Andre. [1] http://marc.info/?l=kvm=143825354808135=2 Andre Przywara (7): Refactor kernel image loading provide generic read_file() implementation powerpc: use read_file() in kernel and initrd loading MIPS: use read wrappers in kernel loading x86: use read wrappers in kernel loading

[PATCH 0/7] kvmtool: Cleanup kernel loading

2015-10-30 Thread Andre Przywara
, Andre. [1] http://marc.info/?l=kvm=143825354808135=2 Andre Przywara (7): Refactor kernel image loading provide generic read_file() implementation powerpc: use read_file() in kernel and initrd loading MIPS: use read wrappers in kernel loading x86: use read wrappers in kernel loading

[PATCH 1/7] Refactor kernel image loading

2015-10-30 Thread Andre Przywara
for MIPS as special cases for those architectures (removing the arch specific code from the generic kvm.c file on the way) and rename the existing "flat binary" loader functions for the other architectures to the new name. Signed-off-by: Andre Przywara <andre.przyw...@arm.com>

[PATCH 4/7] MIPS: use read wrappers in kernel loading

2015-10-30 Thread Andre Przywara
Replace the unsafe read-loops used in the MIPS kernel image loading with our safe read_file() and read_in_full() wrappers. This should fix random fails in kernel image loading, especially from pipes and sockets. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- mips/kvm.

[PATCH 2/7] provide generic read_file() implementation

2015-10-30 Thread Andre Przywara
to provide the only safe implementation, so take that as an inspiration to provide a generic read_file() function usable by every part of kvmtool. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- include/kvm/read-write.h | 2 ++ util/read-write.c| 21 + 2

[PATCH 2/7] provide generic read_file() implementation

2015-10-30 Thread Andre Przywara
to provide the only safe implementation, so take that as an inspiration to provide a generic read_file() function usable by every part of kvmtool. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- include/kvm/read-write.h | 2 ++ util/read-write.c| 21 + 2

Re: Network hangs when communicating with host

2015-10-19 Thread Andre Przywara
Hi Dmitry, On 19/10/15 10:05, Dmitry Vyukov wrote: > On Fri, Oct 16, 2015 at 7:25 PM, Sasha Levin wrote: >> On 10/15/2015 04:20 PM, Dmitry Vyukov wrote: >>> Hello, >>> >>> I am trying to run a program in lkvm sandbox so that it communicates >>> with a program on host. I

Re: [PATCH v3 00/16] KVM: arm64: GICv3 ITS emulation

2015-10-12 Thread Andre Przywara
Hej, On 10/10/15 16:37, Christoffer Dall wrote: > Hi Andre, > > > On Wed, Oct 07, 2015 at 03:55:10PM +0100, Andre Przywara wrote: >> Hi, >> >> another respin and rebase of the ITS emulation series. >> Major changes compared to v2 (beside some minor things

Re: [PATCH v3 12/16] KVM: arm64: handle pending bit for LPIs in ITS emulation

2015-10-12 Thread Andre Przywara
Hi Pavel, On 12/10/15 08:40, Pavel Fedin wrote: > Hello! > >> -Original Message- >> From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf >> Of Andre Przywara >> Sent: Wednesday, October 07, 2015 5:55 PM >> To: marc.zyng...@

Re: [PATCH 1/2] KVM: arm/arm64: Optimize away redundant LR tracking

2015-10-12 Thread Andre Przywara
Hi, On 02/10/15 15:44, Pavel Fedin wrote: > Currently we use vgic_irq_lr_map in order to track which LRs hold which > IRQs, and lr_used bitmap in order to track which LRs are used or free. > > vgic_irq_lr_map is actually used only for piggy-back optimization, and > can be easily replaced by

Re: [PATCH 0/2] KVM: arm/arm64: Clean up some obsolete code

2015-10-08 Thread Andre Przywara
Hi, On 08/10/15 11:56, Marc Zyngier wrote: > On 08/10/15 11:14, Christoffer Dall wrote: >> Hi Pavel, >> >> On Fri, Oct 02, 2015 at 05:44:27PM +0300, Pavel Fedin wrote: >>> Current KVM code has lots of old redundancies, which can be cleaned up. >>> This patchset is actually a better alternative to

[PATCH v3 13/16] KVM: arm64: sync LPI configuration and pending tables

2015-10-07 Thread Andre Przywara
exercised by hardware, so the sync points are well known. Provide functions that read the guest memory and store the information from the configuration and pending tables in the kernel. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- Changelog v2..v3: - rework functions to avoid pro

[PATCH v3 05/16] KVM: arm/arm64: extend arch CAP checks to allow per-VM capabilities

2015-10-07 Thread Andre Przywara
KVM capabilities can be a per-VM property, though ARM/ARM64 currently does not pass on the VM pointer to the architecture specific capability handlers. Add a "struct kvm*" parameter to those function to later allow proper per-VM capability reporting. Signed-off-by: Andre Przywara &l

[PATCH v3 14/16] KVM: arm64: implement ITS command queue command handlers

2015-10-07 Thread Andre Przywara
basic at this point, as we don't have a good way of communicating errors to the guest (usually a SError). The INT command handler is missing at this point, as we gain the capability of actually injecting MSIs into the guest only later on. Signed-off-by: Andre Przywara <andre.przyw...@arm.

[PATCH v3 15/16] KVM: arm64: implement MSI injection in ITS emulation

2015-10-07 Thread Andre Przywara
provide the handler for the ITS "INT" command, which allows a guest to trigger an MSI via the ITS command queue. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- Changelog v2..v3: - proper checking for unmapped collections include/kvm/arm_vgic.h | 1 + virt/kvm/arm/its

[PATCH v3 12/16] KVM: arm64: handle pending bit for LPIs in ITS emulation

2015-10-07 Thread Andre Przywara
them is easy. With LPIs being only edge-triggered, we get away with a less complex IRQ handling. We extend the number of bits for storing the IRQ number in our LR struct to 16 to cover the LPI numbers we support as well. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- Changelog

[PATCH v3 16/16] KVM: arm64: enable ITS emulation as a virtual MSI controller

2015-10-07 Thread Andre Przywara
we enable the KVM_SIGNAL_MSI feature to allow userland to inject MSIs into the guest. Not having enabled the ITS emulation will lead to a -ENODEV when trying to inject a MSI. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- Changelog v2..v3: - replace kmalloc with kcalloc - adjust

[PATCH v3 03/16] KVM: extend struct kvm_msi to hold a 32-bit device ID

2015-10-07 Thread Andre Przywara
we will enable it when ITS emulation is used. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> Reviewed-by: Eric Auger <eric.au...@linaro.org> --- Changelog v2..v3: - adjust KVM_CAP number to not clash with upstream Documentation/virtual/kvm/api.txt | 12 ++-- includ

[PATCH v3 11/16] KVM: arm64: add data structures to model ITS interrupt translation

2015-10-07 Thread Andre Przywara
uest being quite low. Should the number of LPIs exceed the number where iterating through lists seems acceptable, we can later revisit this and use more efficient data structures. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- Changelog v2..v3: - add a comment include/kvm/

[PATCH v3 07/16] KVM: arm64: Introduce new MMIO region for the ITS base address

2015-10-07 Thread Andre Przywara
by that check. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> Reviewed-by: Eric Auger <eric.au...@linaro.org> --- Changelog v2..v3: - none Documentation/virtual/kvm/devices/arm-vgic.txt | 9 + arch/arm64/include/uapi/asm/kvm.h | 2 ++ include/kv

[PATCH v3 10/16] KVM: arm64: implement basic ITS register handlers

2015-10-07 Thread Andre Przywara
before the actual command handler is called. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- Changelog v2..v3: - use new renamed vgic_reg64_access() function - rework locking in CWRITER handling - use kcalloc instead of kmalloc include/kvm/arm_vgic.h | 3 + include

[PATCH v3 06/16] KVM: arm/arm64: make GIC frame address initialization model specific

2015-10-07 Thread Andre Przywara
. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- Changelog v2..v3: - none virt/kvm/arm/vgic-v2-emul.c | 3 +++ virt/kvm/arm/vgic-v3-emul.c | 3 +++ virt/kvm/arm/vgic.c | 3 --- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/virt/kvm/arm/vgic-v2-emul.c b/vi

[PATCH v3 01/16] KVM: arm/arm64: VGIC: don't track used LRs in the distributor

2015-10-07 Thread Andre Przywara
less than once every 100,000 exits. This has been briefly tested on Midway, Juno and the model (the latter both with GICv2 and GICv3 guests). Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- Changelog v2..v3: - adapt to 4.3-rc - keep, but change retire_lr to drop now unused par

[PATCH v3 08/16] KVM: arm64: handle ITS related GICv3 redistributor registers

2015-10-07 Thread Andre Przywara
emulation. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- Changelog v2..v3: - rename vgic_handle_base_register to vgic_reg64_access() include/kvm/arm_vgic.h | 8 virt/kvm/arm/vgic-v3-emul.c | 44 virt/kvm/arm/vgic.c

[PATCH v3 04/16] KVM: arm/arm64: add emulation model specific destroy function

2015-10-07 Thread Andre Przywara
. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> Reviewed-by: Eric Auger <eric.au...@linaro.org> --- Changelog v2..v3: - none include/kvm/arm_vgic.h | 1 + virt/kvm/arm/vgic-v3-emul.c | 9 + virt/kvm/arm/vgic.c | 11 ++- 3 files changed, 20 inse

[PATCH v3 00/16] KVM: arm64: GICv3 ITS emulation

2015-10-07 Thread Andre Przywara
s/its-emul/v3 [3]: git://linux-arm.org/kvmtool.git http://www.linux-arm.org/git?p=kvmtool.git;a=log;h=refs/heads/its [4]: http://arminfo.emea.arm.com/help/topic/com.arm.doc.ihi0069a/IHI0069A_gic_architecture_specification.pdf Andre Przywara (16): KVM: arm/arm64: VGIC: don't track used LRs in th

[PATCH v3 02/16] KVM: arm/arm64: remove now unused code after stay-in-LR rework

2015-10-07 Thread Andre Przywara
Now that we synchronize the LR state into our emulation upon guest exit, there is no need for taking extra care of disabled IRQs. Remove that code. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- Changelog v2..v3: - new patch virt/kvm/arm/vgic.c | 29 --

[PATCH v3 09/16] KVM: arm64: introduce ITS emulation file with stub functions

2015-10-07 Thread Andre Przywara
are not yet ready for the show. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> Reviewed-by: Eric Auger <eric.au...@linaro.org> --- Changelog v2..v3: - drop ITS check before doing GICR_CTLR access arch/arm64/kvm/Makefile| 1 + include/kvm/arm_vgic.h

Re: [PATCH v2 13/15] KVM: arm64: implement ITS command queue command handlers

2015-10-07 Thread Andre Przywara
PM, Andre Przywara wrote: >> The connection between a device, an event ID, the LPI number and the >> allocated CPU is stored in in-memory tables in a GICv3, but their >> format is not specified by the spec. Instead software uses a command >> queue in a ring buffer to let

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

2015-10-02 Thread Andre Przywara
Hi Pavel, On 02/10/15 13:39, Pavel Fedin wrote: > Hello! > >> Can't you use the ELRSR bitmap instead? The idea of lr_used sounds like >> a moot optimization to me. > > This perfectly works on 4.2, but will break HW interrupt forwarding on 4.3. > If you look at 4.3 >

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

2015-10-02 Thread Andre Przywara
Hi Pavel, On 02/10/15 10:55, Pavel Fedin wrote: > Hello! One more concern. > >> Currently we track which IRQ has been mapped to which VGIC list >> register and also have to synchronize both. We used to do this >> to hold some extra state (for instance the active bit). >> It turns out that this

Re: [PATCH v3 5/8] arm/arm64: KVM: Use appropriate define in VGIC reset code

2015-10-02 Thread Andre Przywara
Hi Christoffer, On 29/09/15 15:49, Christoffer Dall wrote: > We currently initialize the SGIs to be enabled in the VGIC code, but we > use the VGIC_NR_PPIS define for this purpose, instead of the the more > natural VGIC_NR_SGIS. Change this slightly confusing use of the > defines. > > Note:

Re: [PATCH v3 3/8] arm/arm64: KVM: vgic: Factor out level irq processing on guest exit

2015-10-02 Thread Andre Przywara
Hi Christoffer, On 29/09/15 15:49, Christoffer Dall wrote: > Currently vgic_process_maintenance() processes dealing with a completed > level-triggered interrupt directly, but we are soon going to reuse this > logic for level-triggered mapped interrupts with the HW bit set, so > move this logic

Re: [PATCH v3 4/8] arm/arm64: KVM: Implement GICD_ICFGR as RO for PPIs

2015-10-02 Thread Andre Przywara
ing kernel coding style because of a single statement not needing braces? Maybe move the comment in front of the if-statement to make this more obvious? Other than that: Reviewed-by: Andre Przywara <andre.przyw...@arm.com> Cheers, Andre. -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH v3 8/8] arm/arm64: KVM: Support edge-triggered forwarded interrupts

2015-10-02 Thread Andre Przywara
On 29/09/15 15:49, Christoffer Dall wrote: > We mark edge-triggered interrupts with the HW bit set as queued to > prevent the VGIC code from injecting LRs with both the Active and > Pending bits set at the same time while also setting the HW bit, > because the hardware does not support this. > >

Re: [PATCH v4 07/11] KVM: arm/arm64: vgic: Allow HW interrupts to be queued to a guest

2015-09-30 Thread Andre Przywara
Hi Christoffer, On 29/09/15 14:44, Christoffer Dall wrote: > On Wed, Sep 23, 2015 at 06:55:04PM +0100, Andre Przywara wrote: >> Salut Marc, >> >> I know that this patch is already merged, but >> >> On 07/08/15 16:45, Marc Zyngier wrote: >>> diff

Re: [PATCH kvmtool] Skip a few messages by default: command line args; flat binary; earlyprintk.

2015-09-30 Thread Andre Przywara
Hi Dimitri, thanks for sharing your patches. On 29/09/15 17:59, Dimitri John Ledkov wrote: > The partial command line args & earlyprintk=serial are still enabled > in the debug mode. Warning that a flat binary kernel image is attemped > to be loaded is completely dropped. These are not that

Re: [PATCH kvmtool] kvmtool: expose the TSC Deadline Timer feature to the guest

2015-09-30 Thread Andre Przywara
Hi Dimitri, On 29/09/15 18:00, Dimitri John Ledkov wrote: > From: Arjan van de Ven > > with the TSC deadline timer feature, we don't need to calibrate the apic > timers anymore, which saves more than 100 milliseconds of boot time. > > Signed-off-by: Arjan van de Ven

Re: [PATCH v3 5/5] KVM: arm64: Implement vGICv3 CPU interface access

2015-09-25 Thread Andre Przywara
On 24/09/15 13:08, Pavel Fedin wrote: > Hello! > >> The only thing that is pure 64-bit is the MRS/MSR _instruction_ in >> Aarch64, which always takes a x register. >> So can you model the register size according to the spec and allow >> 32-bit accesses from userland? > > I would like to

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

2015-09-24 Thread Andre Przywara
Hi Pavel, On 24/09/15 12:18, Pavel Fedin wrote: > Hello Andre and others! > > How are things going? I see the last message in thread something like 1 > month old, then silence... > Our project relies on this feature, any assistance needed? I am about to make it work on top of Christoffer's

Re: [PATCH v2 7/8] arm/arm64: KVM: Rework the arch timer to use level-triggered semantics

2015-09-23 Thread Andre Przywara
Hi Christoffer, > diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c > index 9ed8d53..f4ea950 100644 > --- a/virt/kvm/arm/vgic.c > +++ b/virt/kvm/arm/vgic.c > @@ -1422,34 +1422,43 @@ static bool vgic_process_maintenance(struct kvm_vcpu > *vcpu) > /* > * Save the physical active state, and

Re: [PATCH v4 07/11] KVM: arm/arm64: vgic: Allow HW interrupts to be queued to a guest

2015-09-23 Thread Andre Przywara
Salut Marc, I know that this patch is already merged, but On 07/08/15 16:45, Marc Zyngier wrote: > diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c > index 51c9900..9d009d2 100644 ... > @@ -1364,6 +1397,39 @@ static bool vgic_process_maintenance(struct kvm_vcpu > *vcpu) >

Re: [PATCH v2 6/8] arm/arm64: KVM: Add forwarded physical interrupts documentation

2015-09-15 Thread Andre Przywara
Hi Christoffer, On 14/09/15 12:42, Christoffer Dall wrote: Where is this done? I see that the physical dist state is altered on the actual IRQ forwarding, but not on later exits/entries? Do you mean kvm_vgic_flush_hwstate() with "flush"? >>> >>> this is a bug and should be

Re: [PATCH v2 7/8] arm/arm64: KVM: Rework the arch timer to use level-triggered semantics

2015-09-14 Thread Andre Przywara
Hi Christoffer, just one small nit I stumbled upon: On 04/09/15 20:40, Christoffer Dall wrote: > diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c > index 9ed8d53..f4ea950 100644 > --- a/virt/kvm/arm/vgic.c > +++ b/virt/kvm/arm/vgic.c > @@ -1422,34 +1422,43 @@ static bool

Re: [PATCH v2 6/8] arm/arm64: KVM: Add forwarded physical interrupts documentation

2015-09-11 Thread Andre Przywara
Hi Christoffer, (actually you are not supposed to reply during your holidays!) On 09/09/15 09:49, Christoffer Dall wrote: > On Tue, Sep 8, 2015 at 6:57 PM, Andre Przywara <andre.przyw...@arm.com> wrote: >> Hi Eric, >> >> thanks for you answer. >> >> On 0

Re: [PATCH kvmtool] Make static libc and guest-init functionality optional.

2015-09-11 Thread Andre Przywara
Hi Dimitri, thanks for sharing this patch and sorry for the delay. (CC:ing Will) On 04/09/15 13:04, Dimitri John Ledkov wrote: > If one typically only boots full disk-images, one wouldn't necessaraly > want to statically link glibc, for the guest-init feature of the > kvmtool. As statically

Re: [PATCH v2 6/8] arm/arm64: KVM: Add forwarded physical interrupts documentation

2015-09-08 Thread Andre Przywara
Hi Eric, thanks for you answer. On 08/09/15 09:43, Eric Auger wrote: > Hi Andre, > On 09/07/2015 01:25 PM, Andre Przywara wrote: >> Hi, >> >> firstly: this text is really great, thanks for coming up with that. >> See below for some information I got from tracing t

Re: [PATCH v2 6/8] arm/arm64: KVM: Add forwarded physical interrupts documentation

2015-09-07 Thread Andre Przywara
Hi, firstly: this text is really great, thanks for coming up with that. See below for some information I got from tracing the host which I cannot make sense of On 04/09/15 20:40, Christoffer Dall wrote: > Forwarded physical interrupts on arm/arm64 is a tricky concept and the > way we deal

Re: [PATCH] kvmtool Makefile: relax arm test

2015-09-04 Thread Andre Przywara
Hi Riku, On 04/09/15 11:52, Riku Voipio wrote: > On 4 September 2015 at 13:10, Andre Przywara <andre.przyw...@arm.com> wrote: >> Hi Riku, >> >> On 03/09/15 12:20, riku.voi...@linaro.org wrote: >>> From: Riku Voipio <riku.voi...@linaro.org> >>>

Re: [PATCH] kvmtool Makefile: relax arm test

2015-09-04 Thread Andre Przywara
Hi Riku, On 03/09/15 12:20, riku.voi...@linaro.org wrote: > From: Riku Voipio > > Currently Makefile accepts only armv7l.* When building kvmtool under 32bit > personality on Aarch64 machines, uname -m reports "armv8l", so build fails. > We expect doing 32bit arm builds

Re: [PATCH v2 1/5] KVM: arm/arm64: Refactor vGIC attributes handling code

2015-09-04 Thread Andre Przywara
Hi Pavel, On 02/09/15 09:09, Pavel Fedin wrote: > Separate all implementation-independent code in vgic_attr_regs_access() > and move it to vgic.c. This will allow to reuse this code for vGICv3 > implementation. > > Signed-off-by: Pavel Fedin > --- >

Re: [PATCH v3 2/5] KVM: arm64: Implement vGICv3 distributor and redistributor access from userspace

2015-09-04 Thread Andre Przywara
Hi Pavel, On 04/09/15 13:40, Pavel Fedin wrote: > The access is done similar to vGICv2, using KVM_DEV_ARM_VGIC_GRP_DIST_REGS > and KVM_DEV_ARM_VGIC_GRP_REDIST_REGS with KVM_SET_DEVICE_ATTR and > KVM_GET_DEVICE_ATTR ioctls. Since GICv3 can handle large number of CPUs, > KVM_DEV_ARM_VGIC_CPUID_MASK

Re: [PATCH v3 3/5] KVM: arm64: Refactor system register handlers

2015-09-04 Thread Andre Przywara
Hi Pavel, On 04/09/15 13:40, Pavel Fedin wrote: > Replace Rt with data pointer in struct sys_reg_params. This will allow to > reuse system register handling code in implementation of vGICv3 CPU > interface access API. Additionally, got rid of "massive hack" > in kvm_handle_cp_64(). > >

Re: [PATCH v3 4/5] KVM: arm64: Introduce find_reg_by_id()

2015-09-04 Thread Andre Przywara
es them both. > > Signed-off-by: Pavel Fedin <p.fe...@samsung.com> Reviewed-by: Andre Przywara <andre.przyw...@arm.com> > --- > arch/arm64/kvm/sys_regs.c | 22 +++--- > arch/arm64/kvm/sys_regs.h | 4 > 2 files changed, 19 insertions(+), 7 del

Re: [PATCH v3 5/5] KVM: arm64: Implement vGICv3 CPU interface access

2015-09-04 Thread Andre Przywara
Hi Pavel, On 04/09/15 13:40, Pavel Fedin wrote: > The access is done similar to GICv2, using KVM_DEV_ARM_VGIC_GRP_CPU_REGS > group, however attribute ID encodes corresponding system register. Access > size is always 64 bits. Why is this? Actually all registers in the CPU interface (except the

Re: [PATCH v2 1/5] KVM: arm/arm64: Refactor vGIC attributes handling code

2015-09-04 Thread Andre Przywara
Hi, On 04/09/15 16:11, Pavel Fedin wrote: > Hello! > >> Isn't the len parameter redundant here? I see that you don't initialize >> mmio.len (which is a bit scary, btw), so can't you just use that field? > > This was because of split below. I did not know about call_range_handler(), > and now

Re: [PATCH 2/2] arm/arm64: KVM: Improve kvm_exit tracepoint

2015-09-03 Thread Andre Przywara
Hi Christoffer, On 30/08/15 14:55, Christoffer Dall wrote: > The ARM architecture only saves the exit class to the HSR (ESR_EL2 for > arm64) on synchronous exceptions, not on asynchronous exceptions like an > IRQ. However, we only report the exception class on kvm_exit, which is > confusing

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

2015-09-02 Thread Andre Przywara
On 31/08/15 09:42, Eric Auger wrote: > On 08/24/2015 06:33 PM, Andre Przywara wrote: Salut Eric, ... >>>> @@ -1126,9 +1124,9 @@ static void vgic_queue_irq_to_lr(struct kvm_vcpu >>>> *vcpu, int irq, >>>> */ >>>> bool vgic_queue_i

Re: [PATCH 1/3] KVM: arm64: Implement vGICv3 distributor and redistributor access from userspace

2015-09-01 Thread Andre Przywara
Hi Pavel, ... >> diff --git a/virt/kvm/arm/vgic-v3-emul.c b/virt/kvm/arm/vgic-v3-emul.c >> index e661e7f..b3847e1 100644 >> --- a/virt/kvm/arm/vgic-v3-emul.c >> +++ b/virt/kvm/arm/vgic-v3-emul.c ... >> @@ -1000,40 +1102,95 @@ static void vgic_v3_destroy(struct kvm_device *dev) >>

Re: [PATCH v2 12/15] KVM: arm64: sync LPI configuration and pending tables

2015-08-25 Thread Andre Przywara
Hi Eric, On 14/08/15 12:58, Eric Auger wrote: On 07/10/2015 04:21 PM, Andre Przywara wrote: The LPI configuration and pending tables of the GICv3 LPIs are held in tables in (guest) memory. To achieve reasonable performance, we cache this data in our own data structures, so we need to sync

Re: [PATCH v2 11/15] KVM: arm64: handle pending bit for LPIs in ITS emulation

2015-08-25 Thread Andre Przywara
Hi Eric, On 14/08/15 12:58, Eric Auger wrote: On 07/10/2015 04:21 PM, Andre Przywara wrote: As the actual LPI number in a guest can be quite high, but is mostly assigned using a very sparse allocation scheme, bitmaps and arrays for storing the virtual interrupt status are a waste of memory

Re: [PATCH v2 12/15] KVM: arm64: sync LPI configuration and pending tables

2015-08-25 Thread Andre Przywara
Hi Eric, On 14/08/15 13:35, Eric Auger wrote: On 08/14/2015 01:58 PM, Eric Auger wrote: On 07/10/2015 04:21 PM, Andre Przywara wrote: The LPI configuration and pending tables of the GICv3 LPIs are held in tables in (guest) memory. To achieve reasonable performance, we cache this data in our

Re: [PATCH v2 08/15] KVM: arm64: introduce ITS emulation file with stub functions

2015-08-25 Thread Andre Przywara
Salut Eric, diff --git a/virt/kvm/arm/vgic-v3-emul.c b/virt/kvm/arm/vgic-v3-emul.c index 5269ad1..f5865e7 100644 --- a/virt/kvm/arm/vgic-v3-emul.c +++ b/virt/kvm/arm/vgic-v3-emul.c @@ -48,6 +48,7 @@ #include asm/kvm_mmu.h #include vgic.h +#include its-emul.h static bool

Re: [PATCH v2 09/15] KVM: arm64: implement basic ITS register handlers

2015-08-25 Thread Andre Przywara
Hi Eric, diff --git a/virt/kvm/arm/its-emul.c b/virt/kvm/arm/its-emul.c index 659dd39..b498f06 100644 --- a/virt/kvm/arm/its-emul.c +++ b/virt/kvm/arm/its-emul.c @@ -32,10 +32,62 @@ #include vgic.h #include its-emul.h +#define BASER_BASE_ADDRESS(x) ((x) 0xf000ULL) +

Re: [PATCH v2 10/15] KVM: arm64: add data structures to model ITS interrupt translation

2015-08-25 Thread Andre Przywara
Hi Eric, On 13/08/15 16:46, Eric Auger wrote: On 07/10/2015 04:21 PM, Andre Przywara wrote: The GICv3 Interrupt Translation Service (ITS) uses tables in memory to allow a sophisticated interrupt routing. It features device tables, an interrupt table per device and a table connecting

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 ITS case).

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 kvm_vcpu *vcpu);

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 confusing when adding another VGIC model

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 that emulate those MMIO

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 wrapper functions to iterate the linked

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 ID. This becomes possible to use KVM_SIGNAL_MSI

[PATCH 06/14] MIPS: use pseek() in ELF kernel image loading

2015-07-30 Thread Andre Przywara
Use the newly introduced pseek() function when skipping to the start offset in the ELF file. The layout of an ELF file should satisfy the constraints of pseek, so that we should be able to use a pipe file descriptor as well. Signed-off-by: Andre Przywara andre.przyw...@arm.com --- mips/kvm.c | 4

[PATCH 12/14] powerpc: use read_file() in kernel and initrd loading

2015-07-30 Thread Andre Przywara
Replace the unsafe read-loops in the powerpc kernel image loading function with our new and safe read_file() wrapper. This should fix random fails in kernel image loading, especially from pipes and sockets. Signed-off-by: Andre Przywara andre.przyw...@arm.com --- powerpc/kvm.c | 36

[PATCH 11/14] arm/arm64: use read_file() in kernel and initrd loading

2015-07-30 Thread Andre Przywara
Use the new read_file() wrapper in our arm/arm64 kernel image loading function instead of the private implementation. Signed-off-by: Andre Przywara andre.przyw...@arm.com --- arm/kvm.c | 42 -- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git

[PATCH 13/14] MIPS: use read wrappers in kernel loading

2015-07-30 Thread Andre Przywara
Replace the unsafe read-loops used in the MIPS kernel image loading with our safe read_file() and read_in_full() wrappers. This should fix random fails in kernel image loading, especially from pipes and sockets. Signed-off-by: Andre Przywara andre.przyw...@arm.com --- mips/kvm.c | 35

[PATCH 04/14] x86: support loading flat binary kernel images from a pipe

2015-07-30 Thread Andre Przywara
without using a seek, so kvmtool will happily accept any file descriptor (including pipes) for the image file. Signed-off-by: Andre Przywara andre.przyw...@arm.com --- x86/kvm.c | 48 +--- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/x86

[PATCH 01/14] Refactor kernel image loading

2015-07-30 Thread Andre Przywara
for MIPS as special cases for those architectures and rename the existing flat binary loader functions for the other architectures to the new name. Signed-off-by: Andre Przywara andre.przyw...@arm.com --- arm/fdt.c | 4 ++-- include/kvm/kvm.h | 5 ++--- kvm.c | 42

[PATCH 00/14] kvmtool: Refactor kernel image loading to allow pipes

2015-07-30 Thread Andre Przywara
architecture over to using the safe read wrappers. These patches apply on top of the latest kvmtool master branch. So far I could test arm, arm64 and x86, with MIPS and PowerPC being at least compile-tested. Cheers, Andre. Andre Przywara (14): Refactor kernel image loading arm/powerpc: remove

  1   2   3   4   5   6   7   >