[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 1/9] libs/guest: Reduce number of parts in write_split_record


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Frediano Ziglio <freddy77@xxxxxxxxx>
  • Date: Wed, 3 Jun 2026 11:16:38 +0100
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=qPPsAuWkEsVt8zn//IOlR2zwGNNKDkbBvGgmciDAiiI=; fh=pmfIAu1zZ/y4MK+Ok8pH+KJi8l1vy8Cep5fL3L/xSOQ=; b=gYy1UaYIFl3mhnk8c35e/Caf/pbEVTYDmOUuuCt0Ho/zVT+O/DDw++eNdQSQDWH3Se CxL6p1i4KMubr2Er33jLikWPnt3jH/ZQ36K9sDRV6diVI4Na1RkC0q7epDIYOVg61nwJ P8mYFi57kyqDuwHHoZkcGn1FwuPgkIw2bnHr36uWgb02gP6yGErmY9WwCWDYL///0gAr rnuj/Ois9LIRu8O2UmZoekJVxQggnIgRO+ccKt7IYISUGuxQsBk1iJCHfIhCeWcmJE/5 WrZ69cMYtbuCAw/2Km7D5P2Q1pm37unsDNu5drRraFdfPtxgDjpQqsaQ7dXE9UBxmWMY v4pg==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1780481809; cv=none; d=google.com; s=arc-20240605; b=fp68ScXXeJVLHVufjOa5zIJm72nzBXN6j/4lRLq+jBTDKN/fbRqGLucaNOUj8SLnbv am3qh1aEWYDUgR2P7rIn+PwQCjaPWFD1gD2PWUS//th7a6sAmZea7Gcqwuw1kIyfcYxx XDn7i6HNajuX4UsKmPRllZD7ONy0Kh6IBiLdyt0BI5XMiBzuuMGv+GO+KQ4nbWrZjvma +xJiezqeqKNxpVB0FZymccPMV33IewmrK6XbAbrIVpslRsW5cT+Olwm0gtBL6sLQ+LHG 2hrS3E03mOK+YKPHC49UIRb2mCxT/hjjxUXL6Q8k+dZHd+o5PP+ZKU362wPpVd5piTrO JZdA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Frediano Ziglio <frediano.ziglio@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Wed, 03 Jun 2026 10:16:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, 2 Jun 2026 at 12:50, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>
> On 26/05/2026 10:43 am, Frediano Ziglio wrote:
> > From: Frediano Ziglio <frediano.ziglio@xxxxxxxxxx>
> >
> > 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 part is fine.
>
> > 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.
>
> This isn't.  The truncation just happens in a different place now, when
> constructing rhdr.  The length is strictly 32 bits.
>

Yes, there's still the truncation but the below check

    if ( record_length > REC_LENGTH_MAX )

is now catching it.

> I'd just drop this paragraph.  The largest record is marginally over 4M,
> and callers won't be passing in anything larger.
>
> ~Andrew

Frediano



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.