On Thu, May 22, 2025 at 01:42:58PM +0200, Borislav Petkov wrote:
> On Wed, May 21, 2025 at 07:44:37PM -0700, Pawan Gupta wrote:
> > + if (retbleed_mitigation == RETBLEED_MITIGATION_STUFF &&
> > + spectre_v2_enabled != SPECTRE_V2_RETPOLINE) {
> > + pr_err("WARNING: retbleed=stuff depends on spectre_v2=retpoline\n");
> > + retbleed_mitigation = RETBLEED_MITIGATION_AUTO;
>
> What would be the next-best thing fallback for this, short of disabling the
> mitigation?
>
> UNRET, IBPB?
Next best is IBRS/eIBRS, which also depends on spectre-v2 mitigation. So
NONE is fine here because the next code block will take care of selecting
the right mitigation.
> I would prefer if we look at STUFFing only when SPECTRE_V2_RETPOLINE - i.e.,
> is it even possible.
retbleed_update_mitigation() is the earliest we know that stuffing is
possible (when spectre-v2 has selected the mitigation).
> If not, we fallback to another mitigation which is probably more expensive but
> it is better than NONE...
Covered above.