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

2017-05-04 Thread Auger Eric
Hi Christoffer, On 27/04/2017 16:45, Christoffer Dall wrote: > Hi Eric, > > On Thu, Apr 27, 2017 at 02:51:00PM +0200, Auger Eric wrote: >> On 27/04/2017 13:02, Christoffer Dall wrote: >>> On Thu, Apr 27, 2017 at 11:33:39AM +0200, Auger Eric wrote: On 27/04/2017 10:57, Christoffer Dall

Re: [PATCH 5/5] KVM: arm/arm64: Allow setting the timer IRQ numbers from userspace

2017-05-04 Thread Christoffer Dall
On Thu, May 04, 2017 at 10:34:32AM +0100, Marc Zyngier wrote: > On 03/05/17 19:33, Christoffer Dall wrote: > > First we define an ABI using the vcpu devices that lets userspace set > > the interrupt numbers for the various timers on both the 32-bit and > > 64-bit KVM/ARM implementations. > > > >

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

2017-05-04 Thread Christoffer Dall
On Thu, May 04, 2017 at 12:20:13AM +0200, Auger Eric wrote: > Hi, > > On 30/04/2017 23:10, Christoffer Dall wrote: > > On Fri, Apr 14, 2017 at 12:15:33PM +0200, Eric Auger wrote: > >> In its_sync_lpi_pending_table() we currently ignore the > >> target_vcpu of the LPIs. We sync the pending bit

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

2017-05-04 Thread Auger Eric
Hi Marc, On 04/05/2017 09:40, Marc Zyngier wrote: > On 04/05/17 08:00, Auger Eric wrote: >> Hi Christoffer, >> >> On 27/04/2017 16:45, Christoffer Dall wrote: >>> Hi Eric, >>> >>> On Thu, Apr 27, 2017 at 02:51:00PM +0200, Auger Eric wrote: On 27/04/2017 13:02, Christoffer Dall wrote: > On

Re: [PATCH 1/5] KVM: arm64: Allow creating the PMU without the in-kernel GIC

2017-05-04 Thread Christoffer Dall
On Thu, May 04, 2017 at 09:28:50AM +0100, Marc Zyngier wrote: > On 04/05/17 09:13, Christoffer Dall wrote: > > On Thu, May 04, 2017 at 09:09:47AM +0100, Marc Zyngier wrote: > >> On 03/05/17 19:32, Christoffer Dall wrote: > >>> Since we got support for devices in userspace which allows reporting

Re: [PATCH 1/5] KVM: arm64: Allow creating the PMU without the in-kernel GIC

2017-05-04 Thread Christoffer Dall
On Thu, May 04, 2017 at 10:05:43AM +0100, Marc Zyngier wrote: > On 04/05/17 09:38, Christoffer Dall wrote: > > On Thu, May 04, 2017 at 09:28:50AM +0100, Marc Zyngier wrote: > >> On 04/05/17 09:13, Christoffer Dall wrote: > >>> On Thu, May 04, 2017 at 09:09:47AM +0100, Marc Zyngier wrote: > On

Re: [PATCH 1/5] KVM: arm64: Allow creating the PMU without the in-kernel GIC

2017-05-04 Thread Marc Zyngier
On 03/05/17 19:32, Christoffer Dall wrote: > Since we got support for devices in userspace which allows reporting the > PMU overflow output status to userspace, we should actually allow > creating the PMU on systems without an in-kernel irqchip, which in turn > requires us to slightly clarify

Re: [PATCH 3/5] KVM: arm/arm64: Move irq_is_ppi() to header file

2017-05-04 Thread Marc Zyngier
On 03/05/17 19:32, Christoffer Dall wrote: > We are about to need this define in the arch timer code as well so move > it to a common location. > > Signed-off-by: Christoffer Dall > --- > include/kvm/arm_vgic.h | 2 ++ > virt/kvm/arm/pmu.c | 2 -- > 2 files changed, 2

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

2017-05-04 Thread Christoffer Dall
On Thu, May 04, 2017 at 09:40:35AM +0200, Auger Eric wrote: > Hi Christoffer, > > On 04/05/2017 09:31, Christoffer Dall wrote: > > On Wed, May 03, 2017 at 11:55:34PM +0200, Auger Eric wrote: > >> Hi Christoffer, > >> > >> On 03/05/2017 18:37, Christoffer Dall wrote: > >>> On Wed, May 03, 2017 at

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

2017-05-04 Thread Christoffer Dall
On Wed, May 03, 2017 at 11:55:34PM +0200, Auger Eric wrote: > Hi Christoffer, > > On 03/05/2017 18:37, Christoffer Dall wrote: > > On Wed, May 03, 2017 at 06:08:58PM +0200, Auger Eric wrote: > >> Hi Christoffer, > >> > >> On 30/04/2017 22:14, Christoffer Dall wrote: > >>> On Fri, Apr 14, 2017 at

