Skip to content

Commit 05d32df

Browse files
author
Marc Zyngier
committed
irqchip/gic-v4.1: Plumb set_vcpu_affinity SGI callbacks
Just like for vLPIs, there is some configuration information that cannot be directly communicated through the normal irqchip API, and we have to use our good old friend set_vcpu_affinity as a side-band communication mechanism. This is used to configure group and priority for a given vSGI. Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Zenghui Yu <[email protected]> Reviewed-by: Eric Auger <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7017ff0 commit 05d32df

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4047,13 +4047,31 @@ static int its_sgi_get_irqchip_state(struct irq_data *d,
40474047
return 0;
40484048
}
40494049

4050+
static int its_sgi_set_vcpu_affinity(struct irq_data *d, void *vcpu_info)
4051+
{
4052+
struct its_vpe *vpe = irq_data_get_irq_chip_data(d);
4053+
struct its_cmd_info *info = vcpu_info;
4054+
4055+
switch (info->cmd_type) {
4056+
case PROP_UPDATE_VSGI:
4057+
vpe->sgi_config[d->hwirq].priority = info->priority;
4058+
vpe->sgi_config[d->hwirq].group = info->group;
4059+
its_configure_sgi(d, false);
4060+
return 0;
4061+
4062+
default:
4063+
return -EINVAL;
4064+
}
4065+
}
4066+
40504067
static struct irq_chip its_sgi_irq_chip = {
40514068
.name = "GICv4.1-sgi",
40524069
.irq_mask = its_sgi_mask_irq,
40534070
.irq_unmask = its_sgi_unmask_irq,
40544071
.irq_set_affinity = its_sgi_set_affinity,
40554072
.irq_set_irqchip_state = its_sgi_set_irqchip_state,
40564073
.irq_get_irqchip_state = its_sgi_get_irqchip_state,
4074+
.irq_set_vcpu_affinity = its_sgi_set_vcpu_affinity,
40574075
};
40584076

40594077
static int its_sgi_irq_domain_alloc(struct irq_domain *domain,

include/linux/irqchip/arm-gic-v4.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ enum its_vcpu_info_cmd_type {
103103
SCHEDULE_VPE,
104104
DESCHEDULE_VPE,
105105
INVALL_VPE,
106+
PROP_UPDATE_VSGI,
106107
};
107108

108109
struct its_cmd_info {
@@ -115,6 +116,10 @@ struct its_cmd_info {
115116
bool g0en;
116117
bool g1en;
117118
};
119+
struct {
120+
u8 priority;
121+
bool group;
122+
};
118123
};
119124
};
120125

0 commit comments

Comments
 (0)