Messages in this thread |  | | Date | Tue, 22 Nov 2022 10:10:20 +0100 | From | Peter Zijlstra <> | Subject | Re: [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?
|  |