Re: [PATCH 5/5] KVM: arm/arm64: Allow setting the timer IRQ numbers from userspace

2017-05-04 Thread Marc Zyngier
On 03/05/17 19:33, Christoffer Dall wrote: > First we define an ABI using the vcpu devices that lets userspace set > the interrupt numbers for the various timers on both the 32-bit and > 64-bit KVM/ARM implementations. > > Second, we add the definitions for the groups and attributes introduced >

Re: [PATCH v3 1/3] arm64: kvm: support kvmtool to detect RAS extension feature

2017-05-04 Thread James Morse
Hi Paolo, On 02/05/17 16:48, Paolo Bonzini wrote: > On 02/05/2017 09:56, Christoffer Dall wrote: >> The subject and description of these patches are also misleading. >> Hopefully this is in no way tied to kvmtool, but to userspace >> generically, for example also to be used by QEMU? > > Yes,

Re: [PATCH 1/5] KVM: arm64: Allow creating the PMU without the in-kernel GIC

2017-05-04 Thread Marc Zyngier
On 04/05/17 09:38, Christoffer Dall wrote: > On Thu, May 04, 2017 at 09:28:50AM +0100, Marc Zyngier wrote: >> On 04/05/17 09:13, Christoffer Dall wrote: >>> On Thu, May 04, 2017 at 09:09:47AM +0100, Marc Zyngier wrote: On 03/05/17 19:32, Christoffer Dall wrote: > Since we got support for

Re: [PATCH 1/5] KVM: arm64: Allow creating the PMU without the in-kernel GIC

2017-05-04 Thread Marc Zyngier
On 04/05/17 10:44, Christoffer Dall wrote: > On Thu, May 04, 2017 at 10:05:43AM +0100, Marc Zyngier wrote: >> On 04/05/17 09:38, Christoffer Dall wrote: >>> On Thu, May 04, 2017 at 09:28:50AM +0100, Marc Zyngier wrote: On 04/05/17 09:13, Christoffer Dall wrote: > On Thu, May 04, 2017 at

Re: [PATCH 1/5] KVM: arm64: Allow creating the PMU without the in-kernel GIC

2017-05-04 Thread Marc Zyngier
On 04/05/17 09:13, Christoffer Dall wrote: > On Thu, May 04, 2017 at 09:09:47AM +0100, Marc Zyngier wrote: >> On 03/05/17 19:32, Christoffer Dall wrote: >>> Since we got support for devices in userspace which allows reporting the >>> PMU overflow output status to userspace, we should actually

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

2017-05-04 Thread Auger Eric
Hi, On 04/05/2017 10:23, Christoffer Dall wrote: > On Thu, May 04, 2017 at 09:40:35AM +0200, Auger Eric wrote: >> Hi Christoffer, >> >> On 04/05/2017 09:31, Christoffer Dall wrote: >>> On Wed, May 03, 2017 at 11:55:34PM +0200, Auger Eric wrote: Hi Christoffer, On 03/05/2017 18:37,

[PATCH v6 11/24] KVM: arm64: vgic-its: Interpret MAPD Size field and check related errors

2017-05-04 Thread Eric Auger
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 eventid bits in the its_device and do the check on MAPTI. Also make sure the ITT size

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

2017-05-04 Thread Eric Auger
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 move its definition in the irqchip header. We restore the full length

[PATCH v6 04/24] arm/arm64: vgic: turn vgic_find_mmio_region into public

2017-05-04 Thread Eric Auger
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 regions. Signed-off-by: Eric Auger Reviewed-by: Andre Przywara

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

2017-05-04 Thread Eric Auger
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 supported ABIs (at the moment a single ABI is supported though). The following

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

2017-05-04 Thread Eric Auger
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 used and this must be less than or equal to the max revision KVM

[PATCH v6 13/24] KVM: arm64: vgic-its: Check the device id matches TYPER DEVBITS range

2017-05-04 Thread Eric Auger
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. Also check the collection ID belongs to the 16 bit range as GITS_TYPER CIL field equals to 0. Signed-off-by: Eric Auger

[PATCH v6 08/24] KVM: arm64: vgic-its: Implement vgic_mmio_uaccess_write_its_creadr

2017-05-04 Thread Eric Auger
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 --- v5 -> v6: - remove usage of update_64bit_reg and check alignment of cmd offset v4 -> v5: - keep

[PATCH v6 12/24] KVM: arm64: vgic-its: Interpret MAPD ITT_addr field

2017-05-04 Thread Eric Auger
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 --- v5 -> v6: - fix its_cmd_get_ittaddr and pass 44 to its_cmd_mask_field v4 -> v5: - its_cmd_get_ittaddr macro now returns

[PATCH v6 07/24] KVM: arm64: vgic-its: Implement vgic_its_has_attr_regs and attr_regs_access

2017-05-04 Thread Eric Auger
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 require to differentiate a guest write action from a user access. As such let's

Re: [PATCH v3 02/10] KVM: Add documentation for VCPU requests

2017-05-04 Thread Paolo Bonzini
On 03/05/2017 18:06, Andrew Jones wrote: > Signed-off-by: Andrew Jones > --- > Documentation/virtual/kvm/vcpu-requests.rst | 269 > I for one welcome our new reStructuredText overlords. :) Thanks for the excellent writeup. > 1 file changed,

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

2017-05-04 Thread Eric Auger
When creating the lpi we now ask the redistributor what is the state of the LPI (priority, enabled, pending). Signed-off-by: Eric Auger --- v6: creation --- virt/kvm/arm/vgic/vgic-its.c | 35 --- 1 file changed, 24 insertions(+), 11

Re: [PATCH 5/5] KVM: arm/arm64: Allow setting the timer IRQ numbers from userspace

2017-05-04 Thread Marc Zyngier
On 04/05/17 10:59, Christoffer Dall wrote: > On Thu, May 04, 2017 at 10:34:32AM +0100, Marc Zyngier wrote: >> On 03/05/17 19:33, Christoffer Dall wrote: >>> First we define an ABI using the vcpu devices that lets userspace set >>> the interrupt numbers for the various timers on both the 32-bit and

Re: [PATCH 1/5] KVM: arm64: Allow creating the PMU without the in-kernel GIC

2017-05-04 Thread Christoffer Dall
On Thu, May 04, 2017 at 11:16:57AM +0100, Marc Zyngier wrote: > On 04/05/17 10:44, Christoffer Dall wrote: > > On Thu, May 04, 2017 at 10:05:43AM +0100, Marc Zyngier wrote: > >> On 04/05/17 09:38, Christoffer Dall wrote: > >>> On Thu, May 04, 2017 at 09:28:50AM +0100, Marc Zyngier wrote: > On

Re: [PATCH 5/5] KVM: arm/arm64: Allow setting the timer IRQ numbers from userspace

2017-05-04 Thread Christoffer Dall
On Thu, May 04, 2017 at 11:54:06AM +0100, Marc Zyngier wrote: > On 04/05/17 10:59, Christoffer Dall wrote: > > On Thu, May 04, 2017 at 10:34:32AM +0100, Marc Zyngier wrote: > >> On 03/05/17 19:33, Christoffer Dall wrote: > >>> First we define an ABI using the vcpu devices that lets userspace set >

Re: [PATCH v3 08/10] KVM: arm/arm64: change exit request to sleep request

2017-05-04 Thread Paolo Bonzini
On 03/05/2017 18:06, Andrew Jones wrote: > -#define KVM_REQ_VCPU_EXIT \ > +#define KVM_REQ_SLEEP \ > KVM_ARCH_REQ_FLAGS(0, KVM_REQUEST_NO_WAKEUP | KVM_REQUEST_WAIT) Note that this is still like this in kvm/queue: #define KVM_REQ_VCPU_EXIT (8 | KVM_REQUEST_WAIT |

[PATCH v6 03/24] KVM: arm/arm64: vgic-its: rename itte into ite

2017-05-04 Thread Eric Auger
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 --- v5: Add Marc's A-b --- virt/kvm/arm/vgic/vgic-its.c | 148

[PATCH v6 00/24] vITS save/restore

2017-05-04 Thread Eric Auger
This series specifies and implements an API aimed at saving and restoring the state of the in-kernel emulated ITS device. The ITS is programmed through registers and tables. Those latter are allocated by the guest. Their base address is programmed in registers or table entries before the ITS is

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

2017-05-04 Thread Eric Auger
Add description for how to access ITS registers and how to save/restore ITS tables into/from memory. Signed-off-by: Eric Auger --- v5 -> v6: - add restoration ordering - 256B -> 256 Byte aligned - DTE Size is number of bits for the EVENTID - s/GITS_READR/GITS_CREADR v4

[PATCH v6 02/24] KVM: arm/arm64: Add GICV3 pending table save API documentation

2017-05-04 Thread Eric Auger
Add description for how to save GICV3 LPI pending bit into guest RAM pending tables. Signed-off-by: Eric Auger --- v5: creation --- Documentation/virtual/kvm/devices/arm-vgic-v3.txt | 6 ++ 1 file changed, 6 insertions(+) diff --git

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

2017-05-04 Thread Christoffer Dall
On Thu, May 04, 2017 at 01:44:29PM +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

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

2017-05-04 Thread Christoffer Dall
On Thu, May 04, 2017 at 01:44:27PM +0200, 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 require to

Re: [PATCH v6 08/24] KVM: arm64: vgic-its: Implement vgic_mmio_uaccess_write_its_creadr

2017-05-04 Thread Christoffer Dall
On Thu, May 04, 2017 at 01:44:28PM +0200, 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 > > --- > v5 -> v6: > - remove

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

2017-05-04 Thread Marc Zyngier
On 04/05/17 18:19, Christoffer Dall wrote: > On Thu, May 04, 2017 at 01:44:33PM +0200, 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. >> >> Also check the