Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1544490

Re: [PATCH] Xen: ARM: Zero reserved fields of xatp before making hypervisor call

From Juergen Gross <jgross@suse.com>
Newsgroups linux.kernel
Subject Re: [PATCH] Xen: ARM: Zero reserved fields of xatp before making hypervisor call
Date 2016-12-19 13:20 +0100
Message-ID <sQ558-7DY-15@gated-at.bofh.it> (permalink)
References <sPWlc-1Pz-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 19/12/16 03:56, Jiandi An wrote:
> Ensure all reserved fields of xatp are zero before making hypervisor
> call to XEN in xen_map_device_mmio().  xenmem_add_to_physmap_one() in
> XEN fails the mapping request if extra.res reserved field in xatp is
> not zero for XENMAPSPACE_dev_mmio request.
> 
> Signed-off-by: Jiandi An <anjiandi@codeaurora.org>
> ---
>  drivers/xen/arm-device.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/xen/arm-device.c b/drivers/xen/arm-device.c
> index 778acf8..208273b 100644
> --- a/drivers/xen/arm-device.c
> +++ b/drivers/xen/arm-device.c
> @@ -87,6 +87,9 @@ static int xen_map_device_mmio(const struct resource *resources,
>  			idxs[j] = XEN_PFN_DOWN(r->start) + j;
>  		}
>  
> +		/* Ensure reserved fields are set to zero */
> +		memset(&xatp, 0, sizeof(xatp));
> +
>  		xatp.domid = DOMID_SELF;
>  		xatp.size = nr;
>  		xatp.space = XENMAPSPACE_dev_mmio;

Instead of setting xatp to 0 in each iteration I'd prefer a static
initialization of .domid and .space:

	struct xen_add_to_physmap_range xatp = {
		.domid = DOMID_SELF,
		.space = XENMAPSPACE_dev_mmio
	};


Juergen

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] Xen: ARM: Zero reserved fields of xatp before making hypervisor call Jiandi An <anjiandi@codeaurora.org> - 2016-12-19 04:00 +0100
  Re: [PATCH] Xen: ARM: Zero reserved fields of xatp before making  hypervisor call Juergen Gross <jgross@suse.com> - 2016-12-19 13:20 +0100
    Re: [PATCH] Xen: ARM: Zero reserved fields of xatp before making  hypervisor call Stefano Stabellini <sstabellini@kernel.org> - 2016-12-19 19:50 +0100
      Re: [PATCH] Xen: ARM: Zero reserved fields of xatp before making  hypervisor call Jiandi An <anjiandi@codeaurora.org> - 2016-12-20 06:10 +0100
        Re: [PATCH] Xen: ARM: Zero reserved fields of xatp before making  hypervisor call Juergen Gross <jgross@suse.com> - 2016-12-20 11:00 +0100
        Re: [PATCH] Xen: ARM: Zero reserved fields of xatp before making  hypervisor call Julien Grall <julien.grall@arm.com> - 2016-12-20 11:40 +0100

csiph-web