Re: [RESEND PATCH v3 1/2] kho: add KHOSER_COPY_TYPE(UN)SAFE for phys copy

From: tarunsahu

Date: Mon Jun 22 2026 - 18:59:09 EST


Mike Rapoport <rppt@xxxxxxxxxx> writes:

> On Mon, 22 Jun 2026 11:12:14 +0000, Tarun Sahu <tarunsahu@xxxxxxxxxx> 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.

Done! Sent V4.
Thanks for reviewing.

~Tarun

>
> --
> Sincerely yours,
> Mike.