performance reasons dom0 is unprotected by default. If it is necessary to
protect dom0 too, boot with `spec-ctrl=ibpb-entry`.
-If Xen was compiled with INDIRECT_THUNK support, `bti-thunk=` can be used to
-select which of the thunks gets patched into the `__x86_indirect_thunk_%reg`
-locations. The default thunk is `retpoline` (generally preferred), with the
-alternatives being `jmp` (a `jmp *%reg` gadget, minimal overhead), and
-`lfence` (an `lfence; jmp *%reg` gadget).
+If Xen was compiled with `CONFIG_INDIRECT_THUNK` support, `bti-thunk=` can be
+used to select which of the thunks gets patched into the
+`__x86_indirect_thunk_%reg` locations. The default thunk is `retpoline`
+(generally preferred), with the alternatives being `jmp` (a `jmp *%reg` gadget,
+minimal overhead), and `lfence` (an `lfence; jmp *%reg` gadget).
On hardware supporting IBRS (Indirect Branch Restricted Speculation), the
`ibrs=` option can be used to force or prevent Xen using the feature itself.
{
s += 10;
- if ( !cmdline_strcmp(s, "retpoline") )
+ if ( !IS_ENABLED(CONFIG_INDIRECT_THUNK) )
+ {
+ no_config_param("INDIRECT_THUNK", "spec-ctrl", s - 10, ss);
+ rc = -EINVAL;
+ }
+ else if ( !cmdline_strcmp(s, "retpoline") )
opt_thunk = THUNK_RETPOLINE;
else if ( !cmdline_strcmp(s, "lfence") )
opt_thunk = THUNK_LFENCE;