From owner-svn-src-head@FreeBSD.ORG Fri Jun 28 06:25:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9C173CF6; Fri, 28 Jun 2013 06:25:04 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8E502178B; Fri, 28 Jun 2013 06:25:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5S6P4Zf044249; Fri, 28 Jun 2013 06:25:04 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5S6P4aM044248; Fri, 28 Jun 2013 06:25:04 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201306280625.r5S6P4aM044248@svn.freebsd.org> From: Peter Grehan Date: Fri, 28 Jun 2013 06:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252336 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2013 06:25:04 -0000 Author: grehan Date: Fri Jun 28 06:25:04 2013 New Revision: 252336 URL: http://svnweb.freebsd.org/changeset/base/252336 Log: Allow 8259 registers to be read. This is a transient condition during Linux boot. Submitted by: tycho nightingale at pluribusnetworks com Reviewed by: neel Modified: head/usr.sbin/bhyve/atpic.c Modified: head/usr.sbin/bhyve/atpic.c ============================================================================== --- head/usr.sbin/bhyve/atpic.c Fri Jun 28 06:05:33 2013 (r252335) +++ head/usr.sbin/bhyve/atpic.c Fri Jun 28 06:25:04 2013 (r252336) @@ -37,13 +37,6 @@ __FBSDID("$FreeBSD$"); #include "inout.h" -/* - * FreeBSD only writes to the 8259 interrupt controllers to put them in a - * shutdown state. - * - * So, we just ignore the writes. - */ - #define IO_ICU1 0x20 #define IO_ICU2 0xA0 #define ICU_IMR_OFFSET 1 @@ -55,8 +48,14 @@ atpic_handler(struct vmctx *ctx, int vcp if (bytes != 1) return (-1); - if (in) - return (-1); + if (in) { + if (port & ICU_IMR_OFFSET) { + /* all interrupts masked */ + *eax = 0xff; + } else { + *eax = 0x00; + } + } /* Pretend all writes to the 8259 are alright */ return (0);