[Skiboot] [PATCH v2 1/5] xive, interrupts: Add a mask() source op

Cédric Le Goater clg at kaod.org
Thu Sep 5 16:52:00 AEST 2019


On 05/09/2019 05:08, Oliver O'Halloran wrote:
> We want to be able to mask LSIs from inside of skiboot. For P9 most of
> the actual interrupt wrangling is internal to the XIVE driver, so we
> need to provide a way for XIVE based interrupt sources to mask
> and interrupt. Do this by adding a mask() function to the interrupt
> source ops structure.
> 
> Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
> ---
> v2: patch added in v2
> ---
>  hw/xive.c            | 18 ++++++++++++++++++
>  include/interrupts.h |  1 +
>  include/xive.h       |  1 +
>  3 files changed, 20 insertions(+)
> 
> diff --git a/hw/xive.c b/hw/xive.c
> index 76b41a9ee95f..ea970de7898e 100644
> --- a/hw/xive.c
> +++ b/hw/xive.c
> @@ -2705,6 +2705,23 @@ static void xive_source_eoi(struct irq_source *is, uint32_t isn)
>  		__xive_source_eoi(is, isn);
>  }
>  
> +void __xive_source_mask(struct irq_source *is, uint32_t isn)
I would remove the '__' prefix.

> +{
> +	struct xive_src *s = container_of(is, struct xive_src, is);
> +
> +	xive_update_irq_mask(s, isn - s->esb_base, true);
> +}
> +
> +static void xive_source_mask(struct irq_source *is, uint32_t isn)

and get rid of the mask() handler. 

The set_xive, get_xive, eoi handlers were introduced for issues in DD1 
(PHB LSIs) and for the XICS emulation also maybe. I don't think we need 
to follow that pattern anymore.

C. 

> +{
> +	struct xive_src *s = container_of(is, struct xive_src, is);
> +
> +	if (s->orig_ops && s->orig_ops->eoi)
> +		s->orig_ops->mask(is, isn);
> +	else
> +		__xive_source_mask(is, isn);
> +}
> +
>  static void xive_source_interrupt(struct irq_source *is, uint32_t isn)
>  {
>  	struct xive_src *s = container_of(is, struct xive_src, is);
> @@ -2739,6 +2756,7 @@ static const struct irq_source_ops xive_irq_source_ops = {
>  	.interrupt = xive_source_interrupt,
>  	.attributes = xive_source_attributes,
>  	.name = xive_source_name,
> +	.mask = xive_source_mask,
>  };
>  
>  static void __xive_register_source(struct xive *x, struct xive_src *s,
> diff --git a/include/interrupts.h b/include/interrupts.h
> index d1ee5c4c112b..a8c44be2217b 100644
> --- a/include/interrupts.h
> +++ b/include/interrupts.h
> @@ -153,6 +153,7 @@ struct irq_source_ops {
>  	void (*interrupt)(struct irq_source *is, uint32_t isn);
>  	void (*eoi)(struct irq_source *is, uint32_t isn);
>  	char *(*name)(struct irq_source *is, uint32_t isn);
> +	void (*mask)(struct irq_source *is, uint32_t isn);
>  };
>  
>  struct irq_source {
> diff --git a/include/xive.h b/include/xive.h
> index 4100e7127784..b1f4b82ee041 100644
> --- a/include/xive.h
> +++ b/include/xive.h
> @@ -511,5 +511,6 @@ void *xive_get_trigger_port(uint32_t girq);
>  /* To be used by special EOI override in PSI */
>  struct irq_source;
>  void __xive_source_eoi(struct irq_source *is, uint32_t isn);
> +void __xive_source_mask(struct irq_source *is, uint32_t isn);
>  
>  #endif /* __XIVE_H__ */
> 



More information about the Skiboot mailing list