Re: [PATCH v6 10/10] clocksource: arm_arch_timer: Remove arch_timer_get_timecounter

2016-04-11 Thread Daniel Lezcano
On Mon, Apr 11, 2016 at 04:33:00PM +0100, Julien Grall wrote: > The only call of arch_timer_get_timecounter (in KVM) has been removed. > > Signed-off-by: Julien Grall > Acked-by: Christoffer Dall > > --- > Cc: Daniel Lezcano

Re: [PATCH v6 02/10] clocksource: arm_arch_timer: Extend arch_timer_kvm_info to get the virtual IRQ

2016-04-11 Thread Daniel Lezcano
On Mon, Apr 11, 2016 at 04:32:52PM +0100, Julien Grall wrote: > Currently, the firmware table is parsed by the virtual timer code in > order to retrieve the virtual timer interrupt. However, this is already > done by the arch timer driver. > > To avoid code duplication, extend arch_timer_kvm_info

Re: [PATCH v6 01/10] clocksource: arm_arch_timer: Gather KVM specific information in a structure

2016-04-11 Thread Daniel Lezcano
On Mon, Apr 11, 2016 at 04:32:51PM +0100, Julien Grall wrote: > Introduce a structure which are filled up by the arch timer driver and > used by the virtual timer in KVM. > > The first member of this structure will be the timecounter. More members > will be added later. > > A stub for the new

[PATCH v6 10/10] clocksource: arm_arch_timer: Remove arch_timer_get_timecounter

2016-04-11 Thread Julien Grall
The only call of arch_timer_get_timecounter (in KVM) has been removed. Signed-off-by: Julien Grall Acked-by: Christoffer Dall --- Cc: Daniel Lezcano Cc: Thomas Gleixner Changes in v4:

[PATCH v6 00/10] arm64: Add support for KVM with ACPI

2016-04-11 Thread Julien Grall
Hello, This patch series allows KVM to work with ACPI on ARM64. Currently, the firmware tables are parsed by the the virtual timer and virtual GIC code in order to configure them correctly. However the parsing of these tables is already done in the GIC and arch timer drivers. This patch series

[PATCH v6 01/10] clocksource: arm_arch_timer: Gather KVM specific information in a structure

2016-04-11 Thread Julien Grall
Introduce a structure which are filled up by the arch timer driver and used by the virtual timer in KVM. The first member of this structure will be the timecounter. More members will be added later. A stub for the new helper isn't introduced because KVM requires the arch timer for both ARM64 and

[PATCH v6 07/10] irqchip/gic-v3: Parse and export virtual GIC information

2016-04-11 Thread Julien Grall
Fill up the recently introduced gic_kvm_info with the hardware information used for virtualization. Signed-off-by: Julien Grall Cc: Thomas Gleixner Cc: Jason Cooper Cc: Marc Zyngier --- Changes in v6:

[PATCH v6 08/10] KVM: arm/arm64: arch_timer: Rely on the arch timer to parse the firmware tables

2016-04-11 Thread Julien Grall
The firmware table is currently parsed by the virtual timer code in order to retrieve the virtual timer interrupt. However, this is already done by the arch timer driver. To avoid code duplication, use the newly function arch_timer_get_kvm_info() which return all the information required by the

[PATCH v6 03/10] irqchip/gic-v2: Gather ACPI specific data in a single structure

2016-04-11 Thread Julien Grall
The ACPI code requires to use global variables in order to collect information from the tables. For now, a single global variable is used, but more will be added in a subsequent patch. To make clear they are ACPI specific, gather all the information in a single structure. Signed-off-by: Julien

[PATCH v6 06/10] irqchip/gic-v3: Gather all ACPI specific data in a single structure

2016-04-11 Thread Julien Grall
The ACPI code requires to use global variables in order to collect information from the tables. To make clear those variables are ACPI specific, gather all of them in a single structure. Furthermore, even if some of the variables are not marked with __initdata, they are all only used during the

[PATCH v6 02/10] clocksource: arm_arch_timer: Extend arch_timer_kvm_info to get the virtual IRQ

2016-04-11 Thread Julien Grall
Currently, the firmware table is parsed by the virtual timer code in order to retrieve the virtual timer interrupt. However, this is already done by the arch timer driver. To avoid code duplication, extend arch_timer_kvm_info to get the virtual IRQ. Note that the KVM code will be modified in a

[PATCH v6 05/10] irqchip/gic-v3: Prefix all pr_* messages by "GICv3: "

2016-04-11 Thread Julien Grall
Currently, most of the pr_* messages in the GICv3 driver don't have a prefix. Add one to make clear where the messages come from. Signed-off-by: Julien Grall --- Changes in v6: - Patch added --- drivers/irqchip/irq-gic-v3.c | 2 ++ 1 file changed, 2

[PATCH v6 09/10] KVM: arm/arm64: vgic: Rely on the GIC driver to parse the firmware tables

2016-04-11 Thread Julien Grall
Currently, the firmware tables are parsed 2 times: once in the GIC drivers, the other time when initializing the vGIC. It means code duplication and make more tedious to add the support for another firmware table (like ACPI). Use the recently introduced helper gic_get_kvm_info() to get

[PATCH v6 04/10] irqchip/gic-v2: Parse and export virtual GIC information

2016-04-11 Thread Julien Grall
For now, the firmware tables are parsed 2 times: once in the GIC drivers, the other timer when initializing the vGIC. It means code duplication and make more tedious to add the support for another firmware table (like ACPI). Introduce a new structure and set of helpers to get/set the virtual GIC

Re: [PATCH v5 6/9] irqchip/gic-v3: Parse and export virtual GIC information

