|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v8 25/28] xen/arm: ITS: Add domain specific ITS initialization
From: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxxxxxxxxxx>
Call domain specific ITS initialization and introduce
callback in vgic for domain free
Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxxxxxxxxxx>
---
v7: - Deprecate use of gic_lpi_supported and instead use
vgic_v3_hw.lpi_support
v6: - Moved vits_domain_free() out of this patch
---
xen/arch/arm/vgic-v3.c | 12 ++++++++++++
xen/arch/arm/vgic.c | 3 +++
xen/include/asm-arm/vgic.h | 2 ++
3 files changed, 17 insertions(+)
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index aa3c5ed..8c1877f 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -1830,6 +1830,11 @@ static int vgic_v3_domain_init(struct domain *d)
d->arch.vgic.ctlr = VGICD_CTLR_DEFAULT;
spin_lock_init(&d->arch.vgic.prop_lock);
+ if ( is_hardware_domain(d) && vgic_v3_hw.its_support )
+ {
+ if ( vits_domain_init(d) )
+ return -ENODEV;
+ }
if ( is_hardware_domain(d) && vgic_v3_hw.its_support )
{
@@ -1843,9 +1848,16 @@ static int vgic_v3_domain_init(struct domain *d)
return 0;
}
+void vgic_v3_domain_free(struct domain *d)
+{
+ if ( is_hardware_domain(d) && vgic_v3_hw.its_support )
+ vits_domain_free(d);
+}
+
static const struct vgic_ops v3_ops = {
.vcpu_init = vgic_v3_vcpu_init,
.domain_init = vgic_v3_domain_init,
+ .domain_free = vgic_v3_domain_free,
.emulate_sysreg = vgic_v3_emulate_sysreg,
/*
* We use both AFF1 and AFF0 in (v)MPIDR. Thus, the max number of CPU
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index e0ae5a5..c35501b 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -198,6 +198,9 @@ void domain_vgic_free(struct domain *d)
if ( vgic_is_lpi_supported(d) && d->arch.vgic.prop_page != NULL )
free_xenheap_pages(d->arch.vgic.prop_page,
get_order_from_bytes(d->arch.vgic.prop_size));
+
+ if ( d->arch.vgic.handler->domain_free )
+ d->arch.vgic.handler->domain_free(d);
}
int vcpu_vgic_init(struct vcpu *v)
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index 5e194b7..7c1af7d 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -128,6 +128,8 @@ struct vgic_ops {
int (*vcpu_init)(struct vcpu *v);
/* Domain specific initialization of vGIC */
int (*domain_init)(struct domain *d);
+ /* Free domain specific resources */
+ void (*domain_free)(struct domain *d);
/* vGIC sysreg emulation */
int (*emulate_sysreg)(struct cpu_user_regs *regs, union hsr hsr);
/* Maximum number of vCPU supported */
--
1.7.9.5
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |