lkml.org 
[lkml]   [2023]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v9 07/18] x86/virt/tdx: Do TDX module per-cpu initialization
    On Tue, Feb 14, 2023 at 12:59:14AM +1300, Kai Huang wrote:
    > +/*
    > + * Call @func on all online cpus one by one but skip those cpus
    > + * when @skip_func is valid and returns true for them.
    > + */
    > +static int tdx_on_each_cpu_cond(int (*func)(void *), void *func_data,
    > + bool (*skip_func)(int cpu, void *),
    > + void *skip_data)
    > +{
    > + int cpu;
    > +
    > + for_each_online_cpu(cpu) {
    > + int ret;
    > +
    > + if (skip_func && skip_func(cpu, skip_data))
    > + continue;
    > +
    > + /*
    > + * SEAMCALL can be time consuming. Call the @func on
    > + * remote cpu via smp_call_on_cpu() instead of
    > + * smp_call_function_single() to avoid busy waiting.
    > + */
    > + ret = smp_call_on_cpu(cpu, func, func_data, true);
    > + if (ret)
    > + return ret;
    > + }
    > +
    > + return 0;
    > +}

    schedule_on_each_cpu() ?

    \
     
     \ /
      Last update: 2023-03-27 00:23    [W:4.153 / U:0.248 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site