From: Jiandi An <anjiandi@codeaurora.org>
To: Jan Beulich <JBeulich@suse.com>
Cc: tim@xen.org, sstabellini@kernel.org, wei.liu2@citrix.com,
George.Dunlap@eu.citrix.com,
Andrew Cooper <andrew.cooper3@citrix.com>,
ian.jackson@eu.citrix.com, xen-devel@lists.xen.org,
shankerd@codeaurora.org
Subject: Re: [PATCH] xen/physmap: Propagate error rc from xenmem_add_to_physmap_one
Date: Wed, 07 Dec 2016 12:54:13 -0600 [thread overview]
Message-ID: <58485AD5.8040101@codeaurora.org> (raw)
In-Reply-To: <584803DB02000078001262C9@prv-mh.provo.novell.com>
On 12/07/16 05:43, Jan Beulich wrote:
>>>> On 07.12.16 at 02:07, <andrew.cooper3@citrix.com> wrote:
>> On 07/12/2016 01:00, Jiandi An wrote:
>>> --- a/xen/common/memory.c
>>> +++ b/xen/common/memory.c
>>> @@ -762,6 +762,8 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
>>> rc = xenmem_add_to_physmap_one(d, xatpb->space,
>>> xatpb->u,
>>> idx, _gfn(gpfn));
>>> + if ( rc < 0 )
>>> + goto out;
>>>
>>> if ( unlikely(__copy_to_guest_offset(xatpb->errs, 0, &rc, 1)) )
>>> {
>>
>> This can't be correct. You now skip writing rc into the errs[] array on
>> a failure, which means that userspace will get an overall failure but an
>> errs[] array which said that nothing went wrong.
>>
>> This code addition looks like it wants to be an "else if" on the end of
>> this if() in context.
>
> Why would this go elsewhere? It's unneeded - it's a property of the
> hypercall that when seeing overall success you still need to look at
> errs[].
>
> Jan
>
I realized the issue is on the guest side errs[] is not being checked
after the heypercall. Will fix on the guest side.
--
Jiandi An
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
prev parent reply other threads:[~2016-12-07 18:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-07 1:00 [PATCH] xen/physmap: Propagate error rc from xenmem_add_to_physmap_one Jiandi An
2016-12-07 1:07 ` Andrew Cooper
2016-12-07 11:43 ` Jan Beulich
2016-12-07 17:09 ` Andrew Cooper
2016-12-08 9:21 ` Jan Beulich
2016-12-07 18:54 ` Jiandi An [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=58485AD5.8040101@codeaurora.org \
--to=anjiandi@codeaurora.org \
--cc=George.Dunlap@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=shankerd@codeaurora.org \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.