From owner-svn-src-all@FreeBSD.ORG Wed Oct 1 23:15:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B32FBA9; Wed, 1 Oct 2014 23:15:24 +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 47C6BCBF; Wed, 1 Oct 2014 23:15:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s91NFOKn074883; Wed, 1 Oct 2014 23:15:24 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91NFOPY074882; Wed, 1 Oct 2014 23:15:24 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201410012315.s91NFOPY074882@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Wed, 1 Oct 2014 23:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272388 - stable/10/sys/amd64/vmm/io X-SVN-Group: stable-10 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.18-1 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: Wed, 01 Oct 2014 23:15:24 -0000 Author: grehan Date: Wed Oct 1 23:15:23 2014 New Revision: 272388 URL: https://svnweb.freebsd.org/changeset/base/272388 Log: MFC r272193 Allow the PIC's IMR register to be read before ICW initialisation. As of git submit e179f6914152eca9, the Linux kernel does a simple probe of the PIC by writing a pattern to the IMR and then reading it back, prior to the init sequence of ICW words. The bhyve PIC emulation wasn't allowing the IMR to be read until the ICW sequence was complete. This limitation isn't required so relax the test. With this change, Linux kernels 3.15-rc2 and later won't hang on boot when calibrating the local APIC. Approved by: re (gjb) Modified: stable/10/sys/amd64/vmm/io/vatpic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/io/vatpic.c ============================================================================== --- stable/10/sys/amd64/vmm/io/vatpic.c Wed Oct 1 22:18:07 2014 (r272387) +++ stable/10/sys/amd64/vmm/io/vatpic.c Wed Oct 1 23:15:23 2014 (r272388) @@ -600,20 +600,19 @@ vatpic_write(struct vatpic *vatpic, stru VATPIC_LOCK(vatpic); if (port & ICU_IMR_OFFSET) { - if (atpic->ready) { + switch (atpic->icw_num) { + case 2: + error = vatpic_icw2(vatpic, atpic, val); + break; + case 3: + error = vatpic_icw3(vatpic, atpic, val); + break; + case 4: + error = vatpic_icw4(vatpic, atpic, val); + break; + default: error = vatpic_ocw1(vatpic, atpic, val); - } else { - switch (atpic->icw_num) { - case 2: - error = vatpic_icw2(vatpic, atpic, val); - break; - case 3: - error = vatpic_icw3(vatpic, atpic, val); - break; - case 4: - error = vatpic_icw4(vatpic, atpic, val); - break; - } + break; } } else { if (val & (1 << 4))