Local APIC access via 32-bit naturally-aligned loads is merely

suggested in the SDM.  Since some OSes have implemented otherwise
don't be too rigorous in enforcing it.

Approved by:	grehan (co-mentor)
This commit is contained in:
tychon 2014-04-15 17:06:26 +00:00
parent e9d7536fae
commit bbe78c2d72

View File

@ -230,10 +230,12 @@ lapic_mmio_read(void *vm, int cpu, uint64_t gpa, uint64_t *rval, int size,
off = gpa - DEFAULT_APIC_BASE;
/*
* Memory mapped local apic accesses must be 4 bytes wide and
* aligned on a 16-byte boundary.
* Memory mapped local apic accesses should be aligned on a
* 16-byte boundary. They are also suggested to be 4 bytes
* wide, alas not all OSes follow suggestions.
*/
if (size != 4 || off & 0xf)
off &= ~3;
if (off & 0xf)
return (EINVAL);
vlapic = vm_lapic(vm, cpu);