Re: [RESEND PATCH v3 1/2] kho: add KHOSER_COPY_TYPE(UN)SAFE for phys copy
Mike Rapoport <[email protected]>
| Newsgroups | org.infradead.lists.kexec,org.kernel.vger.linux-kernel,org.kvack.linux-mm |
|---|---|
| Message-ID | <178215570871.91679.11260349768439750235.b4-review@b4> |
On Mon, 22 Jun 2026 11:12:14 +0000, Tarun Sahu <[email protected]> wrote: > diff --git a/include/linux/kho/abi/kexec_handover.h b/include/linux/kho/abi/kexec_handover.h > index 5e2eb8519bda..618408fbe9c9 100644 > --- a/include/linux/kho/abi/kexec_handover.h > +++ b/include/linux/kho/abi/kexec_handover.h > @@ -139,6 +139,18 @@ > (typeof((s).ptr))((s).phys ? phys_to_virt((s).phys) : NULL); \ > }) > > +/* Copies one serializable pointer to another of same type. */ > +#define KHOSER_COPY_TYPESAFE(dest, src) \ Maybe name if KHOSER_COPY_PTR? > + ({ \ > + typecheck(typeof((dest).ptr), (src).ptr); \ And if we could replace the typecheck with some other magic to allow void * we won't need the unsafe version. -- Sincerely yours, Mike.