From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796389453; b=uhpmK2PPVaM0IIzjqCqVrHekI9ZcIWzPFr2n4LTuJYZtiJ8XOOYYBaHqtgZq0yyOrWCz FtaajZ6ey92XYuj/zskezitQfosfpxrynq54ZPAvr3SvKBu+Oq58mNOZ1DQL6TDT0rKtf dx/hrfnUbBzQWxo3j/QHVPDrsNyKi+Rzn+0khgiJ0U/Fd7smIjfKnpQaRrLWdWTI96Khe yQd13jwW3tnjaCLGw8JiaezfH6MueqDfXWsjOk2joyPB3iWwUGtp4MWWGDTAtJkHsu4Gr SmBBIoc0ZuszmqeHjcj5xtZWtrnqKEddRAu/XYcQu8JeZkAPBR/NJdpEQt6Y1h8Y1nA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389453; h=Received:DKIM-Signature:X-Mailer:From:To:Cc:Subject:In-Reply-To: References:Date:Message-ID:MIME-Version:Content-Type; bh=6yiXoWZ84BA5z//Jxt+lSlpDGtM7jIjILO6JvEq+AAA=; b=atYGGB1x8CjjTVSTt6OLQL+5fCsU6Zyfn5zIqvdCZ5Ep2kChuuQvwQZgOGi4EAUfhL8h mGtMEbsBcFniw/8x/hVC3UjovZgiNpJJhLBg/TUY8o6s49J2OZB4Cq/e4gYnmy1VOl9Id WR+ewgvtm4hH7ZBlp0Gj32JPyUx/sv7bnirJsRdZhHdDH0sYa7HT7Q0nYvMjrDJIVrVMi ltJIlq/KzZD4xLgIAq5csSjt6KNuZTH0L0DgyZZ9oE1oezuiqDOm6y4c/DX9Dh1JynynS mMFmFJeSOQQeq0GFELYv5Vx1dObUAddisjasd1tlVEO99B4lQo4a1Xj2C/t3WbaYMQw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="iDZ2h/zj"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2B83606A322; Fri, 4 Dec 2026 13:04:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=iDZ2h/zj Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61FC91F00897; Fri, 4 Dec 2026 13:04:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796389453; bh=6yiXoWZ84BA5z//Jxt+lSlpDGtM7jIjILO6JvEq+AAA=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=iDZ2h/zjszKzMak3WfBBjHDEbqKE4GvWV8beX7ea0kmAUpjSUivQHR+rT+jthoQRp TWrrP5xRi/HcFBpsFpgKl/qkpnZDrSe0SrFUtgH0Kg+Vr4JB+bbLe+SthQHVhf2JN6 Enxh4o0LlU+cH45roKl8pPhly3iLiw8rWTyt9Ia2iHJUQFhxFNV3x/LNtu602nyAp4 AQALpefUIpzuO6pxge2zdLC0pY+bM+4e9ukiul7dGdCRErKA/c8tFFqr2cCq0MFHa4 PIMgvy8X9vaS7ywy/Gpb0OF81pxodU1RLn6roJFHSYOzCLPFzs973WC/nKQKaGKLBD VugTAmJpJF0Nw== X-Mailer: emacs 31.1 (via feedmail 11-beta-1 I) From: Aneesh Kumar K.V To: Jiri Pirko , linux-coco@lists.linux.dev Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, jgg@ziepe.ca, david.quigley@intel.com, lukas@wunner.de, ksinyuk@kernel.org, rodrigo.vivi@intel.com, cedric.xing@intel.com, sameo@meta.com, drdeeglaze@gmail.com, James.Bottomley@HansenPartnership.com, aik@amd.com, jpiotrowski@nvidia.com, qinkun@google.com, pgonda@google.com, jic23@kernel.org, alistair.francis@wdc.com, ankita@nvidia.com, suzuki.poulose@arm.com, kas@kernel.org, rick.p.edgecombe@intel.com, elena.reshetova@intel.com, dave.hansen@linux.intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, peter.fang@intel.com, jarkko@kernel.org, zohar@linux.ibm.com, yeoreum.yun@arm.com, dave.jiang@intel.com, nik.borisov@suse.com, sergii.dmytruk@3mdeb.com Subject: Re: [PATCH RFC v2 11/15] ctlv: Add operation dispatch In-Reply-To: <20261113155515.2510194-12-jiri@resnulli.us> References: <20261113155515.2510194-1-jiri@resnulli.us> <20261113155515.2510194-12-jiri@resnulli.us> Date: Fri, 04 Dec 2026 18:33:58 +0530 Message-ID: X-Mailing-List: linux-api@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain Jiri Pirko writes: > From: Jiri Pirko [ ... 1027 lines skipped ... ] > +/** > + * ctlv_ext_fill - Delegate an extension-point output record. > + * @ctx: operation context > + * @request: validated request root > + * @record: output record selected by the generated helper > + * > + * Return: filling callback result, or 0 for an unfilled point. > + */ > +int ctlv_ext_fill(struct ctlv_op_ctx *ctx, const struct ctlv_cursor *request, > + struct ctlv_cursor *record) > +{ > + const struct ctlv_schema_tree *tree; > + u32 index; > + > + if (WARN_ON_ONCE(!record->tree)) > + return -EINVAL; > + tree = record->tree; > + > + for (index = 0; index < tree->ext_schemas_count; index++) { > + const struct ctlv_ext_schema *ext_schema = &tree->ext_schemas[index]; > + const struct ctlv_cursor *filled_request = request; > + const struct ctlv_ext_fill_schema *fill_schema; > + const struct ctlv_ext_ops *ext_ops; > + struct ctlv_cursor filled; > + int ret; > + > + if (ext_schema->node != record->node) > + continue; > + ext_ops = ctlv_ext_ops_find(ctx->ctlv, ext_schema); > + if (!ext_ops || !ext_ops->fill) > + continue; > + > + if (request) { > + fill_schema = ctlv_schema_fill(ctx->family, ext_schema->family_id, > + ext_schema->ext_id); > + if (WARN_ON_ONCE(!fill_schema)) > + return -EINVAL; > + filled = *request; > + if (ctlv_message_input_rebind(&filled, &fill_schema->members, 0)) > + filled_request = &filled; > + else > + filled_request = NULL; > + } > + > + ret = ext_ops->fill(ctx->ctlv, ctx, filled_request, record); > + if (ret) > + return ret; > + } > + return 0; > +} > +EXPORT_SYMBOL_NS_GPL(ctlv_ext_fill, "CTLV"); > + Could we also add a helper here to select the child family's schema when decoding a request extension record? I am using this for the SPDM changes, which extend the common evidence-get request with device-session-id fields. evidence-get: type: action request: ..... # Optional family-specific collection parameters. parameters?: extension evidence-parameters reply: # Optional family-specific evidence result metadata. details?: extension evidence-details and in ctlv-attestation-spdm.yaml evidence-parameters: # Connection or lock device session ID this collection belongs to. device-session-id: uint # Identity slot; captured host evidence requires the selected identity. slot?: uint(..7) # Fills the common evidence-details reply extension after bundle delivery. evidence-details: # Connection or lock device session ID of the delivered bundle. device-session-id: uint When evidence-get selects the parameters record, its cursor still uses the common attestation schema. That schema does not define the SPDM fields inside the record. Reading those fields therefore triggers WARN_ON_ONCE() in ctlv_message_input_slot() -aneesh