Re: [Xen-devel] [PATCH 2/3 v3] xen: Add support for initializing 16550 UART using ACPI

2017-11-24 Thread Andre Przywara
Hi, (answering to both Konrad and Bhupinder ...) On 24/11/17 13:50, Konrad Rzeszutek Wilk wrote: > On Fri, Nov 24, 2017 at 05:09:11PM +0530, Bhupinder Thakur wrote: >> Currently, Xen supports only DT based initialization of 16550 UART. >> This patch adds support for initializing 16550 UART using

Re: [Xen-devel] [PATCH] arm64: ITS: fix cacheability adjustment

2017-11-28 Thread Andre Przywara
Hi, On 16/11/17 12:02, Andre Przywara wrote: > If the host GICv3 redistributor reports that the pending table cannot > use shareable memory, we try to drop the cacheability attributes as > well. However we fail horribly in doing computer science 101 bit > masking, effectively cleari

Re: [Xen-devel] [PATCH 1/2] gnttab: correct GNTTABOP_cache_flush empty batch handling

2017-12-01 Thread Andre Przywara
-by: Jann Horn > Signed-off-by: Jan Beulich Took me a while to wrap my head around it, because the actual fix is just the "*cur_ref = 0;" line, I think. But this looks correct to me. Signed-off-by: Andre Przywara > --- a/xen/common/grant_table.c > +++ b/xen/common/gr

Re: [Xen-devel] [PATCH 2/2] gnttab: improve GNTTABOP_cache_flush locking

2017-12-01 Thread Andre Przywara
ince there is only one caller, this might be overkill, though. > Signed-off-by: Jan Beulich Reviewed-by: Andre Przywara Cheers, Andre. > > --- a/xen/common/grant_table.c > +++ b/xen/common/grant_table.c > @@ -786,10 +786,10 @@ static int _set_status(unsigned gt_versi >

Re: [Xen-devel] [RFC PATCH 04/31] cpufreq: make turbo settings to be configurable

2017-12-04 Thread Andre Przywara
Hi, > And the most important question is how to recognize in Xen on ARM > (using SCPI protocol) which frequencies are turbo-frequencies > actually? I couldn't find any information regarding that in protocol > description. So traditionally on ARM there is no notion of a "turbo" frequency. Th

Re: [Xen-devel] [PATCH 1/2] gnttab: correct GNTTABOP_cache_flush empty batch handling

2017-12-04 Thread Andre Przywara
r of argument checks: >>> We shouldn't accept zero-length elements with unknown bits set in "op". >>> Also constify cache_flush()'s first parameter. >>> >>> Reported-by: Jann Horn >>> Signed-off-by: Jan Beulich >> >> Took me

Re: [Xen-devel] [PATCH 03/12] ARM: VGIC: remove gic_clear_pending_irqs()

2017-12-06 Thread Andre Przywara
Hi, On 10/11/17 16:42, Andre Przywara wrote: > Hi, > > On 26/10/17 01:14, Stefano Stabellini wrote: >> On Thu, 19 Oct 2017, Andre Przywara wrote: >>> gic_clear_pending_irqs() was not only misnamed, but also misplaced, as >>> a function solely dealing with the

Re: [Xen-devel] [PATCH 05/12] ARM: VGIC: move gic_remove_from_lr_pending()

2017-12-06 Thread Andre Przywara
Hi, On 26/10/17 01:20, Stefano Stabellini wrote: > On Thu, 19 Oct 2017, Andre Przywara wrote: >> gic_remove_from_lr_pending() was not only misnamed, it also had the wrong >> abstraction, as it should not live in gic.c. >> Move it into vgic.c and vgic.h, where it belongs,

Re: [Xen-devel] [PATCH 07/12] ARM: VGIC: split gic.c to observe hardware/virtual GIC separation

2017-12-06 Thread Andre Przywara
Hi, On 26/10/17 01:37, Stefano Stabellini wrote: > On Thu, 19 Oct 2017, Andre Przywara wrote: >> Currently gic.c holds code to handle hardware IRQs as well as code to >> bridge VGIC requests to the GIC virtualization hardware. > > That is true, however, I don't ne

[Xen-devel] [PATCH v2 03/10] ARM: VGIC: move gic_remove_irq_from_queues()

2017-12-07 Thread Andre Przywara
gic_remove_irq_from_queues() was not only misnamed, it also has the wrong abstraction, as it should not live in gic.c. Move it into vgic.c and vgic.h, where it belongs to, and rename it on the way. Signed-off-by: Andre Przywara Reviewed-by: Stefano Stabellini --- xen/arch/arm/gic.c

[Xen-devel] [PATCH v2 07/10] ARM: VGIC: rework events_need_delivery()

2017-12-07 Thread Andre Przywara
In event.h we very deeply dive into the VGIC to learn if an event for a guest is pending. Rework that function to abstract the VGIC specific part out. Also reorder the queries there, as we only actually need to check for the event channel if there are no other pending IRQs. Signed-off-by: Andre

[Xen-devel] [PATCH v2 06/10] ARM: VGIC: split up gic_dump_info() to cover virtual part separately

2017-12-07 Thread Andre Przywara
Currently gic_dump_info() not only dumps the hardware state of the GIC, but also the VGIC internal virtual IRQ lists. Split the latter off and move it into gic-vgic.c to observe the abstraction. Signed-off-by: Andre Przywara --- xen/arch/arm/domain.c | 1 + xen/arch/arm/gic-vgic.c | 11

[Xen-devel] [PATCH v2 00/10] ARM: VGIC/GIC separation cleanups

2017-12-07 Thread Andre Przywara
ll be addressed later. Andre Przywara (10): ARM: remove unneeded gic.h inclusions ARM: vGIC: fix nr_irq definition ARM: VGIC: move gic_remove_irq_from_queues() ARM: VGIC: streamline gic_restore_pending_irqs() ARM: VGIC: split gic.c to observe hardware/virtual GIC separation ARM:

[Xen-devel] [PATCH v2 09/10] ARM: VGIC: factor out vgic_get_hw_irq_desc()

2017-12-07 Thread Andre Przywara
At the moment we happily access the VGIC internal struct pending_irq (which describes a virtual IRQ) in irq.c. Factor out the actually needed functionality to learn the associated hardware IRQ and move that into gic-vgic.c to improve abstraction. Signed-off-by: Andre Przywara Acked-by: Stefano

[Xen-devel] [PATCH v2 04/10] ARM: VGIC: streamline gic_restore_pending_irqs()

2017-12-07 Thread Andre Przywara
-off-by: Andre Przywara --- xen/arch/arm/domain.c | 1 + xen/arch/arm/gic.c| 11 +-- xen/arch/arm/traps.c | 2 +- xen/include/asm-arm/gic.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index

[Xen-devel] [PATCH v2 02/10] ARM: vGIC: fix nr_irq definition

2017-12-07 Thread Andre Przywara
as a local variable name or as a function parameter. Drop the optimization and make nr_irqs a normal variable for ARM also. Signed-off-by: Andre Przywara Reviewed-by: Stefano Stabellini --- xen/arch/arm/irq.c| 2 ++ xen/include/asm-arm/irq.h | 2 +- 2 files changed, 3 insertions(+), 1 del

[Xen-devel] [PATCH v2 01/10] ARM: remove unneeded gic.h inclusions

2017-12-07 Thread Andre Przywara
actually not needed. Signed-off-by: Andre Przywara Reviewed-by: Stefano Stabellini --- xen/arch/arm/domain_build.c | 1 - xen/arch/arm/p2m.c | 1 - xen/arch/arm/platforms/vexpress.c| 1 - xen/arch/arm/platforms/xgene-storm.c | 1 - xen/arch/arm/time.c

[Xen-devel] [PATCH v2 05/10] ARM: VGIC: split gic.c to observe hardware/virtual GIC separation

2017-12-07 Thread Andre Przywara
separate file, so that gic.c does what is says on the tin. Signed-off-by: Andre Przywara --- xen/arch/arm/Makefile | 1 + xen/arch/arm/gic-vgic.c | 413 xen/arch/arm/gic.c | 366 +- 3 files changed, 416

[Xen-devel] [PATCH v2 10/10] ARM: VGIC: rework gicv[23]_update_lr to not use pending_irq

2017-12-07 Thread Andre Przywara
The functions to actually populate a list register were accessing the VGIC internal pending_irq struct, although they should be abstracting from that. Break the needed information down to remove the reference to pending_irq from gic-v[23].c. Signed-off-by: Andre Przywara --- xen/arch/arm/gic-v2

[Xen-devel] [PATCH v2 08/10] ARM: VGIC: factor out vgic_connect_hw_irq()

2017-12-07 Thread Andre Przywara
said accesses to VGIC data structures and improves abstraction. Signed-off-by: Andre Przywara Acked-by: Stefano Stabellini --- xen/arch/arm/gic-vgic.c| 31 +++ xen/arch/arm/gic.c | 42 ++ xen/include/asm-arm/vgic.h | 2

Re: [Xen-devel] [PATCH 12/12] ARM: VGIC: rework gicv[23]_update_lr to not use pending_irq

2017-12-07 Thread Andre Przywara
Hi, On 26/10/17 09:28, Julien Grall wrote: > Hi Andre, > > On 10/19/2017 01:48 PM, Andre Przywara wrote: >> The functions to actually populate a list register were accessing >> the VGIC internal pending_irq struct, although they should be abstracting >> from that. >

Re: [Xen-devel] [RFC] xen/arm: Handling cache maintenance instructions by set/way

2017-12-11 Thread Andre Przywara
Hi, On 08/12/17 10:56, George Dunlap wrote: > On 12/07/2017 07:21 PM, Marc Zyngier wrote: >> On 07/12/17 18:06, George Dunlap wrote: >>> On 12/07/2017 04:58 PM, Marc Zyngier wrote: On 07/12/17 16:44, George Dunlap wrote: > On 12/07/2017 04:04 PM, Julien Grall wrote: >> Hi Jan, >>

Re: [Xen-devel] [PATCH] xen/arm: Black list everything with a PPI

2019-05-16 Thread Andre Przywara
On Thu, 16 May 2019 17:15:36 +0530 Amit Tomer wrote: Hi, > Thanks for having a look at it. > > On Thu, May 16, 2019 at 12:25 AM Oleksandr wrote: > > > > > > On 03.05.19 20:02, Amit Singh Tomar wrote: > > > > Hi, Amit > > > > > XEN should not forward PPIs to Dom0 as it only support SPIs. > >

Re: [Xen-devel] [PATCH v2] gic: drop interrupts enabling on interrupts processing

2019-05-31 Thread Andre Przywara
On Tue, 28 May 2019 18:07:19 +0100 Julien Grall wrote: [ ... ] > While looking at the code, I noticed that in the new vgic vgic_get_irq() > looks unsafe to be called with interrupt unmasked. This is because one > of the callee (vgic_get_lpi()) takes a spinlock and not a spinlock_irq. > Andre,

Re: [Xen-devel] [PATCH v2] gic: drop interrupts enabling on interrupts processing

2019-05-31 Thread Andre Przywara
On Fri, 31 May 2019 18:16:52 +0100 Julien Grall wrote: > Hi, > > On 30/05/2019 17:14, Andrii Anisov wrote: > > > > > > On 29.05.19 18:32, Julien Grall wrote: > >>> BTW, do you hear about plans for the new vgic? Some time ago it was said > >>> that > >>> new vgic implementation going to rep

Re: [Xen-devel] [PATCH v2 for-4.12] gic-vgic: fix an assert condition

2019-01-28 Thread Andre Przywara
; disconnection on debug builds. > > Fixes: ec2a2f1 ("ARM: VGIC: factor out vgic_connect_hw_irq()") > Signed-off-by: Andrii Anisov > Suggested-by: Stefan Nuernberger Reviewed-by: Andre Przywara Cheers, Andre. > --- > in v2: > - updated condition as suggeste

Re: [Xen-devel] [PATCH v2 1/2] ns16550: Add compatible string for Raspberry Pi 4

2019-07-29 Thread Andre Przywara
8250/16550 driver for the aux UART [2]. > > Unfortunately the brcm,bcm2835-aux-uart device tree binding doesn't > have the reg-shift and reg-io-width properties [3]. Thus, the reg-shift > and reg-io-width properties are inherent properties of this UART. > > Thanks to Andre Przywa

Re: [Xen-devel] [RFC 5/6] arm64: call enter_hypervisor_head only when it is needed

2019-07-31 Thread Andre Przywara
On Wed, 31 Jul 2019 12:02:20 +0100 Julien Grall wrote: Hi, > On 30/07/2019 18:35, Andrii Anisov wrote: > > > > On 26.07.19 13:59, Julien Grall wrote: > >> Hi, > >> > >> On 26/07/2019 11:37, Andrii Anisov wrote: > >>> From: Andrii Anisov > >>> > >>> On ARM64 we know exactly if trap happened

Re: [Xen-devel] [PATCH v2 0/2] Raspberry Pi 4 support

2019-07-31 Thread Andre Przywara
On Mon, 29 Jul 2019 09:19:18 -0400 Stewart Hildebrand wrote: Hi, > This is a series to enable UART console for Raspberry Pi 4. Note that I'm > relying on the firmware to initialize the UART (i.e. enable_uart=1 in > config.txt), since full UART initialization on this platform requires > access

Re: [Xen-devel] [PATCH] xen/arm: Blacklist PMU with "arm, cortex-a53-pmu"

2019-04-15 Thread Andre Przywara
On Mon, 15 Apr 2019 13:41:41 +0530 Amit Tomer wrote: > Hello, > > > After talking via IRC, the problem is PPIs, that this platform uses for > > PMU interrupts. When Xen tries to setup the IRQ forwarding for Dom0 for > > this device, it fails because it only supports forwarding SPIs. > > So inter

Re: [Xen-devel] [PATCH] xen/arm: Basic support for sunxi/sun50i h6 platform.

2019-12-03 Thread Andre Przywara
e memory map, they missed the opportunity to put each device at least in their own 4K page. Reviewed-by: Andre Przywara If you can wait till this evening, I can even test it. It's actually a shame that we need this enumeration, when all we are after is an answer to the question: Does a d

Re: [Xen-devel] [PATCH] xen/arm: Basic support for sunxi/sun50i h6 platform.

2019-12-04 Thread Andre Przywara
On Tue, 3 Dec 2019 16:52:45 + Julien Grall wrote: Hi, > On 03/12/2019 14:38, Andre Przywara wrote: > > On Tue, 3 Dec 2019 11:39:58 + > > Julien Grall wrote: > > > > Hi, > > > >> (+Andre) > >> > >> Hi, > >> >

Re: [Xen-devel] [PATCH] arch: arm: vgic-v3: fix GICD_ISACTIVER range

2019-11-12 Thread Andre Przywara
On Mon, 11 Nov 2019 11:01:07 -0800 (PST) Stefano Stabellini wrote: Hi, > On Sat, 9 Nov 2019, Julien Grall wrote: > > On Sat, 9 Nov 2019, 04:27 Stefano Stabellini, > > wrote: > > On Thu, 7 Nov 2019, Peng Fan wrote: > > > The end should be GICD_ISACTIVERN not GICD_ISACTIVER. > >

Re: [Xen-devel] [RFC 00/16] Old GIC (gic-vgic) optimizations for GICV2

2018-11-29 Thread Andre Przywara
On Thu, 29 Nov 2018 07:40:00 + Andrii Anisov wrote: > Hello, > > Again, I sent this cover letter only to myself. So, here it is, hope > it does not break the thread. Sorry for the mess. > > > From: Andrii Anisov > Sent: Wednesday, November 28, 2018 11:31 PM > Cc: Andrii Anisov > Subject:

Re: [Xen-devel] [RFC 02/16] hack: drop GIC v3 support

2018-11-29 Thread Andre Przywara
On Wed, 28 Nov 2018 23:31:57 +0200 Andrii Anisov wrote: Hi, > From: Andrii Anisov > > This reduces some code and conditions in an IRQ processing path, > and opens way to further code reduction. While I understand that this is some sort of a hack, I am commenting just on this patch to demonstr

Re: [Xen-devel] [RFC 10/16] gic:vgic:gic-vgic: introduce non-atomic bitops

2018-11-29 Thread Andre Przywara
On Wed, 28 Nov 2018 23:32:05 +0200 Andrii Anisov wrote: Hi, > From: Andrii Anisov > > All bit operations for gic, vgic and gic-vgic are performed under > spinlocks, so there is no need for atomic bit ops here, they only > introduce excessive call to functions used more expensive exclusive > AR

Re: [Xen-devel] [PATCH 1/4] xen/arm: gic: Ensure we have an ISB between ack and do_IRQ()

2018-12-03 Thread Andre Przywara
On 30/11/2018 19:52, Andrii Anisov wrote: > Hello Andre, > > Please see my comments below: > > On 23.11.18 14:18, Andre Przywara wrote: >> Fundamentally there is a semantic difference between edge and level >> triggered IRQs: When the guest has handled an *edge* IRQ

Re: [Xen-devel] [RFC 10/16] gic:vgic:gic-vgic: introduce non-atomic bitops

2018-12-03 Thread Andre Przywara
On Mon, 3 Dec 2018 14:33:08 +0200 Andrii Anisov wrote: Hi Andrii, > On 29.11.18 14:14, Andre Przywara wrote: > > Nah, please don't do this. > Sorry for making you crying looking at this code. > It's terrible, I know. It's rather an idea. > > >

Re: [Xen-devel] [PATCH] ARM: new VGIC: evtchn: fix potential race in vcpu_mark_events_pending()

2018-04-04 Thread Andre Przywara
Hi, On 04/04/18 01:04, Stefano Stabellini wrote: > On Tue, 3 Apr 2018, Julien Grall wrote: >> On 29/03/18 18:35, Stefano Stabellini wrote: >>> On Thu, 29 Mar 2018, Andre Przywara wrote: >>>> Stefano pointed out the following situation: >>>> --

Re: [Xen-devel] [PATCH v2 2/2] xen/arm: Add Marvell ARMADA 3700 early printk support

2018-04-04 Thread Andre Przywara
Hi, On 03/04/18 14:49, Amit Singh Tomar wrote: > Signed-off-by: Amit Singh Tomar > --- > Changes since v1: > * Removed header file dependency. > > --- > docs/misc/arm/early-printk.txt | 1 + > xen/arch/arm/Rules.mk | 1 + > xen/arch/arm/arm64/debug-mvebu.inc

Re: [Xen-devel] [PATCH v2 2/2] xen/arm: Add Marvell ARMADA 3700 early printk support

2018-04-04 Thread Andre Przywara
Hi, one more thing ... On 04/04/18 16:34, Andre Przywara wrote: > Hi, > > On 03/04/18 14:49, Amit Singh Tomar wrote: >> diff --git a/xen/arch/arm/arm64/debug-mvebu.inc >> b/xen/arch/arm/arm64/debug-mvebu.inc >> new file mode 100644 >> index 000..ac48

Re: [Xen-devel] [PATCH v2 1/2] xen/arm: Add MVEBU UART driver for Marvell Armada 3700 SoC

2018-04-04 Thread Andre Przywara
Hi, On 03/04/18 14:49, Amit Singh Tomar wrote: > This patch adds driver for UART controller found on Armada 3700 SoC. > > There is no reference manuals available for 3700 SoC in public and it > is derived by looking at Linux driver[1]. > > [1]https://github.com/torvalds/linux/blob/master/drivers

Re: [Xen-devel] [PATCH v3 2/2] xen/arm: Add Marvell ARMADA 3700 early printk support

2018-04-05 Thread Andre Przywara
Hi, On 05/04/18 11:16, Amit Singh Tomar wrote: > Signed-off-by: Amit Singh Tomar Reviewed-by: Andre Przywara Cheers, Andre. > --- > Changes since v2: > * Addressed Andre's comments. > Changes since v1: > * Removed header file dependency. > --- > d

Re: [Xen-devel] [PATCH v3 1/2] xen/arm: Add MVEBU UART driver for Marvell Armada 3700 SoC

2018-04-05 Thread Andre Przywara
gt; +{ > +struct mvebu3700_uart *uart = port->uart; > +uint32_t reg; > + > +reg = mvebu3700_read(uart, UART_CTRL_REG); > + reg &= ~CTRL_TX_RDY_INT; > +mvebu3700_write(uart, UART_CTRL_REG, reg); > +} > + > +static void mvebu3700_uart_start_tx(stru

Re: [Xen-devel] [PATCH v4] xen/arm: Add MVEBU UART driver for Marvell Armada 3700 SoC

2018-04-06 Thread Andre Przywara
/linux/blob/master/drivers/tty/serial/mvebu-uart.c > commit-id: c685af1108d7c303f0b901413405d68eaeac4477 > > Signed-off-by: Amit Singh Tomar Reviewed-by: Andre Przywara Tested-by: Andre Przywara Cheers, Andre. > --- > Changes since v3: > * Dropped uart->irq >

Re: [Xen-devel] [PATCH] xen: char: Remove unnecessary (uart->irq > 0) check

2018-04-30 Thread Andre Przywara
Hi, On 28/04/18 10:08, Amit Singh Tomar wrote: > While working on MVEBU uart driver, Julien pointed out that (uart->irq > 0) > check is unnecessary during irq set up.if ever there is an invalid irq, driver > initialization itself would be bailed out from platform_get_irq. > > This patch would rem

[Xen-devel] [PATCH 04/57] ARM: GICv3: simplify GICv3 redistributor stride handling

2018-03-05 Thread Andre Przywara
Instead of hard coding the architected redistributor stride into the code, lets use a clear #define to the two values for GICv3 and GICv4 and clarify the algorithm to determine the needed stride value. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - no changes xen/arch/arm/gic-v3.c

[Xen-devel] [PATCH 09/57] ARM: VGIC: Move domain_max_vcpus() to be VGIC specific

2018-03-05 Thread Andre Przywara
structures. Move this function into vgic.c, to keep this VGIC internal. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - dump previous approach, move function to VGIC specific file instead xen/arch/arm/domain.c | 14 -- xen/arch/arm/vgic.c | 14 ++ 2 files changed, 14

[Xen-devel] [PATCH 00/57] New VGIC(-v2) implementation

2018-03-05 Thread Andre Przywara
esses - use interface for HCR bit changes - iterate over set CPU bits in SGI injection handler Andre Przywara (57): tools: ARM: vGICv3: Avoid inserting optional DT properties ARM: vGICv3: clarify on GUEST_GICV3_RDIST_REGIONS symbol ARM: GICv3: use hardware GICv3 redistributor values for

[Xen-devel] [PATCH 12/57] ARM: VGIC: carve out struct vgic_cpu and struct vgic_dist

2018-03-05 Thread Andre Przywara
definition of these embedded structures into vgic.h, and just use the opaque type in the arch specific structures. This allows easy switching between different implementations later. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - No changes xen/include/asm-arm/domain.h | 85

[Xen-devel] [PATCH 13/57] ARM: VGIC: reorder prototypes in vgic.h

2018-03-05 Thread Andre Przywara
Currently vgic.h both contains prototypes used by Xen arch code outside of the actual VGIC (for instance vgic_vcpu_inject_irq()), and prototypes for functions used by the VGIC internally. Group them to later allow an easy split with one #ifdef. Signed-off-by: Andre Przywara Reviewed-by: Julien

[Xen-devel] [PATCH 18/57] ARM: GICv2: introduce gicv2_poke_irq()

2018-03-05 Thread Andre Przywara
: Andre Przywara --- Changelog RFC ... v1: - new patch xen/arch/arm/gic-v2.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c index 7938a42591..618dd94120 100644 --- a/xen/arch/arm/gic-v2.c +++ b/xen/arch/arm/gic-v2.c

[Xen-devel] [PATCH 22/57] ARM: GIC: Allow tweaking the active and pending state of an IRQ

2018-03-05 Thread Andre Przywara
state of an associated hardware IRQ. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - use struct irq_desc* in the interface (instead of just the IRQ number) - add set_pending_state() (needed later) xen/arch/arm/gic-v2.c | 32 xen/arch/arm/gic-v3.c

[Xen-devel] [PATCH 01/57] tools: ARM: vGICv3: Avoid inserting optional DT properties

2018-03-05 Thread Andre Przywara
don't need to describe them if they don't differ from the default values. This will always be the case for our constructed DomU memory map. So we drop those properties altogether and provide a clean and architected GICv3 DT node for DomUs. Signed-off-by: Andre Przywara --- Changelog

[Xen-devel] [PATCH 30/57] ARM: new VGIC: Add IRQ sorting

2018-03-05 Thread Andre Przywara
clude file, nothing has been changed in this code. This is based on Linux commit 8e4447457965, written by Christoffer Dall. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - use Linux coding style for list_sort.c xen/arch/arm/vgic/vgic.c| 59 + xen/common/list_s

[Xen-devel] [PATCH 34/57] ARM: new VGIC: Add MMIO handling framework

2018-03-05 Thread Andre Przywara
Marc Zyngier. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - adapt to former changes - whitespace fixes - use C99 data types - drop unneeded regions support (ITS, CPU i/f) xen/arch/arm/vgic/vgic-mmio.c | 180 ++ xen/arch/arm/vgic/vgic-mmio.h

[Xen-devel] [PATCH 41/57] ARM: new VGIC: Add CONFIG registers handlers

2018-03-05 Thread Andre Przywara
The config register handlers are shared between the v2 and v3 emulation, so their implementation goes into vgic-mmio.c, to be easily referenced from the v3 emulation as well later. This is based on Linux commit 79717e4ac09c, written by Andre Przywara. Signed-off-by: Andre Przywara --- Changelog

[Xen-devel] [PATCH 16/57] ARM: GICv3: rename HYP interface definitions to use ICH_ prefix

2018-03-05 Thread Andre Przywara
heir usage in gic-v3.c and is needed to allow co-existence of the GICv2 and GICv3 definitions in the same file. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - new patch xen/arch/arm/gic-v3.c | 48 +++--- xen/include/asm-ar

[Xen-devel] [PATCH 17/57] ARM: Introduce kick_vcpu()

2018-03-05 Thread Andre Przywara
ity in the new kick_vcpu() function and make this available to the whole Xen arch code. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - new patch xen/arch/arm/smp.c| 14 ++ xen/arch/arm/vgic.c | 10 ++ xen/include/asm-arm/smp.h | 3 +++ 3 files c

[Xen-devel] [PATCH 14/57] ARM: VGIC: Introduce gic_get_nr_lrs()

2018-03-05 Thread Andre Przywara
So far the number of list registers (LRs) a GIC implements is only needed in the hardware facing side of the VGIC code (gic-vgic.c). The new VGIC will need this information in more and multiple places, so export a function that returns the number. Signed-off-by: Andre Przywara --- Changelog RFC

[Xen-devel] [PATCH 42/57] ARM: new VGIC: Add TARGET registers handlers

2018-03-05 Thread Andre Przywara
a hardware mapped vIRQ on the way. This is based on Linux commit 2c234d6f1826, written by Andre Przywara. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - propagate affinity changes to hardware mapped IRQs xen/arch/arm/vgic/vgic-mmio-v2.c | 64

[Xen-devel] [PATCH 20/57] ARM: GICv2: fix GICH_V2_LR definitions

2018-03-05 Thread Andre Przywara
The bit definition for the CPUID mask in the GICv2 LR register was wrong, fortunately the current implementation does not use that bit. Fix it up (it's starting at bit 10, not bit 9) and clean up some nearby definitions on the way. This will be used by the new VGIC shortly. Signed-off-by:

[Xen-devel] [PATCH 33/57] ARM: new VGIC: Implement vgic_vcpu_pending_irq

2018-03-05 Thread Andre Przywara
Tell Xen whether a particular VCPU has an IRQ that needs handling in the guest. This is used to decide whether a VCPU is runnable or if a hypercall should be preempted to let the guest handle the IRQ. This is based on Linux commit 90eee56c5f90, written by Eric Auger. Signed-off-by: Andre

[Xen-devel] [PATCH 10/57] ARM: VGIC: rename gic_event_needs_delivery()

2018-03-05 Thread Andre Przywara
gic_event_needs_delivery() is not named very intuitively, especially the gic_ prefix is somewhat misleading. Rename it to vgic_pending_irq(), which makes it clear that this relates to the virtual GIC and is about interrupts. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - new patch

[Xen-devel] [PATCH 51/57] ARM: new VGIC: Add preliminary stub implementation

2018-03-05 Thread Andre Przywara
The ARM arch code requires an interrupt controller emulation to implement vgic_clear_pending_irqs(), although it is suspected that it is actually not necessary. Go with a stub for now to make the linker happy. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - split off from former patch

[Xen-devel] [PATCH 47/57] ARM: new VGIC: Handle virtual IRQ allocation/reservation

2018-03-05 Thread Andre Przywara
can't easily reuse the existing implementation. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - no changes xen/arch/arm/vgic/vgic.c | 44 1 file changed, 44 insertions(+) diff --git a/xen/arch/arm/vgic/vgic.c b/xen/arch/arm/vgic/v

[Xen-devel] [PATCH 50/57] ARM: new VGIC: Implement arch_move_irqs()

2018-03-05 Thread Andre Przywara
When a VCPU moves to another CPU, we need to adjust the target affinity of any hardware mapped vIRQs, to observe our "physical-follows-virtual" policy. Implement arch_move_irqs() to adjust the physical affinity of all hardware mapped vIRQs targetting this VCPU. Signed-off-by: Andr

[Xen-devel] [PATCH 19/57] ARM: GICv3: poke_irq: make RWP optional

2018-03-05 Thread Andre Przywara
in pointless MMIO reads for many registers. Add an option to gicv3_poke_irq() to state whether we want to wait for this bit and use it accordingly to match the spec. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - new patch xen/arch/arm/gic-v3.c | 12 +++- 1 file changed, 7

[Xen-devel] [PATCH 21/57] ARM: GICv2: extend LR read/write functions to cover EOI and source

2018-03-05 Thread Andre Przywara
assemble those bits from/to an LR. This allows the new VGIC to use this information. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - new patch xen/arch/arm/gic-v2.c | 7 +++ xen/include/asm-arm/gic.h | 8 +--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/xen

[Xen-devel] [PATCH 40/57] ARM: new VGIC: Add PRIORITY registers handlers

2018-03-05 Thread Andre Przywara
oment. This is based on Linux commit dd238ec2b87b, written by Andre Przywara. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - use 32 bit register types xen/arch/arm/vgic/vgic-mmio-v2.c | 2 +- xen/arch/arm/vgic/vgic-mmio.c| 47 xen/arch/arm/vgic

[Xen-devel] [PATCH 57/57] ARM: VGIC: wire new VGIC(-v2) files into Xen build system

2018-03-05 Thread Andre Przywara
n the moment this is restricted to a vGIC-v2. To make the build system happy, we provide a temporary dummy implementation of vgic_v3_setup_hw() to allow building for now. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - no changes xen/arch/arm/Kconfig | 6 +- xen/arch/

[Xen-devel] [PATCH 32/57] ARM: new VGIC: Add GICv2 world switch backend

2018-03-05 Thread Andre Przywara
setup the host GIC addresses. This is based on Linux commit 140b086dd197, written by Marc Zyngier. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - extend comments - adapt to former changes - use existing Xen LR accessor interface (->write_lr, ->read_lr) - merge save_state and re

[Xen-devel] [PATCH 11/57] ARM: VGIC: change to level-IRQ compatible IRQ injection interface

2018-03-05 Thread Andre Przywara
prepares the callers to do the right thing later automatically. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - no change xen/arch/arm/domain.c | 4 ++-- xen/arch/arm/gic-v3-lpi.c | 2 +- xen/arch/arm/irq.c | 2 +- xen/arch/arm/time.c| 2 +- xen/arch/ar

[Xen-devel] [PATCH 06/57] ARM: vGICv3: remove rdist_stride from VGIC structure

2018-03-05 Thread Andre Przywara
value. Signed-off-by: Andre Przywara Acked-by: Julien Grall --- Changelog RFC ... v1: - Add Julien's ACK xen/arch/arm/gic-v3.c | 3 +-- xen/arch/arm/vgic-v3.c| 14 -- xen/include/asm-arm/domain.h | 1 - xen/include/asm-arm/vgic.h| 1 - xen/include/p

[Xen-devel] [PATCH 38/57] ARM: new VGIC: Add PENDING registers handlers

2018-03-05 Thread Andre Przywara
combine it with the device's level to get the actual pending state. Hardware mapped IRQs need some special handling, as their hardware state has to be coordinated with the virtual pending bit to avoid hanging or masked interrupts. This is based on Linux commit 96b298000db4, written by Andre Prz

[Xen-devel] [PATCH 03/57] ARM: GICv3: use hardware GICv3 redistributor values for Dom0

2018-03-05 Thread Andre Przywara
dware domain. This avoids the hardware GIC code to reference vGIC data structures. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - Use GIC hardware values consistently in this function. xen/arch/arm/gic-v3.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff

[Xen-devel] [PATCH 26/57] ARM: vPL011: Use the VGIC's level triggered IRQs handling if available

2018-03-05 Thread Andre Przywara
The emulated ARM SBSA UART is using level triggered IRQ semantics, however the current VGIC can only handle edge triggered IRQs, really. Disable the existing workaround for this problem in case we have the new VGIC in place, which can properly handle level triggered IRQs. Signed-off-by: Andre

[Xen-devel] [PATCH 02/57] ARM: vGICv3: clarify on GUEST_GICV3_RDIST_REGIONS symbol

2018-03-05 Thread Andre Przywara
Normally there is only one GICv3 redistributor region, and we use that for DomU guests using a GICv3. Explain the background in a comment and why we need to keep the number of hardware regions for Dom0. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - Keep GUEST_GICV3_RDIST_REGIONS

[Xen-devel] [PATCH 43/57] ARM: new VGIC: Add SGIR register handler

2018-03-05 Thread Andre Przywara
Triggering an IPI via this register is v2 specific, so the implementation lives entirely in vgic-mmio-v2.c. This is based on Linux commit 55cc01fb9004, written by Andre Przywara. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - use symbolic names instead of magic values - iterates over

[Xen-devel] [PATCH 27/57] ARM: new VGIC: Add data structure definitions

2018-03-05 Thread Andre Przywara
to avoid touching all the users. This is based on Linux commit b18b57787f5e, written by Christoffer Dall. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - rename header file to new_vgic.h - drop unneeded data structures (vgic_its, vgic_v_cpu_if) - reorder members in vgic_irq to avoid

[Xen-devel] [PATCH 23/57] ARM: GIC: allow reading pending state of a hardware IRQ

2018-03-05 Thread Andre Przywara
pending state of a particular interrupt. Due to hardware limitations this only works for private interrupts of the current CPU, so there is no CPU field in the prototype. This adds gicv2/3_peek_irq() helper functions, to read a bit in a bitmap spread over several MMIO registers. Signed-off-by: Andre

[Xen-devel] [PATCH 52/57] ARM: new VGIC: vgic-init: register VGIC

2018-03-05 Thread Andre Przywara
This patch implements the function which is called by Xen when it wants to register the virtual GIC. This also implements domain_max_vcpus() for the new VGIC, which reports back the maximum number of VCPUs a certain GIC model supports. Signed-off-by: Andre Przywara --- Changelog RFC ... v1

[Xen-devel] [PATCH 39/57] ARM: new VGIC: Add ACTIVE registers handlers

2018-03-05 Thread Andre Przywara
, so chances are we are tasked to clear bits that are already zero. Add some simple check to avoid a pointless warning in this case. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - remove premature "proper ACTIVE" handler stub - avoid unnecessary warnings on NO-OP register write

[Xen-devel] [PATCH 36/57] ARM: new VGIC: Add CTLR, TYPER and IIDR handlers

2018-03-05 Thread Andre Przywara
. This is based on Linux commit 2b0cda878965, written by Marc Zyngier. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - use PRODUCT_ID_XEN - use proper locking on enabling VGIC - use kick_vcpu() xen/arch/arm/vgic/vgic-mmio-v2.c | 54 +++- xen/arch/arm/vgic

[Xen-devel] [PATCH 56/57] ARM: allocate two pages for struct vcpu

2018-03-05 Thread Andre Przywara
there is no real technical reason this struct has to fit in one page, so lifting the limit to two pages seems like the most pragmatic solution. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - no changes xen/arch/arm/domain.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-)

[Xen-devel] [PATCH 54/57] ARM: new VGIC: vgic-init: implement map_resources

2018-03-05 Thread Andre Przywara
-by: Andre Przywara --- Changelog RFC ... v1: - adapting to previous changes xen/arch/arm/vgic/vgic-v2.c | 66 + xen/arch/arm/vgic/vgic.h| 1 + 2 files changed, 67 insertions(+) diff --git a/xen/arch/arm/vgic/vgic-v2.c b/xen/arch/arm/vgic/vgic-v2.c

[Xen-devel] [PATCH 46/57] ARM: new VGIC: Add event channel IRQ handling

2018-03-05 Thread Andre Przywara
The Xen core/arch code relies on two abstracted functions to inject an event channel IRQ and to query its pending state. Implement those to query the state of the new VGIC implementation. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - add locking xen/arch/arm/vgic/vgic.c | 23

[Xen-devel] [PATCH 37/57] ARM: new VGIC: Add ENABLE registers handlers

2018-03-05 Thread Andre Przywara
. Because the existing locking order between vgic_irq->irq_lock and irq_desc->lock dictates so, we drop the irq_lock and retake them in the proper order. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - extend and move vgic_sync_hardware_irq() - do proper locking sequence - skip a

[Xen-devel] [PATCH 48/57] ARM: new VGIC: Dump virtual IRQ info

2018-03-05 Thread Andre Przywara
When we dump guest state on the Xen console, we also print the state of IRQs that are on a VCPU. Add the code to dump the state of an IRQ handled by the new VGIC. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - use proper locking - use one header line to announce active or pending IRQs

[Xen-devel] [PATCH 24/57] ARM: timer: Handle level triggered IRQs correctly

2018-03-05 Thread Andre Przywara
vGIC (and the LR). The VGIC in Xen so far only implemented edge triggered vIRQs, really, so we need to add new functionality to re-sample the interrupt state. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - extend comments - don't read CNTV_CVAL_EL0 - use symbolic names for constants

[Xen-devel] [PATCH 31/57] ARM: new VGIC: Add IRQ sync/flush framework

2018-03-05 Thread Andre Przywara
ed in the following patches. This is based on Linux commit 0919e84c0fc1, written by Marc Zyngier. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - extend comments - adapt to former changes - remove gic_clear_lrs() xen/arch/arm/vgic/vgic.c

[Xen-devel] [PATCH 53/57] ARM: new VGIC: vgic-init: implement vgic_init

2018-03-05 Thread Andre Przywara
initialize the VGIC. Their prototypes are already in existing header files. This is based on Linux commit ad275b8bb1e6, written by Eric Auger. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - adapt to former changes - add missing comment line - extend commit message xen/arch/arm/vgic

[Xen-devel] [PATCH 55/57] ARM: new VGIC: Add vgic_v2_enable

2018-03-05 Thread Andre Przywara
Enable the VGIC operation by properly initialising the registers in the hypervisor GIC interface. This is based on Linux commit f7b6985cc3d0, written by Eric Auger. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - drop unneeded vgic_vmcr initialization - use update_hcr_status wrapper

[Xen-devel] [PATCH 45/57] ARM: new VGIC: Handle hardware mapped IRQs

2018-03-05 Thread Andre Przywara
physical world. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - add ASSERT for hardware mapped IRQs being SPI only - check h/w IRQ matches before disconnecting xen/arch/arm/vgic/vgic.c | 71 1 file changed, 71 insertions(+) diff --git a/xen

[Xen-devel] [PATCH 29/57] ARM: new VGIC: Implement virtual IRQ injection

2018-03-05 Thread Andre Przywara
patch. This is based on Linux commit 81eeb95ddbab, written by Christoffer Dall. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - fix locking order comment - adapt to former changes - extend comments - use kick_vcpu() xen/arch/arm/vgic/vgic.c

[Xen-devel] [PATCH 44/57] ARM: new VGIC: Add SGIPENDR register handlers

2018-03-05 Thread Andre Przywara
As this register is v2 specific, its implementation lives entirely in vgic-mmio-v2.c. This register allows setting the source mask of an IPI. This is based on Linux commit ed40213ef9b0, written by Andre Przywara. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - use C99 and unsigned

[Xen-devel] [PATCH 28/57] ARM: new VGIC: Add acccessor to new struct vgic_irq instance

2018-03-05 Thread Andre Przywara
interrupts and SPIs, but handles the ref-counting for LPIs. This is based on Linux commit 64a959d66e47, written by Christoffer Dall. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - add kernel-doc comments to exported functions - adapt to previous changes (new_vgic.h, arch_vcpu member name

[Xen-devel] [PATCH 07/57] ARM: VGIC: rename gic_inject() and gic_clear_lrs()

2018-03-05 Thread Andre Przywara
The two central functions to synchronise our emulated VGIC state with the GIC hardware (the LRs, really), are named somewhat confusingly. Rename them from gic_inject() to vgic_sync_to_lrs() and from gic_clear_lrs() to vgic_sync_from_lrs(), to make the code more readable. Signed-off-by: Andre

[Xen-devel] [PATCH 35/57] ARM: new VGIC: Add GICv2 MMIO handling framework

2018-03-05 Thread Andre Przywara
on Linux commit fb848db39661, written by Andre Przywara. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - drop (dummy) user interface entries - use frame number instead of physical address xen/arch/arm/vgic/vgic-mmio-v2.c | 83 xen/arch/arm/vgic

[Xen-devel] [PATCH 25/57] ARM: evtchn: Handle level triggered IRQs correctly

2018-03-05 Thread Andre Przywara
evtchn_upcall_pending variable to make the interrupt line match its status, and call this function upon every hypervisor entry. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - no changes xen/arch/arm/domain.c | 7 +++ xen/arch/arm/traps.c| 1 + xen/include/asm-arm/event.h

  1   2   3   4   5   >