lkml.org 
[lkml]   [2022]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v7 06/20] x86/virt/tdx: Shut down TDX module in case of error
    On Mon, Nov 21, 2022 at 01:26:28PM +1300, Kai Huang wrote:

    > +/*
    > + * Data structure to make SEAMCALL on multiple CPUs concurrently.
    > + * @err is set to -EFAULT when SEAMCALL fails on any cpu.
    > + */
    > +struct seamcall_ctx {
    > + u64 fn;
    > + u64 rcx;
    > + u64 rdx;
    > + u64 r8;
    > + u64 r9;
    > + atomic_t err;
    > +};

    > @@ -166,6 +180,25 @@ static int __always_unused seamcall(u64 fn, u64 rcx, u64 rdx, u64 r8, u64 r9,
    > }
    > }
    >
    > +static void seamcall_smp_call_function(void *data)
    > +{
    > + struct seamcall_ctx *sc = data;
    > + int ret;
    > +
    > + ret = seamcall(sc->fn, sc->rcx, sc->rdx, sc->r8, sc->r9, NULL, NULL);
    > + if (ret)
    > + atomic_set(&sc->err, -EFAULT);
    > +}

    Can someone explain me this usage of atomic_t, please?

    \
     
     \ /
      Last update: 2022-11-22 10:12    [W:4.259 / U:0.096 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site