[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN v5 01/10] xen/arm: domain_build: Track unallocated pages using the frame number
- To: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Michal Orzel <michal.orzel@xxxxxxx>
- Date: Wed, 19 Apr 2023 14:05:44 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=koVgJq0CDskxBs3mtL1uJ4fcZrANCwjGhvanYDgGC4k=; b=VAd7Tft5Or48kERkDmej1FYJAKJPF57FlKj4lNkqOmyPflhD1DDHh49sUPDgr9yoftyx6AxAnEMQc9KdQvQl64mRnMxrdXemQJpaBvDbAAfPjXRpRX3DXhVP4rGHIHyXB+qBeQUKIrUC71Q6AiBNGG5h14hkzahN/5IcROLj2nZo/DFAhJq5g/zZ/xYGCK0N6+andI8eyKja4X3FkICExqGHPoYpdPiXh/+c5l3V8NJ2p1BMf4KuNKErBSvHYJajCmUe4eNRMfjIAxhuYModEl1D/V+8OVsTIIiyVlLEr2ctWpUxqc9RZeYdmE6GrDLcKB7aFNY+kuycIkETro/WPQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YIKC/Fds7A9GVj+UogZd7za14uuWKuuCeWA78S7PZlnDhAMNjOue0xLPYxZKcW/nNiixsDdBtBTwKUuNSGl05aljDBiAyIm9hoVevoJWHVLQQD/YmqgKO3DO9Xk24Ouomadl7xg7/0G4aFglmRyqEBaSUOJeLeaGgRNLLk8GYrDmOLaCsMYxrGO1ly0UAmQ0VMHfwjg4xLPcAz11/U/UwhqIe8qbbjI5vrUCpkMXscJk7BM7lNW3SV/Z0YE8dmxqqR48y3TmFHeJ6BRZFV22wA4BtbHUTplMaLPeWyCsW9oAtLGhUtEVM3RmdArAKQD/sqmtBtdiSUvMPnR9RaOVFA==
- Cc: <sstabellini@xxxxxxxxxx>, <stefano.stabellini@xxxxxxx>, <julien@xxxxxxx>, <Volodymyr_Babchuk@xxxxxxxx>, <bertrand.marquis@xxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <george.dunlap@xxxxxxxxxx>, <jbeulich@xxxxxxxx>, <wl@xxxxxxx>, <rahul.singh@xxxxxxx>
- Delivery-date: Wed, 19 Apr 2023 12:06:05 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Hi Ayan,
On 13/04/2023 19:37, Ayan Kumar Halder wrote:
>
>
> rangeset_{xxx}_range() functions are invoked with 'start' and 'size' as
> arguments which are either 'uint64_t' or 'paddr_t'. However, the function
> accepts 'unsigned long' for 'start' and 'size'. 'unsigned long' is 32 bits for
> Arm32. Thus, there is an implicit downcasting from 'uint64_t'/'paddr_t' to
> 'unsigned long' when invoking rangeset_{xxx}_range().
>
> So, it may seem there is a possibility of lose of data due to truncation.
>
> In reality, 'start' and 'size' are always page aligned. And Arm32 currently
> supports 40 bits as the width of physical address.
> So if the addresses are page aligned, the last 12 bits contain zeroes.
> Thus, we could instead pass page frame number which will contain 28 bits
> (40-12
> on Arm32) and this can be represented using 'unsigned long'.
>
> On Arm64, this change will not induce any adverse side effect as the width of
> physical address is 48 bits.
NIT: This reads as const, so it would be better to write: "as the max supported
width of ..."
Thus, the width of 'gfn' (ie 48 - 12 = 36) can be
> represented using 'unsigned long' (which is 64 bits wide).
>
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
With or without (after all this is just a commit msg):
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
~Michal
|