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

Re: [PATCH 2/3] x86/boot: Simplify address calculations in move_memory()


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Tue, 22 Oct 2024 20:16:41 -0400
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • 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-seal: i=1; a=rsa-sha256; t=1729642604; cv=none; d=zohomail.com; s=zohoarc; b=G/ySipiSpB+0hsRgKZXWUgr+T0n2D1mQzUtKE6PJCBib8Htl6SrlcemUOOL4/oOLGGybgnc0sF5CDbqTrNgsdDpKgQrNlaz8rq+4fNgUUim90/0joasc6iq9DucVZQlkwzJifHCnFlhaFKZRQMOWjSE0rlusm08W0HZPcG6LLkg=
  • Cc: Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 23 Oct 2024 00:16:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>

After nit,

Reviewed-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>



 


Rackspace

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