KVM: arm/arm64: vgic-its: Fix return value for device table restore
authorwanghaibin <wanghaibin.wang@huawei.com>
Thu, 26 Oct 2017 15:23:03 +0000 (17:23 +0200)
committerChristoffer Dall <christoffer.dall@linaro.org>
Sun, 29 Oct 2017 02:25:06 +0000 (03:25 +0100)
commitb92382620e33c9f1bcbcd7c169262b9bf0525871
tree348fe223141e12c8878019e002b47f80dc6b84e5
parentf9b269f3098121b5d54aaf822e0898c8ed1d3fec
KVM: arm/arm64: vgic-its: Fix return value for device table restore

If ITT only contains invalid entries, vgic_its_restore_itt
returns 1 and this is considered as an an error in
vgic_its_restore_dte.

Also in case the device table only contains invalid entries,
the table restore fails and this is not correct.

This patch fixes those 2 issues:
- vgic_its_restore_itt now returns <= 0 values. If all
  ITEs are invalid, this is considered as successful.
- vgic_its_restore_device_tables also returns <= 0 values.

We also simplify the returned value computation in
handle_l1_dte.

Signed-off-by: wanghaibin <wanghaibin.wang@huawei.com>
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
virt/kvm/arm/vgic/vgic-its.c