From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f73.google.com (mail-ed1-f73.google.com [209.85.208.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7B58377004 for ; Tue, 23 Jun 2026 11:12:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782213138; cv=none; b=CFHKW/59Qyj/5nqxgFaJMKCS6TaGDmD9aKBOXsmTZvGAACSNSQJVqWGnbywpWZulSpN43uvudcOeKI0+zDR/VMcdacnj/ftI5JtMV1SU4ZRJ9D7E2vyxLlTYUeCdeA9ozIO4fjgubng4vNh+xxgKclTYs8wFYhxktXJDw8Fyi/g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782213138; c=relaxed/simple; bh=KqzgwhxvRULfAZxElqJD7q+L3F5b1TQda6dQ+yVUgXM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=D6Ju0GBbGc4bKdddKAs19N3vHkjxc2OBhsxQuPi8TfCLlXFQTTZpaUvWZykYKMpxClDPBEHK0mbiGwIMHOVwp6+/bTjSu1lRmcP8VqKQK6EYqkQb3Q7KYFI1+7CN5cpcHkosZ/2kZCp5p+lGS7N7z4EuZBq+rhftGNPoUN6Anpk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--tarunsahu.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=LdSd4MTt; arc=none smtp.client-ip=209.85.208.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--tarunsahu.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="LdSd4MTt" Received: by mail-ed1-f73.google.com with SMTP id 4fb4d7f45d1cf-69604dfdce2so5203251a12.0 for ; Tue, 23 Jun 2026 04:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1782213135; x=1782817935; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=0GTqVg+rgasX/S0lzuuc6nnVfnMSvL9+pic5H7oW7Ww=; b=LdSd4MTthp9eP2Yi2JD4UrhSbzs+t0BIGvQHbIgwq+Ydt3sZKOQ78Jl6zHu0Sk6orh uAeq6i5Ls6ojQpYyWysnjHNRM5Ebg9ow5LJZOrANf/wxaYDIDg5M3JJLeSC2sYv+uZ6b NaZWRPA1UIP1a+hxqZRxjqT5utNjPBq5e+W7GkyVKl4o8muBsQOIyI32slj+zSdJhe7N 0UPSNeOmwWrvN0UJxa6L111C/GM2oxN0FepdMCjrSvqyk9FXK21RnIxHsLLlBq9Aywbl 5NR+uthw7yI5GREbXU+AJRFbtdCmu0NnonH09YIVYbu7g4j01p4OOKWxtvReVCUuDcNs T+fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782213135; x=1782817935; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0GTqVg+rgasX/S0lzuuc6nnVfnMSvL9+pic5H7oW7Ww=; b=BMkBJDYrXXmbuaNQAzxYB7qHi9k3T8AQijFV1o+U8DBuJJRXjASOD5O3lOM6HP8LV4 D2MubHjA0UicCbHMe5zSmHkwzHSQxArU+VE94GtJ1AxsD6qYhlj0xP1qmxPEOX3G/8qP /jT30C715y84KmVRJizYBSGmCQSWT07UqlfOnM4ceeJNaboPTFWWuBGUVZDx9x0cnsq9 lpJ04gcI1t8xyFtU77cHXw6pZJm3tThkMVl2+SVHF0qVFaGbaoVvA+CKU/aNsZg8x1v+ WbaVqeOQ+LJ34ubLpMZcOFscV7G0VVmyPOKnc8/3ZuecUYoV/nK+jxHrom8L+rGKilSX 2N0g== X-Forwarded-Encrypted: i=1; AFNElJ8alSQH85bOC/iU4DfI3ety++zgMxdXXw2qtc66ThMxd+w199t8v3i4wbzD7eAsA5ohaYYUNJ70RrTdjT0=@vger.kernel.org X-Gm-Message-State: AOJu0YxXy5hfsw9NIZ07xd6KpTLwm6LtZC5u3E07jPZwEF149SDGwpIl yuLkQH5bfLsseKNW2XjyzvzTeX8ZsOWN9DDALPTsxp9lO2w78kJlbq0RnWLzLpIYv0astBeZWIJ JQF+R+emt2n0Ni1KYHg== X-Received: from edaa1.prod.google.com ([2002:a05:6402:24c1:b0:695:df16:a5b7]) (user=tarunsahu job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:3205:b0:68d:4450:d21 with SMTP id 4fb4d7f45d1cf-696ee621b1amr9223700a12.8.1782213134747; Tue, 23 Jun 2026 04:12:14 -0700 (PDT) Date: Tue, 23 Jun 2026 11:12:13 +0000 In-Reply-To: <20260623105201.3724592-3-tarunsahu@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260623105201.3724592-1-tarunsahu@google.com> <20260623105201.3724592-3-tarunsahu@google.com> Message-ID: <9huza4slo6ia.fsf@tarunix.c.googlers.com> Subject: Re: [PATCH v5 2/3] kho: add KHOSER_COPY_PTR to allow phys copy of serialized ptr From: tarunsahu@google.com To: Mike Rapoport , Pasha Tatashin , Pratyush Yadav , Andrew Morton , Alexander Graf Cc: kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Tarun Sahu writes: > Adding KHOSER_COPY_PTR to copy one serializeable pointer to > another. It basically allows copy of phys val of the > serializeable pointer. > > It ignores the typecheck if any of the argument is of void * > > Signed-off-by: Tarun Sahu > --- > include/linux/kho/abi/kexec_handover.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/include/linux/kho/abi/kexec_handover.h b/include/linux/kho/abi/kexec_handover.h > index 5e2eb8519bda..c1b61d875dcc 100644 > --- a/include/linux/kho/abi/kexec_handover.h > +++ b/include/linux/kho/abi/kexec_handover.h > @@ -139,6 +139,17 @@ > (typeof((s).ptr))((s).phys ? phys_to_virt((s).phys) : NULL); \ > }) > > +/* Copies one serializable pointer to another. */ > +#define KHOSER_COPY_PTR(dest, src) \ > + ({ \ > + static_assert( \ > + __builtin_types_compatible_p(typeof((dest).ptr), typeof((src).ptr)) || \ > + __builtin_types_compatible_p(typeof((dest).ptr), void *) || \ > + __builtin_types_compatible_p(typeof((src).ptr), void *), \ > + "pointer type mismatch in KHOSER_COPY_PTR" \ > + ); \ > + (dest).phys = (src).phys; \ > + }) This needs to be updated as per Mike's comment on v4. > /* > * This header is embedded at the beginning of each `kho_vmalloc_chunk` > * and contains a pointer to the next chunk in the linked list, > -- > 2.55.0.rc0.786.g65d90a0328-goog