From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 1A92819ABC6 for ; Mon, 18 May 2026 15:08:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779116924; cv=none; b=Kv7TRZK38qGL8PgL8Z1glgio6d80sJqBrlnb4VfmccHvm6RKDxmBrGSYwHqWRQqA8NdU6kTKOXeqgefoPrMLsiuCnZQsgf02UhBDrNJDzvm5mKAH8hAiaVA8UmqOhTX4amYCJkuSDgpxkFfm9VEcydFcLVlZFXkrQZ2/UW5ZGSQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779116924; c=relaxed/simple; bh=nvP7U/Dl/xIbO6Hrcjf9FGeD1/9FM39srDJUAU6VEUE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ctwe98k2wQLdmTD4wd9330O4LrXml3oDgd1QVquyPBTMsOiz0/Pi8+AALqjqtk0wYFW+it4e7D9zIcP81tu+wH83I3kN9tLhrJFA7AyhKOmjxDPV87r+YFweP+ktDACAQBaEW04PEJYRt0CDSR346GVAZvVlL8Lxk3MHDybTnGc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=EDchZvvS; arc=none smtp.client-ip=209.85.214.182 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=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="EDchZvvS" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2b46da8c48eso2745ad.1 for ; Mon, 18 May 2026 08:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1779116922; x=1779721722; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=LPcZ0QcVqHJUaR115s6MSWN7sWOXwruE9IKTdy4RibY=; b=EDchZvvS1DjXu7qFBQwph6XSresNopLO5DynjlhjtiRN6OrtNSjgZ7adWmPkbfuJCG CJutLJtLnRO638ZZbAzDwgZ9rHFuPOsgnymEp13HEKgWk/lS7PLxOUtHsSoL+9jwzNL/ 9yAANZrEbRk1ZUmGRxxBLPGhMakbDzwn7KBiPxj/TLNjIKrI8c6nYs4e+41rxCoyU9qj eiK8ANhuqOfooylvIBc9Rniph463kwoCS6I5SjhcJ14ZBTw0Urd90+RQEYpq+V11uD+a TmeSsFY5mNaP7FW4TfuthHt1rFVOKqTNO/KwGRIEsvdh/cI+jFxfNXlgMNGYarVqr3WM gVGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779116922; x=1779721722; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LPcZ0QcVqHJUaR115s6MSWN7sWOXwruE9IKTdy4RibY=; b=CFDUFrS+JA1mBEJ+1qEeBBTzQQ1iOx8yf0o502t9Nnrs1xnKEEXqzjt7Fk5sntQKRE NtXrMH5z/pZJOGM3rt0g2TQJDXvTVNLatyOg9Z1MYpfSAlYiJoO5ltKHuUHDLuJxM5ab Vu5eTPO3whON4qIVdUI2nXF4KmDgv1lV0AIecWRBujmU18cao/Dzeo2j0esic+Mfb9Na QkMUN75p/44RJms0qDTdGI3voX2CILA8AJSyUD3RWaB64MqIgCUwzcwECfw180L/BLQJ SRh8b9NEGpiLtqBuIK8FSUWUWPWK18+lu+mL11/QBr+mAHXW9suYsEU4udxnd/5XG5fy fMRg== X-Forwarded-Encrypted: i=1; AFNElJ9B50LVB1uPcnFu9g6m5gwtPpzVQI1e7+vW8Gf8G4S+/lucKX0kjA5z7UxnrRoX+Dbg+bFxFIwxFCqBdtQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyFFf+dBxL36fg/PA1TNjDxPWU2FKQmIQSPP8X8YtGrHC/Uf1Bf XHdlDvqqLYkffJLlA1OF3qB6486AemLyhyE96JZFxj2IHnRQJ17B4XYmeBtgG7QGUQ== X-Gm-Gg: Acq92OF8s/VH2UpIpze2Pc/Y2BsjYa3yslFWx2FgYO53F3uGTdOoqQk9EBlnJ0t1D8E NstHoGEiqkRynZVvH05LyyofqSSGRmb6GB7YeIng5itqoFy7zNUZ4/B6YBLKis5oCtNMbptgZ7D +yURLklzKOmN+LnqQw/3iCujY78QRPGqz3Ych4KIAME993W/KQO9l42CzcrfJi/9StvdVFSB9Kg P6sbiRDDX8nAIwoDu+8bGsLNnT2jl5X0iwANR9DqlCth/yrPulaYHbXda4ivx8/h5zlQsKzCp3H 7sCDAitszXTzx9WTeJdAdd2aIGuwIirgnSMvxfsIj8vEerEkYPQXG4X3iUs4rfXh7Ng2tOEa1oi Qzf8o1c/I0434Fe2zSfk0bgCCNOCDhjicLGwCbsxMmOE4rh+dHiQouXRPJPHcs8PbCyU10so69C oadMXH2IWRFYKyWLLihMxb+NVhwH2DT/3qBTwmesZqHmbb412jhLrIUVvEkorPt6tHUx/G X-Received: by 2002:a17:902:d58b:b0:2bd:6dad:3dfb with SMTP id d9443c01a7336-2bdb36d252amr2864685ad.25.1779116921506; Mon, 18 May 2026 08:08:41 -0700 (PDT) Received: from google.com (44.234.124.34.bc.googleusercontent.com. [34.124.234.44]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bd5c264241sm150322355ad.36.2026.05.18.08.08.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2026 08:08:40 -0700 (PDT) Date: Mon, 18 May 2026 15:08:32 +0000 From: Pranjal Shrivastava To: Pratyush Yadav Cc: David Matlack , Samiullah Khawaja , David Woodhouse , Lu Baolu , Joerg Roedel , Will Deacon , Jason Gunthorpe , Robin Murphy , Kevin Tian , Alex Williamson , Shuah Khan , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Saeed Mahameed , Adithya Jayachandran , Parav Pandit , Leon Romanovsky , William Tu , Pasha Tatashin , Andrew Morton , Chris Li , Vipin Sharma , YiFei Zhu Subject: Re: [PATCH v2 02/16] iommu: Implement IOMMU Live update FLB callbacks Message-ID: References: <20260427175633.1978233-1-skhawaja@google.com> <20260427175633.1978233-3-skhawaja@google.com> <2vxz8q9gajwm.fsf@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2vxz8q9gajwm.fsf@kernel.org> On Mon, May 18, 2026 at 04:10:01PM +0200, Pratyush Yadav wrote: > On Mon, May 18 2026, Pranjal Shrivastava wrote: > > > On Fri, May 01, 2026 at 09:45:19PM +0000, David Matlack wrote: > > > > [...] > > > >> > + > >> > +/** > >> > + * struct iommu_hdr_ser - Common header for all serialized IOMMU objects > >> > + * @ref_count: Reference count for the object > >> > + * @deleted: Flag indicating if the object is deleted > >> > + * @incoming: Flag indicating if the object was preserved in previous kernel > >> > + */ > >> > +struct iommu_hdr_ser { > >> > + u32 ref_count; > >> > + u32 deleted:1; > >> > + u32 incoming:1; > >> > >> Are C bitfields safe to use in Live Update ABI? > >> > > > > AFAIU, they aren't. The C standard does not dictate how bitfields are > > packed into their underlying types (e.g., whether they are packed MSB to > > LSB or vice-versa), making them highly dependent on the compiler and arch > > endianness. > > I had the same question and Jason told me otherwise: > https://lore.kernel.org/linux-mm/20250909155044.GN789684@nvidia.com/ > > I took him at his word and didn't really look much deeper. I use them > for memfd preservation as well. See struct memfd_luo_folio_ser in > include/linux/kho/abi/memfd.h. Ah I see.. I guess I agree if x86 has it.. Arm should too.. I'll try to check this. Thanks Praan