From: Auger Eric <eric.auger@redhat.com>
To: Zenghui Yu <yuzenghui@huawei.com>, maz@kernel.org
Cc: andre.przywara@arm.com, linux-kernel@vger.kernel.org,
kvmarm@lists.cs.columbia.edu,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] KVM: arm/arm64: vgic-its: Check hopefully the last DISCARD command error
Date: Tue, 14 Jan 2020 09:20:50 +0100 [thread overview]
Message-ID: <615c4713-d00e-e2f7-c2d4-fa8047355c9b@redhat.com> (raw)
In-Reply-To: <41c88abb-433a-f87c-c858-7f2eb4c40926@huawei.com>
Hi Zenghui,
On 1/14/20 8:10 AM, Zenghui Yu wrote:
> Hi Eric,
>
> On 2020/1/10 16:37, Auger Eric wrote:
>> Hi Zenghui,
>>
>> On 12/25/19 2:30 PM, Zenghui Yu wrote:
>>> DISCARD command error occurs if any of the following apply:
>>>
>>> - [ ... (those which we have already handled) ]
>> nit: I would remove the above and simply say the discard is supposed to
>> fail if the collection is not mapped to any target redistributor. If an
>> ITE exists then the ite->collection is non NULL.
>
> I think this is not always true. Let's talk about the following scenario
> (a bit insane, though):
>
> 1. First map a LPI to an unmapped Collection, then ite->collection is
> non NULL and its target_addr is COLLECTION_NOT_MAPPED.
>
> 2. Then issue MAPC and unMAPC(V=0) commands on this Collection, the
> ite->collection will be NULL, see vgic_its_free_collection().
You're right I missed that case.
>
> Discard the LPI mapping after "1" or "2", we will both encounter the
> unmapped collection command error.
>
>> What needs to be checked is its_is_collection_mapped().
>>
>> By the way update_affinity_collection() also tests ite->collection. I
>> think this is useless or do I miss something?
>
> Yeah, I agree. We managed to invoke update_affinity_collection(,, coll),
> ensure that the 'coll' can _not_ be NULL.
> So '!ite->collection' is already a subcase of 'coll != ite->collection'.
> We can safely get rid of it.
OK. But that's not for the (wrong) reason I mentioned above. So it is a
minor cleanup and you may just leave it as is and just focus on this fix.
Thanks
Eric
>
>>
>> Reviewed-by: Eric Auger <eric.auger@redhat.com>
>>
>
> Thanks for that. I'll change the commit message with your suggestion and
> add your R-b in v2.
>
>
> Thanks,
> Zenghui
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
prev parent reply other threads:[~2020-01-14 8:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-25 13:30 [PATCH] KVM: arm/arm64: vgic-its: Check hopefully the last DISCARD command error Zenghui Yu
2020-01-10 8:37 ` Auger Eric
2020-01-14 7:10 ` Zenghui Yu
2020-01-14 8:20 ` Auger Eric [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=615c4713-d00e-e2f7-c2d4-fa8047355c9b@redhat.com \
--to=eric.auger@redhat.com \
--cc=andre.przywara@arm.com \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=yuzenghui@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