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

Re: [XEN v6 02/12] xen/arm: Typecast the DT values into paddr_t


  • To: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Thu, 4 May 2023 09:27:07 +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=piNITOBU4G5juGieXw/xT3ryw6m2OzxAGcoOcWNc/iw=; b=HHaj8lxxAIK2tFW68v0PHujjDhshCHYqhRkprRY7urzOJmeZvuCEpGuqNvfAJ9c62zilsYGl1s3nbN32KRxa6DEUskgNa7sr/1bXrJWiqCuu/0lm5pa8wKvlTS7wSUwEYCRxWd4beSbyYoyCVKU6y/NFBeB/0zYy+J/MGnip9Dqw6vLsj3GC3BKZWgb678GXRi9Rb+w5+0aqbZFsxiaOC/3G66t7ej+fhe055CmQlGKzWAL9wwyHINEkiHuUCu/PXJ4EMM+aNofs87pn3zN8/fl9y3EzGkDekeNhsG90/jp+KOwf7avDZd6ac1v4RNnzLZ46CzgpXn+SYQGa0UMJ0g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NwPyUoFiPLy79x+V3gAUVNnuJ2u0KI35vP94nwvM/SaJBXAWZb9c37jU2Pokch9tRiD2GdxUhp3RO5CnVKKIXPmr4E28b8NSwFfcfdhxmzKZ2AMdxhgcqmmxCDeNX8nBOzQ6MCwIDaaeCQHGz4Rv8EysxCPlJTKzjJ1ynsEP7lrzIGgS/C5NYCazPZaVsqLbAYjO6xABrIv1KW59+7ySHjp6X3+a0S5wMGuOfZbA7hRmtT1aGfdgIfaDL6Y3sWX2urooLvF/oTwnwui4Cx1JL2nC4/i3Onr1MXzJXxXuapngnBMu+4CMb4+tMnOKDlZHEGiWpISsZdN/+fzL22Ql2g==
  • 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: Thu, 04 May 2023 07:27:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 28/04/2023 19:55, Ayan Kumar Halder wrote:
> 
> 
> The DT functions (dt_read_number(), device_tree_get_reg(), fdt_get_mem_rsv())
> currently accept or return 64-bit values.
> 
> In future when we support 32-bit physical address, these DT functions are
> expected to accept/return 32-bit or 64-bit values (depending on the width of
> physical address). Also, we wish to detect if any truncation has occurred
> (i.e. while parsing 32-bit physical addresses from 64-bit values read from 
> DT).
> 
> device_tree_get_reg() should now be able to return paddr_t. This is invoked by
> various callers to get DT address and size.
> 
> For fdt_get_mem_rsv(), we have introduced a wrapper named
> fdt_get_mem_rsv_paddr() which will invoke fdt_get_mem_rsv() and translate
> uint64_t to paddr_t. The reason being we cannot modify fdt_get_mem_rsv() as it
> has been imported from external source.
> 
> For dt_read_number(), we have also introduced a wrapper named dt_read_paddr()
> dt_read_paddr() to read physical addresses. We chose not to modify the 
> original
> function as it is used in places where it needs to specifically read 64-bit
> values from dt (For e.g. dt_property_read_u64()).
> 
> Xen prints warning when it detects truncation in cases where it is not able to
> return error.
> 
> Also, replaced u32/u64 with uint32_t/uint64_t in the functions touched
> by the code changes.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

~Michal




 


Rackspace

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