From: Juergen Gross <jgross@suse.com>
To: Jiandi An <anjiandi@codeaurora.org>,
boris.ostrovsky@oracle.com, xen-devel@lists.xenproject.org,
linux-kernel@vger.kernel.org
Cc: julien.grall@arm.com, sstabellini@kernel.org,
shankerd@codeaurora.org, shannon.zhao@linaro.org
Subject: Re: [PATCH] Xen: ARM: Zero reserved fields of xatp before making hypervisor call
Date: Mon, 19 Dec 2016 13:14:56 +0100 [thread overview]
Message-ID: <df19a0eb-578c-12e9-0d48-474ba1812db5@suse.com> (raw)
In-Reply-To: <1482116198-28940-1-git-send-email-anjiandi@codeaurora.org>
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
next prev parent reply other threads:[~2016-12-19 12:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-19 2:56 Jiandi An
2016-12-19 12:14 ` Juergen Gross [this message]
2016-12-19 18:49 ` Stefano Stabellini
2016-12-20 5:02 ` Jiandi An
2016-12-20 9:57 ` Juergen Gross
2016-12-20 10:31 ` Julien Grall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=df19a0eb-578c-12e9-0d48-474ba1812db5@suse.com \
--to=jgross@suse.com \
--cc=anjiandi@codeaurora.org \
--cc=boris.ostrovsky@oracle.com \
--cc=julien.grall@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shankerd@codeaurora.org \
--cc=shannon.zhao@linaro.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®