2017-11-02 05:50:59

by Christoffer Dall

[permalink] [raw]
Subject: Re: [PATCH v6 2/9] KVM: arm/arm64: vgic-its: Fix vgic_its_restore_collection_table returned value

On Thu, Oct 26, 2017 at 05:23:04PM +0200, Eric Auger wrote:
> vgic_its_restore_cte returns +1 if the collection table entry
> is valid and properly decoded. As a consequence, if the
> collection table is fully filled with valid data that are
> decoded without error, vgic_its_restore_collection_table()
> returns +1. This is wrong.
>
> Let's return 0 in that case.
>

Acked-by: Christoffer Dall <[email protected]>

> Fixes: ea1ad53e1e31a3 (KVM: arm64: vgic-its: Collection table save/restore)
> Signed-off-by: Eric Auger <[email protected]>
>
> ---
>
> v5 -> v6:
> - use the same trick as vgic_its_restore_itt and
> vgic_its_restore_device_tables
>
> v4 -> v5:
> - added Christoffer R-b
>
> v2 -> v3: creation
> ---
> virt/kvm/arm/vgic/vgic-its.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
> index d27a301..8230ffe 100644
> --- a/virt/kvm/arm/vgic/vgic-its.c
> +++ b/virt/kvm/arm/vgic/vgic-its.c
> @@ -2268,6 +2268,10 @@ static int vgic_its_restore_collection_table(struct vgic_its *its)
> gpa += cte_esz;
> read += cte_esz;
> }
> +
> + if (ret > 0)
> + return 0;
> +
> return ret;
> }
>
> --
> 2.5.5
>

From 1582334190338569112@xxx Thu Oct 26 15:24:37 +0000 2017
X-GM-THRID: 1582334190338569112
X-Gmail-Labels: Inbox,Category Forums