RE: [PATCH 7/9] iommu/vt-d: Remove the 'force_on' variable

From: Tian, Kevin

Date: Wed Jun 17 2026 - 03:23:02 EST


> From: Baolu Lu <baolu.lu@xxxxxxxxxxxxxxx>
> Sent: Friday, June 12, 2026 10:17 PM
>
> On 6/4/2026 1:15 PM, Kevin Tian wrote:
> > /*
> > - * set to 1 to panic kernel if can't successfully enable VT-d
> > + * set to 1 to avoid kernel panic if can't successfully enable VT-d
> > * (used when kernel is launched w/ TXT)
> > */
>
> It might be cleaner to replace it entirely with a new comment. For
> example:
>
> /*
> * Skip forcing iommu enablement and avoid tboot-related kernel panics
> * during initialization when set to 1 (via intel_iommu=tboot_noforce).
> */
> int intel_iommu_tboot_noforce;

+1

> >
> > +static inline bool dmar_is_force_on(void)
> > +{
> > + return dmar_state == DMAR_ENABLED_FORCE;
> > +}
>
> This helper is only meaningful after
>
> tboot_force_iommu();
> platform_optin_force_iommu();
>
> have been called. It would be better to add a brief comment about this?
>

IMHO it's obvious. The callers of this helper are limited and well spotted.