[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] x86/domain: restrict context switch hooks for the idle domain



On Fri, Oct 02, 2026 at 01:33:42PM +0200, Jan Beulich wrote:
> On 02.10.2026 13:20, Roger Pau Monne wrote:
> > From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
> > 
> > The arch_init_idle_domain() initializes struct arch_csw idle_csw as:
> > 
> >     static const struct arch_csw idle_csw = {
> >         .from = paravirt_ctxt_switch_from,
> >         .to   = paravirt_ctxt_switch_to,
> >         .tail = idle_loop,
> >     };
> > 
> > but only place where d->arch.ctxt_switch->{to,from}() are used is
> > __context_switch() where they are both guarded by !is_idle_domain(pd)
> > which makes the callbacks in idle_csw unreachable.
> > 
> > Introduce a new poison value to be used in unreachable function hooks, and
> > set the from/to fields of idle_csw to it.  Use a different value from the
> > currently defined ones for easy differentiation.
> > 
> > Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
> > Signed-off-by: Roger Pau Monné <roger@xxxxxxxxxxxxxx>
> 
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
> provided this doesn't raise new Misra violations, including for rules which
> aren't entirely clean yet, but which are actively being worked on.

I've wondered the same, but since your recent change in:

68c3f7fb3a84 Eclair: relax long <-> function-pointer conversion deviation

I think it should be fine?  I will run a CI loop first anyway.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.