projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8833bc3
)
MIPS: KVM: Do not sign extend on unsigned MMIO load
author
Nicholas Mc Guire
<
[email protected]
>
Thu, 7 May 2015 12:47:50 +0000
(14:47 +0200)
committer
Ralf Baechle
<
[email protected]
>
Sat, 6 Jun 2015 08:21:10 +0000
(10:21 +0200)
Fix possible unintended sign extension in unsigned MMIO loads by casting
to uint16_t in the case of mmio_needed != 2.
Signed-off-by: Nicholas Mc Guire <
[email protected]
>
Reviewed-by: James Hogan <
[email protected]
>
Tested-by: James Hogan <
[email protected]
>
Cc: Gleb Natapov <
[email protected]
>
Cc: Paolo Bonzini <
[email protected]
>
Cc:
[email protected]
Cc:
[email protected]
Cc:
[email protected]
Patchwork: https://patchwork.linux-mips.org/patch/9985/
Signed-off-by: Ralf Baechle <
[email protected]
>
arch/mips/kvm/emulate.c
patch
|
blob
|
history
diff --git
a/arch/mips/kvm/emulate.c
b/arch/mips/kvm/emulate.c
index 4b50c5787e25bdb4bdb28eb7736296e1d5d3812c..d5fa3eaf39a106546f52d82ec3e5391302ef8dec 100644
(file)
--- a/
arch/mips/kvm/emulate.c
+++ b/
arch/mips/kvm/emulate.c
@@
-2409,7
+2409,7
@@
enum emulation_result kvm_mips_complete_mmio_load(struct kvm_vcpu *vcpu,
if (vcpu->mmio_needed == 2)
*gpr = *(int16_t *) run->mmio.data;
else
- *gpr = *(
int16_t *)
run->mmio.data;
+ *gpr = *(
uint16_t *)
run->mmio.data;
break;
case 1: