xen/arm: Add GICv3 support
v8 cover xen/arm: Add GICv3 support
From: Vijaya Kumar K <[email protected]>
Add GICv3 support for arm64 platform.
Quoted 1 line
From v6 version, this patch series is split into v6a and v6.
All the GICv2 and VGIC code refactoring patches of v6a are merged.
The v8 version of GICv3 patches are posted here.
Tested with ARM64 simulator with multicore core
and booted Dom0 kernel.
Major changes in v8:
- Introduced assembler aliases for GIC system registers to be able to compile with Linaro toolchain
- Few PIDRn macros definitions are moved to vgic-v3.c
- Introduced 2 more patches. Patch 1 for introducing sizes.h file and Patch 2 for {READ,WRITE}_SYSREG macro changes
Major changes in v7:
- Introduced vgic callback to handle sysreg emulation
- Coding style fixes
- undef64_exception instead of undef_exception for sysreg error
Major changes in v6:
- Added read_apr() to read ICH_APRn in GICv3
- Added asserts
- PIDR2 check for architecture value
- Remove update_cpu_lr_mask call
- Changed parameter ordering for gicv3_send_sgi()
- Save and restore ICC_SRE_EL1 register
- Computed cpumask in gicv3_send_sgi() function
Major changes in v5:
- Introduced new patch for checking platform capability for gicv3
- Introduced more patches for vgic clean up and code movement
- Added synchronization barriers and clean up in GICv3 driver
- Rebase on top of master branch + remotes/origin/no_maintenance_interrupts-v8 patch set
- Code base available in github
git clone https://github.com/vijaykilari/Xen-GICv3.git
- Fixed comments and coding style
Major changes in v4:
- Changed io handlers to take mmio address and size as parameters
- ioremap is used instead of fixmap to map GICv2 address space. Removed /4 in GICv2 register definitions
- vGIC driver now uses register size to calculate IRQ rank
- GICv2 LR register definitions are declared locally in GICv2 driver
- GICR & GICD common register handling in vgic-v3 driver are segregated in one common function
- irq_hw_controller definition is managed in GICv2 and GICv3 drivers
- Made irq_ops const
- GIC DT node is updated in respective drivers
- Comments and coding style fixes
- Rebased on remotes/origin/no_maintenance_interrupts-v8 + Julien's patch set
Major changes in v3:
- Moved io.h from xen/arch/arm to xen/include/asm-arm and renamed as mmio.h
- Made all the io handlers as domain specific and removed check handlers. Instead address and size are passed
- Cleaned up sgi handling functions in V2 gic driver and made generic
- Removed unused parameters in do_sgi call
- VGIC driver is chosen based on GIC driver initialized
- Implemented SGI handling for GICv3 to boot multicore
- Missing coding style fixes
- Rebased to remotes/origin/no_maintenance_interrupts-v6 branch of Stephano's unstable tree
Major Changes in v2:
- Added per domain io handler
- Use device api to initialize gic driver
- Avoid use of void pointer to access common data
- Moved vgic address information data from domain.h
- Coding style
Vijaya Kumar K (7):
xen/arm: Introduce sizes.h
xen/arm: Stringify the register name in sysreg read write macros xen/arm: Add support for GIC v3
xen/arm: Add virtual GICv3 support
xen/arm: Update Dom0 GIC dt node with GICv3 information xen/arm: add SGI handling for GICv3
xen/arm: check for GICv3 platform support
xen/arch/arm/Makefile | 2 + xen/arch/arm/domain_build.c | 47 +- xen/arch/arm/gic-v2.c | 51 ++ xen/arch/arm/gic-v3.c | 1270 +++++++++++++++++++++++++++++++++ xen/arch/arm/gic.c | 6 + xen/arch/arm/setup.c | 5 +- xen/arch/arm/traps.c | 15 + xen/arch/arm/vgic-v2.c | 8 +- xen/arch/arm/vgic-v3.c | 973 +++++++++++++++++++++++++ xen/arch/arm/vgic.c | 15 + xen/include/asm-arm/arm64/processor.h | 10 +- xen/include/asm-arm/cpufeature.h | 1 + xen/include/asm-arm/domain.h | 8 + xen/include/asm-arm/gic.h | 24 + xen/include/asm-arm/gic_v3_defs.h | 165 +++++ xen/include/asm-arm/processor.h | 18 +- xen/include/asm-arm/sysregs.h | 56 ++ xen/include/asm-arm/vgic.h | 16 +- xen/include/xen/sizes.h | 48 ++ 19 files changed, 2680 insertions(+), 58 deletions(-) create mode 100644 xen/arch/arm/gic-v3.c create mode 100644 xen/arch/arm/vgic-v3.c create mode 100644 xen/include/asm-arm/gic_v3_defs.h create mode 100644 xen/include/xen/sizes.h
Signature · 1 line
1.7.9.5
PATCH v8 1/7 xen/arm: Introduce sizes.h
From: Vijaya Kumar K <[email protected]>
Add sizes.h file similar to include/linux/sizes.h of kernel code. These size macros helps in porting kernel drivers to Xen
--- xen/include/xen/sizes.h | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+)
xen/include/xen/sizes.h new file +48 -0
@@ -0,0 +1,48 @@ +#ifndef __XEN_SIZES_H__ +#define __XEN_SIZES_H__ + +/* +* Taken from kernel code include/linux/size.h +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#define SZ_1 0x00000001 +#define SZ_2 0x00000002 +#define SZ_4 0x00000004 +#define SZ_8 0x00000008 +#define SZ_16 0x00000010 +#define SZ_32 0x00000020 +#define SZ_64 0x00000040 +#define SZ_128 0x00000080 +#define SZ_256 0x00000100 +#define SZ_512 0x00000200 + +#define SZ_1K 0x00000400 +#define SZ_2K 0x00000800 +#define SZ_4K 0x00001000 +#define SZ_8K 0x00002000 +#define SZ_16K 0x00004000 +#define SZ_32K 0x00008000 +#define SZ_64K 0x00010000 +#define SZ_128K 0x00020000 +#define SZ_256K 0x00040000 +#define SZ_512K 0x00080000 + +#define SZ_1M 0x00100000 +#define SZ_2M 0x00200000 +#define SZ_4M 0x00400000 +#define SZ_8M 0x00800000 +#define SZ_16M 0x01000000 +#define SZ_32M 0x02000000 +#define SZ_64M 0x04000000 +#define SZ_128M 0x08000000 +#define SZ_256M 0x10000000 +#define SZ_512M 0x20000000 + +#define SZ_1G 0x40000000 +#define SZ_2G 0x80000000 + +#endif /* __XEN_SIZES_H__ */
Signature · 1 line
1.7.9.5
Re: [PATCH v8 1/7] xen/arm: Introduce sizes.h
Quoted 7 lines · On Wed, 2014-07-23 at 19:11 +0530, [email protected] wrote:
From: Vijaya Kumar K <[email protected]>
Add
sizes.hfile similar toinclude/linux/sizes.hof kernel code. These size macros helps in porting kernel drivers to XenSigned-off-by Vijaya Kumar K <[email protected]>
PATCH v8 2/7 xen/arm: Stringify the register name in sysreg read write macros
In reply to [email protected]From: Vijaya Kumar K <[email protected]>
The register name parameter in {READ,WRITE}_SYSREG{32,64} macros is replaced as register name in mrs and msr assembly instruction.
If this register name is macro indirection, the register name is not replaced with designated macro. So replace the register name with __stringify macro, which replaces register name if it is macro
--- xen/include/asm-arm/arm64/processor.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
xen/include/asm-arm/arm64/processor.h +6 -4
@@ -1,6 +1,8 @@#ifndef __ASM_ARM_ARM64_PROCESSOR_H#define __ASM_ARM_ARM64_PROCESSOR_H +#include <xen/stringify.h> +#ifndef __ASSEMBLY__/* Anonymous union includes both 32- and 64-bit names (e.g., r0/x0). */
@@ -85,20 +87,20 @@ struct cpu_user_regs#define READ_SYSREG32 (name) ({ \ uint32_t _r; \ - asm volatile("mrs %0, "#name : "=r" (_r)); \ + asm volatile("mrs %0, "__stringify(name) : "=r" (_r)); \ _r; })#define WRITE_SYSREG32 (v, name) do { \ uint32_t _r = v; \ - asm volatile("msr "#name", %0" : : "r" (_r)); \ + asm volatile("msr "__stringify(name)", %0" : : "r" (_r)); \ } while (0)#define WRITE_SYSREG64 (v, name) do { \ uint64_t _r = v; \ - asm volatile("msr "#name", %0" : : "r" (_r)); \ + asm volatile("msr "__stringify(name)", %0" : : "r" (_r)); \ } while (0)#define READ_SYSREG64 (name) ({ \ uint64_t _r; \ - asm volatile("mrs %0, "#name : "=r" (_r)); \ + asm volatile("mrs %0, "__stringify(name) : "=r" (_r)); \ _r; })#define READ_SYSREG (name) READ_SYSREG64(name)
Signature · 1 line
1.7.9.5
Re: [PATCH v8 2/7] xen/arm: Stringify the register name in sysreg read write macros
Hi Vijay,
Quoted 6 lines · On 07/23/2014 02:41 PM, [email protected] wrote:
From: Vijaya Kumar K <[email protected]>
The register name parameter in {READ,WRITE}_SYSREG{32,64} macros is replaced as register name in mrs and msr assembly instruction.
Quoted 6 lines
If this register name is macro indirection, the register name is not replaced with designated macro. So replace the register name with
__stringifymacro, which replaces register name if it is macroSigned-off-by Vijaya Kumar K <[email protected]>
Regards,
Quoted 43 lines
--- xen/include/asm-arm/arm64/processor.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)xen/include/asm-arm/arm64/processor.h +6
-4@@ -1,6 +1,8 @@#ifndef __ASM_ARM_ARM64_PROCESSOR_H#define __ASM_ARM_ARM64_PROCESSOR_H +#include <xen/stringify.h> +#ifndef __ASSEMBLY__/* Anonymous union includes both 32- and 64-bit names (e.g., r0/x0). */ @@ -85,20 +87,20 @@ struct cpu_user_regs#define READ_SYSREG32 (name) ({ \ uint32_t _r; \ - asm volatile("mrs %0, "#name : "=r" (_r)); \ + asm volatile("mrs %0, "__stringify(name) : "=r" (_r)); \ _r; })#define WRITE_SYSREG32 (v, name) do { \ uint32_t _r = v; \ - asm volatile("msr "#name", %0" : : "r" (_r)); \ + asm volatile("msr "__stringify(name)", %0" : : "r" (_r)); \ } while (0)#define WRITE_SYSREG64 (v, name) do { \ uint64_t _r = v; \ - asm volatile("msr "#name", %0" : : "r" (_r)); \ + asm volatile("msr "__stringify(name)", %0" : : "r" (_r)); \ } while (0)#define READ_SYSREG64 (name) ({ \ uint64_t _r; \ - asm volatile("mrs %0, "#name : "=r" (_r)); \ + asm volatile("mrs %0, "__stringify(name) : "=r" (_r)); \ _r; })#define READ_SYSREG (name) READ_SYSREG64(name)
Signature · 1 line
Julien Grall
Re: [PATCH v8 2/7] xen/arm: Stringify the register name in sysreg read write macros
In reply to [email protected]Quoted 6 lines · On Wed, 2014-07-23 at 19:11 +0530, [email protected] wrote:
From: Vijaya Kumar K <[email protected]>
The register name parameter in {READ,WRITE}_SYSREG{32,64} macros is replaced as register name in mrs and msr assembly instruction.
Quoted 6 lines
If this register name is macro indirection, the register name is not replaced with designated macro. So replace the register name with
__stringifymacro, which replaces register name if it is macroSigned-off-by Vijaya Kumar K <[email protected]>
PATCH v8 3/7 xen/arm: Add support for GIC v3
In reply to [email protected]From: Vijaya Kumar K <[email protected]>
Add support for GIC v3 specification System register access(SRE) is enabled to access cpu and virtual interface registers based on kernel GICv3 driver.
This patch adds only basic v3 support.
Does not support Interrupt Translation support (ITS)
---
v8: - Introduced assembler aliases for GIC system registers
- Removed usage of lib.h for adding size macro, instead used sizes.h
- Renamed PIDR macros
- Removed check for number of cpus in cluster in gicv3_send_sgi() and instead check is added in gicv3_populate_rdist()
- Added comments and fixed coding style
- Removed nr_lrs parameter in gicv3_{restore,save}_lrs()
- Rename GICV3 compat strings.
v7: - Fixed wrong check for irq number in gicv3_set_irq_properties.
- Introduced panic during cpu_init on wrong priority bits.
v6: - Added read_apr() to read ICH_APRn in GICv3
- Added asserts
- PIDR2 check for architecture valu
- Remove update_cpu_lr_mask call
- Changed parameter ordering for gicv3_send_sgi()
- Save and restore ICC_SRE_EL1 registers
--- xen/arch/arm/Makefile | 1 + xen/arch/arm/gic-v3.c | 1185 +++++++++++++++++++++++++++++++++++++ xen/include/asm-arm/domain.h | 8 + xen/include/asm-arm/gic.h | 20 + xen/include/asm-arm/gic_v3_defs.h | 158 +++++ xen/include/asm-arm/processor.h | 14 + xen/include/asm-arm/sysregs.h | 53 ++ 7 files changed, 1439 insertions(+)
xen/arch/arm/Makefile +1 -0
@@ -11,6 +11,7 @@ obj-y += domctl.o obj-y += sysctl.o obj-y += domain_build.o obj-y += gic.o gic-v2.o +obj-$(CONFIG_ARM_64) += gic-v3.o obj-y += io.o obj-y += irq.o obj-y += kernel.o
xen/arch/arm/gic-v3.c new file +1185 -0
1,185 lines not on this page · raw message
xen/include/asm-arm/domain.h +8 -0
@@ -99,6 +99,14 @@ struct arch_domain/* Base address for guest GIC */ paddr_t dbase;/* Distributor base address */ paddr_t cbase;/* CPU base address */ +#ifdef CONFIG_ARM_64 +/* GIC V3 addressing */ +paddr_t dbase_size;/* Distributor base size */ +paddr_t rbase[MAX_RDIST_COUNT ];/* Re-Distributor base address */ +paddr_t rbase_size[MAX_RDIST_COUNT ];/* Re-Distributor size */ +uint32_t rdist_stride;/* Re-Distributor stride */ +int rdist_count;/* No. of Re-Distributors */ +#endif } vgic;struct vuart {
xen/include/asm-arm/gic.h +20 -0
@@ -18,6 +18,10 @@#ifndef __ASM_ARM_GIC_H__#define __ASM_ARM_GIC_H__ +#define NR_GIC_LOCAL_IRQS NR_LOCAL_IRQS +#define NR_GIC_SGI 16 +#define MAX_RDIST_COUNT 4 +#define GICD_CTLR (0x000)#define GICD_TYPER (0x004)#define GICD_IIDR (0x008)
@@ -154,6 +158,20 @@#define DT_MATCH_GIC_V2 DT_MATCH_COMPATIBLE(DT_COMPAT_GIC_CORTEX_A15), \ DT_MATCH_COMPATIBLE(DT_COMPAT_GIC_CORTEX_A7) +#define DT_COMPAT_GIC_V3 "arm,gic-v3" + +#define DT_MATCH_GIC_V3 DT_MATCH_COMPATIBLE(DT_COMPAT_GIC_V3) + +/* +* GICv3 registers that needs to be saved/restored +*/ +struct gic_v3 { +uint32_t hcr, vmcr, sre_el1; +uint32_t apr0[4 ]; +uint32_t apr1[4 ]; +uint64_t lr[16 ]; +}; +/* * GICv2 register that needs to be saved/restored * on VCPU context switch
@@ -170,6 +188,7 @@ struct gic_v2 {*/ union gic_state_data {struct gic_v2 v2; +struct gic_v3 v3; };/*
@@ -189,6 +208,7 @@ struct gic_lr {enum gic_version {GIC_V2 , +GIC_V3 , };extern enum gic_version gic_hw_version (void );
xen/include/asm-arm/gic_v3_defs.h new file +158 -0
158 lines not on this page · raw message
xen/include/asm-arm/processor.h +14 -0
@@ -17,6 +17,20 @@#define MPIDR_HWID_MASK _AC(0xffffff,U)#define MPIDR_INVALID (~MPIDR_HWID_MASK) +/* +* Macros to extract affinity level. picked from kernel +*/ + +#define MPIDR_LEVEL_BITS_SHIFT 3 +#define MPIDR_LEVEL_BITS (1 << MPIDR_LEVEL_BITS_SHIFT) +#define MPIDR_LEVEL_MASK ((1 << MPIDR_LEVEL_BITS) - 1) + +#define MPIDR_LEVEL_SHIFT (level) \ + (((1 << level) >> 1) << MPIDR_LEVEL_BITS_SHIFT) + +#define MPIDR_AFFINITY_LEVEL (mpidr, level) \ + ((mpidr >> MPIDR_LEVEL_SHIFT(level)) & MPIDR_LEVEL_MASK) +/* TTBCR Translation Table Base Control Register */ #define TTBCR_EAE _AC(0x80000000,U)#define TTBCR_N_MASK _AC(0x07,U)
xen/include/asm-arm/sysregs.h +53 -0
59 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Re: [PATCH v8 3/7] xen/arm: Add support for GIC v3
Hi Vijay,
xen/include/asm-arm/gic_v3_defs.h line 60
Quoted 2 lines · On 07/23/2014 02:41 PM, [email protected] wrote:
xen/include/asm-arm/gic_v3_defs.h new file +2
-0+#define GICD_PIDR2_ARCH_REV_MASK (0xf0) +#define GICD_PIDR2_ARCH_REV_OFFSET (0x4)
NIT: We tend to use SHIFT rather than OFFSET.
xen/include/asm-arm/gic_v3_defs.h line 63
Quoted 3 lines
xen/include/asm-arm/gic_v3_defs.h new file +3
-0+#define GICD_PIDR2_ARCH_GICV3 (0x3) +#define GICD_PIDR2_USES_JEP_MASK (0x08) +#define GICD_PIDR2_JEP_ID_MASK (0x07)
NIT: I don't see any usage of GICD_PIDR2_USES_JEP_MASK and GICD_PIDR2_JEP_ID_MASK.
Hence, you don't define the SHIFT. So I would drop them.
Regards,
Signature · 1 line
Julien Grall
Re: [PATCH v8 3/7] xen/arm: Add support for GIC v3
Quoted 8 lines · Julien Grall
Hi Vijay,
xen/include/asm-arm/gic_v3_defs.h line 60
Quoted 2 lines · On 07/23/2014 02:41 PM, [email protected] wrote:
xen/include/asm-arm/gic_v3_defs.h new file +2
-0+#define GICD_PIDR2_ARCH_REV_MASK (0xf0) +#define GICD_PIDR2_ARCH_REV_OFFSET (0x4)NIT: We tend to use SHIFT rather than OFFSET.
Quoted 8 lines
xen/include/asm-arm/gic_v3_defs.h line 63
Quoted 3 lines
xen/include/asm-arm/gic_v3_defs.h new file +3
-0+#define GICD_PIDR2_ARCH_GICV3 (0x3) +#define GICD_PIDR2_USES_JEP_MASK (0x08) +#define GICD_PIDR2_JEP_ID_MASK (0x07)NIT: I don't see any usage of
GICD_PIDR2_USES_JEP_MASKandGICD_PIDR2_JEP_ID_MASK.Hence, you don't define the SHIFT. So I would drop them.
FWIW I don't think it is a problem define bits of a register which aren't currently used on the principal that including the full set is a reasonable choice.
Ian.
Re: [PATCH v8 3/7] xen/arm: Add support for GIC v3
Quoted 16 lines · Ian Campbell
Quoted 15 lines · Julien Grall
Hi Vijay,
xen/include/asm-arm/gic_v3_defs.h line 60
Quoted 2 lines · On 07/23/2014 02:41 PM, [email protected] wrote:
xen/include/asm-arm/gic_v3_defs.h new file +2
-0+#define GICD_PIDR2_ARCH_REV_MASK (0xf0) +#define GICD_PIDR2_ARCH_REV_OFFSET (0x4)NIT: We tend to use SHIFT rather than OFFSET.
xen/include/asm-arm/gic_v3_defs.h line 63
Quoted 3 lines
xen/include/asm-arm/gic_v3_defs.h new file +3
-0+#define GICD_PIDR2_ARCH_GICV3 (0x3) +#define GICD_PIDR2_USES_JEP_MASK (0x08) +#define GICD_PIDR2_JEP_ID_MASK (0x07)NIT: I don't see any usage of
GICD_PIDR2_USES_JEP_MASKandGICD_PIDR2_JEP_ID_MASK.
Quoted 5 lines
Quoted 1 line
Hence, you don't define the SHIFT. So I would drop them.
FWIW I don't think it is a problem define bits of a register which aren't currently used on the principal that including the full set is a reasonable choice.
In this case, he has to be consistent and also define the SHIFT. It's pointless to only define a MASK.
Regards,
Signature · 1 line
Julien Grall
PATCH v8 4/7 xen/arm: Add virtual GICv3 support
In reply to [email protected]From: Vijaya Kumar K <[email protected]>
Add virtual GICv3 driver support.
Also, with this patch vgic_irq_rank structure is modified to hold GICv2 GICD_TARGET and GICv3 GICD_ROUTER registers under union.
This patch adds only basic GICv3 support. Does not support Interrupt Translation support (ITS)
---
v8: - Fixed printk coding styles
- Moved GICD_PIDRn and GICR_PIDRn macros to vgic-v3.c from header file
- Check is made on return value of vgic_v3_init()
v7: Fixed coding style.
v6: Removed byte read access for IROUTERN register.
--- xen/arch/arm/Makefile | 1 + xen/arch/arm/vgic-v2.c | 8 +- xen/arch/arm/vgic-v3.c | 919 ++++++++++++++++++++++++++++++++++++++++++++ xen/arch/arm/vgic.c | 6 + xen/include/asm-arm/vgic.h | 13 +- 5 files changed, 942 insertions(+), 5 deletions(-)
xen/arch/arm/Makefile +1 -0
@@ -28,6 +28,7 @@ obj-y += smp.o obj-y += shutdown.o obj-y += traps.o obj-y += vgic.o vgic-v2.o +obj-$(CONFIG_ARM_64) += vgic-v3.o obj-y += vtimer.o obj-y += vuart.o obj-y += hvm.o
xen/arch/arm/vgic-v2.c +4 -4
@@ -133,7 +133,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info)if ( rank ==NULL ) goto read_as_zero;vgic_lock_rank (v, rank); - *r = rank->itargets[REG_RANK_INDEX (8 , gicd_reg -GICD_ITARGETSR , + *r = rank->v2.itargets[REG_RANK_INDEX (8 , gicd_reg -GICD_ITARGETSR ,DABT_WORD )];if ( dabt.size ==DABT_BYTE ) *r =vgic_byte_read (*r, dabt.sign, gicd_reg);
@@ -361,10 +361,10 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)if ( rank ==NULL ) goto write_ignore;vgic_lock_rank (v, rank);if ( dabt.size ==DABT_WORD ) - rank->itargets[REG_RANK_INDEX (8 , gicd_reg -GICD_ITARGETSR , + rank->v2.itargets[REG_RANK_INDEX (8 , gicd_reg -GICD_ITARGETSR ,DABT_WORD )] = *r;else -vgic_byte_write (&rank->itargets[REG_RANK_INDEX (8 , +vgic_byte_write (&rank->v2.itargets[REG_RANK_INDEX (8 , gicd_reg -GICD_ITARGETSR ,DABT_WORD )], *r, gicd_reg);vgic_unlock_rank (v, rank);return 1 ;
@@ -466,7 +466,7 @@ static int vgic_v2_vcpu_init(struct vcpu *v)/* For SGI and PPI the target is always this CPU */ for ( i =0 ; i <8 ; i++ ) - v->arch.vgic.private_irqs->itargets[i] = + v->arch.vgic.private_irqs->v2.itargets[i] = (1 <<(v->vcpu_id+0 )) | (1 <<(v->vcpu_id+8 )) | (1 <<(v->vcpu_id+16 ))
xen/arch/arm/vgic-v3.c new file +919 -0
919 lines not on this page · raw message
xen/arch/arm/vgic.c +6 -0
@@ -69,6 +69,12 @@ int domain_vgic_init(struct domain *d)switch (gic_hw_version () ) { +#ifdef CONFIG_ARM_64 +case GIC_V3 : +if (vgic_v3_init (d) ) +return -ENODEV ; +break ; +#endif case GIC_V2 :if (vgic_v2_init (d) )return -ENODEV ;
xen/include/asm-arm/vgic.h +12 -1
@@ -83,7 +83,14 @@ struct vgic_irq_rank {uint32_t ienable, iactive, ipend, pendsgi;uint32_t icfg[2 ];uint32_t ipriority[8 ]; -uint32_t itargets[8 ]; +union { +struct { +uint32_t itargets[8 ]; + }v2; +struct { +uint64_t irouter[32 ]; + }v3; + }; };struct vgic_ops {
@@ -110,6 +117,9 @@ static inline int REG_RANK_NR(int b, uint32_t n) {switch ( b ) { +case 64 :return n >>6 ; +case 32 :return n >>5 ; +case 16 :return n >>4 ;case 8 :return n >>3 ;case 4 :return n >>2 ;case 2 :return n >>1 ;
@@ -159,6 +169,7 @@ extern void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n);extern void vgic_enable_irqs (struct vcpu *v,uint32_t r,int n);extern void register_vgic_ops (struct domain *d,const struct vgic_ops *ops);int vgic_v2_init (struct domain *d); +int vgic_v3_init (struct domain *d);extern int vcpu_vgic_free (struct vcpu *v); extern int vgic_to_sgi(struct vcpu *v, register_t sgir,
Signature · 1 line
1.7.9.5
Re: [PATCH v8 4/7] xen/arm: Add virtual GICv3 support
Please ignore this patch.
There are some alignment issues reappearing
Quoted 1,056 lines · On Wed, Jul 23, 2014 at 7:11 PM, <[email protected]> wrote:
From: Vijaya Kumar K <[email protected]>
Add virtual GICv3 driver support.
Also, with this patchvgic_irq_rankstructure is modified to hold GICv2GICD_TARGETand GICv3GICD_ROUTERregisters under union.This patch adds only basic GICv3 support. Does not support Interrupt Translation support (ITS)
Signed-off-by Vijaya Kumar K <[email protected]>---
v8: - Fixed printk coding styles
- MovedGICD_PIDRnandGICR_PIDRnmacros tovgic-v3.cfrom header file
- Check is made on return value ofvgic_v3_init()
v7: Fixed coding style.
v6: Removed byte read access for IROUTERN register.--- xen/arch/arm/Makefile | 1 + xen/arch/arm/vgic-v2.c | 8 +- xen/arch/arm/vgic-v3.c | 919 ++++++++++++++++++++++++++++++++++++++++++++ xen/arch/arm/vgic.c | 6 + xen/include/asm-arm/vgic.h | 13 +- 5 files changed, 942 insertions(+), 5 deletions(-)xen/arch/arm/Makefile +1
-0@@ -28,6 +28,7 @@ obj-y += smp.o obj-y += shutdown.o obj-y += traps.o obj-y += vgic.o vgic-v2.o +obj-$(CONFIG_ARM_64) += vgic-v3.o obj-y += vtimer.o obj-y += vuart.o obj-y += hvm.oxen/arch/arm/vgic-v2.c +4
-4@@ -133,7 +133,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info)if ( rank ==NULL ) goto read_as_zero;vgic_lock_rank (v, rank); - *r = rank->itargets[REG_RANK_INDEX (8 , gicd_reg -GICD_ITARGETSR , + *r = rank->v2.itargets[REG_RANK_INDEX (8 , gicd_reg -GICD_ITARGETSR ,DABT_WORD )];if ( dabt.size ==DABT_BYTE ) *r =vgic_byte_read (*r, dabt.sign, gicd_reg);@@ -361,10 +361,10 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)if ( rank ==NULL ) goto write_ignore;vgic_lock_rank (v, rank);if ( dabt.size ==DABT_WORD ) - rank->itargets[REG_RANK_INDEX (8 , gicd_reg -GICD_ITARGETSR , + rank->v2.itargets[REG_RANK_INDEX (8 , gicd_reg -GICD_ITARGETSR ,DABT_WORD )] = *r;else -vgic_byte_write (&rank->itargets[REG_RANK_INDEX (8 , +vgic_byte_write (&rank->v2.itargets[REG_RANK_INDEX (8 , gicd_reg -GICD_ITARGETSR ,DABT_WORD )], *r, gicd_reg);vgic_unlock_rank (v, rank);return 1 ;@@ -466,7 +466,7 @@ static int vgic_v2_vcpu_init(struct vcpu *v)/* For SGI and PPI the target is always this CPU */ for ( i =0 ; i <8 ; i++ ) - v->arch.vgic.private_irqs->itargets[i] = + v->arch.vgic.private_irqs->v2.itargets[i] = (1 <<(v->vcpu_id+0 )) | (1 <<(v->vcpu_id+8 )) | (1 <<(v->vcpu_id+16 ))xen/arch/arm/vgic-v3.c new file +919
-0@@ -0,0 +1,919 @@ +/* +* xen/arch/arm/vgic-v3.c +* +* ARM Virtual Generic Interrupt Controller v3 support +* based on xen/arch/arm/vgic.c +* +* Vijaya Kumar K <[email protected]> +* Copyright (c) 2014 Cavium Inc. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#include <xen/bitops.h> +#include <xen/config.h> +#include <xen/lib.h> +#include <xen/init.h> +#include <xen/softirq.h> +#include <xen/irq.h> +#include <xen/sched.h> +#include <xen/sizes.h> +#include <asm/current.h> +#include <asm/device.h> +#include <asm/mmio.h> +#include <asm/gic_v3_defs.h> +#include <asm/gic.h> +#include <asm/vgic.h> + +/* GICD_PIDRn register values for ARM implementations */ +#define GICV3_GICD_PIDR0 0x92 +#define GICV3_GICD_PIDR1 0xb4 +#define GICV3_GICD_PIDR2 0x3b +#define GICV3_GICD_PIDR4 0x04 + +/* GICR_PIDRn register values for ARM implementations */ +#define GICV3_GICR_PIDR0 0x93 +#define GICV3_GICR_PIDR1 GICV3_GICD_PIDR1 +#define GICV3_GICR_PIDR2 GICV3_GICD_PIDR2 +#define GICV3_GICR_PIDR4 GICV3_GICD_PIDR4 + +static int __vgic_v3_rdistr_rd_mmio_read (struct vcpu *v,mmio_info_t *info, +uint32_t gicr_reg) +{ +struct hsr_dabt dabt = info->dabt; +struct cpu_user_regs *regs =guest_cpu_user_regs (); +register_t *r =select_user_reg (regs, dabt.reg); +uint64_t aff; + +switch ( gicr_reg ) + { +case GICR_CTLR : +/* We have not implemented LPI's, read zero */ + goto read_as_zero; +case GICR_IIDR : +if ( dabt.size !=DABT_WORD ) goto bad_width; + *r =GICV3_GICR_IIDR_VAL ; +return 1 ; +case GICR_TYPER : +if ( dabt.size !=DABT_DOUBLE_WORD ) goto bad_width; +/* TBD: Update processor id in [23:8] when ITS support is added */ + aff = (MPIDR_AFFINITY_LEVEL (v->arch.vmpidr,3 ) <<56 | +MPIDR_AFFINITY_LEVEL (v->arch.vmpidr,2 ) <<48 | +MPIDR_AFFINITY_LEVEL (v->arch.vmpidr,1 ) <<40 | +MPIDR_AFFINITY_LEVEL (v->arch.vmpidr,0 ) <<32 ); + *r = aff; +return 1 ; +case GICR_STATUSR : +/* Not implemented */ + goto read_as_zero; +case GICR_WAKER : +/* Power management is not implemented */ + goto read_as_zero; +case GICR_SETLPIR : +/* WO. Read as zero */ + goto read_as_zero_64; +case GICR_CLRLPIR : +/* WO. Read as zero */ + goto read_as_zero_64; +case GICR_PROPBASER : +/* LPI's not implemented */ + goto read_as_zero_64; +case GICR_PENDBASER : +/* LPI's not implemented */ + goto read_as_zero_64; +case GICR_INVLPIR : +/* WO. Read as zero */ + goto read_as_zero_64; +case GICR_INVALLR : +/* WO. Read as zero */ + goto read_as_zero_64; +return 0 ; +case GICR_SYNCR : +if ( dabt.size !=DABT_WORD ) goto bad_width; +/* RO . But when read it always returns busy bito bit[0] */ + *r =GICR_SYNCR_NOT_BUSY ; +return 1 ; +case GICR_MOVLPIR : +/* WO Read as zero */ + goto read_as_zero_64; +case GICR_MOVALLR : +/* WO Read as zero */ + goto read_as_zero_64; +case GICR_PIDR0 : +if ( dabt.size !=DABT_WORD ) goto bad_width; + *r =GICV3_GICR_PIDR0 ; +return 1 ; +case GICR_PIDR1 : +if ( dabt.size !=DABT_WORD ) goto bad_width; + *r =GICV3_GICR_PIDR1 ; +return 1 ; +case GICR_PIDR2 : +if ( dabt.size !=DABT_WORD ) goto bad_width; + *r =GICV3_GICR_PIDR2 ; +return 1 ; +case GICR_PIDR3 : +/* Manufacture/customer defined */ + goto read_as_zero; +case GICR_PIDR4 : +if ( dabt.size !=DABT_WORD ) goto bad_width; + *r =GICV3_GICR_PIDR4 ; +return 1 ; + case GICR_PIDR5 ... GICR_PIDR7: +/* Reserved0 */ + goto read_as_zero; +default : +printk ("vGICv3: vGICR: read r%d offset %#08x\n not found" , + dabt.reg, gicr_reg); +return 0 ; + } +bad_width: +printk ("vGICv3: vGICR: bad read width %d r%d offset %#08x\n" , + dabt.size, dabt.reg, gicr_reg); +domain_crash_synchronous (); +return 0 ; + +read_as_zero_64: +if ( dabt.size !=DABT_DOUBLE_WORD ) goto bad_width; + *r =0 ; +return 1 ; + +read_as_zero: +if ( dabt.size !=DABT_WORD ) goto bad_width; + *r =0 ; +return 1 ; +} + +static int __vgic_v3_rdistr_rd_mmio_write (struct vcpu *v,mmio_info_t *info, +uint32_t gicr_reg) +{ +struct hsr_dabt dabt = info->dabt; +struct cpu_user_regs *regs =guest_cpu_user_regs (); +register_t *r =select_user_reg (regs, dabt.reg); + +switch ( gicr_reg ) + { +case GICR_CTLR : +/* LPI's not implemented */ + goto write_ignore; +case GICR_IIDR : +/* RO */ + goto write_ignore; +case GICR_TYPER : +/* RO */ + goto write_ignore_64; +case GICR_STATUSR : +/* Not implemented */ + goto write_ignore; +case GICR_WAKER : +/* Power mgmt not implemented */ + goto write_ignore; +case GICR_SETLPIR : +/* LPI is not implemented */ + goto write_ignore_64; +case GICR_CLRLPIR : +/* LPI is not implemented */ + goto write_ignore_64; +case GICR_PROPBASER : +/* LPI is not implemented */ + goto write_ignore_64; +case GICR_PENDBASER : +/* LPI is not implemented */ + goto write_ignore_64; +case GICR_INVLPIR : +/* LPI is not implemented */ + goto write_ignore_64; +case GICR_INVALLR : +/* LPI is not implemented */ + goto write_ignore_64; +case GICR_SYNCR : +/* RO */ + goto write_ignore; +case GICR_MOVLPIR : +/* LPI is not implemented */ + goto write_ignore_64; +case GICR_MOVALLR : +/* LPI is not implemented */ + goto write_ignore_64; + case GICR_PIDR7... GICR_PIDR0: +/* RO */ + goto write_ignore; +default : +printk ("vGICR: write r%d offset %#08x\n not found" , dabt.reg, gicr_reg); +return 0 ; + } +bad_width: +printk ("vGICR: bad write width %d r%d=%" PRIregister" offset %#08x\n" , + dabt.size, dabt.reg, *r, gicr_reg); +domain_crash_synchronous (); +return 0 ; + +write_ignore_64: +if ( dabt.size !=DABT_DOUBLE_WORD ) goto bad_width; +return 1 ; + +write_ignore: +if ( dabt.size !=DABT_WORD ) goto bad_width; +return 1 ; +} + +static int __vgic_v3_distr_common_mmio_read (struct vcpu *v,mmio_info_t *info, +uint32_t reg) +{ +struct hsr_dabt dabt = info->dabt; +struct cpu_user_regs *regs =guest_cpu_user_regs (); +register_t *r =select_user_reg (regs, dabt.reg); +struct vgic_irq_rank *rank; + +switch ( reg ) + { + case GICD_IGROUPR ... GICD_IGROUPRN: +/* We do not implement security extensions for guests, read zero */ + goto read_as_zero; + case GICD_ISENABLER ... GICD_ISENABLERN: +if ( dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,1 , reg -GICD_ISENABLER ,DABT_WORD ); +if ( rank ==NULL ) goto read_as_zero; +vgic_lock_rank (v, rank); + *r = rank->ienable; +vgic_unlock_rank (v, rank); +return 1 ; + case GICD_ICENABLER ... GICD_ICENABLERN: +if ( dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,1 , reg -GICD_ICENABLER ,DABT_WORD ); +if ( rank ==NULL ) goto read_as_zero; +vgic_lock_rank (v, rank); + *r = rank->ienable; +vgic_unlock_rank (v, rank); +return 1 ; + case GICD_ISPENDR ... GICD_ISPENDRN: +if ( dabt.size !=DABT_BYTE && dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,1 , reg -GICD_ISPENDR ,DABT_WORD ); +if ( rank ==NULL ) goto read_as_zero; +vgic_lock_rank (v, rank); + *r =vgic_byte_read (rank->ipend, dabt.sign, reg); +vgic_unlock_rank (v, rank); +return 1 ; + case GICD_ICPENDR ... GICD_ICPENDRN: +if ( dabt.size !=DABT_BYTE && dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,1 , reg -GICD_ICPENDR ,DABT_WORD ); +if ( rank ==NULL ) goto read_as_zero; +vgic_lock_rank (v, rank); + *r =vgic_byte_read (rank->ipend, dabt.sign, reg); +vgic_unlock_rank (v, rank); +return 1 ; + case GICD_ISACTIVER ... GICD_ISACTIVERN: +if ( dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,1 , reg -GICD_ISACTIVER ,DABT_WORD ); +if ( rank ==NULL ) goto read_as_zero; +vgic_lock_rank (v, rank); + *r = rank->iactive; +vgic_unlock_rank (v, rank); +return 1 ; + case GICD_ICACTIVER ... GICD_ICACTIVERN: +if ( dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,1 , reg -GICD_ICACTIVER ,DABT_WORD ); +if ( rank ==NULL ) goto read_as_zero; +vgic_lock_rank (v, rank); + *r = rank->iactive; +vgic_unlock_rank (v, rank); +return 1 ; + case GICD_IPRIORITYR ... GICD_IPRIORITYRN: +if ( dabt.size !=DABT_BYTE && dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,8 , reg -GICD_IPRIORITYR ,DABT_WORD ); +if ( rank ==NULL ) goto read_as_zero; + +vgic_lock_rank (v, rank); + *r = rank->ipriority[REG_RANK_INDEX (8 , reg -GICD_IPRIORITYR , +DABT_WORD )]; +if ( dabt.size ==DABT_BYTE ) + *r =vgic_byte_read (*r, dabt.sign, reg); +vgic_unlock_rank (v, rank); +return 1 ; + case GICD_ICFGR ... GICD_ICFGRN: +if ( dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,2 , reg -GICD_ICFGR ,DABT_WORD ); +if ( rank ==NULL ) goto read_as_zero; +vgic_lock_rank (v, rank); + *r = rank->icfg[REG_RANK_INDEX (2 , reg -GICD_ICFGR ,DABT_WORD )]; +vgic_unlock_rank (v, rank); +return 1 ; +default : +printk ("vGICv3: vGICD/vGICR: unhandled read r%d offset %#08x\n" , + dabt.reg, reg); +return 0 ; + } + +bad_width: +dprintk (XENLOG_ERR , +"vGICv3: vGICD/vGICR: bad read width %d r%d offset %#08x\n" , + dabt.size, dabt.reg, reg); +domain_crash_synchronous (); +return 0 ; + +read_as_zero: +if ( dabt.size !=DABT_WORD ) goto bad_width; + *r =0 ; +return 1 ; +} + +static int __vgic_v3_distr_common_mmio_write (struct vcpu *v,mmio_info_t *info, +uint32_t reg) +{ +struct hsr_dabt dabt = info->dabt; +struct cpu_user_regs *regs =guest_cpu_user_regs (); +register_t *r =select_user_reg (regs, dabt.reg); +struct vgic_irq_rank *rank; +uint32_t tr; + +switch ( reg ) + { + case GICD_IGROUPR ... GICD_IGROUPRN: +/* We do not implement security extensions for guests, write ignore */ + goto write_ignore; + case GICD_ISENABLER ... GICD_ISENABLERN: +if ( dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,1 , reg -GICD_ISENABLER ,DABT_WORD ); +if ( rank ==NULL ) goto write_ignore; +vgic_lock_rank (v, rank); + tr = rank->ienable; + rank->ienable |= *r; +vgic_unlock_rank (v, rank); +/* The irq number is extracted from offset. so shift by register size */ +vgic_enable_irqs (v, (*r) & (~tr), (reg -GICD_ISENABLER ) >>DABT_WORD ); +return 1 ; + case GICD_ICENABLER ... GICD_ICENABLERN: +if ( dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,1 , reg -GICD_ICENABLER ,DABT_WORD ); +if ( rank ==NULL ) goto write_ignore; +vgic_lock_rank (v, rank); + tr = rank->ienable; + rank->ienable &= ~*r; +vgic_unlock_rank (v, rank); +/* The irq number is extracted from offset. so shift by register size */ +vgic_disable_irqs (v, (*r) & tr, (reg -GICD_ICENABLER ) >>DABT_WORD ); +return 1 ; + case GICD_ISPENDR ... GICD_ISPENDRN: +if ( dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,1 , reg -GICD_ISPENDR ,DABT_WORD ); +if ( rank ==NULL ) goto write_ignore; +vgic_lock_rank (v, rank); + rank->ipend = *r; +vgic_unlock_rank (v, rank); +return 1 ; + case GICD_ICPENDR ... GICD_ICPENDRN: +if ( dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,1 , reg -GICD_ICPENDR ,DABT_WORD ); +if ( rank ==NULL ) goto write_ignore; +vgic_lock_rank (v, rank); + rank->ipend &= ~*r; +vgic_unlock_rank (v, rank); +return 1 ; + case GICD_ISACTIVER ... GICD_ISACTIVERN: +if ( dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,1 , reg -GICD_ISACTIVER ,DABT_WORD ); +if ( rank ==NULL ) goto write_ignore; +vgic_lock_rank (v, rank); + rank->iactive &= ~*r; +vgic_unlock_rank (v, rank); +return 1 ; + case GICD_ICACTIVER ... GICD_ICACTIVERN: +if ( dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,1 , reg -GICD_ICACTIVER ,DABT_WORD ); +if ( rank ==NULL ) goto write_ignore; +vgic_lock_rank (v, rank); + rank->iactive &= ~*r; +vgic_unlock_rank (v, rank); +return 1 ; + case GICD_IPRIORITYR ... GICD_IPRIORITYRN: +if ( dabt.size !=DABT_BYTE && dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,8 , reg -GICD_IPRIORITYR ,DABT_WORD ); +if ( rank ==NULL ) goto write_ignore; +vgic_lock_rank (v, rank); +if ( dabt.size ==DABT_WORD ) + rank->ipriority[REG_RANK_INDEX (8 , reg -GICD_IPRIORITYR , +DABT_WORD )] = *r; +else +vgic_byte_write (&rank->ipriority[REG_RANK_INDEX (8 , + reg -GICD_IPRIORITYR ,DABT_WORD )], *r, reg); +vgic_unlock_rank (v, rank); +return 1 ; +case GICD_ICFGR :/* Restricted to configure SGIs */ + goto write_ignore; + case GICD_ICFGR + 4 ... GICD_ICFGRN: /* PPI + SPIs */ +/* ICFGR1 for PPI's, which is implementation defined +if ICFGR1 is programmable or not. We chose to program */ +if ( dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,2 , reg -GICD_ICFGR ,DABT_WORD ); +if ( rank ==NULL ) goto write_ignore; +vgic_lock_rank (v, rank); + rank->icfg[REG_RANK_INDEX (2 , reg -GICD_ICFGR ,DABT_WORD )] = *r; +vgic_unlock_rank (v, rank); +return 1 ; +default : +printk ("vGICv3: vGICD/vGICR: unhandled write r%d " +"=%" PRIregister" offset %#08x\n" , dabt.reg, *r, reg); +return 0 ; + } + +bad_width: +dprintk (XENLOG_ERR , +"vGICv3: vGICD/vGICR: bad write width %d r%d=%" PRIregister" " +"offset %#08x\n" , dabt.size, dabt.reg, *r, reg); +domain_crash_synchronous (); +return 0 ; + +write_ignore: +if ( dabt.size !=DABT_WORD ) goto bad_width; +return 1 ; +} + +static int vgic_v3_rdistr_sgi_mmio_read (struct vcpu *v,mmio_info_t *info, +uint32_t gicr_reg) +{ +struct hsr_dabt dabt = info->dabt; +struct cpu_user_regs *regs =guest_cpu_user_regs (); +register_t *r =select_user_reg (regs, dabt.reg); +struct vgic_irq_rank *rank; + +switch ( gicr_reg ) + { +case GICR_IGRPMODR0 : +/* We do not implement security extensions for guests, read zero */ + goto read_as_zero; +case GICR_IGROUPR0 : +case GICR_ISENABLER0 : +case GICR_ICENABLER0 : +case GICR_ISACTIVER0 : +case GICR_ICACTIVER0 : + case GICR_IPRIORITYR0...GICR_IPRIORITYR7: + case GICR_ICFGR0... GICR_ICFGR1: +/* +* Above registers offset are common with GICD. +* So handle in common with GICD handling +*/ +return __vgic_v3_distr_common_mmio_read (v, info, gicr_reg); +case GICR_ISPENDR0 : +if ( dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,1 , gicr_reg -GICR_ISPENDR0 ,DABT_WORD ); +if ( rank ==NULL ) goto read_as_zero; +vgic_lock_rank (v, rank); + *r = rank->pendsgi; +vgic_unlock_rank (v, rank); +return 1 ; +case GICR_ICPENDR0 : +if ( dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,1 , gicr_reg -GICR_ICPENDR0 ,DABT_WORD ); +if ( rank ==NULL ) goto read_as_zero; +vgic_lock_rank (v, rank); + *r = rank->pendsgi; +vgic_unlock_rank (v, rank); +return 1 ; +case GICR_NSACR : +if ( dabt.size !=DABT_WORD ) goto bad_width; +return 1 ; +default : +printk ("vGICv3: vGICR: read r%d offset %#08x\n not found" , + dabt.reg, gicr_reg); +return 0 ; + } +bad_width: +printk ("vGICv3: vGICR: bad read width %d r%d offset %#08x\n" , + dabt.size, dabt.reg, gicr_reg); +domain_crash_synchronous (); +return 0 ; + +read_as_zero: +if ( dabt.size !=DABT_WORD ) goto bad_width; + *r =0 ; +return 1 ; +} + +static int vgic_v3_rdistr_sgi_mmio_write (struct vcpu *v,mmio_info_t *info, +uint32_t gicr_reg) +{ +struct hsr_dabt dabt = info->dabt; +struct cpu_user_regs *regs =guest_cpu_user_regs (); +register_t *r =select_user_reg (regs, dabt.reg); +struct vgic_irq_rank *rank; + +switch ( gicr_reg ) + { +case GICR_IGRPMODR0 : +/* We do not implement security extensions for guests, write ignore */ + goto write_ignore; +case GICR_IGROUPR0 : +case GICR_ISENABLER0 : +case GICR_ICENABLER0 : +case GICR_ISACTIVER0 : +case GICR_ICACTIVER0 : +case GICR_ICFGR1 : + case GICR_IPRIORITYR0...GICR_IPRIORITYR7: +/* +* Above registers offset are common with GICD. +* So handle common with GICD handling +*/ +return __vgic_v3_distr_common_mmio_write (v, info, gicr_reg); +case GICR_ISPENDR0 : +if ( dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,1 , gicr_reg -GICR_ISACTIVER0 ,DABT_WORD ); +if ( rank ==NULL ) goto write_ignore; +vgic_lock_rank (v, rank); +/* TODO: we just store the SGI pending status. Handle it properly */ + rank->pendsgi |= *r; +vgic_unlock_rank (v, rank); +return 1 ; +case GICR_ICPENDR0 : +if ( dabt.size !=DABT_WORD ) goto bad_width; + rank =vgic_rank_offset (v,1 , gicr_reg -GICR_ISACTIVER0 ,DABT_WORD ); +if ( rank ==NULL ) goto write_ignore; +vgic_lock_rank (v, rank); +/* TODO: we just store the SGI pending status. Handle it properly */ + rank->pendsgi &= ~*r; +vgic_unlock_rank (v, rank); +return 1 ; +case GICR_NSACR : +/* We do not implement security extensions for guests, write ignore */ + goto write_ignore; +default : +printk ("vGICv3: vGICR SGI: write r%d offset %#08x\n not found" , + dabt.reg, gicr_reg); +return 0 ; + } + +bad_width: +printk ("vGICR SGI: bad write width %d r%d=%" PRIregister" offset %#08x\n" , + dabt.size, dabt.reg, *r, gicr_reg); +domain_crash_synchronous (); +return 0 ; + +write_ignore: +if ( dabt.size !=DABT_WORD ) goto bad_width; +return 1 ; +} + +static int vgic_v3_rdistr_mmio_read (struct vcpu *v,mmio_info_t *info) +{ +uint32_t offset; + + offset = info->gpa & (v->domain->arch.vgic.rdist_stride -1 ); + +if ( offset <SZ_64K ) +return __vgic_v3_rdistr_rd_mmio_read (v, info, offset); +else if ( (offset >=SZ_64K ) && (offset <2 *SZ_64K ) ) +return vgic_v3_rdistr_sgi_mmio_read (v, info, (offset -SZ_64K )); +else +gdprintk (XENLOG_WARNING , +"vGICv3: vGICR: unknown gpa read address %" PRIpaddr"\n" , + info->gpa); + +return 0 ; +} + +static int vgic_v3_rdistr_mmio_write (struct vcpu *v,mmio_info_t *info) +{ +uint32_t offset; + + offset = info->gpa & (v->domain->arch.vgic.rdist_stride -1 ); +if ( offset <SZ_64K ) +return __vgic_v3_rdistr_rd_mmio_write (v, info, offset); +else if ( (offset >=SZ_64K ) && (offset <2 *SZ_64K ) ) +return vgic_v3_rdistr_sgi_mmio_write (v, info, (offset -SZ_64K )); +else +gdprintk (XENLOG_WARNING , +"vGICV3: vGICR: unknown gpa write address %" PRIpaddr"\n" , + info->gpa); + +return 0 ; +} + +static int vgic_v3_distr_mmio_read (struct vcpu *v,mmio_info_t *info) +{ +struct hsr_dabt dabt = info->dabt; +struct cpu_user_regs *regs =guest_cpu_user_regs (); +register_t *r =select_user_reg (regs, dabt.reg); +struct vgic_irq_rank *rank; +int gicd_reg = (int )(info->gpa - v->domain->arch.vgic.dbase); + +switch ( gicd_reg ) + { +case GICD_CTLR : +if ( dabt.size !=DABT_WORD ) goto bad_width; +vgic_lock (v); + *r = v->domain->arch.vgic.ctlr; +vgic_unlock (v); +return 1 ; +case GICD_TYPER : +if ( dabt.size !=DABT_WORD ) goto bad_width; +/* No secure world support for guests. */ + *r = (((v->domain->max_vcpus <<5 ) &GICD_TYPE_CPUS ) | + ((v->domain->arch.vgic.nr_lines /32 ) &GICD_TYPE_LINES )); +return 1 ; +case GICD_STATUSR : +/* +* Optional, Not implemented for now. +* Update to support guest debugging. +*/ + goto read_as_zero; +case GICD_IIDR : +if ( dabt.size !=DABT_WORD ) goto bad_width; + *r =GICV3_GICD_IIDR_VAL ; +return 1 ; + case 0x020 ... 0x03c: + case 0xc000 ... 0xffcc: +/* Implementation defined -- read as zero */ + goto read_as_zero; + case GICD_IGROUPR ... GICD_IGROUPRN: + case GICD_ISENABLER ... GICD_ISENABLERN: + case GICD_ICENABLER ... GICD_ICENABLERN: + case GICD_ISPENDR ... GICD_ISPENDRN: + case GICD_ICPENDR ... GICD_ICPENDRN: + case GICD_ISACTIVER ... GICD_ISACTIVERN: + case GICD_IPRIORITYR ... GICD_IPRIORITYRN: + case GICD_ICFGR ... GICD_ICFGRN: +/* +* Above all register are common with GICR and GICD +* Manage in common +*/ +return __vgic_v3_distr_common_mmio_read (v, info, gicd_reg); + case GICD_IROUTER ... GICD_IROUTER31: +/* SGI/PPI is RES0 */ + goto read_as_zero_64; + case GICD_IROUTER32 ... GICD_IROUTERN: +if ( dabt.size !=DABT_DOUBLE_WORD ) goto bad_width; + rank =vgic_rank_offset (v,64 , gicd_reg -GICD_IROUTER ,DABT_DOUBLE_WORD ); +if ( rank ==NULL ) goto read_as_zero; +vgic_lock_rank (v, rank); +/* IROUTER is 64 bit so, to make it byte size right shift by 3. +Here once. macro REG_RANK_INDEX will do it twice */ + *r = rank->v3.irouter[REG_RANK_INDEX (64 , + (gicd_reg -GICD_IROUTER ),DABT_DOUBLE_WORD )]; +vgic_unlock_rank (v, rank); +return 1 ; + case GICD_NSACR ... GICD_NSACRN: +/* We do not implement security extensions for guests, read zero */ + goto read_as_zero; +case GICD_SGIR : +/* Read as ICH_SGIR system register with SRE set. So ignore */ + goto read_as_zero; + case GICD_CPENDSGIR ... GICD_CPENDSGIRN: +/* Replaced with GICR_ICPENDR0. So ignore write */ + goto read_as_zero; + case GICD_SPENDSGIR ... GICD_SPENDSGIRN: +/* Replaced with GICR_ISPENDR0. So ignore write */ + goto read_as_zero; +case GICD_PIDR0 : +/* GICv3 identification value */ +if ( dabt.size !=DABT_WORD ) goto bad_width; + *r =GICV3_GICD_PIDR0 ; +return 1 ; +case GICD_PIDR1 : +/* GICv3 identification value */ +if ( dabt.size !=DABT_WORD ) goto bad_width; + *r =GICV3_GICD_PIDR1 ; +return 1 ; +case GICD_PIDR2 : +/* GICv3 identification value */ +if ( dabt.size !=DABT_WORD ) goto bad_width; + *r =GICV3_GICD_PIDR2 ; +return 1 ; +case GICD_PIDR3 : +/* GICv3 identification value. Manufacturer/Customer defined */ + goto read_as_zero; +case GICD_PIDR4 : +/* GICv3 identification value */ +if ( dabt.size !=DABT_WORD ) goto bad_width; + *r =GICV3_GICD_PIDR4 ; +return 1 ; + case GICD_PIDR5 ... GICD_PIDR7: +/* Reserved0 */ + goto read_as_zero; +case 0x00c : +case 0x044 : +case 0x04c : + case 0x05c ... 0x07c: + case 0xf30 ... 0x5fcc: + case 0x8000 ... 0xbfcc: +/* These are reserved register addresses */ +printk ("vGICv3: vGICD: read unknown 0x00c .. 0xfcc r%d offset %#08x\n" , + dabt.reg, gicd_reg); + goto read_as_zero; +default : +printk ("vGICv3: vGICD: unhandled read r%d offset %#08x\n" , + dabt.reg, gicd_reg); +return 0 ; + } + +bad_width: +dprintk (XENLOG_ERR ,"vGICv3: vGICD: bad read width %d r%d offset %#08x\n" , + dabt.size, dabt.reg, gicd_reg); +domain_crash_synchronous (); +return 0 ; + +read_as_zero_64: +if ( dabt.size !=DABT_DOUBLE_WORD ) goto bad_width; + *r =0 ; +return 1 ; + +read_as_zero: +if ( dabt.size !=DABT_WORD ) goto bad_width; + *r =0 ; +return 1 ; +} + +static int vgic_v3_distr_mmio_write (struct vcpu *v,mmio_info_t *info) +{ +struct hsr_dabt dabt = info->dabt; +struct cpu_user_regs *regs =guest_cpu_user_regs (); +register_t *r =select_user_reg (regs, dabt.reg); +struct vgic_irq_rank *rank; +int gicd_reg = (int )(info->gpa - v->domain->arch.vgic.dbase); + +switch ( gicd_reg ) + { +case GICD_CTLR : +if ( dabt.size !=DABT_WORD ) goto bad_width; +/* Ignore all but the enable bit */ + v->domain->arch.vgic.ctlr = (*r) &GICD_CTL_ENABLE ; +return 1 ; +case GICD_TYPER : +/* RO -- write ignored */ + goto write_ignore; +case GICD_IIDR : +/* RO -- write ignored */ + goto write_ignore; +case GICD_STATUSR : +/* RO -- write ignored */ + goto write_ignore; +case GICD_SETSPI_NSR : +/* Message based SPI is not implemented */ + goto write_ignore; +case GICD_CLRSPI_NSR : +/* Message based SPI is not implemented */ + goto write_ignore; +case GICD_SETSPI_SR : +/* Message based SPI is not implemented */ + goto write_ignore; +case GICD_CLRSPI_SR : +/* Message based SPI is not implemented */ + goto write_ignore; + case 0x020 ... 0x03c: + case 0xc000 ... 0xffcc: +/* Implementation defined -- write ignored */ +printk ("vGICv3: vGICD: write unknown 0x020 - 0x03c r%d offset %#08x\n" , + dabt.reg, gicd_reg); + goto write_ignore; + case GICD_IGROUPR ... GICD_IGROUPRN: + case GICD_ISENABLER ... GICD_ISENABLERN: + case GICD_ICENABLER ... GICD_ICENABLERN: + case GICD_ISPENDR ... GICD_ISPENDRN: + case GICD_ICPENDR ... GICD_ICPENDRN: + case GICD_ISACTIVER ... GICD_ISACTIVERN: + case GICD_ICACTIVER ... GICD_ICACTIVERN: + case GICD_IPRIORITYR ... GICD_IPRIORITYRN: + case GICD_ICFGR ... GICD_ICFGRN: +/* Above registers are common with GICR and GICD +* Manage in common */ +return __vgic_v3_distr_common_mmio_write (v, info, gicd_reg); + case GICD_IROUTER ... GICD_IROUTER31: +/* SGI/PPI is RES0 */ + goto write_ignore_64; + case GICD_IROUTER32 ... GICD_IROUTERN: +if ( dabt.size !=DABT_DOUBLE_WORD ) goto bad_width; + rank =vgic_rank_offset (v,64 , gicd_reg -GICD_IROUTER ,DABT_DOUBLE_WORD ); +if ( rank ==NULL ) goto write_ignore_64; +if ( *r ) + { +/* TODO: Ignored. We don't support irq delivery for vcpu != 0 */ +gdprintk (XENLOG_DEBUG , +"SPI delivery to secondary cpus not supported\n" ); + goto write_ignore_64; + } +vgic_lock_rank (v, rank); + rank->v3.irouter[REG_RANK_INDEX (64 , + (gicd_reg -GICD_IROUTER ),DABT_DOUBLE_WORD )] = *r; +vgic_unlock_rank (v, rank); +return 1 ; + case GICD_NSACR ... GICD_NSACRN: +/* We do not implement security extensions for guests, write ignore */ + goto write_ignore; +case GICD_SGIR : +/* it is accessed as system register in GICv3 */ + goto write_ignore; + case GICD_CPENDSGIR ... GICD_CPENDSGIRN: +/* Replaced with GICR_ICPENDR0. So ignore write */ +if ( dabt.size !=DABT_WORD ) goto bad_width; +return 0 ; + case GICD_SPENDSGIR ... GICD_SPENDSGIRN: +/* Replaced with GICR_ISPENDR0. So ignore write */ +if ( dabt.size !=DABT_WORD ) goto bad_width; +return 0 ; + case GICD_PIDR7... GICD_PIDR0: +/* RO -- write ignore */ + goto write_ignore; +case 0x00c : +case 0x044 : +case 0x04c : + case 0x05c ... 0x07c: + case 0xf30 ... 0x5fcc: + case 0x8000 ... 0xbfcc: +/* Reserved register addresses */ +printk ("vGICv3: vGICD: write unknown 0x00c 0xfcc r%d offset %#08x\n" , + dabt.reg, gicd_reg); + goto write_ignore; +default : +printk ("vGICv3: vGICD: unhandled write r%d=%" PRIregister" " +"offset %#08x\n" , dabt.reg, *r, gicd_reg); +return 0 ; + } + +bad_width: +dprintk (XENLOG_ERR , +"VGICv3: vGICD: bad write width %d r%d=%" PRIregister" " +"offset %#08x\n" , dabt.size, dabt.reg, *r, gicd_reg); +domain_crash_synchronous (); +return 0 ; + +write_ignore: +if ( dabt.size !=DABT_WORD ) goto bad_width; +return 1 ; + +write_ignore_64: +if ( dabt.size !=DABT_DOUBLE_WORD ) goto bad_width; +return 1 ; +} + +static const struct mmio_handler_ops vgic_rdistr_mmio_handler = { + .read_handler = vgic_v3_rdistr_mmio_read, + .write_handler = vgic_v3_rdistr_mmio_write, +}; + +static const struct mmio_handler_ops vgic_distr_mmio_handler = { + .read_handler = vgic_v3_distr_mmio_read, + .write_handler = vgic_v3_distr_mmio_write, +}; + +static int vgicv3_vcpu_init (struct vcpu *v) +{ +int i; +uint64_t affinity; + +/* For SGI and PPI the target is always this CPU */ + affinity = (MPIDR_AFFINITY_LEVEL (v->arch.vmpidr,3 ) <<32 | +MPIDR_AFFINITY_LEVEL (v->arch.vmpidr,2 ) <<16 | +MPIDR_AFFINITY_LEVEL (v->arch.vmpidr,1 ) <<8 | +MPIDR_AFFINITY_LEVEL (v->arch.vmpidr,0 )); + +for ( i =0 ; i <32 ; i++ ) + v->arch.vgic.private_irqs->v3.irouter[i] = affinity; + +return 0 ; +} + +static int vgicv3_domain_init (struct domain *d) +{ +int i; + +/* We rely on gicv init to get dbase and size */ +register_mmio_handler (d, &vgic_distr_mmio_handler, d->arch.vgic.dbase, + d->arch.vgic.dbase_size); + +/* +* Register mmio handler per redistributor region but not for +* every sgi rdist region which is per core. +* The redistributor region encompasses per core sgi region. +*/ +for ( i =0 ; i < d->arch.vgic.rdist_count; i++ ) +register_mmio_handler (d, &vgic_rdistr_mmio_handler, + d->arch.vgic.rbase[i], d->arch.vgic.rbase_size[i]); + +return 0 ; +} + +static const struct vgic_ops v3_ops = { + .vcpu_init = vgicv3_vcpu_init, + .domain_init = vgicv3_domain_init, +}; + +int vgic_v3_init (struct domain *d) +{ +register_vgic_ops (d, &v3_ops); + +return 0 ; +} + +/* +* Local variables: +* mode: C +* c-file-style: "BSD" +* c-basic-offset: 4 +* indent-tabs-mode: nil +* End: +*/ xen/arch/arm/vgic.c +6
-0@@ -69,6 +69,12 @@ int domain_vgic_init(struct domain *d)switch (gic_hw_version () ) { +#ifdef CONFIG_ARM_64 +case GIC_V3 : +if (vgic_v3_init (d) ) +return -ENODEV ; +break ; +#endif case GIC_V2 :if (vgic_v2_init (d) )return -ENODEV ;xen/include/asm-arm/vgic.h +12
-2@@ -83,7 +83,14 @@ struct vgic_irq_rank {uint32_t ienable, iactive, ipend, pendsgi;uint32_t icfg[2 ];uint32_t ipriority[8 ]; -uint32_t itargets[8 ]; +union { +struct { +uint32_t itargets[8 ]; + }v2; +struct { +uint64_t irouter[32 ]; + }v3; + }; };struct vgic_ops {@@ -110,6 +117,9 @@ static inline int REG_RANK_NR(int b, uint32_t n) {switch ( b ) { +case 64 :return n >>6 ; +case 32 :return n >>5 ; +case 16 :return n >>4 ;case 8 :return n >>3 ;case 4 :return n >>2 ;case 2 :return n >>1 ;@@ -159,6 +169,7 @@ extern void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n);extern void vgic_enable_irqs (struct vcpu *v,uint32_t r,int n);extern void register_vgic_ops (struct domain *d,const struct vgic_ops *ops);int vgic_v2_init (struct domain *d); +int vgic_v3_init (struct domain *d);extern int vcpu_vgic_free (struct vcpu *v); extern int vgic_to_sgi(struct vcpu *v, register_t sgir, --1.7.9.5
Re: [PATCH v8 4/7] xen/arm: Add virtual GICv3 support
Quoted 2 lines · Vijay Kilari
Please ignore this patch.
There are some alignment issues reappearing
OK.
I suppose there isn't much point in taking #3 without this?
FYI I'm seeing a trap in gicv3_init when running on a model. I haven't tracked it down to an actual location yet though. I'll let you know what I find.
Ian.
Re: [PATCH v8 4/7] xen/arm: Add virtual GICv3 support
Quoted 3 lines · Ian Campbell
FYI I'm seeing a trap in
gicv3_initwhen running on a model. I haven't tracked it down to an actual location yet though. I'll let you know what I find.
The access to ICC_BPR1_EL1 in gicv3_cpu_init is faulting for some reason. do_hyp_trap is then access current-> but it is too soon to do that, hence a data abort occurs which is what I was seeing.
This is on a fast model with the boot-wrapper, perhaps the "firmware" failed to setup something?
BTW, ICC_BPR1_EL1 is the secure alias of the NS version of the register. Why not just use the NS version directly?
Ian.
Re: [PATCH v8 4/7] xen/arm: Add virtual GICv3 support
Quoted 8 lines · Ian Campbell
Quoted 3 lines · Ian Campbell
FYI I'm seeing a trap in
gicv3_initwhen running on a model. I haven't tracked it down to an actual location yet though. I'll let you know what I find.The access to
ICC_BPR1_EL1ingicv3_cpu_initis faulting for some reason.do_hyp_trapis then access current-> but it is too soon to do that, hence a data abort occurs which is what I was seeing.
In which "case" does Xen end up? The sysreg one?
If so, it looks wrong to me that an error who come from the hypervisor is using the current variable.
Regards,
Signature · 1 line
Julien Grall
Re: [PATCH v8 4/7] xen/arm: Add virtual GICv3 support
Quoted 11 lines · Julien Grall
Quoted 8 lines · Ian Campbell
Quoted 3 lines · Ian Campbell
FYI I'm seeing a trap in
gicv3_initwhen running on a model. I haven't tracked it down to an actual location yet though. I'll let you know what I find.The access to
ICC_BPR1_EL1ingicv3_cpu_initis faulting for some reason.do_hyp_trapis then access current-> but it is too soon to do that, hence a data abort occurs which is what I was seeing.In which "case" does Xen end up? The sysreg one?
Yes.
Quoted 2 lines
If so, it looks wrong to me that an error who come from the hypervisor is using the current variable.
Correct, although it's an unexpected occurrence in the normal case.
If we intended to "probe" for system registers then we'd need to handle this case explicitly. As it stands it just lead to a rather odd failure mode. We could perhaps add some debugging checks on regs->cpsr mode.
Ian.
Re: [PATCH v8 4/7] xen/arm: Add virtual GICv3 support
Quoted 15 lines · Ian Campbell
Quoted 11 lines · Julien Grall
Quoted 8 lines · Ian Campbell
Quoted 3 lines · Ian Campbell
FYI I'm seeing a trap in
gicv3_initwhen running on a model. I haven't tracked it down to an actual location yet though. I'll let you know what I find.The access to
ICC_BPR1_EL1ingicv3_cpu_initis faulting for some reason.do_hyp_trapis then access current-> but it is too soon to do that, hence a data abort occurs which is what I was seeing.In which "case" does Xen end up? The sysreg one?
Yes.
Quoted 8 lines
Quoted 2 lines
If so, it looks wrong to me that an error who come from the hypervisor is using the current variable.
Correct, although it's an unexpected occurrence in the normal case.
If we intended to "probe" for system registers then we'd need to handle this case explicitly. As it stands it just lead to a rather odd failure mode. We could perhaps add some debugging checks on
regs->cpsrmode.
I think it's a good idea to add debugging checks. It would avoid spending time to understand what's going.
But it's not part of this series.
Regards,
Signature · 1 line
Julien Grall
Re: [PATCH v8 4/7] xen/arm: Add virtual GICv3 support
In reply to Ian CampbellQuoted 11 lines · Ian Campbell
Quoted 3 lines · Ian Campbell
FYI I'm seeing a trap in
gicv3_initwhen running on a model. I haven't tracked it down to an actual location yet though. I'll let you know what I find.The access to
ICC_BPR1_EL1ingicv3_cpu_initis faulting for some reason.do_hyp_trapis then access current-> but it is too soon to do that, hence a data abort occurs which is what I was seeing.This is on a fast model with the boot-wrapper, perhaps the "firmware" failed to setup something?
IIRC, the "firmware" has to configure some register in secure. I suspect it's ICC_SRE_EL1.
I guess your bootwrapper already contains this stuff.
Quoted 2 lines
BTW,
ICC_BPR1_EL1is the secure alias of the NS version of the register. Why not just use the NS version directly?
AFAIU the spec, the name is not different between secure and non-secure. The processor will know it following the state.
Regards,
Signature · 1 line
Julien Grall
Re: [PATCH v8 4/7] xen/arm: Add virtual GICv3 support
Quoted 10 lines · Julien Grall
Quoted 9 lines · Ian Campbell
Quoted 3 lines · Ian Campbell
FYI I'm seeing a trap in
gicv3_initwhen running on a model. I haven't tracked it down to an actual location yet though. I'll let you know what I find.The access to
ICC_BPR1_EL1ingicv3_cpu_initis faulting for some reason.do_hyp_trapis then access current-> but it is too soon to do that, hence a data abort occurs which is what I was seeing.
Quoted 5 lines
Quoted 2 lines
This is on a fast model with the boot-wrapper, perhaps the "firmware" failed to setup something?
IIRC, the "firmware" has to configure some register in secure. I suspect it's
ICC_SRE_EL1.
_EL3, but otherwise I think you are right.
Quoted 1 line
I guess your bootwrapper already contains this stuff.
It turns out it does not because I'm using an old version of the upstream bootwrapper modified for Xen.
Unfortunately upstream has moved on in ways which make rebasing the Xen support a case of a complete rewrite so I'd been putting it off. Looks like it just got bumped up the TODO a bit...
Quoted 6 lines
Quoted 2 lines
BTW,
ICC_BPR1_EL1is the secure alias of the NS version of the register. Why not just use the NS version directly?AFAIU the spec, the name is not different between secure and non-secure. The processor will know it following the state.
The spec says:
This register is an alias of the Non-secure view of ICC_BPR0_EL1, and a Secure access to this register is identical to a Non-secure access to ICC_BPR0_EL1.
So for Xen (necessarily running NS) ICC_BPR0_EL1 and ICC_BPR1_EL1 are the same, but accessing BPR0 would seem more natural.
Ian.
Re: [PATCH v8 4/7] xen/arm: Add virtual GICv3 support
Quoted 11 lines · Ian Campbell
Quoted 10 lines · Julien Grall
Quoted 9 lines · Ian Campbell
Quoted 3 lines · Ian Campbell
FYI I'm seeing a trap in
gicv3_initwhen running on a model. I haven't tracked it down to an actual location yet though. I'll let you know what I find.The access to
ICC_BPR1_EL1ingicv3_cpu_initis faulting for some reason.do_hyp_trapis then access current-> but it is too soon to do that, hence a data abort occurs which is what I was seeing.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
This is on a fast model with the boot-wrapper, perhaps the "firmware" failed to setup something?
IIRC, the "firmware" has to configure some register in secure. I suspect it's
ICC_SRE_EL1.
_EL3, but otherwise I think you are right.
It might be worse to add a check in Xen that ICC_SRE_EL3 as the SRE bit enabled.
Quoted 16 lines
Quoted 1 line
I guess your bootwrapper already contains this stuff.
It turns out it does not because I'm using an old version of the upstream bootwrapper modified for Xen.
Unfortunately upstream has moved on in ways which make rebasing the Xen support a case of a complete rewrite so I'd been putting it off. Looks like it just got bumped up the TODO a bit...
Quoted 6 lines
Quoted 2 lines
BTW,
ICC_BPR1_EL1is the secure alias of the NS version of the register. Why not just use the NS version directly?AFAIU the spec, the name is not different between secure and non-secure. The processor will know it following the state.
Quoted 7 lines
The spec says:
This register is an alias of the Non-secure view ofICC_BPR0_EL1, and a Secure access to this register is identical to a Non-secure access toICC_BPR0_EL1.So for Xen (necessarily running NS)
ICC_BPR0_EL1andICC_BPR1_EL1are the same, but accessing BPR0 would seem more natural.
You are right. I read quickly the specification.
Regards,
Signature · 1 line
Julien Grall
Re: [PATCH v8 4/7] xen/arm: Add virtual GICv3 support
Quoted 2 lines · Julien Grall
It might be worse to add a check in Xen that
ICC_SRE_EL3as the SRE bit enabled.
I don't think it is readable from EL2.
Ian.
Re: [PATCH v8 4/7] xen/arm: Add virtual GICv3 support
Quoted 6 lines · Ian Campbell
Quoted 2 lines · Julien Grall
It might be worse to add a check in Xen that
ICC_SRE_EL3as the SRE bit enabled.I don't think it is readable from EL2.
Oh yes.
FWIW, the Linux documentation say:
"For systems with a GICv3 interrupt controller:
- If EL3 is present:
ICC_SRE_EL3.Enable (bit 3) must be initialiased to 0b1. ICC_SRE_EL3.SRE (bit 0) must be initialised to 0b1.
- If the kernel is entered at EL1:
ICC.SRE_EL2.Enable (bit 3) must be initialised to 0b1 ICC_SRE_EL2.SRE (bit 0) must be initialised to 0b1.
"
I guess if the firmware doesn't set up correctly those values, then it's the problem of the firmware developper.
Regards,
Signature · 1 line
Julien Grall
PATCH v8 5/7 xen/arm: Update Dom0 GIC dt node with GICv3 information
In reply to [email protected]From: Vijaya Kumar K <[email protected]>
Update GIC device tree node for DOM0 with GICv3 information. GIC hw specfic device tree information is moved to respective GIC driver.
---
v8: - Remove GICV3 dt strings and introduced in patch 3
--- xen/arch/arm/domain_build.c | 47 ++------------------------ xen/arch/arm/gic-v2.c | 51 ++++++++++++++++++++++++++++ xen/arch/arm/gic-v3.c | 78 +++++++++++++++++++++++++++++++++++++++++++ xen/arch/arm/gic.c | 6 ++++ xen/include/asm-arm/gic.h | 4 +++ 5 files changed, 141 insertions(+), 45 deletions(-)
xen/arch/arm/domain_build.c +2 -45
@@ -526,9 +526,6 @@ static int make_gic_node(const struct domain *d, void *fdt, const struct dt_device_node *node) {const struct dt_device_node *gic = dt_interrupt_controller; -const void *compatible =NULL ; -u32 len; -__be32 *new_cells, *tmp;int res =0 ;/*
@@ -543,48 +540,7 @@ static int make_gic_node(const struct domain *d, void *fdt,DPRINT ("Create gic node\n" ); - compatible =dt_get_property (gic,"compatible" , &len); -if ( !compatible ) - { -dprintk (XENLOG_ERR ,"Can't find compatible property for the gic node\n" ); -return -FDT_ERR_XEN (ENOENT ); - } - - res =fdt_begin_node (fdt,"interrupt-controller" ); -if ( res ) -return res; - - res =fdt_property (fdt,"compatible" , compatible, len); -if ( res ) -return res; - - res =fdt_property_cell (fdt,"#interrupt-cells" ,3 ); -if ( res ) -return res; - - res =fdt_property (fdt,"interrupt-controller" ,NULL ,0 ); - -if ( res ) -return res; - - len =dt_cells_to_size (dt_n_addr_cells (node) +dt_n_size_cells (node)); - len *=2 ;/* GIC has two memory regions: Distributor + CPU interface */ - new_cells =xzalloc_bytes (len); -if ( new_cells ==NULL ) -return -FDT_ERR_XEN (ENOMEM ); - - tmp = new_cells; -DPRINT (" Set Distributor Base 0x%" PRIpaddr"-0x%" PRIpaddr"\n" , - d->arch.vgic.dbase, d->arch.vgic.dbase +PAGE_SIZE -1 ); -dt_set_range (&tmp, node, d->arch.vgic.dbase,PAGE_SIZE ); - -DPRINT (" Set Cpu Base 0x%" PRIpaddr"-0x%" PRIpaddr"\n" , - d->arch.vgic.cbase, d->arch.vgic.cbase + (PAGE_SIZE *2 ) -1 ); -dt_set_range (&tmp, node, d->arch.vgic.cbase,PAGE_SIZE *2 ); - - res =fdt_property (fdt,"reg" , new_cells, len); -xfree (new_cells); - + res =gic_make_node (d, node, fdt);if ( res )return res;
@@ -805,6 +761,7 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,static const struct dt_device_match gic_matches[]__initconst = {DT_MATCH_GIC_V2 , +DT_MATCH_GIC_V3 , {/* sentinel */ }, }; static const struct dt_device_match timer_matches[] __initconst =
xen/arch/arm/gic-v2.c +51 -0
69 lines not on this page · raw message
xen/arch/arm/gic-v3.c +78 -0
96 lines not on this page · raw message
xen/arch/arm/gic.c +6 -0
@@ -616,6 +616,12 @@ void __cpuinit init_maintenance_interrupt(void) "irq-maintenance", NULL); } +int gic_make_node (const struct domain *d,const struct dt_device_node *node, +void *fdt) +{ +return gic_hw_ops->make_dt_node (d, node, fdt); +} +/* * Local variables: * mode: C
xen/include/asm-arm/gic.h +4 -0
@@ -336,9 +336,13 @@ struct gic_hw_operations {unsigned int (*read_apr)(int apr_reg);/* Secondary CPU init */ int (*secondary_init)(void ); +int (*make_dt_node)(const struct domain *d, +const struct dt_device_node *node,void *fdt); };void register_gic_ops (const struct gic_hw_operations *ops); +int gic_make_node (const struct domain *d,const struct dt_device_node *node, +void *fdt);#endif /* __ASSEMBLY__ */ #endif
Signature · 1 line
1.7.9.5
PATCH v8 6/7 xen/arm: add SGI handling for GICv3
In reply to [email protected]From: Vijaya Kumar K <[email protected]>
In ARMv8, write to ICC_SGI1R_EL1 register raises trap to EL2. Handle the trap and inject SGI to vcpu.
---
v8: - Return 0 on wrong irqmode instead of BUG()
- Add Comment on ignoring affinity 1,2,3 for SGI
- Assert on emulate_sysreg callback
v7: - Introduced callback for sysreg emulation
- Removed unused parameter in inject_undef_exception()
- Use inject_undef64_exception for reporting sysreg handling failure
v6: - Removed forward declaration of vgic_to_sgi() in vgic-v3.c
- Used vgic callback for SGI handling
- Alignment changes
--- xen/arch/arm/traps.c | 15 +++++++++++ xen/arch/arm/vgic-v3.c | 54 +++++++++++++++++++++++++++++++++++++ xen/arch/arm/vgic.c | 9 +++++++ xen/include/asm-arm/gic_v3_defs.h | 7 +++++ xen/include/asm-arm/sysregs.h | 3 +++ xen/include/asm-arm/vgic.h | 3 +++ 6 files changed, 91 insertions(+)
xen/arch/arm/traps.c +15 -0
@@ -41,6 +41,7 @@#include "decode.h" #include "vtimer.h" #include <asm/gic.h> +#include <asm/vgic.h> /* The base of the stack must always be double-word aligned, which means * that both the kernel half of struct cpu_user_regs (which is pushed in
@@ -1641,6 +1642,20 @@ static void do_sysreg(struct cpu_user_regs *regs,domain_crash_synchronous (); }break ; +case HSR_SYSREG_ICC_SGI1R_EL1 : +if ( !vgic_emulate (regs, hsr) ) + { +dprintk (XENLOG_WARNING , +"failed emulation of sysreg ICC_SGI1R_EL1 access\n" ); +inject_undef64_exception (regs, hsr.len); + } +break ; +case HSR_SYSREG_ICC_SGI0R_EL1 : +case HSR_SYSREG_ICC_ASGI1R_EL1 : +/* TBD: Implement to support secure grp0/1 SGI forwarding */ +dprintk (XENLOG_WARNING , +"Emulation of sysreg ICC_SGI0R_EL1/ASGI1R_EL1 not supported\n" ); +inject_undef64_exception (regs, hsr.len);default : bad_sysreg: {
xen/arch/arm/vgic-v3.c +54 -0
66 lines not on this page · raw message
xen/arch/arm/vgic.c +9 -0
@@ -344,6 +344,15 @@ out:smp_send_event_check_mask (cpumask_of (v->processor)); } +int vgic_emulate (struct cpu_user_regs *regs,union hsr hsr) +{ +struct vcpu *v = current; + +ASSERT (v->domain->arch.vgic.handler->emulate_sysreg !=NULL ); + +return v->domain->arch.vgic.handler->emulate_sysreg (regs, hsr); +} +/* * Local variables: * mode: C
xen/include/asm-arm/gic_v3_defs.h +7 -0
@@ -146,6 +146,13 @@#define GICH_VMCR_PRIORITY_MASK 0xff#define GICH_VMCR_PRIORITY_SHIFT 24 +#define ICH_SGI_IRQMODE_SHIFT 40 +#define ICH_SGI_IRQMODE_MASK 0x1 +#define ICH_SGI_TARGET_OTHERS 1 +#define ICH_SGI_TARGET_LIST 0 +#define ICH_SGI_IRQ_SHIFT 24 +#define ICH_SGI_IRQ_MASK 0xf +#define ICH_SGI_TARGETLIST_MASK 0xffff#endif /* __ASM_ARM_GIC_V3_DEFS_H__ */ /*
xen/include/asm-arm/sysregs.h +3 -0
@@ -78,6 +78,9 @@#define HSR_SYSREG_PMINTENCLR_EL1 HSR_SYSREG(3,0,c9,c14,2)#define HSR_SYSREG_MAIR_EL1 HSR_SYSREG(3,0,c10,c2,0)#define HSR_SYSREG_AMAIR_EL1 HSR_SYSREG(3,0,c10,c3,0) +#define HSR_SYSREG_ICC_SGI1R_EL1 HSR_SYSREG(3,0,c12,c11,5) +#define HSR_SYSREG_ICC_ASGI1R_EL1 HSR_SYSREG(3,1,c12,c11,6) +#define HSR_SYSREG_ICC_SGI0R_EL1 HSR_SYSREG(3,2,c12,c11,7)#define HSR_SYSREG_CONTEXTIDR_EL1 HSR_SYSREG(3,0,c13,c0,1)#define HSR_SYSREG_PMCR_EL0 HSR_SYSREG(3,3,c9,c12,0)
xen/include/asm-arm/vgic.h +3 -0
@@ -98,6 +98,8 @@ struct vgic_ops {int (*vcpu_init)(struct vcpu *v);/* Domain specific initialization of vGIC */ int (*domain_init)(struct domain *d); +/* vGIC sysreg emulation */ +int (*emulate_sysreg)(struct cpu_user_regs *regs,union hsr hsr); };/* Number of ranks of interrupt registers for a domain */
@@ -165,6 +167,7 @@ extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq);extern void vgic_clear_pending_irqs (struct vcpu *v);extern struct pending_irq *irq_to_pending (struct vcpu *v,unsigned int irq);extern struct vgic_irq_rank *vgic_rank_offset (struct vcpu *v,int b,int n,int s); +extern int vgic_emulate (struct cpu_user_regs *regs,union hsr hsr);extern void vgic_disable_irqs (struct vcpu *v,uint32_t r,int n);extern void vgic_enable_irqs (struct vcpu *v,uint32_t r,int n);extern void register_vgic_ops (struct domain *d,const struct vgic_ops *ops);
Signature · 1 line
1.7.9.5
Re: [PATCH v8 6/7] xen/arm: add SGI handling for GICv3
Quoted 6 lines · On Wed, 23 Jul 2014, [email protected] wrote:
From: Vijaya Kumar K <[email protected]>
In ARMv8, write to
ICC_SGI1R_EL1register raises trap to EL2. Handle the trap and inject SGI to vcpu.Signed-off-by Vijaya Kumar K <[email protected]>
Looks good.
Quoted 201 lines
v8: - Return 0 on wrong irqmode instead of
BUG()
- Add Comment on ignoring affinity 1,2,3 for SGI
- Assert onemulate_sysregcallback
v7: - Introduced callback for sysreg emulation
- Removed unused parameter ininject_undef_exception()
- Useinject_undef64_exceptionfor reporting sysreg handling failurev6: - Removed forward declaration of
vgic_to_sgi()invgic-v3.c
- Used vgic callback for SGI handling
- Alignment changes--- xen/arch/arm/traps.c | 15 +++++++++++ xen/arch/arm/vgic-v3.c | 54 +++++++++++++++++++++++++++++++++++++ xen/arch/arm/vgic.c | 9 +++++++ xen/include/asm-arm/gic_v3_defs.h | 7 +++++ xen/include/asm-arm/sysregs.h | 3 +++ xen/include/asm-arm/vgic.h | 3 +++ 6 files changed, 91 insertions(+)xen/arch/arm/traps.c +15
-0@@ -41,6 +41,7 @@#include "decode.h" #include "vtimer.h" #include <asm/gic.h> +#include <asm/vgic.h> /* The base of the stack must always be double-word aligned, which means * that both the kernel half of struct cpu_user_regs (which is pushed in @@ -1641,6 +1642,20 @@ static void do_sysreg(struct cpu_user_regs *regs,domain_crash_synchronous (); }break ; +case HSR_SYSREG_ICC_SGI1R_EL1 : +if ( !vgic_emulate (regs, hsr) ) + { +dprintk (XENLOG_WARNING , +"failed emulation of sysreg ICC_SGI1R_EL1 access\n" ); +inject_undef64_exception (regs, hsr.len); + } +break ; +case HSR_SYSREG_ICC_SGI0R_EL1 : +case HSR_SYSREG_ICC_ASGI1R_EL1 : +/* TBD: Implement to support secure grp0/1 SGI forwarding */ +dprintk (XENLOG_WARNING , +"Emulation of sysreg ICC_SGI0R_EL1/ASGI1R_EL1 not supported\n" ); +inject_undef64_exception (regs, hsr.len);default : bad_sysreg: {xen/arch/arm/vgic-v3.c +54
-0@@ -850,6 +850,59 @@ write_ignore_64:return 1 ; } +static int vgicv3_to_sgi (struct vcpu *v,register_t sgir) +{ +int virq; +int irqmode; +enum gic_sgi_mode sgi_mode; +unsigned long vcpu_mask =0 ; + + irqmode = (sgir >>ICH_SGI_IRQMODE_SHIFT ) &ICH_SGI_IRQMODE_MASK ; + virq = (sgir >>ICH_SGI_IRQ_SHIFT ) &ICH_SGI_IRQ_MASK ; +/* SGI's are injected at Rdist level 0. ignoring affinity 1, 2, 3 */ + vcpu_mask = sgir &ICH_SGI_TARGETLIST_MASK ; + +/* Map GIC sgi value to enum value */ +switch ( irqmode ) + { +case ICH_SGI_TARGET_LIST : + sgi_mode =SGI_TARGET_LIST ; +break ; +case ICH_SGI_TARGET_OTHERS : + sgi_mode =SGI_TARGET_OTHERS ; +break ; +default : +gdprintk (XENLOG_WARNING ,"Wrong irq mode in SGI1R_EL1 register\n" ); +return 0 ; + } + +return vgic_to_sgi (v, sgir, sgi_mode, virq, vcpu_mask); +} + +static int vgicv3_emulate_sysreg (struct cpu_user_regs *regs,union hsr hsr) +{ +struct vcpu *v = current; +struct hsr_sysreg sysreg = hsr.sysreg; +register_t *r =select_user_reg (regs, sysreg.reg); + +ASSERT (hsr.ec ==HSR_EC_SYSREG ); + +switch ( hsr.bits &HSR_SYSREG_REGS_MASK ) + { +case HSR_SYSREG_ICC_SGI1R_EL1 : +/* WO */ +if ( !sysreg.read ) +return vgicv3_to_sgi (v, *r); +else + { +gdprintk (XENLOG_WARNING ,"Reading SGI1R_EL1 - WO register\n" ); +return 0 ; + } +default : +return 0 ; + } +} +static const struct mmio_handler_ops vgic_rdistr_mmio_handler = { .read_handler = vgic_v3_rdistr_mmio_read, .write_handler = vgic_v3_rdistr_mmio_write,@@ -900,6 +953,7 @@ static int vgicv3_domain_init(struct domain *d)static const struct vgic_ops v3_ops = { .vcpu_init = vgicv3_vcpu_init, .domain_init = vgicv3_domain_init, + .emulate_sysreg = vgicv3_emulate_sysreg, };int vgic_v3_init (struct domain *d)xen/arch/arm/vgic.c +9
-0@@ -344,6 +344,15 @@ out:smp_send_event_check_mask (cpumask_of (v->processor)); } +int vgic_emulate (struct cpu_user_regs *regs,union hsr hsr) +{ +struct vcpu *v = current; + +ASSERT (v->domain->arch.vgic.handler->emulate_sysreg !=NULL ); + +return v->domain->arch.vgic.handler->emulate_sysreg (regs, hsr); +} +/* * Local variables: * mode: C xen/include/asm-arm/gic_v3_defs.h +7
-0@@ -146,6 +146,13 @@#define GICH_VMCR_PRIORITY_MASK 0xff#define GICH_VMCR_PRIORITY_SHIFT 24 +#define ICH_SGI_IRQMODE_SHIFT 40 +#define ICH_SGI_IRQMODE_MASK 0x1 +#define ICH_SGI_TARGET_OTHERS 1 +#define ICH_SGI_TARGET_LIST 0 +#define ICH_SGI_IRQ_SHIFT 24 +#define ICH_SGI_IRQ_MASK 0xf +#define ICH_SGI_TARGETLIST_MASK 0xffff#endif /* __ASM_ARM_GIC_V3_DEFS_H__ */ /* xen/include/asm-arm/sysregs.h +3
-0@@ -78,6 +78,9 @@#define HSR_SYSREG_PMINTENCLR_EL1 HSR_SYSREG(3,0,c9,c14,2)#define HSR_SYSREG_MAIR_EL1 HSR_SYSREG(3,0,c10,c2,0)#define HSR_SYSREG_AMAIR_EL1 HSR_SYSREG(3,0,c10,c3,0) +#define HSR_SYSREG_ICC_SGI1R_EL1 HSR_SYSREG(3,0,c12,c11,5) +#define HSR_SYSREG_ICC_ASGI1R_EL1 HSR_SYSREG(3,1,c12,c11,6) +#define HSR_SYSREG_ICC_SGI0R_EL1 HSR_SYSREG(3,2,c12,c11,7)#define HSR_SYSREG_CONTEXTIDR_EL1 HSR_SYSREG(3,0,c13,c0,1)#define HSR_SYSREG_PMCR_EL0 HSR_SYSREG(3,3,c9,c12,0)xen/include/asm-arm/vgic.h +3
-0@@ -98,6 +98,8 @@ struct vgic_ops {int (*vcpu_init)(struct vcpu *v);/* Domain specific initialization of vGIC */ int (*domain_init)(struct domain *d); +/* vGIC sysreg emulation */ +int (*emulate_sysreg)(struct cpu_user_regs *regs,union hsr hsr); };/* Number of ranks of interrupt registers for a domain */ @@ -165,6 +167,7 @@ extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq);extern void vgic_clear_pending_irqs (struct vcpu *v);extern struct pending_irq *irq_to_pending (struct vcpu *v,unsigned int irq);extern struct vgic_irq_rank *vgic_rank_offset (struct vcpu *v,int b,int n,int s); +extern int vgic_emulate (struct cpu_user_regs *regs,union hsr hsr);extern void vgic_disable_irqs (struct vcpu *v,uint32_t r,int n);extern void vgic_enable_irqs (struct vcpu *v,uint32_t r,int n);extern void register_vgic_ops (struct domain *d,const struct vgic_ops *ops);Signature · 1 line
1.7.9.5
Re: [PATCH v8 6/7] xen/arm: add SGI handling for GICv3
In reply to [email protected]Hi Vijay,
Quoted 6 lines · On 07/23/2014 02:41 PM, [email protected] wrote:
From: Vijaya Kumar K <[email protected]>
In ARMv8, write to
ICC_SGI1R_EL1register raises trap to EL2. Handle the trap and inject SGI to vcpu.Signed-off-by Vijaya Kumar K <[email protected]>
Regards,
Quoted 200 lines
---
v8: - Return 0 on wrong irqmode instead ofBUG()
- Add Comment on ignoring affinity 1,2,3 for SGI
- Assert onemulate_sysregcallback
v7: - Introduced callback for sysreg emulation
- Removed unused parameter ininject_undef_exception()
- Useinject_undef64_exceptionfor reporting sysreg handling failurev6: - Removed forward declaration of
vgic_to_sgi()invgic-v3.c
- Used vgic callback for SGI handling
- Alignment changes--- xen/arch/arm/traps.c | 15 +++++++++++ xen/arch/arm/vgic-v3.c | 54 +++++++++++++++++++++++++++++++++++++ xen/arch/arm/vgic.c | 9 +++++++ xen/include/asm-arm/gic_v3_defs.h | 7 +++++ xen/include/asm-arm/sysregs.h | 3 +++ xen/include/asm-arm/vgic.h | 3 +++ 6 files changed, 91 insertions(+)xen/arch/arm/traps.c +15
-0@@ -41,6 +41,7 @@#include "decode.h" #include "vtimer.h" #include <asm/gic.h> +#include <asm/vgic.h> /* The base of the stack must always be double-word aligned, which means * that both the kernel half of struct cpu_user_regs (which is pushed in @@ -1641,6 +1642,20 @@ static void do_sysreg(struct cpu_user_regs *regs,domain_crash_synchronous (); }break ; +case HSR_SYSREG_ICC_SGI1R_EL1 : +if ( !vgic_emulate (regs, hsr) ) + { +dprintk (XENLOG_WARNING , +"failed emulation of sysreg ICC_SGI1R_EL1 access\n" ); +inject_undef64_exception (regs, hsr.len); + } +break ; +case HSR_SYSREG_ICC_SGI0R_EL1 : +case HSR_SYSREG_ICC_ASGI1R_EL1 : +/* TBD: Implement to support secure grp0/1 SGI forwarding */ +dprintk (XENLOG_WARNING , +"Emulation of sysreg ICC_SGI0R_EL1/ASGI1R_EL1 not supported\n" ); +inject_undef64_exception (regs, hsr.len);default : bad_sysreg: {xen/arch/arm/vgic-v3.c +54
-0@@ -850,6 +850,59 @@ write_ignore_64:return 1 ; } +static int vgicv3_to_sgi (struct vcpu *v,register_t sgir) +{ +int virq; +int irqmode; +enum gic_sgi_mode sgi_mode; +unsigned long vcpu_mask =0 ; + + irqmode = (sgir >>ICH_SGI_IRQMODE_SHIFT ) &ICH_SGI_IRQMODE_MASK ; + virq = (sgir >>ICH_SGI_IRQ_SHIFT ) &ICH_SGI_IRQ_MASK ; +/* SGI's are injected at Rdist level 0. ignoring affinity 1, 2, 3 */ + vcpu_mask = sgir &ICH_SGI_TARGETLIST_MASK ; + +/* Map GIC sgi value to enum value */ +switch ( irqmode ) + { +case ICH_SGI_TARGET_LIST : + sgi_mode =SGI_TARGET_LIST ; +break ; +case ICH_SGI_TARGET_OTHERS : + sgi_mode =SGI_TARGET_OTHERS ; +break ; +default : +gdprintk (XENLOG_WARNING ,"Wrong irq mode in SGI1R_EL1 register\n" ); +return 0 ; + } + +return vgic_to_sgi (v, sgir, sgi_mode, virq, vcpu_mask); +} + +static int vgicv3_emulate_sysreg (struct cpu_user_regs *regs,union hsr hsr) +{ +struct vcpu *v = current; +struct hsr_sysreg sysreg = hsr.sysreg; +register_t *r =select_user_reg (regs, sysreg.reg); + +ASSERT (hsr.ec ==HSR_EC_SYSREG ); + +switch ( hsr.bits &HSR_SYSREG_REGS_MASK ) + { +case HSR_SYSREG_ICC_SGI1R_EL1 : +/* WO */ +if ( !sysreg.read ) +return vgicv3_to_sgi (v, *r); +else + { +gdprintk (XENLOG_WARNING ,"Reading SGI1R_EL1 - WO register\n" ); +return 0 ; + } +default : +return 0 ; + } +} +static const struct mmio_handler_ops vgic_rdistr_mmio_handler = { .read_handler = vgic_v3_rdistr_mmio_read, .write_handler = vgic_v3_rdistr_mmio_write,@@ -900,6 +953,7 @@ static int vgicv3_domain_init(struct domain *d)static const struct vgic_ops v3_ops = { .vcpu_init = vgicv3_vcpu_init, .domain_init = vgicv3_domain_init, + .emulate_sysreg = vgicv3_emulate_sysreg, };int vgic_v3_init (struct domain *d)xen/arch/arm/vgic.c +9
-0@@ -344,6 +344,15 @@ out:smp_send_event_check_mask (cpumask_of (v->processor)); } +int vgic_emulate (struct cpu_user_regs *regs,union hsr hsr) +{ +struct vcpu *v = current; + +ASSERT (v->domain->arch.vgic.handler->emulate_sysreg !=NULL ); + +return v->domain->arch.vgic.handler->emulate_sysreg (regs, hsr); +} +/* * Local variables: * mode: C xen/include/asm-arm/gic_v3_defs.h +7
-0@@ -146,6 +146,13 @@#define GICH_VMCR_PRIORITY_MASK 0xff#define GICH_VMCR_PRIORITY_SHIFT 24 +#define ICH_SGI_IRQMODE_SHIFT 40 +#define ICH_SGI_IRQMODE_MASK 0x1 +#define ICH_SGI_TARGET_OTHERS 1 +#define ICH_SGI_TARGET_LIST 0 +#define ICH_SGI_IRQ_SHIFT 24 +#define ICH_SGI_IRQ_MASK 0xf +#define ICH_SGI_TARGETLIST_MASK 0xffff#endif /* __ASM_ARM_GIC_V3_DEFS_H__ */ /* xen/include/asm-arm/sysregs.h +3
-0@@ -78,6 +78,9 @@#define HSR_SYSREG_PMINTENCLR_EL1 HSR_SYSREG(3,0,c9,c14,2)#define HSR_SYSREG_MAIR_EL1 HSR_SYSREG(3,0,c10,c2,0)#define HSR_SYSREG_AMAIR_EL1 HSR_SYSREG(3,0,c10,c3,0) +#define HSR_SYSREG_ICC_SGI1R_EL1 HSR_SYSREG(3,0,c12,c11,5) +#define HSR_SYSREG_ICC_ASGI1R_EL1 HSR_SYSREG(3,1,c12,c11,6) +#define HSR_SYSREG_ICC_SGI0R_EL1 HSR_SYSREG(3,2,c12,c11,7)#define HSR_SYSREG_CONTEXTIDR_EL1 HSR_SYSREG(3,0,c13,c0,1)#define HSR_SYSREG_PMCR_EL0 HSR_SYSREG(3,3,c9,c12,0)xen/include/asm-arm/vgic.h +3
-0@@ -98,6 +98,8 @@ struct vgic_ops {int (*vcpu_init)(struct vcpu *v);/* Domain specific initialization of vGIC */ int (*domain_init)(struct domain *d); +/* vGIC sysreg emulation */ +int (*emulate_sysreg)(struct cpu_user_regs *regs,union hsr hsr); };/* Number of ranks of interrupt registers for a domain */ @@ -165,6 +167,7 @@ extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq);extern void vgic_clear_pending_irqs (struct vcpu *v);extern struct pending_irq *irq_to_pending (struct vcpu *v,unsigned int irq);extern struct vgic_irq_rank *vgic_rank_offset (struct vcpu *v,int b,int n,int s); +extern int vgic_emulate (struct cpu_user_regs *regs,union hsr hsr);extern void vgic_disable_irqs (struct vcpu *v,uint32_t r,int n);extern void vgic_enable_irqs (struct vcpu *v,uint32_t r,int n);extern void register_vgic_ops (struct domain *d,const struct vgic_ops *ops);
Signature · 1 line
Julien Grall
Re: [PATCH v8 6/7] xen/arm: add SGI handling for GICv3
In reply to [email protected]Quoted 6 lines · On Wed, 2014-07-23 at 19:11 +0530, [email protected] wrote:
From: Vijaya Kumar K <[email protected]>
In ARMv8, write to
ICC_SGI1R_EL1register raises trap to EL2. Handle the trap and inject SGI to vcpu.Signed-off-by Vijaya Kumar K <[email protected]>
PATCH v8 7/7 xen/arm: check for GICv3 platform support
In reply to [email protected]From: Vijaya Kumar K <[email protected]>
ID_AA64PFR0_EL1 register provides information about GIC support. Check for this register in GICv3 driver.
Also print GICv3 support information in boot log
---
v8: - Rearranged prf64 structure member variables
v7: - return -ENODEV on lack GICv3 platform support instead of
panic
--- xen/arch/arm/gic-v3.c | 7 +++++++ xen/arch/arm/setup.c | 5 +++-- xen/include/asm-arm/cpufeature.h | 1 + xen/include/asm-arm/processor.h | 4 ++-- 4 files changed, 13 insertions(+), 4 deletions(-)
xen/arch/arm/gic-v3.c +7 -0
@@ -39,6 +39,7 @@#include <asm/device.h> #include <asm/gic.h> #include <asm/gic_v3_defs.h> +#include <asm/cpufeature.h> struct rdist_region {paddr_t base;
@@ -1143,6 +1144,12 @@ static int __init gicv3_init(struct dt_device_node *node, const void *data)int res, i;uint32_t reg; +if ( !cpu_has_gicv3 ) + { +dprintk (XENLOG_ERR ,"Platform does not support GICv3\n" ); +return -ENODEV ; + } +dt_device_set_used_by (node,DOMID_XEN ); res =dt_device_get_address (node,0 , &gicv3.dbase, &gicv3.dbase_size);
xen/arch/arm/setup.c +3 -2
@@ -100,9 +100,10 @@ static void __init processor_id(void) cpu_has_el2_32 ?"64+32" : cpu_has_el2_64 ?"64" :"No" , cpu_has_el1_32 ?"64+32" : cpu_has_el1_64 ?"64" :"No" , cpu_has_el0_32 ? "64+32" : cpu_has_el0_64 ? "64" : "No"); -printk (" Extensions:%s%s\n" , +printk (" Extensions:%s%s%s\n" , cpu_has_fp ?" FloatingPoint" :"" , - cpu_has_simd ?" AdvancedSIMD" :"" ); + cpu_has_simd ?" AdvancedSIMD" :"" , + cpu_has_gicv3 ?" GICv3" :"" );printk (" Debug Features: %016" PRIx64" %016" PRIx64"\n" , boot_cpu_data.dbg64.bits[0 ], boot_cpu_data.dbg64.bits[1 ]);
xen/include/asm-arm/cpufeature.h +1 -0
@@ -15,6 +15,7 @@#define cpu_has_el3_64 (boot_cpu_feature64(el3) >= 1)#define cpu_has_fp (boot_cpu_feature64(fp) == 0)#define cpu_has_simd (boot_cpu_feature64(simd) == 0) +#define cpu_has_gicv3 (boot_cpu_feature64(gic) == 1)#endif #define cpu_feature32 (c, feat) ((c)->pfr32.feat)
xen/include/asm-arm/processor.h +2 -2
@@ -188,8 +188,8 @@ struct cpuinfo_arm { unsigned long el3:4; unsigned long fp:4; /* Floating Point */ unsigned long simd:4; /* Advanced SIMD */ - unsigned long __res0:8; - + unsigned long gic:4; /* GIC support */ + unsigned long __res0:4;unsigned long __res1; }; } pfr64;
Signature · 1 line
1.7.9.5
Re: [PATCH v8 7/7] xen/arm: check for GICv3 platform support
Quoted 32 lines · On 07/23/2014 02:41 PM, [email protected] wrote:
From: Vijaya Kumar K <[email protected]>
ID_AA64PFR0_EL1register provides information about GIC support. Check for this register in GICv3 driver.Also print GICv3 support information in boot log
Signed-off-by Vijaya Kumar K <[email protected]>---
v8: - Rearranged prf64 structure member variables
v7: - return-ENODEVon lack GICv3 platform support instead of
panic--- xen/arch/arm/gic-v3.c | 7 +++++++ xen/arch/arm/setup.c | 5 +++-- xen/include/asm-arm/cpufeature.h | 1 + xen/include/asm-arm/processor.h | 4 ++-- 4 files changed, 13 insertions(+), 4 deletions(-)xen/arch/arm/gic-v3.c +1
-0@@ -39,6 +39,7 @@#include <asm/device.h> #include <asm/gic.h> #include <asm/gic_v3_defs.h> +#include <asm/cpufeature.h> struct rdist_region {paddr_t base;
xen/arch/arm/gic-v3.c static int __init gicv3_init(struct dt_device_node *node, const void *data) · line 1149
Quoted 6 lines
xen/arch/arm/gic-v3.c +3
-0@@ -1143,6 +1144,12 @@ static int __init gicv3_init(struct dt_device_node *node, const void *data)int res, i;uint32_t reg; +if ( !cpu_has_gicv3 ) + { +dprintk (XENLOG_ERR ,"Platform does not support GICv3\n" );
AFAIU, this field indicates if we support GICv3 system registers or not. It's entirely possible to use a GICv3 without system registers (see 4.4.1 System Register Access to CPU Interface Registers).
So I would be more specific in the error message. Smth like:
"The GICv3 drivers request system registers support.".
Quoted 11 lines
xen/arch/arm/gic-v3.c +3
-0+return -ENODEV ; + } +dt_device_set_used_by (node,DOMID_XEN ); res =dt_device_get_address (node,0 , &gicv3.dbase, &gicv3.dbase_size);xen/arch/arm/setup.c +0
-0
xen/arch/arm/setup.c static void __init processor_id(void) · line 106
Quoted 9 lines
xen/arch/arm/setup.c +3
-2@@ -100,9 +100,10 @@ static void __init processor_id(void) cpu_has_el2_32 ?"64+32" : cpu_has_el2_64 ?"64" :"No" , cpu_has_el1_32 ?"64+32" : cpu_has_el1_64 ?"64" :"No" , cpu_has_el0_32 ? "64+32" : cpu_has_el0_64 ? "64" : "No"); -printk (" Extensions:%s%s\n" , +printk (" Extensions:%s%s%s\n" , cpu_has_fp ?" FloatingPoint" :"" , - cpu_has_simd ?" AdvancedSIMD" :"" ); + cpu_has_simd ?" AdvancedSIMD" :"" , + cpu_has_gicv3 ?" GICv3" :"" );
I would rename into GICv3SysReg.
Regards,
Signature · 1 line
Julien Grall
Hi Vijay,
Quoted 10 lines · On 23/07/14 14:41, [email protected] wrote:
From: Vijaya Kumar K <[email protected]>
Add GICv3 support for arm64 platform.
From v6 version, this patch series is split into v6a and v6.
All the GICv2 and VGIC code refactoring patches of v6a are merged.The v8 version of GICv3 patches are posted here.
Tested with ARM64 simulator with multicore core
and booted Dom0 kernel.
Do you have any plan to add support for guest? This actual series looks pointless to me if we are only able to boot DOM0... Hence, this series doesn't support GICv2 emulation on GICv3.
It would be nice if you fix the toolstack as soon as possible.
Regards,
Signature · 1 line
Julien Grall
Quoted 9 lines · Julien Grall
Hi Vijay,
Quoted 6 lines · On 23/07/14 14:41, [email protected] wrote:
From: Vijaya Kumar K <[email protected]>
Add GICv3 support for arm64 platform.
From v6 version, this patch series is split into v6a and v6.
All the GICv2 and VGIC code refactoring patches of v6a are merged.
Quoted 7 lines
Quoted 4 lines
The v8 version of GICv3 patches are posted here.
Tested with ARM64 simulator with multicore core
and booted Dom0 kernel.Do you have any plan to add support for guest? This actual series looks pointless to me if we are only able to boot DOM0...
That's not pointless, it's a necessary step along the way to supporting GICv3.
Remember: Xen wouldn't boot on these systems at all without GICv3 support (since they lack v2 compatibility in h/w), so getting to a dom0 prompt is a useful step in its own right.
Quoted 4 lines
Hence, this series
doesn't support GICv2 emulation on GICv3.It would be nice if you fix the toolstack as soon as possible.
A not for application bodge at the end of the series would be nice, but not critical IMHO. Proper toolstack level support for gic v3 can come next.
Ian.
Quoted 25 lines · Ian Campbell
Quoted 9 lines · Julien Grall
Hi Vijay,
Quoted 6 lines · On 23/07/14 14:41, [email protected] wrote:
From: Vijaya Kumar K <[email protected]>
Add GICv3 support for arm64 platform.
From v6 version, this patch series is split into v6a and v6.
All the GICv2 and VGIC code refactoring patches of v6a are merged.Quoted 7 lines
Quoted 4 lines
The v8 version of GICv3 patches are posted here.
Tested with ARM64 simulator with multicore core
and booted Dom0 kernel.Do you have any plan to add support for guest? This actual series looks pointless to me if we are only able to boot DOM0...
That's not pointless, it's a necessary step along the way to supporting GICv3.
Remember: Xen wouldn't boot on these systems at all without GICv3 support (since they lack v2 compatibility in h/w), so getting to a dom0 prompt is a useful step in its own right.
Quoted 8 lines
Quoted 4 lines
Hence, this series
doesn't support GICv2 emulation on GICv3.It would be nice if you fix the toolstack as soon as possible.
A not for application bodge at the end of the series would be nice, but not critical IMHO. Proper toolstack level support for gic v3 can come next.
I'm mostly worry on the fact in 8 versions of this series we didn't see any support/testing for GICv3 guest.
If it doesn't happen that mean we will have a Xen 4.5 with GICv3 support only able to boot DOM0...
I want to make sure that won't happen.
Regards,
Signature · 1 line
Julien Grall
Quoted 5 lines · Julien Grall
I'm mostly worry on the fact in 8 versions of this series we didn't see any support/testing for GICv3 guest.
If it doesn't happen that mean we will have a Xen 4.5 with GICv3 support only able to boot DOM0...
That would indeed to unfortunate, even if it doesn't block this series as it is.
Vijay, are you planning to work on GICv3 guest support once the basic Host support is in?
Ian.
A message that is not in the archive (sent off-list or not yet received): CALicx6ucRFNP4A3a2uBPTmhYzKtNWNOvwmPLUfy4Z2DoYDVr3g@mail.gmail.com
(reinstating the cc)
Quoted 4 lines · Vijay Kilari
On Mon, Aug 4, 2014 at 4:12 PM, Ian Campbell <[email protected]> wrote:
Yes, Already I have booted domU with GICv3 patches with changes to xl tool.
Excellent!
Quoted 1 line
Need some time to make it generic and send patches.
Perhaps you could send out whatever dirty version you have now for people who want to try GICv3 to play with?
Quoted 6 lines
BTW, I have following questions
1) The device tree is generated by xl tool for domU is hardcoding GICv2 node. How to generate device tree for GICv2 & GICv3 based on DomU? Should we always generate GIC node based on HW support (by query hw support via domctl) ?
Something like that, yes.
There's a few different aspects which need to be taken care of, first of all what the hardware+Xen actual support (v2 only, v3 only, v3 w/ v2 compat, vN+1 etc) and what the guest cfg actually asks for, what to do if the guest cfg asks for something which Xen can't manage (e.g. v2 on a v3 only system etc).
I think Julien is adding a domctl to control the number of SPIs in his passthrough series. It probably makes sense to extend that into a more generic "gic cfg" domctl with a field for requesting the version of gic to support for this guest, with an explicit "default" setting for letting Xen choose. I think it would be preferable to do all the gic setup in one domctl, rather than proliferate loads of them.
By default I suppose Xen should be able to pick the latest GIC, unless the guest cfg file says otherwise.
Which means we need some mechanism to find out the actual version which Xen picked, so that the toolstack can generate the appropriate DTB node. Perhaps that is as simple as having the domctl field be IN/OUT i.e. updated with the actual selection.
I think we can get away with not exposing what Xen supports by simply failing domctl requests for things which can't be done. If we really do need this then we can perhaps use XENVER_capabilities or something new which exposes which versions of h/w we support. I suppose we'll need something like that sooner or later.
Quoted 10 lines
2) The GIC regs are hardcoded to physical base address for DOMU in
xen/include/public/arch-arm.h/* Physical Address Space */
#define GUEST_GICD_BASE 0x03001000ULL #define GUEST_GICD_SIZE 0x00001000ULL #define GUEST_GICC_BASE 0x03002000ULL #define GUEST_GICC_SIZE 0x00000100ULLany idea why it is kept same as physical address?
Same as what physical address?
The guest physical address space is static (and unrelated to any particular hardware). So far we haven't had a need to make it dynamic.
Note that these are shared only between the Xen hypervisor (which implements the "hardware") and Xen toolstack (which generates the DTB describing the "hardware"). These defines are surrounded by ifdefs so that e.g. guest kernels do not see them.
Quoted 1 line
How about for GICv3?. can we encode physical base address for domU's?
Yes. Just need to reserve some space, it can reuse the existing spaces or extend it as needed. I think there is plenty of room in the vicinity of 0x03xxxxxx.
Ian.
Hi Ian,
Quoted 8 lines · Ian Campbell
(reinstating the cc)
Quoted 4 lines · Vijay Kilari
On Mon, Aug 4, 2014 at 4:12 PM, Ian Campbell <[email protected]> wrote:
Yes, Already I have booted domU with GICv3 patches with changes to xl tool.
Quoted 6 lines
Excellent!
Quoted 1 line
Need some time to make it generic and send patches.
Perhaps you could send out whatever dirty version you have now for people who want to try GICv3 to play with?
If there are no further comments on GICv3 patches,
I can fix pending NITs and send new version, which you can merge. This helps to test DomUs and your 48 bit support RFC patches.
Quoted 16 lines
Quoted 7 lines
BTW, I have following questions
1) The device tree is generated by xl tool for domU is hardcoding GICv2 node. How to generate device tree for GICv2 & GICv3 based on DomU? Should we always generate GIC node based on HW support (by query hw support via domctl) ?
Something like that, yes.
There's a few different aspects which need to be taken care of, first of all what the hardware+Xen actual support (v2 only, v3 only, v3 w/ v2 compat, vN+1 etc) and what the guest cfg actually asks for, what to do if the guest cfg asks for something which Xen can't manage (e.g. v2 on a v3 only system etc).
Quoted 7 lines
I think Julien is adding a domctl to control the number of SPIs in his passthrough series. It probably makes sense to extend that into a more generic "gic cfg" domctl with a field for requesting the version of gic to support for this guest, with an explicit "default" setting for letting Xen choose. I think it would be preferable to do all the gic setup in one domctl, rather than proliferate loads of them.
Any reference to Julien's patches for the same?
Hello Vijay,
Quoted 13 lines · Vijay Kilari
Hi Ian,
Quoted 10 lines · Ian Campbell
(reinstating the cc)
Quoted 4 lines · Vijay Kilari
On Mon, Aug 4, 2014 at 4:12 PM, Ian Campbell <[email protected]> wrote:
Yes, Already I have booted domU with GICv3 patches with changes to xl tool.
Excellent!
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Need some time to make it generic and send patches.
Perhaps you could send out whatever dirty version you have now for people who want to try GICv3 to play with?
If there are no further comments on GICv3 patches,
I can fix pending NITs and send new version, which you can merge. This helps to test DomUs and your 48 bit support RFC patches.
I think Ian was asking to have a dirty version of your patch to support GICv3 on guest.
It would be nice if you can send it. So people can give a try of the support on the ARM64 model.
Quoted 16 lines
Quoted 16 lines
Quoted 7 lines
BTW, I have following questions
1) The device tree is generated by xl tool for domU is hardcoding GICv2 node. How to generate device tree for GICv2 & GICv3 based on DomU? Should we always generate GIC node based on HW support (by query hw support via domctl) ?
Something like that, yes.
There's a few different aspects which need to be taken care of, first of all what the hardware+Xen actual support (v2 only, v3 only, v3 w/ v2 compat, vN+1 etc) and what the guest cfg actually asks for, what to do if the guest cfg asks for something which Xen can't manage (e.g. v2 on a v3 only system etc).
Quoted 6 lines
Quoted 6 lines
I think Julien is adding a domctl to control the number of SPIs in his passthrough series. It probably makes sense to extend that into a more generic "gic cfg" domctl with a field for requesting the version of gic to support for this guest, with an explicit "default" setting for letting Xen choose. I think it would be preferable to do all the gic setup in one domctl, rather than proliferate loads of them.
The plan was to allow the hypercall to be extended. I'm sure we would need to configure other things in the future.
Quoted 3 lines
Quoted 1 line
Any reference to Julien's patches for the same?
https://patches.linaro.org/34664/
Regards,
Signature · 1 line
Julien Grall
Quoted 25 lines · Julien Grall
Hello Vijay,
Quoted 13 lines · Vijay Kilari
Hi Ian,
Quoted 10 lines · Ian Campbell
(reinstating the cc)
Quoted 4 lines · Vijay Kilari
On Mon, Aug 4, 2014 at 4:12 PM, Ian Campbell <[email protected]> wrote:
Yes, Already I have booted domU with GICv3 patches with changes to xl tool.
Excellent!
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Need some time to make it generic and send patches.
Perhaps you could send out whatever dirty version you have now for people who want to try GICv3 to play with?
If there are no further comments on GICv3 patches,
I can fix pending NITs and send new version, which you can merge. This helps to test DomUs and your 48 bit support RFC patches.
Quoted 5 lines
I think Ian was asking to have a dirty version of your patch to support GICv3 on guest.
It would be nice if you can send it. So people can give a try of the support on the ARM64 model.
I have sent trivial patch for testing GICv3 with domU. Any further comments on GICv3 patch series?.
Regards
Vijay
Quoted 26 lines · Vijay Kilari
Quoted 25 lines · Julien Grall
Hello Vijay,
Quoted 21 lines · Vijay Kilari
Hi Ian,
Quoted 8 lines · Ian Campbell
(reinstating the cc)
Quoted 4 lines · Vijay Kilari
On Mon, Aug 4, 2014 at 4:12 PM, Ian Campbell <[email protected]> wrote:
Yes, Already I have booted domU with GICv3 patches with changes to xl tool.
Quoted 6 lines
Excellent!
Quoted 1 line
Need some time to make it generic and send patches.
Perhaps you could send out whatever dirty version you have now for people who want to try GICv3 to play with?
If there are no further comments on GICv3 patches,
I can fix pending NITs and send new version, which you can merge. This helps to test DomUs and your 48 bit support RFC patches.
Quoted 8 lines
Quoted 5 lines
I think Ian was asking to have a dirty version of your patch to support GICv3 on guest.
It would be nice if you can send it. So people can give a try of the support on the ARM64 model.
I have sent trivial patch for testing GICv3 with domU. Any further comments on GICv3 patch series?.
Sorry for the late reply but we are all currently traveling or on vacation. There are still a few minor unanswered points on v8, maybe you could go ahead and send a v9?
Quoted 3 lines · Stefano Stabellini
Sorry for the late reply but we are all currently traveling or on vacation. There are still a few minor unanswered points on v8, maybe you could go ahead and send a v9?
Indeed. I've just applied the first two patches since they were standalone but from the third onwards there were some outstanding (but minor seeming) comments. Most concerning was Vijay's comment on #4 I think?
Ian.