From: Julien Grall <julien.grall@arm.com>
To: Jiandi An <anjiandi@codeaurora.org>,
Stefano Stabellini <sstabellini@kernel.org>
Cc: Juergen Gross <jgross@suse.com>,
boris.ostrovsky@oracle.com, xen-devel@lists.xenproject.org,
linux-kernel@vger.kernel.org, shankerd@codeaurora.org,
shannon.zhao@linaro.org
Subject: Re: [PATCH] Xen: ARM: Zero reserved fields of xatp before making hypervisor call
Date: Tue, 20 Dec 2016 11:31:07 +0100 [thread overview]
Message-ID: <e4680b28-1caf-3235-1832-3bf477f49c30@arm.com> (raw)
In-Reply-To: <5858BB54.5090106@codeaurora.org>
Hi Jiandi,
Please respect the netiquette and wrap line to 70-75 characters.
On 20/12/2016 06:02, Jiandi An wrote:
> On 12/19/16 12:49, Stefano Stabellini wrote:
>> On Mon, 19 Dec 2016, Juergen Gross wrote:
>>> On 19/12/16 03:56, Jiandi An wrote:
> Thanks for you comments. xatp is passed to XEN via the hypervisor call in each loop.
> XEN touches xatp and returns it back. For example XEN returns error of underlying mapping call in the err[] array in xatp. (The err[] is not checked after the hypervisor call returns and it's a bug to be addressed in a separate patch) XEN could theoretically corrupt xatp when it's returned. And the loop would go on to the next iteration passing in whatever that's in xatp returned by the previous hypervisor call. Harder to debug in my opinion if xatp get corrupted by XEN somehow when a bug is introduced in XEN. At first I put the memset of xatp at the beginning outside of the loop. But I thought it's better to initialize xatp that's passed in each time a hypervisor call is made so we know exactly we set going into the hypervisor call.
If you move struct xen_add_to_physmap_range in the loop, the compiler
will initialize and zeroed for you the structure at each loop. I.e
for (i = 0; i < count; i++) {
struct xen_add_to_physmap_range xapt = ....
}
Cheers,
--
Julien Grall
prev parent reply other threads:[~2016-12-20 10:31 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
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 [this message]
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=e4680b28-1caf-3235-1832-3bf477f49c30@arm.com \
--to=julien.grall@arm.com \
--cc=anjiandi@codeaurora.org \
--cc=boris.ostrovsky@oracle.com \
--cc=jgross@suse.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®