Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15452CD6E79 for ; Tue, 9 Jun 2026 09:40:00 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1332568.1595025 (Exim 4.92) (envelope-from ) id 1wWsvy-0001Os-R7; Tue, 09 Jun 2026 09:39:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1332568.1595025; Tue, 09 Jun 2026 09:39:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wWsvy-0001Ol-Mm; Tue, 09 Jun 2026 09:39:46 +0000 Received: by outflank-mailman (input) for mailman id 1332568; Tue, 09 Jun 2026 09:39:45 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) id 1wWsvx-0001OY-IL for xen-devel@lists.xenproject.org; Tue, 09 Jun 2026 09:39:45 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wWsvw-00Fku2-KX for xen-devel@lists.xenproject.org; Tue, 09 Jun 2026 11:39:44 +0200 Received: from [10.42.69.3] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a27df4e-bab6-0a2a0a5309dd-0a2a45038358-48 for ; Tue, 09 Jun 2026 11:39:44 +0200 Received: from [209.85.208.50] (helo=mail-ed1-f50.google.com) by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 6a27df60-672d-0a2a45030019-d155d032d11c-3 for ; Tue, 09 Jun 2026 11:39:44 +0200 Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-691c5776f35so2576254a12.3 for ; Tue, 09 Jun 2026 02:39:44 -0700 (PDT) Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl. [109.243.148.111]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-68e6595c722sm8324423a12.22.2026.06.09.02.39.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Jun 2026 02:39:43 -0700 (PDT) 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:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780997984; x=1781602784; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ojAoOIr8suU/Ii90bmf7iq53dfd/rns61I5bJ24u/Ns=; b=OGcYsnQSMFo609NFYaQTXSeA1Tt7R6WKGagtB3LtbqwsURSbGpJXrutWURWQ/dncmE blUIIc966QDW8o6xjEYGhUeupWMHR03uPK8T76ECqvhR+ob+w0+uQzc4jYu6Ac8uQyJ2 DNBK4UdjtXrWtQ3KmSGLQ+BQAMRkEX0ec71qe2pzGVVa5V+/G1xErqkgGOo7g8MaWvbk oOohu/XWjz4wJQYsqAHi9hjxKWtXwYocpCZklFumYjTr7M0eORACrUK74lHF88KKa81G lsb6aJk5UMxag096m9nYBqLdIg+RPM2q7rL50HtJvNWqa6QFPr+TUe8OsMLWlg39zEC4 iRsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780997984; x=1781602784; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ojAoOIr8suU/Ii90bmf7iq53dfd/rns61I5bJ24u/Ns=; b=JYTHzai+3m2RxQ1j1VV6hcobyhwyDdsDjMuMtf1JIH8q21smxdraMHdfwGCzC/EtbL tJ1ZXJNZQUjIHtFMcBNuYytpqYmPlPBHwWPUcTHQ6cFitI4jRtYbOhVMnOAv9eT/2nKq XVjLho2OtkfUFtmffdyDWXGH+bS5r8tps33fyaUj3f3AkUGmpKWhsDZidY7GZ1IVNPsX ddeNUT89glnuKVItivPVHjOxKTuuQCcRA5pnkv2bP74sxos9LrZMvpg0HeEqV3KK9bzl ZOkHuxjQDS01bAQvpGNhQ5CvFaXxBkjKKinMQ/Wz7E49zb3HXk8RxnsnvIGOHVtFJNLj 1AqA== X-Forwarded-Encrypted: i=1; AFNElJ/uOrHC40NQQAhoVHDAgx/Je+QEhyzWLIRO/kq+Jg8uy/s9SuT6dCw+Ds3ZoR8Se1mgYbTqCTlIuhE=@lists.xenproject.org X-Gm-Message-State: AOJu0Yynf3IeRPTQvGbl0HbM9D76ALhIM6o7GsB/DSiSqzcb64H0uEYI qXWyeXYDRQwZMk1YAhjcBrh15xCGEtcYDzvr/8mgYVn5XgSjJ9r589Dtu5u+SA== X-Gm-Gg: Acq92OEqXinKR5vzr2lkBeTY6g3YC29ABWhdVdJHMqc3cFKScOo6PstFchhN5HmRGW5 Y4OQBoa2nxaFIgtHYQSWvqpQK75muRVUJUJ+iOnkIWIxme6Ng5JnYnbV4O0P53b118jk/ZfnXRX t6PPgUlZ5Pq2yeXaEPr7kbfYUkpqc5Caz4TbmJFwc4YEP8HsxbTFt5noaMoS3hp7sg5k2uTk4ye pQbeIugmSvgK7+DGpxMFrPQbu+PxukrUPDRoY2Q73ooFkr8ybyi+7GZ0CGHGDUrJn7S6ZBmgv21 gs7pmzVIkYvmQZYkpZHngws6tsZ/TWQL1uWK90gKocDJbUg7pLujqCjLRbPwItN9QDG9znD+U7X wDFInTUZL6jjMtUT1YbMFdWh6RzfqgzrXMZ9ovQkfbC2toBJpfOS+K2NW/sCrOutDp9T8ddDWQf 3IWxgahaWYzfO5Z0WCBFF3dvS5xYqgY187ymrZVKXLUS64+Nr2XSaV9TlYudymICQNT5FSNepJM PGcDzJw0WK5WvUc X-Received: by 2002:a05:6402:27d4:b0:68c:33e9:bf71 with SMTP id 4fb4d7f45d1cf-68fa4e18fafmr9061861a12.11.1780997983688; Tue, 09 Jun 2026 02:39:43 -0700 (PDT) Message-ID: <7f8679f1-7bd9-4c48-a112-edc83d95d196@gmail.com> Date: Tue, 9 Jun 2026 11:39:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH for-4.22] xen/pdx: fix off-by-one index in offset mask calculation To: Roger Pau Monne , xen-devel@lists.xenproject.org Cc: Anthony PERARD , Andrew Cooper , Michal Orzel , Jan Beulich , Julien Grall , Stefano Stabellini References: <20260609085322.92856-1-roger.pau@citrix.com> Content-Language: en-US From: Oleksii Kurochko In-Reply-To: <20260609085322.92856-1-roger.pau@citrix.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-purgate-ID: tlsNG-33051d/1780997984-3B96D938-39F071F6/10/73395122804 X-purgate-type: spam X-purgate-size: 858 On 6/9/26 10:53 AM, Roger Pau Monne wrote: > Adjust the mask calculation in case the last range is merged with the > previous one, as then the mask must be calculated from the previous range, > which the current one has been merged into. > > Instead of fixing the off-by-one in place, move the calculation of the bit > change mask to the next loop, after the ranges have been merged. This > simplifies the logic by consolidating mask calculation in a single place, > possibly making it less error prone in the future. > > Also add a test case that triggers the bug being fixed by this commit. > > Fixes: c5c45bcbd6a1 ("pdx: introduce a new compression algorithm based on region offsets") > Signed-off-by: Roger Pau Monné Release-Acked-by: Oleksii Kurochko Thanks. ~ Oleksii