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 1ABF1D2CDF9 for ; Wed, 23 Oct 2024 00:17:08 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.824341.1238456 (Exim 4.92) (envelope-from ) id 1t3P3T-00013L-5P; Wed, 23 Oct 2024 00:16:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 824341.1238456; Wed, 23 Oct 2024 00:16:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t3P3T-00013E-22; Wed, 23 Oct 2024 00:16:51 +0000 Received: by outflank-mailman (input) for mailman id 824341; Wed, 23 Oct 2024 00:16:49 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t3P3R-000138-Se for xen-devel@lists.xenproject.org; Wed, 23 Oct 2024 00:16:49 +0000 Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 177cd4a3-90d4-11ef-a0be-8be0dac302b0; Wed, 23 Oct 2024 02:16:48 +0200 (CEST) Received: by mx.zohomail.com with SMTPS id 172964260236081.18775636948408; Tue, 22 Oct 2024 17:16:42 -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" X-Inumbo-ID: 177cd4a3-90d4-11ef-a0be-8be0dac302b0 ARC-Seal: i=1; a=rsa-sha256; t=1729642604; cv=none; d=zohomail.com; s=zohoarc; b=G/ySipiSpB+0hsRgKZXWUgr+T0n2D1mQzUtKE6PJCBib8Htl6SrlcemUOOL4/oOLGGybgnc0sF5CDbqTrNgsdDpKgQrNlaz8rq+4fNgUUim90/0joasc6iq9DucVZQlkwzJifHCnFlhaFKZRQMOWjSE0rlusm08W0HZPcG6LLkg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729642604; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ihha2WkaDo8YK9TFfNt/9gjktJNn6lcUbCtF1XUysTY=; b=NjQDmI3Kcv8igoXxBCwSPPWteL2lii3ce6W9Fc1WMSzP/gMPQYtXEb0aZ6/1UjmPijEiL+7YSpZ8LmyacCvHEt9JoDBzr60cH5c58dXZCJL0eNGLPG73a0VQmKSDjFzfHPwS+e6eipZhi0ci4I7sa5Bj805buOyDci6xBF+PN9U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@apertussolutions.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1729642604; s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=Ihha2WkaDo8YK9TFfNt/9gjktJNn6lcUbCtF1XUysTY=; b=AawezXO3wA3HFV00qaqXCWD3kh7VFxTZUMi52ak+PBUHFETPQXnFFJ+n3iBXWz6u rM/oqWafnuRliIuaPYMhJmdp+8pIk/G8s5Y+YPHCsF0s2qP5dWRaszXqJZf9jnDaKS+ Ktc3pTj8zFaadlPFcR5bLQ6UAo/8PBGNMxGAwCZY= Message-ID: <0aa6940f-5aeb-4f14-bb18-2a598b926686@apertussolutions.com> Date: Tue, 22 Oct 2024 20:16:41 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] x86/boot: Simplify address calculations in move_memory() To: Andrew Cooper , Xen-devel Cc: Jan Beulich , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= References: <20241022223954.432554-1-andrew.cooper3@citrix.com> <20241022223954.432554-3-andrew.cooper3@citrix.com> Content-Language: en-US From: "Daniel P. Smith" In-Reply-To: <20241022223954.432554-3-andrew.cooper3@citrix.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ZohoMailClient: External On 10/22/24 18:39, Andrew Cooper wrote: > Given that soffs is the offset into the 2M superpage, > > start = (src - soffs) >> PAGE_SIFT > > is a complicated expression for the frame address of the containing superpage. > Except, start is converted straight back to a byte address to use, so the > shifting is unnecessary too. > > The only done with the mapped pointer is to have soffs added back on for the nit: think you dropped a word here, "The only done". > memmove() call. bootstrap_map_addr() passes through the offset, so we can > pass src directly in and simplify the memmove() call too. For the end mapping > address, this simplifies to just src + sz too. > > The same reasoning holds for dst and doffs. > > No functional change. > > Signed-off-by: Andrew Cooper > --- > CC: Jan Beulich > CC: Roger Pau Monné > CC: Daniel P. Smith After nit, Reviewed-by: Daniel P. Smith