2016-04-11 Thread Shanker Donthineni
Hi Julien, On 04/11/2016 09:27 AM, Julien Grall wrote: > Hello Hanjun, > > On 11/04/16 06:27, Hanjun Guo wrote: >> On 2016/4/4 19:37, Julien Grall wrote: >>> +static void __init gic_acpi_setup_kvm_info(void) >>> +{ >>> +int irq; >>> + >>> +if (!gic_acpi_collect_virt_info()) { >>> +

Re: [RFC PATCH 45/45] KVM: arm/arm64: vgic-new: enable build

2016-04-11 Thread Andre Przywara
Hi, On 31/03/16 19:18, Christoffer Dall wrote: > On Fri, Mar 25, 2016 at 02:05:08AM +, Andre Przywara wrote: >> Now that the new VGIC implementation has reached feature parity with >> the old one, add the new files to the build system and add a Kconfig >> option to switch between the two

Re: [PATCH v5 6/9] irqchip/gic-v3: Parse and export virtual GIC information

2016-04-11 Thread Julien Grall
Hello Hanjun, On 11/04/16 06:27, Hanjun Guo wrote: On 2016/4/4 19:37, Julien Grall wrote: +static void __init gic_acpi_setup_kvm_info(void) +{ +int irq; + +if (!gic_acpi_collect_virt_info()) { +pr_warn("Unable to get hardware information used for virtualization\n"); +

Re: [PATCH v5 6/9] irqchip/gic-v3: Parse and export virtual GIC information

2016-04-11 Thread Julien Grall
On 09/04/16 03:29, Shanker Donthineni wrote: Hi Julien, Hello Shanker, On 04/04/2016 06:37 AM, Julien Grall wrote: +static int __init gic_acpi_parse_virt_madt_gicc(struct acpi_subtable_header *header, + const unsigned long end) +{ + struct

Re: [PATCH v5 4/9] irqchip/gic-v2: Parse and export virtual GIC information

2016-04-11 Thread Julien Grall
On 11/04/16 04:17, Hanjun Guo wrote: Hi Julian, Hi Hanjun, On 2016/4/4 19:37, Julien Grall wrote: @@ -1302,6 +1339,41 @@ static bool __init gic_validate_dist(struct acpi_subtable_header *header, #define ACPI_GICV2_DIST_MEM_SIZE(SZ_4K) #define ACPI_GIC_CPU_IF_MEM_SIZE(SZ_8K)

Re: [RFC PATCH 28/45] KVM: arm/arm64: vgic-new: Add GICv3 SGI system register trap handler

2016-04-11 Thread Andre Przywara
Hi, On 31/03/16 13:07, Christoffer Dall wrote: > On Fri, Mar 25, 2016 at 02:04:51AM +, Andre Przywara wrote: >> In contrast to GICv2 SGIs in a GICv3 implementation are not triggered >> by a MMIO write, but with a system register write. KVM knows about >> that register already, we just need to

Re: [RFC PATCH 24/45] KVM: arm/arm64: vgic-new: Add GICv3 CTLR, IIDR, TYPER handlers

2016-04-11 Thread Andre Przywara
Hi, On 31/03/16 12:53, Christoffer Dall wrote: > On Fri, Mar 25, 2016 at 02:04:47AM +, Andre Przywara wrote: >> As in the GICv2 emulation we handle those three registers in one >> function. >> >> Signed-off-by: Andre Przywara >> --- >> virt/kvm/arm/vgic/vgic.h |

Re: [RFC PATCH 23/45] KVM: arm/arm64: vgic-new: Add GICv3 emulation framework

2016-04-11 Thread Andre Przywara
Hi, On 31/03/16 12:48, Christoffer Dall wrote: > On Fri, Mar 25, 2016 at 02:04:46AM +, Andre Przywara wrote: >> Describe the GICv3 distributor and redistributor registers in our >> structure. This adds a special macro to deal with the split of >> SGI/PPI in the redistributor and SPIs in the

Re: [RFC PATCH 20/45] KVM: arm/arm64: vgic-new: Add TARGET registers handlers

2016-04-11 Thread Andre Przywara
On 31/03/16 12:31, Christoffer Dall wrote: > On Fri, Mar 25, 2016 at 02:04:43AM +, Andre Przywara wrote: >> Signed-off-by: Andre Przywara >> --- >> virt/kvm/arm/vgic/vgic_mmio.c | 43 >> ++- >> 1 file changed, 42 insertions(+),

Re: [PATCH] KVM: arm/arm64: Handle forward time correction gracefully

2016-04-11 Thread Tomasz Nowicki
On 06.04.2016 10:37, Marc Zyngier wrote: On a host that runs NTP, corrections can have a direct impact on the background timer that we program on the behalf of a vcpu. In particular, NTP performing a forward correction will result in a timer expiring sooner than expected from a guest point of

Re: [RFC PATCH 09/45] KVM: arm/arm64: vgic-new: Add GICv2 IRQ sync/flush

2016-04-11 Thread Andre Przywara
On 31/03/16 10:47, Christoffer Dall wrote: > On Fri, Mar 25, 2016 at 02:04:32AM +, Andre Przywara wrote: >> From: Marc Zyngier >> >> Implement the functionality for syncing IRQs between our emulation >> and the list registers, which represent the guest's view of IRQs. >>

Re: [RFC PATCH 16/45] KVM: arm/arm64: vgic-new: Add PENDING registers handlers

2016-04-11 Thread Andre Przywara
On 31/03/16 10:35, Christoffer Dall wrote: > On Fri, Mar 25, 2016 at 02:04:39AM +, Andre Przywara wrote: >> Signed-off-by: Andre Przywara >> --- >> virt/kvm/arm/vgic/vgic_mmio.c | 87 >> ++- >> 1 file changed, 85 insertions(+),

Re: [RFC PATCH 14/45] KVM: arm/arm64: vgic-new: Add CTLR, TYPER and IIDR handlers

2016-04-11 Thread Andre Przywara
On 31/03/16 10:27, Christoffer Dall wrote: > On Fri, Mar 25, 2016 at 02:04:37AM +, Andre Przywara wrote: >> Signed-off-by: Andre Przywara >> --- >> virt/kvm/arm/vgic/vgic.h | 3 +++ >> virt/kvm/arm/vgic/vgic_mmio.c | 49 >>

Re: [RFC PATCH 13/45] KVM: arm/arm64: vgic-new: Export register access interface

2016-04-11 Thread Andre Przywara
Hej, On 31/03/16 10:24, Christoffer Dall wrote: > On Fri, Mar 25, 2016 at 02:04:36AM +, Andre Przywara wrote: >> Userland can access the emulated GIC to save and restore its state >> for initialization or migration purposes. >> The kvm_io_bus API requires an absolute gpa, which does not fit

Re: [RFC PATCH 12/45] KVM: arm/arm64: vgic-new: Add MMIO handling framework

2016-04-11 Thread Andre Przywara
Hi Christoffer, On 31/03/16 10:08, Christoffer Dall wrote: > Hi Andre, > > [cc'ing Paolo here for his thoughts on the KVM IO bus framework] > > On Fri, Mar 25, 2016 at 02:04:35AM +, Andre Przywara wrote: >> We register each register group of the distributor and redistributors >> as separate