From: wanghaibin <wanghaibin.wang@huawei.com>
To: Auger Eric <eric.auger@redhat.com>
Cc: marc.zyngier@arm.com, cdall@linaro.org,
kvmarm@lists.cs.columbia.edu, wu.wubin@huawei.com,
andre.przywara@arm.com
Subject: Re: [RFC PATCH 3/3] kvm: arm/arm64: vgic-its: fix return value for restore
Date: Sat, 16 Sep 2017 10:02:37 +0800 [thread overview]
Message-ID: <59BC863D.5070108@huawei.com> (raw)
In-Reply-To: <d9245b77-40d7-836d-b2c7-82f8f419b62a@redhat.com>
On 2017/9/14 16:30, Auger Eric wrote:
> Hi Wanghaibin,
>
> On 06/09/2017 15:05, wanghaibin wrote:
>> This patch fix the migrate restore tables failure.
>>
>> The same scene, at the destination, the restore tables interface traversal guest
>> memory, and check the dte/ite is valid or not.
>> If all dtes/ites are invalid, we will do try next one, and the last it will take
>> the 1 return value, but currently, it be treated as error. That's not correct.
>>
>> This patch try to fix this problem.
>>
>> Signed-off-by: wanghaibin <wanghaibin.wang@huawei.com>
>> ---
>> virt/kvm/arm/vgic/vgic-its.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
>> index 5c20352..2c69aeb 100644
>> --- a/virt/kvm/arm/vgic/vgic-its.c
>> +++ b/virt/kvm/arm/vgic/vgic-its.c
>> @@ -2025,7 +2025,7 @@ static int vgic_its_restore_dte(struct vgic_its *its, u32 id,
>> return PTR_ERR(dev);
>>
>> ret = vgic_its_restore_itt(its, dev);
>> - if (ret) {
>> + if (ret < 0) {
>> vgic_its_free_device(its->dev->kvm, dev);
>> return ret;
>> }
>> @@ -2147,9 +2147,6 @@ static int vgic_its_restore_device_tables(struct vgic_its *its)
>> vgic_its_restore_dte, NULL);
>> }
>>
>> - if (ret > 0)
>> - ret = -EINVAL;
> Reworking error handling in scan_its_table as I previously proposed
> indeed don't work for L2 tables, as pointed out by Christoffer. As such
> I eventually think your approach is the best.
>
> The only remark I have left is restore table IOCTL is likely to return 1
> with your change. 1 is not documented in the API as a returned value. I
> think we should return 0 in this case. We are lucky because QEMU
> kvm_device_access does not interpret positive values as errors.
Will fix it.
Thanks.
>
> Thanks
>
> Eric
>
>> -
>> return ret;
>> }
>>
>>
>
> .
>
next prev parent reply other threads:[~2017-09-16 2:00 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-06 13:05 [RFC PATCH 0/3] fix migrate failed when vm is in booting wanghaibin
2017-09-06 13:05 ` [RFC PATCH 1/3] kvm: arm/arm64: vgic-vits: separate vgic_its_free_list() function wanghaibin
2017-09-12 8:50 ` wanghaibin
2017-09-12 10:08 ` Auger Eric
2017-09-13 19:13 ` Christoffer Dall
2017-09-13 19:14 ` Christoffer Dall
2017-09-16 1:59 ` wanghaibin
2017-09-16 22:17 ` Christoffer Dall
2017-09-06 13:05 ` [RFC PATCH 2/3] kvm: arm/arm64: vgic-vits: free its resource when vm reboot/reset wanghaibin
2017-09-06 16:20 ` Auger Eric
2017-09-07 1:32 ` wanghaibin
2017-09-07 11:28 ` Auger Eric
2017-09-10 18:46 ` Auger Eric
2017-09-12 11:15 ` wanghaibin
2017-09-13 8:49 ` Auger Eric
2017-09-13 19:34 ` Christoffer Dall
2017-09-13 21:13 ` Auger Eric
2017-09-14 5:34 ` Christoffer Dall
2017-09-06 13:05 ` [RFC PATCH 3/3] kvm: arm/arm64: vgic-its: fix return value for restore wanghaibin
2017-09-06 15:18 ` Auger Eric
2017-09-13 20:02 ` Christoffer Dall
2017-09-13 21:25 ` Auger Eric
2017-09-14 5:35 ` Christoffer Dall
2017-09-13 20:04 ` Christoffer Dall
2017-09-14 8:30 ` Auger Eric
2017-09-16 2:02 ` wanghaibin [this message]
2017-09-20 1:57 ` [RFC PATCH 0/3] fix migrate failed when vm is in booting wanghaibin
2017-09-20 7:16 ` Auger Eric
2017-09-21 12:17 ` wanghaibin
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=59BC863D.5070108@huawei.com \
--to=wanghaibin.wang@huawei.com \
--cc=andre.przywara@arm.com \
--cc=cdall@linaro.org \
--cc=eric.auger@redhat.com \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=marc.zyngier@arm.com \
--cc=wu.wubin@huawei.com \
/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