| 219 | } |
| 220 | |
| 221 | int |
| 222 | lapic_mmio_read(void *vm, int cpu, uint64_t gpa, uint64_t *rval, int size, |
| 223 | void *arg) |
| 224 | { |
| 225 | int error; |
| 226 | uint64_t off; |
| 227 | struct vlapic *vlapic; |
| 228 | |
| 229 | off = gpa - DEFAULT_APIC_BASE; |
| 230 | |
| 231 | /* |
| 232 | * Memory mapped local apic accesses should be aligned on a |
| 233 | * 16-byte boundary. They are also suggested to be 4 bytes |
| 234 | * wide, alas not all OSes follow suggestions. |
| 235 | */ |
| 236 | off &= ~3; |
| 237 | if (off & 0xf) |
| 238 | return (EINVAL); |
| 239 | |
| 240 | vlapic = vm_lapic(vm, cpu); |
| 241 | error = vlapic_read(vlapic, 1, off, rval, arg); |
| 242 | return (error); |
| 243 | } |
nothing calls this directly
no test coverage detected