From owner-freebsd-virtualization@FreeBSD.ORG Fri Oct 17 15:25:46 2014 Return-Path: Delivered-To: freebsd-virtualization@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 848B53AF for ; Fri, 17 Oct 2014 15:25:46 +0000 (UTC) Received: from SNT004-OMC4S2.hotmail.com (snt004-omc4s2.hotmail.com [65.55.90.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "*.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B39C6BB for ; Fri, 17 Oct 2014 15:25:45 +0000 (UTC) Received: from SNT150-W71 ([65.55.90.200]) by SNT004-OMC4S2.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Fri, 17 Oct 2014 08:24:39 -0700 X-TMN: [zUej4Lrjat9rZBYGnCUircquTo2s+G/s] X-Originating-Email: [mrashutosh@hotmail.com] Message-ID: From: Ashutosh Kumar To: "freebsd-virtualization@freebsd.org" Subject: RE: io-apic interrupt migration on bhyve Date: Fri, 17 Oct 2014 15:24:39 +0000 Importance: Normal In-Reply-To: References: MIME-Version: 1.0 X-OriginalArrivalTime: 17 Oct 2014 15:24:39.0856 (UTC) FILETIME=[77E6B300:01CFEA1E] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Oct 2014 15:25:46 -0000 Hi=2C On more analysis I found that there is a race condition in Guest OS such th= at before complete initialization happens for APs the interrupt migration t= akes place and hence incorrect cpu is written to io-apic's rte for that par= ticular pin. The debug prints either in Guest OS or vmm just kills this rac= e condition. Thanks. =20 RegardsAshutosh > From: mrashutosh@hotmail.com > To: freebsd-virtualization@freebsd.org > Subject: io-apic interrupt migration on bhyve > Date: Fri=2C 17 Oct 2014 13:24:34 +0000 >=20 > =20 >=20 > Hi=2C >=20 > =20 >=20 > I am witnessing some strange behavior w.r.t io-apic > interrupt migration on bhyve. >=20 > I have below assignment for a level triggered > interrupt: >=20 > =20 >=20 > io-apic pin - p >=20 > cpu vector - v >=20 > cpu id - 0 >=20 > =20 >=20 > when this interrupt is migrated to cpu 1 then > the assignment is as below >=20 > =20 >=20 > io-apic pin - p >=20 > cpu vector - v1 >=20 > cpu id - 1 >=20 > =20 >=20 > When VM boots up then OS is getting interrupts for=20 >=20 > =20 >=20 > io-apic pin - p >=20 > cpu vector - v1 >=20 > cpu id - 0 >=20 > =20 >=20 > Added debug prints in vioapic_write function > to check the values written to io-apic rte for this pin and then VM gets > correct interrupts i.e (vector v=2C cpu 0 ) before the interrupts are mig= rated and > (vector v1=2C cpu 1) after the migration When prints are removed then the > problem happens and we see interrupts for (vector v1 and cpu 0). > RegardsAshutosh =20 > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe=2C send any mail to "freebsd-virtualization-unsubscribe@fr= eebsd.org" =