[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RESEND][PATCH v2 6/7] xen/guest_access: Consolidate guest access helpers in xen/guest_access.h
 
- To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
 
- From: Julien Grall <julien@xxxxxxx>
 
- Date: Fri, 14 Aug 2020 20:10:26 +0100
 
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Julien Grall <jgrall@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
 
- Delivery-date: Fri, 14 Aug 2020 19:10:36 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
 
 
 
Hi Stefano,
On 30/07/2020 20:37, Stefano Stabellini wrote:
 
On Thu, 30 Jul 2020, Julien Grall wrote:
 
From: Julien Grall <jgrall@xxxxxxxxxx>
Most of the helpers to access guest memory are implemented the same way
on Arm and x86. The only differences are:
     - guest_handle_{from, to}_param(): while on x86 XEN_GUEST_HANDLE()
 
It is actually just guest_handle_to_param() ?
 
 
 Yes. I forgot Jan recently removed the helper in commit dd5520f9df05 
"x86: adjustments to guest handle treatment". I will update the commit 
message.
 
 
       and XEN_GUEST_HANDLE_PARAM() are the same, they are not on Arm. It
       is still fine to use the Arm implementation on x86.
     - __clear_guest_offset(): Interestingly the prototype does not match
       between the x86 and Arm. However, the Arm one is bogus. So the x86
       implementation can be used.
     - guest_handle{,_subrange}_okay(): They are validly differing
       because Arm is only supporting auto-translated guest and therefore
       handles are always valid.
In the past, the ia64 and ppc64 port use a different model to access
guest parameter. They have been long gone now.
Given Xen currently only support 2 archictures, it is too soon to have a
directory asm-generic as it is not possible to differentiate it with the
existing directory xen/. If/When there is a 3rd port, we can decide to
create the new directory if that new port decide to use a different way
to access guest parameter.
For now, consolidate it in xen/guest_access.h.
While it would be possible to adjust the coding style at the same, this
is left for a follow-up patch so 'diff' can be used to check the
consolidation was done correctly.
Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
 
Looks good to me
Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
 
 
Thank you!
Cheers,
--
Julien Grall
 
 
    
     |