From owner-svn-src-all@FreeBSD.ORG Tue Apr 15 17:06:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0ABF7FE7; Tue, 15 Apr 2014 17:06:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBBBF1370; Tue, 15 Apr 2014 17:06:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FH6Qtk035277; Tue, 15 Apr 2014 17:06:26 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FH6Q5f035276; Tue, 15 Apr 2014 17:06:26 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201404151706.s3FH6Q5f035276@svn.freebsd.org> From: Tycho Nightingale Date: Tue, 15 Apr 2014 17:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264509 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 17:06:27 -0000 Author: tychon Date: Tue Apr 15 17:06:26 2014 New Revision: 264509 URL: http://svnweb.freebsd.org/changeset/base/264509 Log: 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) Modified: head/sys/amd64/vmm/vmm_lapic.c Modified: head/sys/amd64/vmm/vmm_lapic.c ============================================================================== --- head/sys/amd64/vmm/vmm_lapic.c Tue Apr 15 16:31:23 2014 (r264508) +++ head/sys/amd64/vmm/vmm_lapic.c Tue Apr 15 17:06:26 2014 (r264509) @@ -230,10 +230,12 @@ lapic_mmio_read(void *vm, int cpu, uint6 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);