From: "Jan Beulich" Subject: Re: [PATCH v2 5/5] xen: replace XEN_GUEST_HANDLE with XEN_GUEST_HANDLE_PARAM when appropriate Date: Tue, 14 Aug 2012 12:55:27 +0100 Message-ID: <502A58CF0200007800094BE4@nat28.tlf.novell.com> References: <1344600612-10815-5-git-send-email-stefano.stabellini@eu.citrix.com> <5025276B02000078000942BE@nat28.tlf.novell.com> <5029098A020000780009471C@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: "xen-devel@lists.xensource.com" , Ian Campbell , "Tim Deegan (3P)" List-Id: xen-devel@lists.xenproject.org >>> On 14.08.12 at 12:38, Stefano Stabellini wrote: > On Mon, 13 Aug 2012, Jan Beulich wrote: >> >>> On 13.08.12 at 13:24, Stefano Stabellini > wrote: >> > On the other hand if you mean casting a XEN_GUEST_HANDLE_PARAM into a >> > XEN_GUEST_HANDLE to pass it to other internal functions, I don't think >> > there is any point in that because the other internal functions should >> > also have XEN_GUEST_HANDLE_PARAMs as parameters. >> >> So you obviously need a cast from "normal" to _PARAM (so that >> you can pass embedded fields to functions). > > In practice embedded fields are in guest memory, so the first thing Xen > does is calling copy_from_guest and work with the struct pointer > directly from that point on. Perhaps we have a different understanding of embedded fields: I'm thinking of structure field having XEN_GUEST_HANDLE() type. An example would be struct mmuext_op's vcpumask field, which is being passed to vcpumask_to_pcpumask(). This must remain to be possible (and not just in x86-specific code, where it's mere luck that both are really identical). Jan