Re: [PATCH v5 02/22] KVM: arm/arm64: Add GICV3 pending table save API documentation

2017-04-26 Thread Peter Maydell
On 26 April 2017 at 14:00, Christoffer Dall wrote: > Alternatively we should mark a pending error notification to the guest > in KVM, so that when the guest boots it gets something like an SError > instead, given that presumably the guest wrote the weird value. Except > of

Re: [PATCH v5 00/22] vITS save/restore

2017-04-26 Thread Christoffer Dall
Hi Prakash, On Wed, Apr 26, 2017 at 05:08:07PM +0530, Prakash B wrote: > Verified on Cavium ThunderX platform > Continousily migrated Guest more than 500 times b/w different hosts. > Please feel free to add Tested-by: Prakash, Brahmajyosyula > I appreciate

Re: [PATCH v5 02/22] KVM: arm/arm64: Add GICV3 pending table save API documentation

2017-04-26 Thread Christoffer Dall
On Wed, Apr 26, 2017 at 11:57:16AM +0200, Auger Eric wrote: > Hi Peter, Dave, > > On 26/04/2017 10:48, Dr. David Alan Gilbert wrote: > > * Peter Maydell (peter.mayd...@linaro.org) wrote: > >> On 26 April 2017 at 09:26, Auger Eric wrote: > >>> On 25/04/2017 12:43, Peter

Re: [PATCH v5 01/22] KVM: arm/arm64: Add ITS save/restore API documentation

2017-04-26 Thread Christoffer Dall
On Fri, Apr 14, 2017 at 12:15:13PM +0200, Eric Auger wrote: > Add description for how to access ITS registers and how to save/restore > ITS tables into/from memory. > > Signed-off-by: Eric Auger > > --- > v4 -> v5: > - take into account Christoffer's comments > - pending

Re: [PATCH v5 00/22] vITS save/restore

2017-04-26 Thread Prakash B
Verified on Cavium ThunderX platform Continousily migrated Guest more than 500 times b/w different hosts. Please feel free to add Tested-by: Prakash, Brahmajyosyula ___ kvmarm mailing list

Re: [PATCH v5 22/22] KVM: arm64: vgic-v3: KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > This patch adds a new attribute to GICV3 KVM device > KVM_DEV_ARM_VGIC_GRP_CTRL group. This Allows the userspace to > flush all GICR pending tables into guest RAM. At the moment > we do not offer any restore control as

Re: [PATCH v5 21/22] KVM: arm64: vgic-its: Fix pending table sync

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > In its_sync_lpi_pending_table() we currently ignore the > target_vcpu of the LPIs. We sync the pending bit found in > the vcpu pending table even if the LPI is not targeting it. > > Also in vgic_its_cmd_handle_invall() we

Re: [PATCH v5 20/22] KVM: arm64: vgic-its: Device table save/restore

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > This patch saves the device table entries into guest RAM. > Both flat table and 2 stage tables are supported. DeviceId > indexing is used. > > For each device listed in the device table, we also save > the translation

Re: [PATCH v5 19/22] KVM: arm64: vgic-its: ITT save and restore

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > Introduce routines to save and restore device ITT and their > interrupt table entries (ITE). > > The routines will be called on device table save and > restore. They will become static in subsequent patches. > >

Re: [PATCH v5 17/22] KVM: arm64: vgic-its: Collection table save/restore

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > The save path copies the collection entries into guest RAM > at the GPA specified in the BASER register. This obviously > requires the BASER to be set. The last written element is a > dummy collection table entry. > > We

Re: [PATCH v5 18/22] KVM: arm64: vgic-its: vgic_its_check_id returns the entry's GPA

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > As vgic_its_check_id() computes the device/collection entry's > GPA, let's return it so that new callers can retrieve it easily. > > Signed-off-by: Eric Auger Tested-by: Prakash, Brahmajyosyula

Re: [PATCH v5 16/22] KVM: arm64: vgic-its: Add infrastructure for table lookup

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > Add a generic lookup_table() helper whose role consists in > scanning a contiguous table located in guest RAM and applying > a callback on each entry. Entries can be handled as linked lists > since the callback may return

Re: [PATCH v5 15/22] KVM: arm64: vgic-its: vgic_its_alloc_ite/device

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > Add two new helpers to allocate an its ite and an its device. > This will avoid duplication on restore path. > > Signed-off-by: Eric Auger > Acked-by: Marc Zyngier Tested-by:

Re: [PATCH v5 14/22] KVM: arm64: vgic-its: KVM_DEV_ARM_ITS_SAVE/RESTORE_TABLES

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > Introduce new attributes in KVM_DEV_ARM_VGIC_GRP_CTRL group: > - KVM_DEV_ARM_ITS_SAVE_TABLES: saves the ITS tables into guest RAM > - KVM_DEV_ARM_ITS_RESTORE_TABLES: restores them into VGIC internal > structures. > > We

Re: [PATCH v5 13/22] KVM: arm64: vgic-its: Check the device id matches TYPER DEVBITS range

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > On MAPD we currently check the device id can be stored in the device table. > Let's first check it can be encoded within the range defined by TYPER > DEVBITS. > > Signed-off-by: Eric Auger

