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

Re: [PATCH] xen/arm: grant-table: Correct the prototype of the arch helpers


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Tue, 4 Jul 2023 14:35:16 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; 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=K+rZJlQ1eC64c5Kq4Za0wz2FbOXczQGH8R/vTXItowE=; b=YmbUzQOcaBnrO6MtF1pbM/lqlcYBS2GhN7tB+NKasTt5duAcSw952btUq8vETlX9chxvh8lIrHngWVjnSzmYK69vGPuWc/MYukuI3CbF3vz2cjy7bmnrPCFjVJxp79p4it0WiMKVu0cJGuKo4XyqXAX0i6Ff46jLqaQZhuUt4DP9x+GdqkHmwyiBwtavdUVs2ZeKZeGC4ywr+O8CTeBh7SSqcmDLQN8VOx4Z4d9L5MRzm7OS14d+Pj448E47PZJnLikzBCyr4+2DDfypRboD/Dvq9ywbRrn56mxhdhyznxp+0cWz9rnGMpNJcdKDe+/dt0TMEJWlvVZZDbiIcpOHJQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LiHJFWjoU5D7777zsFdh4woyjFaqO6Xk8Ut1phuBYKXejExyteshgG0UFCyctKdo0cFM2TuWqJgC1FrKV9BjEcwcUp9qn591jY5Li8fYk2DwkUK9U7dChsDnEmutJQ9n17EXKMv5OYFNFw7qEt3nArOzJNiYT342at9wYXf28WXPS9C2q8E0KOKxf6zh6Qoc1fRxGTE3GjZJ9QC461l9hrFlMHkunbjRppfPST00YwVbG3dtBi742Uh2jXrsrpSeWEsD01CP/YizmD0cTU6eJZqDkf5jb4aZtBMDNjJdZfiF+9oa3+yCzi6Lb2ktD79hntkRSYvooAWK4EG6ZKdw7g==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Luca Fancellu <Luca.Fancellu@xxxxxxx>, "michal.orzel@xxxxxxx" <michal.orzel@xxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, "federico.serafini@xxxxxxxxxxx" <federico.serafini@xxxxxxxxxxx>
  • Delivery-date: Tue, 04 Jul 2023 14:35:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZqs0B2zzuMPxesEq0PvPe7uOM1q+ps9kA
  • Thread-topic: [PATCH] xen/arm: grant-table: Correct the prototype of the arch helpers

Hi Julien,

> On 29 Jun 2023, at 23:01, Julien Grall <julien@xxxxxxx> wrote:
> 
> From: Julien Grall <jgrall@xxxxxxxxxx>
> 
> Both the stub and the x86 prototypes for replace_grant_host_mapping()
> and create_grant_host_mapping() will define the first parameter (and
> third for the former) as uint64_t. Yet Arm will define it as
> 'unsigned long'.
> 
> While there are no differences for 64-bit, for 32-bit it means
> that the address should be truncated as 32-bit guest could support
> up to 40-bit addresses.
> 
> So replace 'unsigned long' with 'uint64_t' for the first parameter
> (and third parameter for replace_grant_host_mapping()).
> 
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>

Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> ---
> 
> Cc: federico.serafini@xxxxxxxxxxx
> ---
> xen/arch/arm/include/asm/grant_table.h | 6 +++---
> xen/arch/arm/mm.c                      | 6 +++---
> 2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/arch/arm/include/asm/grant_table.h 
> b/xen/arch/arm/include/asm/grant_table.h
> index f2d115b97d8b..d3c518a926b9 100644
> --- a/xen/arch/arm/include/asm/grant_table.h
> +++ b/xen/arch/arm/include/asm/grant_table.h
> @@ -36,10 +36,10 @@ static inline bool gnttab_release_host_mappings(const 
> struct domain *d)
>     return true;
> }
> 
> -int create_grant_host_mapping(unsigned long gpaddr, mfn_t frame,
> +int create_grant_host_mapping(uint64_t gpaddr, mfn_t frame,
>                               unsigned int flags, unsigned int cache_flags);
> -int replace_grant_host_mapping(unsigned long gpaddr, mfn_t frame,
> -                               unsigned long new_gpaddr, unsigned int flags);
> +int replace_grant_host_mapping(uint64_t gpaddr, mfn_t frame,
> +                               uint64_t new_gpaddr, unsigned int flags);
> 
> /*
>  * The region used by Xen on the memory will never be mapped in DOM0
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index 0a3e1f3b64b6..53773368d036 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -1579,7 +1579,7 @@ void put_page_type(struct page_info *page)
>     return;
> }
> 
> -int create_grant_host_mapping(unsigned long gpaddr, mfn_t frame,
> +int create_grant_host_mapping(uint64_t gpaddr, mfn_t frame,
>                               unsigned int flags, unsigned int cache_flags)
> {
>     int rc;
> @@ -1600,8 +1600,8 @@ int create_grant_host_mapping(unsigned long gpaddr, 
> mfn_t frame,
>         return GNTST_okay;
> }
> 
> -int replace_grant_host_mapping(unsigned long gpaddr, mfn_t frame,
> -                               unsigned long new_gpaddr, unsigned int flags)
> +int replace_grant_host_mapping(uint64_t gpaddr, mfn_t frame,
> +                               uint64_t new_gpaddr, unsigned int flags)
> {
>     gfn_t gfn = gaddr_to_gfn(gpaddr);
>     struct domain *d = current->domain;
> -- 
> 2.40.1
> 
> 




 


Rackspace

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