[RFC PATCH v4 21/21] x86/watchdog/hardlockup/hpet: Support interrupt remapping

Thomas Gleixner tglx at linutronix.de
Sun Jun 16 08:44:09 UTC 2019


On Thu, 23 May 2019, Ricardo Neri wrote:
> +/** irq_remapping_enabled() - Detect if interrupt remapping is enabled
> + * @hdata:	A data structure with the HPET block id
> + *
> + * Determine if the HPET block that the hardlockup detector is under
> + * the remapped interrupt domain.
> + *
> + * Returns: True interrupt remapping is enabled. False otherwise.
> + */
> +static bool irq_remapping_enabled(struct hpet_hld_data *hdata)
> +{
> +	struct irq_alloc_info info;
> +
> +	init_irq_alloc_info(&info, NULL);
> +	info.type = X86_IRQ_ALLOC_TYPE_HPET;
> +	info.hpet_id = hdata->blockid;
> +
> +	return !!irq_remapping_get_ir_irq_domain(&info);
> +}
> +
>  /**
>   * compose_msi_msg() - Populate address and data fields of an MSI message
>   * @hdata:	A data strucure with the message to populate
> @@ -161,6 +181,9 @@ static int update_msi_destid(struct hpet_hld_data *hdata)
>  {
>  	u32 destid;
>  
> +	if (irq_remapping_enabled(hdata))
> +		return hld_hpet_intremap_activate_irq(hdata);

No. This is horrible hackery violating all the layering which we carefully
put into place to avoid exactly this kind of sprinkling conditionals into
all code pathes.

With some thought the existing irqdomain hierarchy can be used to achieve
the same thing without tons of extra functions and conditionals.

Thanks,

	tglx


More information about the iommu mailing list