vmm_lapic.c (267447) | vmm_lapic.c (268953) |
---|---|
1/*- 2 * Copyright (c) 2011 NetApp, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2011 NetApp, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: stable/10/sys/amd64/vmm/vmm_lapic.c 267447 2014-06-13 19:10:40Z jhb $ | 26 * $FreeBSD: stable/10/sys/amd64/vmm/vmm_lapic.c 268953 2014-07-21 19:08:02Z jhb $ |
27 */ 28 29#include <sys/cdefs.h> | 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: stable/10/sys/amd64/vmm/vmm_lapic.c 267447 2014-06-13 19:10:40Z jhb $"); | 30__FBSDID("$FreeBSD: stable/10/sys/amd64/vmm/vmm_lapic.c 268953 2014-07-21 19:08:02Z jhb $"); |
31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/smp.h> 35 36#include <x86/specialreg.h> 37#include <x86/apicreg.h> 38 --- 186 unchanged lines hidden (view full) --- 225{ 226 int error; 227 uint64_t off; 228 struct vlapic *vlapic; 229 230 off = gpa - DEFAULT_APIC_BASE; 231 232 /* | 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/smp.h> 35 36#include <x86/specialreg.h> 37#include <x86/apicreg.h> 38 --- 186 unchanged lines hidden (view full) --- 225{ 226 int error; 227 uint64_t off; 228 struct vlapic *vlapic; 229 230 off = gpa - DEFAULT_APIC_BASE; 231 232 /* |
233 * Memory mapped local apic accesses must be 4 bytes wide and 234 * aligned on a 16-byte boundary. | 233 * Memory mapped local apic accesses should be aligned on a 234 * 16-byte boundary. They are also suggested to be 4 bytes 235 * wide, alas not all OSes follow suggestions. |
235 */ | 236 */ |
236 if (size != 4 || off & 0xf) | 237 off &= ~3; 238 if (off & 0xf) |
237 return (EINVAL); 238 239 vlapic = vm_lapic(vm, cpu); 240 error = vlapic_read(vlapic, 1, off, rval, arg); 241 return (error); 242} | 239 return (EINVAL); 240 241 vlapic = vm_lapic(vm, cpu); 242 error = vlapic_read(vlapic, 1, off, rval, arg); 243 return (error); 244} |