From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (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 876C345BD7C for ; Thu, 23 Jul 2026 15:33:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784820806; cv=none; b=H51WaYl2D71f+oS6BYDH3tIqu4Cqo5NnwWid7hAenapcdDFmpTYkFpxOqTKGWnbfWw+jaIFCRItONEIR/JAH8WjXikQz7fKARhN4j9kY4NTmQl46HHGf64oTZc/H1xouV88lEKYpJqw0b5/Tf8AxgCP5KSZjJudp3XgfZ/edvpQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784820806; c=relaxed/simple; bh=b6epmMnwzZFsPHfxhj0CHIlVMssdYr48McQfDWxlzZY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=kf5J3cB2ps6jLJMkoGFstvkcawM2JdjaL5aBfDqpVoyoji4u1/BRHW1noCfqUN0y3MfLXksUYnHrhjvVFR8MEhZqSNbiE84oVZ3MVwubBP2OqwW44Rs9vPgDX9dp31gptypDr2PVSTGd6BD4rJvFM47yDDdyeLgUcusLzmaCObM= 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=MSAG4A7E; arc=none smtp.client-ip=209.85.208.71 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="MSAG4A7E" Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-69cd6606b19so1050524a12.1 for ; Thu, 23 Jul 2026 08:33:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784820802; x=1785425602; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=v0qWoxbum+mc2LRSxBlzJpjmKPNemz4JvYfhVDhJ98E=; b=MSAG4A7ErulnW3r7PuwbqjNkVqkBBV7sT6/pKmeRzQN61MAd4W/ftmzYs0zAOOEpPO Vo79O0b/xoc+za/GWSRTXWBSPoukBttHFFs10f1ciCVFPjy+yu69owjCBiYdykfc8pzJ i0RHlaMyQfqeK30kuV1Jxz5a0LUnqiXiB8pSMMvU7+vC8TBpJ9bStNiyqvDvkKNq3Gjm i8H1UyaRvEjCaEVh5tHvFXNtj4AVWDBv4qfq41PChidvwcWv9NOVQj1BCDpf3pPqpa/W W8nhiDs+JY/LwpPWWSrF5UrY/1FVc4LtOJJJTIflBO4XKitcarj1+v0uTZ4Yi461ZME/ lnfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784820802; x=1785425602; h=content-type: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:content-type; bh=v0qWoxbum+mc2LRSxBlzJpjmKPNemz4JvYfhVDhJ98E=; b=XPQQsnJZ2gyN/kTdvFaZoarwGVzSZuwOTCrteuaAWJ0Q2dP0hQ/KaobpXhOnuzGOHo fhUbL7ZkflSys+nm+K+det3HtT3J1Vsq+0czcJ3AlZSLA7oLYVWdxV0NZ16hwfD+Y93T 03ZlQ8Jxe6Cm2R0I2HTqlKXznM40mYBjofiIUFm1Xl4RZVWsX/3nRmm1MfwGo341LdkO kz1gyRDE1yi6OVKbJem6WluBefd02gNZg55zjhmhRRbNzI53r5Iwt6TbqEI82ycZizg+ b4QIUy0/7/ox55ZYjZblDMQ9OEweiQ8EueYTe9VVrJRAmt4P4Ca4dBzlTDzH/Yle/k+S qLmw== X-Forwarded-Encrypted: i=1; AHgh+RpnSq8JC1BCTzyHAqKN/UKJftfURgXxc3GRRUgdD1ay4SPwTkpmL4bRLLhMt6Ymfefy+CsMLP2Ef/PLfiE=@vger.kernel.org X-Gm-Message-State: AOJu0YwgvS9Nqd3R4hlKCzWN7/Jddb2S+EFId8wZ6ehdVO/v8RPk4Fo0 50bOavkaonrWlu9eWU9FXcpUxt4+MzfTJz2HO87NRyQ+73GUXpE4WRicdWMik+mEUhEYa9iZKo5 3XHtX91n2902yJut+AA== X-Received: from edbbf4.prod.google.com ([2002:a05:6402:1a44:b0:69a:9f30:4b29]) (user=tarunsahu job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:34cd:b0:699:2448:be63 with SMTP id 4fb4d7f45d1cf-69f6b63060emr1442487a12.16.1784820802174; Thu, 23 Jul 2026 08:33:22 -0700 (PDT) Date: Thu, 23 Jul 2026 15:33:21 +0000 In-Reply-To: <2vxzldbklb18.fsf@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260628001114.1869564-1-tarunsahu@google.com> <20260628001114.1869564-4-tarunsahu@google.com> <178271651966.13502.2620034351625890943.b4-review@b4> <2vxzldbklb18.fsf@kernel.org> Message-ID: <9huzbjbx201q.fsf@tarunix.c.googlers.com> Subject: Re: [PATCH v6 3/3] luo: Update serialized data to use KHOSER_PTR From: tarunsahu@google.com To: Pratyush Yadav , Pasha Tatashin Cc: Pratyush Yadav , Andrew Morton , linux-mm@kvack.org, Mike Rapoport , Alexander Graf , skhawaja@google.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Hello, I dont have much opinion here. I am writing this as a gentle reminder to the open discussion below. ~Tarun Pratyush Yadav writes: > Hi Pasha, > > On Mon, Jun 29 2026, Pasha Tatashin wrote: > >> On Sun, 28 Jun 2026 00:11:14 +0000, Tarun Sahu wrote: >>> diff --git a/include/linux/kho/abi/luo.h b/include/linux/kho/abi/luo.h >>> index 288076de6d4a..9e78625cfdc1 100644 >>> --- a/include/linux/kho/abi/luo.h >>> +++ b/include/linux/kho/abi/luo.h >>> @@ -89,14 +90,14 @@ struct luo_ser { >>> /** >>> * struct luo_file_ser - Represents the serialized preserves files. >>> * @compatible: File handler compatible string. >>> - * @data: Private data >>> + * @serialized_data: The serialized KHO pointer for this file >> >> I am concerned about layring violation here. >> >> LUO is designed as a generic, opaque transport layer that promises to >> preserve 64 bits of raw data. How those 64 bits are interpreted is >> entirely up to individual clients. >> >> While some clients like memfd_luo will use those 64 bits as a physical >> address pointing to KHO-preserved structures, other clients may store a >> generic token, cookie, index, or non-pointer status. By >> changing u64 data to DECLARE_KHOSER_PTR(serialized_data, void *) in >> struct luo_file_ser, we force KHO pointer semantics and layout >> constraints on all generic LUO files. > > That makes sense theory, but in practice, no file handler is going to > need only 8 bytes for its metadata. It is always going to need more, and > to store more information, it needs to store a pointer to that > information with the 64 bits it gets. > > Do you have any examples of something else one might store here? > > At least looking at the current file handlers merged and in flight, > memfd, iommufd, vfio, pci, hugetlb, guest_memfd, all of them store a > pointer here. > > And if everyone is only storing pointers in this field, might as well > give them a bit of type safety. > >> >> Clients that need KHO pointer serialization must cast that opaque 64-bit >> value to/from a KHOSER_PTR within their own callbacks. >> >> Also, the field descriptions in struct luo_file_ser are no longer >> aligned due to the length of the new variable name, I believe it will >> cause warning when making docs. > > -- > Regards, > Pratyush Yadav