Re: [PATCH v3 7/8] arm64: exception: handle asynchronous SError interrupt

2017-05-08 Thread Xiongfeng Wang
Hi James, On 2017/5/9 1:27, James Morse wrote: > Hi Xiongfeng Wang, > > On 28/04/17 03:55, Xiongfeng Wang wrote: >> It is ok to just ignore the process following the ESB instruction in >> el0_sync, because the process will be sent SIGBUS signal. I don't understand. How will

Re: [PATCH 00/31] arm64: KVM: Mediate access to GICv3 sysregs at EL2

2017-05-08 Thread David Daney
On 05/03/2017 03:45 AM, Marc Zyngier wrote: [Apologies for posting this at the beginning of a merge window, but as this is a rather hot topic, I'd rather put it out as soon as possible] Some systems have less than perfect GICv3 implementations, leading to all kind of ugly issues (guest

Re: [PATCH V15 11/11] arm/arm64: KVM: add guest SEA support

2017-05-08 Thread Borislav Petkov
On Mon, May 08, 2017 at 01:54:44PM -0600, Baicar, Tyler wrote: > This was discussed in the v12 and v13 patch series. There is existing > code in kvm_handle_guest_abort for injecting an abort back into the > guest. We only want to do that if it was an abort that was not handled > by the firmware

Re: [PATCH V15 06/11] acpi: apei: handle SEA notification type for ARMv8

2017-05-08 Thread Baicar, Tyler
On 5/8/2017 11:28 AM, James Morse wrote: Hi Tyler, On 19/04/17 00:05, Tyler Baicar wrote: ARM APEI extension proposal added SEA (Synchronous External Abort) notification type for ARMv8. Add a new GHES error source handling function for SEA. If an error source's notification type is SEA, then

Re: [PATCH V15 11/11] arm/arm64: KVM: add guest SEA support

2017-05-08 Thread Baicar, Tyler
On 5/8/2017 11:40 AM, Borislav Petkov wrote: On Tue, Apr 18, 2017 at 05:05:23PM -0600, Tyler Baicar wrote: Currently external aborts are unsupported by the guest abort handling. Add handling for SEAs so that the host kernel reports SEAs which occur in the guest kernel. When an SEA occurs in

Re: [PATCH 7/8] KVM: arm/arm64: Register ITS iodev when setting base address

2017-05-08 Thread Christoffer Dall
On Mon, May 08, 2017 at 06:41:36PM +0100, Marc Zyngier wrote: > Hi Christoffer, > > On 08/05/17 12:54, Christoffer Dall wrote: > > We have to register the ITS iodevice before running the VM, because in > > migration scenarios, we may be restoring a live device that wishes to > > inject MSIs

Re: [PATCH v3 3/3] arm/arm64: signal SIBGUS and inject SEA Error

2017-05-08 Thread James Morse
Hi gengdongjiu, On 04/05/17 17:52, gengdongjiu wrote: > 2017-05-04 23:42 GMT+08:00 gengdongjiu : >> On 30/04/17 06:37, Dongjiu Geng wrote: >>> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c >>> index 105b6ab..a96594f 100644 >>> --- a/arch/arm/kvm/mmu.c >>> +++

Re: [PATCH v3 7/8] arm64: exception: handle asynchronous SError interrupt

2017-05-08 Thread James Morse
Hi Xiongfeng Wang, On 28/04/17 03:55, Xiongfeng Wang wrote: >>> >> It is ok to just ignore the process following the ESB instruction in >>> >> el0_sync, because the process will be sent SIGBUS signal. >> > >> > I don't understand. How will Linux know the process caused an error if we >> >

Re: [PATCH 8/8] KVM: arm/arm64: vgic-its: Cleanup after failed ITT restore

2017-05-08 Thread Auger Eric
Hi Christoffer, On 08/05/2017 13:54, Christoffer Dall wrote: > When failing to restore the ITT for a DTE, we should remove the failed > device entry from the list and free the object. > > We slightly refactor vgic_its_destroy to be able to reuse the now > separate vgic_its_free_dte() function. >

Re: [PATCH 4/8] KVM: arm/arm64: Make vgic_v3_check_base more broadly usable

2017-05-08 Thread Christoffer Dall
On Mon, May 08, 2017 at 06:13:01PM +0200, Auger Eric wrote: > Hi Christoffer, > > On 08/05/2017 13:54, Christoffer Dall wrote: > > As we are about to fiddle with the io device registration mechanism > > let's be a little more careful in verifying the addresses we can ealier > > on to provide

Re: [PATCH 7/8] KVM: arm/arm64: Register ITS iodev when setting base address

2017-05-08 Thread Auger Eric
Hi, On 08/05/2017 13:54, Christoffer Dall wrote: > We have to register the ITS iodevice before running the VM, because in > migration scenarios, we may be restoring a live device that wishes to > inject MSIs before we get a chance to run the VM. actually the VM is in running state but the vcpus

Re: [PATCH 5/8] KVM: arm/arm64: Slightly rework kvm_vgic_addr

2017-05-08 Thread Auger Eric
Hi Christoffer, On 08/05/2017 13:54, Christoffer Dall wrote: > As we are about to handle setting the address for the redistributor base > region separately from some of the other base addresses, let's rework > this function to leave a little more room for being flexible in what > each type of

Re: [PATCH 4/8] KVM: arm/arm64: Make vgic_v3_check_base more broadly usable

2017-05-08 Thread Auger Eric
Hi Christoffer, On 08/05/2017 13:54, Christoffer Dall wrote: > As we are about to fiddle with the io device registration mechanism > let's be a little more careful in verifying the addresses we can ealier > on to provide error messages to the user at time related to him/her > setting overlapping

Re: [PATCH 1/8] KVM: arm/arm64: Clarification and relaxation to ITS save/restore ABI

2017-05-08 Thread Auger Eric
Hi Christoffer, On 08/05/2017 13:54, Christoffer Dall wrote: > Clarify what is meant by the save/restore ABI only supporting virtual > physical interrupts. > > Relax the requirement of the order that the collection entries are > written in and be clear that there is no particular ordering

Re: [PATCH 2/8] KVM: arm/arm64: vgic: Rename kvm_vgic_vcpu_init to kvm_vgic_vcpu_enable

2017-05-08 Thread Auger Eric
Hi, On 08/05/2017 13:54, Christoffer Dall wrote: > This function really doesn't init anything, it enables the CPU > interface, so name it as such, which gives us the name to use for actual > init work later on. > > Signed-off-by: Christoffer Dall Reviewed-by: Eric Auger

Re: [PATCH 3/8] KVM: arm/arm64: Refactor vgic_register_redist_iodevs

2017-05-08 Thread Auger Eric
Hi Christoffer, On 08/05/2017 13:54, Christoffer Dall wrote: > Split out the function to register all the redistributor iodevs into a > function that handles a single redistributor at a time in preparation > for being able to call this per VCPU as these get created. > > Signed-off-by:

[PATCH 9/8] KVM: arm/arm64: Don't call map_resources when restoring ITS tables

2017-05-08 Thread Christoffer Dall
The only reason we called kvm_vgic_map_resources() when restoring the ITS tables was because we wanted to have the KVM iodevs registered in the KVM IO bus framework at the time when the ITS was restored such that a restored and active device can inject MSIs prior to otherwise calling

Re: [PATCH v7 16/24] KVM: arm64: vgic-its: KVM_DEV_ARM_ITS_SAVE/RESTORE_TABLES

2017-05-08 Thread Christoffer Dall
On Sat, May 06, 2017 at 05:24:35PM +0200, 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 hold the

Re: [PATCH v7 15/24] KVM: arm64: vgic-its: Read config and pending bit in add_lpi()

2017-05-08 Thread Christoffer Dall
On Sat, May 06, 2017 at 05:24:34PM +0200, Eric Auger wrote: > When creating the lpi we now ask the redistributor what is the state > of the LPI (priority, enabled, pending). > > Signed-off-by: Eric Auger > Reviewed-by: Christoffer Dall

Re: [PATCH v7 14/24] KVM: arm64: vgic-v3: vgic_v3_lpi_sync_pending_status

2017-05-08 Thread Christoffer Dall
On Sat, May 06, 2017 at 05:24:33PM +0200, Eric Auger wrote: > this new helper synchronizes the irq pending_latch > with the LPI pending bit status found in rdist pending table. > As the status is consumed, we reset the bit in pending table. > > As we need the PENDBASER_ADDRESS() in vgic-v3, let's

Re: [PATCH v7 10/24] KVM: arm64: vgic-its: Implement vgic_mmio_uaccess_write_its_iidr

2017-05-08 Thread Christoffer Dall
On Sat, May 06, 2017 at 05:24:29PM +0200, 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 forces the ABI revision to be >

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

2017-05-08 Thread Christoffer Dall
On Sat, May 06, 2017 at 05:24:28PM +0200, Eric Auger wrote: > We plan to support different migration ABIs, ie. characterizing > the ITS table layout format in guest RAM. For example, a new ABI > will be needed if vLPIs get supported for nested use case. > > So let's introduce an array of

[PATCH 0/8] Fixes to v7 of the vITS save/restore series

2017-05-08 Thread Christoffer Dall
We spotted a number of isses on the v7 ITS save/restore patch series, but because most of that patch series is in really good shape, and because the work discussed is somewhat orthogonal (the register iodevs in particular), I decided to send out a set of fixes to apply after the main ITS

[PATCH 7/8] KVM: arm/arm64: Register ITS iodev when setting base address

2017-05-08 Thread Christoffer Dall
We have to register the ITS iodevice before running the VM, because in migration scenarios, we may be restoring a live device that wishes to inject MSIs before we get a chance to run the VM. All we need to register the ITS io device is the base address of the ITS, so we can simply register that

[PATCH 6/8] KVM: arm/arm64: Register iodevs when setting redist base and creating VCPUs

2017-05-08 Thread Christoffer Dall
Instead of waiting with registering KVM iodevs until the very last VCPU is created, we can actually create the iodevs when the redist base address is set. The only downside is that we must now also check if we need to do this for VCPUs which are created after creating the VGIC, because there is

[PATCH 5/8] KVM: arm/arm64: Slightly rework kvm_vgic_addr

2017-05-08 Thread Christoffer Dall
As we are about to handle setting the address for the redistributor base region separately from some of the other base addresses, let's rework this function to leave a little more room for being flexible in what each type of base address does. Signed-off-by: Christoffer Dall

[PATCH 8/8] KVM: arm/arm64: vgic-its: Cleanup after failed ITT restore

2017-05-08 Thread Christoffer Dall
When failing to restore the ITT for a DTE, we should remove the failed device entry from the list and free the object. We slightly refactor vgic_its_destroy to be able to reuse the now separate vgic_its_free_dte() function. Signed-off-by: Christoffer Dall ---

[PATCH 3/8] KVM: arm/arm64: Refactor vgic_register_redist_iodevs

2017-05-08 Thread Christoffer Dall
Split out the function to register all the redistributor iodevs into a function that handles a single redistributor at a time in preparation for being able to call this per VCPU as these get created. Signed-off-by: Christoffer Dall --- virt/kvm/arm/vgic/vgic-mmio-v3.c | 108

[PATCH 4/8] KVM: arm/arm64: Make vgic_v3_check_base more broadly usable

2017-05-08 Thread Christoffer Dall
As we are about to fiddle with the io device registration mechanism let's be a little more careful in verifying the addresses we can ealier on to provide error messages to the user at time related to him/her setting overlapping addresses. We still want to check a consistent system before actually

[PATCH 2/8] KVM: arm/arm64: vgic: Rename kvm_vgic_vcpu_init to kvm_vgic_vcpu_enable

2017-05-08 Thread Christoffer Dall
This function really doesn't init anything, it enables the CPU interface, so name it as such, which gives us the name to use for actual init work later on. Signed-off-by: Christoffer Dall --- virt/kvm/arm/vgic/vgic-init.c | 8 ++-- 1 file changed, 2 insertions(+), 6

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

2017-05-08 Thread Christoffer Dall
On Sun, May 07, 2017 at 02:39:33PM +0100, Marc Zyngier wrote: > On Sat, May 06 2017 at 4:24:41 pm BST, Eric Auger > wrote: > > Implement routines to save and restore device ITT and their > > interrupt table entries (ITE). > > > > Signed-off-by: Eric Auger

Re: [PATCH v7 21/24] KVM: arm64: vgic-its: Device table save/restore

2017-05-08 Thread Christoffer Dall
On Sun, May 07, 2017 at 02:30:57PM +0100, Marc Zyngier wrote: > On Sat, May 06 2017 at 4:24:40 pm BST, 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. >

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

2017-05-08 Thread Christoffer Dall
On Mon, May 08, 2017 at 10:14:21AM +0100, Marc Zyngier wrote: > On 07/05/17 18:05, Auger Eric wrote: > > Hi Marc, > > > > On 07/05/2017 13:54, Marc Zyngier wrote: > >> On Sat, May 06 2017 at 4:24:20 pm BST, Eric Auger > >> wrote: > >>> Add description for how to access

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

2017-05-08 Thread Marc Zyngier
On 07/05/17 18:05, Auger Eric wrote: > Hi Marc, > > On 07/05/2017 13:54, Marc Zyngier wrote: >> On Sat, May 06 2017 at 4:24:20 pm BST, Eric Auger >> wrote: >>> Add description for how to access ITS registers and how to save/restore >>> ITS tables into/from memory. >>>

Re: [PATCH v3 09/10] KVM: arm/arm64: use vcpu requests for irq injection

2017-05-08 Thread Christoffer Dall
On Mon, May 08, 2017 at 10:48:57AM +0200, Paolo Bonzini wrote: > > > On 06/05/2017 20:49, Christoffer Dall wrote: > > On Thu, May 04, 2017 at 01:47:41PM +0200, Paolo Bonzini wrote: > >> > >> > >> On 03/05/2017 18:06, Andrew Jones wrote: > >>> Don't use request-less VCPU kicks when injecting

Re: [PATCH v3 09/10] KVM: arm/arm64: use vcpu requests for irq injection

2017-05-08 Thread Paolo Bonzini
On 06/05/2017 20:49, Christoffer Dall wrote: > On Thu, May 04, 2017 at 01:47:41PM +0200, Paolo Bonzini wrote: >> >> >> On 03/05/2017 18:06, Andrew Jones wrote: >>> Don't use request-less VCPU kicks when injecting IRQs, as a VCPU >>> kick meant to trigger the interrupt injection could be sent