From nobody Mon Sep 21 00:46:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1776974680; cv=none; d=zohomail.com; s=zohoarc; b=Cqpgudkv/KMs7FGujXSM2FJ8WAsY00fZiT6PND7VKXENkj6xdRh1dMGu8gb0js8KJB8H2r+g6lRufrxtnqMHdIYiGG0VV+JbX8/Z3mZT6RYNSGbDZStKGICupI0frfIxLeRGZWTx/j+S4fWaQUaglQiWWJNwXNTDyyFNwRD/ppI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1776974680; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XDfhd227o6gGh3k3sHyBHCTFmn0oVFwYEqgY5uwBNT0=; b=ZIBKTJlAF3V5M9c4ZQ7yisrnxFkgcUCXzbzdfZBVXQRX6EWunb2KmkM7NpPRs1e8X7rRNkRJ8jFcYD9zuKitFrPjaxjIMt7dRjgI8m2Jult+Wp1iwKc4krzd9+OpvFiBBj6O+NG+2erLfuwhJsdTgGd4FbKsL1nUOK2TwN7dg8M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1776974680522404.65269068924863; Thu, 23 Apr 2026 13:04:40 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1292626.1570973 (Exim 4.92) (envelope-from ) id 1wG0Hc-0007Sb-3q; Thu, 23 Apr 2026 20:04:20 +0000 Received: by outflank-mailman (output) from mailman id 1292626.1570973; Thu, 23 Apr 2026 20:04:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wG0Hc-0007SQ-10; Thu, 23 Apr 2026 20:04:20 +0000 Received: by outflank-mailman (input) for mailman id 1292626; Thu, 23 Apr 2026 20:04:18 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wG0Ha-0007FJ-J6 for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 20:04:18 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wG0HZ-005MS0-W8 for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 22:04:18 +0200 Received: from [10.42.69.5] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69ea7b40-5cb7-0a2a0a5109dd-0a2a4505d46e-4 for ; Thu, 23 Apr 2026 22:04:17 +0200 Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com) by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 69ea7b41-aaa8-0a2a45050019-d155dd2ddde8-3 for ; Thu, 23 Apr 2026 22:04:17 +0200 Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-43d6fbd0954so5585381f8f.1 for ; Thu, 23 Apr 2026 13:04:17 -0700 (PDT) Received: from localhost.localdomain (5.116.208.46.dyn.plus.net. [46.208.116.5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e3a341sm60065442f8f.24.2026.04.23.13.04.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2026 13:04:16 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776974657; x=1777579457; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XDfhd227o6gGh3k3sHyBHCTFmn0oVFwYEqgY5uwBNT0=; b=UzRiAQxsJHjx+XfeEt5bh3mMBYBaQJOSfi2ngqVL9QnfRV4+8xp9ZWXTCyDW14tB6H uWhdUXNoXwhgw1iQWN4V00BsYCaSyiPQ/4eSXPGIxpe3qkhpsrHXDxhhsYjgeM3LjNiZ DQkgIFh1AS/TEGND6LpgZtCbLdQ69aoyX7Mu2PJWAx7gepVQb6crg01lOH9kr0mUU2sA f5eaagr5SUv9kgXvBfg+tGF7FL4vvUKjugzn2rROqx6/Uvh81S9myPwT7IFk1sF4i4rm SChvMe7jljMe8qJuxZJMfskoFG37BqNjPxh9HzK47JFIfuCaqqMnSxkopC6BQu5686Wf lqNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776974657; x=1777579457; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=XDfhd227o6gGh3k3sHyBHCTFmn0oVFwYEqgY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ffacd0b85a97d-43fe3db2d1amr41210620f8f.6.1776974657013; Thu, 23 Apr 2026 13:04:17 -0700 (PDT) From: Frediano Ziglio X-Google-Original-From: Frediano Ziglio To: xen-devel@lists.xenproject.org Cc: Frediano Ziglio , Anthony PERARD , Juergen Gross Subject: [PATCH 1/4] xenguest: Reduce number of parts in write_split_record Date: Thu, 23 Apr 2026 21:03:56 +0100 Message-ID: <20260423200406.28178-2-frediano.ziglio@cloud.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260423200406.28178-1-frediano.ziglio@cloud.com> References: <20260423200406.28178-1-frediano.ziglio@cloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-c201ff/1776974657-2A374443-FBC3E0F8/0/0 X-purgate-type: clean X-purgate-size: 1576 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1776974682132154100 Content-Type: text/plain; charset="utf-8" From: Frediano Ziglio Small optimization. There's no much sense to split the header in 2 pieces, it will just take more time and space to reassemble them in the final buffer. This also avoids truncating combined_length to 32 bit in case of 64 bit machines potentially avoiding following record_length check. The function become more coherent with following read_record function. Signed-off-by: Frediano Ziglio --- tools/libs/guest/xg_sr_common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/libs/guest/xg_sr_common.c b/tools/libs/guest/xg_sr_commo= n.c index 7ccdc3b1f6..86c148c62f 100644 --- a/tools/libs/guest/xg_sr_common.c +++ b/tools/libs/guest/xg_sr_common.c @@ -59,11 +59,11 @@ int write_split_record(struct xc_sr_context *ctx, struc= t xc_sr_record *rec, static const char zeroes[(1u << REC_ALIGN_ORDER) - 1] =3D { 0 }; =20 xc_interface *xch =3D ctx->xch; - typeof(rec->length) combined_length =3D rec->length + sz; + size_t combined_length =3D rec->length + sz; size_t record_length =3D ROUNDUP(combined_length, REC_ALIGN_ORDER); + struct xc_sr_rhdr rhdr =3D { rec->type, combined_length }; struct iovec parts[] =3D { - { &rec->type, sizeof(rec->type) }, - { &combined_length, sizeof(combined_length) }, + { &rhdr, sizeof(rhdr) }, { rec->data, rec->length }, { buf, sz }, { (void *)zeroes, record_length - combined_length }, --=20 2.43.0