Re: [PATCH v2 11/13] iommu/vt-d: Make posted MSI an opt-in cmdline option
From: Jacob Pan
Date: Mon Apr 15 2024 - 19:16:26 EST
Hi Kevin,
On Fri, 12 Apr 2024 09:31:32 +0000, "Tian, Kevin" <kevin.tian@xxxxxxxxx>
wrote:
> > From: Jacob Pan <jacob.jun.pan@xxxxxxxxxxxxxxx>
> > Sent: Saturday, April 6, 2024 6:31 AM
> >
> > +#ifdef CONFIG_X86_POSTED_MSI
> > + else if (!strncmp(str, "posted_msi", 10)) {
> > + if (disable_irq_post || disable_irq_remap)
> > + pr_warn("Posted MSI not enabled due to
> > conflicting options!");
> > + else
> > + enable_posted_msi = 1;
> > + }
> > +#endif
>
> the check of disable_irq_remap is unnecessary. It's unlikely to have
> a configuration with disable_irq_post=0 while disable_irq_remap=1
> given the latter has bigger scope.
>
> but thinking more do we really need a check here? there is no order
> guarantee that "posted_msi" is parsed after the parameters deciding
> the value of two disable variables.
>
> it probably makes more sense to just set enable_posted_msi here
> and then do all required checks when picking up the irqchip in
> intel_irq_remapping_alloc().
Makes sense, I have a helper function posted_msi_supported() called in
intel_irq_remapping_alloc() already.
My intention was to alert negligent users, but is is not really necessary
as you said.
Thanks,
Jacob