Re: [PATCH 0/2] KVM: arm64: Fix and test MMIO sign-extending loads
From: Oliver Upton
Date: Mon Jun 22 2026 - 20:20:34 EST
On Mon, Jun 22, 2026 at 08:06:59PM +0100, Fuad Tabba wrote:
> Hi folks,
>
> A sign-extending load (LDRSB/LDRSH/LDRSW) from emulated MMIO returns a
> zero-extended value rather than the sign-extended one the architecture
> requires; vcpu_data_host_to_guest() strips the sign bits when it masks
> the data to the access width.
>
> If my git archeology is right, the masking dates to 2014 (b30070862edbd,
> big-endian support) and has been wrong ever since, but sign-extending
> loads from device memory are rare enough that nobody hit it. Patch 1
> fixes it; patch 2 adds a selftest so it doesn't regress.
>
> Cheers,
> /fuad
>
> Fuad Tabba (2):
> KVM: arm64: Fix sign-extension of MMIO loads
> KVM: arm64: selftests: Add MMIO sign-extending load test
For the oddball guest :)
Reviewed-by: Oliver Upton <oupton@xxxxxxxxxx>
Thanks,
Oliver