Re: [PATCH v5 12/22] KVM: arm64: vgic-its: Interpret MAPD ITT_addr field

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > Up to now the MAPD ITT_addr had been ignored. We will need it > for save/restore. Let's record it in the its_device struct. > > Signed-off-by: Eric Auger Tested-by: Prakash, Brahmajyosyula

Re: [PATCH v5 11/22] KVM: arm64: vgic-its: Interpret MAPD Size field and check related errors

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > Up to now the MAPD's ITT size field has been ignored. It encodes > the number of eventid bit minus 1. It should be used to check > the eventid when a MAPTI command is issued on a device. Let's > store the number of

Re: [PATCH v5 10/22] KVM: arm64: vgic-its: Implement vgic_mmio_uaccess_write_its_iidr

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > The GITS_IIDR revision field is used to encode the migration ABI > revision. So we need to restore it to check the table layout is > readable by the destination. > > By writing the IIDR, userspace thus force the ABI

Re: [PATCH v5 09/22] KVM: arm64: vgic-its: Introduce migration ABI infrastructure

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > We plan to support different migration ABIs, ie. characterizing > the ITS table layout format in guest RAM. Typically a new ABI will > be needed if vLPIs get supported for nested use case. > > So let's introduce an array

Re: [PATCH v5 08/22] KVM: arm64: vgic-its: Implement vgic_mmio_uaccess_write_its_creadr

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > GITS_CREADR needs to be restored so let's implement the associated > uaccess_write_its callback. The write only is allowed if the its > is disabled. > > Signed-off-by: Eric Auger Tested-by:

Re: [PATCH v5 07/22] KVM: arm64: vgic-its: Implement vgic_its_has_attr_regs and attr_regs_access

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > This patch implements vgic_its_has_attr_regs and vgic_its_attr_regs_access > upon the MMIO framework. VGIC ITS KVM device KVM_DEV_ARM_VGIC_GRP_ITS_REGS > group becomes functional. > > At least GITS_CREADR and GITS_IIDR

Re: [PATCH v5 06/22] KVM: arm/arm64: vgic: expose (un)lock_all_vcpus

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > We need to use those helpers in vgic-its.c so let's > expose them in the private vgic header. > > Signed-off-by: Eric Auger > Acked-by: Marc Zyngier Tested-by: Prakash,

Re: [PATCH v5 05/22] KVM: arm64: vgic-its: KVM_DEV_ARM_VGIC_GRP_ITS_REGS group

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > The ITS KVM device exposes a new KVM_DEV_ARM_VGIC_GRP_ITS_REGS > group which allows the userspace to save/restore ITS registers. > > At this stage the get/set/has operations are not yet implemented. > > Signed-off-by:

Re: [PATCH v5 04/22] arm/arm64: vgic: turn vgic_find_mmio_region into public

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > We plan to use vgic_find_mmio_region in vgic-its.c so let's > turn it into a public function. > > Also let's take the opportunity to rename the region parameter > into regions to emphasize this latter is an array of

Re: [PATCH v5 03/22] KVM: arm/arm64: vgic-its: rename itte into ite

2017-04-26 Thread Prakash B
On Fri, Apr 14, 2017 at 3:45 PM, Eric Auger wrote: > The actual abbreviation for the interrupt translation table entry > is ITE. Let's rename all itte instances by ite. > > Signed-off-by: Eric Auger > Acked-by: Marc Zyngier

Re: [PATCH v5 02/22] KVM: arm/arm64: Add GICV3 pending table save API documentation

2017-04-26 Thread Auger Eric
Hi Peter, Dave, On 26/04/2017 10:48, Dr. David Alan Gilbert wrote: > * Peter Maydell (peter.mayd...@linaro.org) wrote: >> On 26 April 2017 at 09:26, Auger Eric wrote: >>> On 25/04/2017 12:43, Peter Maydell wrote: When does the -EFAULT return happen? (if the guest

Re: [PATCH v5 02/22] KVM: arm/arm64: Add GICV3 pending table save API documentation

2017-04-26 Thread Dr. David Alan Gilbert
* Peter Maydell (peter.mayd...@linaro.org) wrote: > On 26 April 2017 at 09:26, Auger Eric wrote: > > On 25/04/2017 12:43, Peter Maydell wrote: > >> When does the -EFAULT return happen? (if the guest points GITS_BASER > >> etc at invalid memory, presumably?) > > > > Yes

Re: [PATCH v5 02/22] KVM: arm/arm64: Add GICV3 pending table save API documentation

2017-04-26 Thread Peter Maydell
On 26 April 2017 at 09:26, Auger Eric wrote: > On 25/04/2017 12:43, Peter Maydell wrote: >> When does the -EFAULT return happen? (if the guest points GITS_BASER >> etc at invalid memory, presumably?) > > Yes that's correct, when GICR_PENDBASER contains a bad GPA. > >> How

Re: [PATCH v5 02/22] KVM: arm/arm64: Add GICV3 pending table save API documentation

2017-04-26 Thread Auger Eric
Hi Peter, On 25/04/2017 12:43, Peter Maydell wrote: > On 14 April 2017 at 11:15, Eric Auger wrote: >> Add description for how to save GICV3 LPI pending bit into >> guest RAM pending tables. >> >> Signed-off-by: Eric Auger >> >> --- >> v5: creation