backport of http://www.spinics.net/lists/kvm-arm/msg07451.html