summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/lapic.c
diff options
context:
space:
mode:
authorWei Yang <richardw.yang@linux.intel.com>2019-03-31 19:17:23 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2019-06-18 11:43:48 +0200
commit4cb8b1163586addc9e1f4eebe232a11534c24d4a (patch)
tree35741a0c491a77044518445197d12590faedf7de /arch/x86/kvm/lapic.c
parentee171d2f39d60c6405dc21a0aaa766cad2c9c43e (diff)
kvm: x86: offset is ensure to be in range
In function apic_mmio_write(), the offset has been checked in: * apic_mmio_in_range() * offset & 0xf These two ensures offset is in range [0x010, 0xff0]. Signed-off-by: Wei Yang <richardw.yang@linux.intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/lapic.c')
-rw-r--r--arch/x86/kvm/lapic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 9a54fccd0aa2..e82a18ccfc1a 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -2023,7 +2023,7 @@ static int apic_mmio_write(struct kvm_vcpu *vcpu, struct kvm_io_device *this,
apic_debug("%s: offset 0x%x with length 0x%x, and value is "
"0x%x\n", __func__, offset, len, val);
- kvm_lapic_reg_write(apic, offset & 0xff0, val);
+ kvm_lapic_reg_write(apic, offset, val);
return 0;
}