Copied from tag v4.2, 64291f7db5bd8150a74ad2036f1037e6a0428df2. Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Richard Henderson <rth@twiddle.net>