From owner-freebsd-drivers@FreeBSD.ORG Thu Aug 21 03:24:53 2014 Return-Path: Delivered-To: freebsd-drivers@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 F17947A8; Thu, 21 Aug 2014 03:24:52 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1blp0189.outbound.protection.outlook.com [207.46.163.189]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C1E23AF5; Thu, 21 Aug 2014 03:24:50 +0000 (UTC) Received: from BY1PR0301MB0902.namprd03.prod.outlook.com (25.160.195.141) by BY1PR0301MB0902.namprd03.prod.outlook.com (25.160.195.141) with Microsoft SMTP Server (TLS) id 15.0.1005.10; Thu, 21 Aug 2014 03:24:48 +0000 Received: from BY1PR0301MB0902.namprd03.prod.outlook.com ([25.160.195.141]) by BY1PR0301MB0902.namprd03.prod.outlook.com ([25.160.195.141]) with mapi id 15.00.1005.008; Thu, 21 Aug 2014 03:24:48 +0000 From: Wei Hu To: =?iso-8859-1?Q?Roger_Pau_Monn=E9?= , John Baldwin , "freebsd-drivers@freebsd.org" Subject: RE: Directly reserve an interrupt IDT entry for Hyper-V Thread-Topic: Directly reserve an interrupt IDT entry for Hyper-V Thread-Index: Ac+8UT9e97G9LT7sSf25pxsUhlOuiAAKdvMAAAQtKYAAAiW0AAAWpWPQ Date: Thu, 21 Aug 2014 03:24:48 +0000 Message-ID: <07ddd62e6cc84509aa76aa299c8dbd3c@BY1PR0301MB0902.namprd03.prod.outlook.com> References: <3defccd56bc0407c88bdda139b2462ac@BY1PR0301MB0902.namprd03.prod.outlook.com> <53F4A34A.4010807@citrix.com> <201408201131.29399.jhb@freebsd.org> <53F4CDBA.8040500@citrix.com> In-Reply-To: <53F4CDBA.8040500@citrix.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [167.220.232.169] x-microsoft-antispam: BCL:0;PCL:0;RULEID:;UriScan:; x-forefront-prvs: 0310C78181 x-forefront-antispam-report: SFV:NSPM; SFS:(6009001)(479174003)(199003)(13464003)(377454003)(189002)(51704005)(24454002)(74502001)(101416001)(93886004)(76482001)(74316001)(87936001)(33646002)(31966008)(99286002)(83322001)(46102001)(85306004)(50986999)(86612001)(81542001)(74662001)(99396002)(19580395003)(54356999)(95666004)(105586002)(4396001)(77096002)(76176999)(19580405001)(77982001)(21056001)(83072002)(80022001)(66066001)(106356001)(20776003)(107046002)(64706001)(92566001)(81342001)(86362001)(76576001)(108616004)(2656002)(85852003)(24736002); DIR:OUT; SFP:; SCL:1; SRVR:BY1PR0301MB0902; H:BY1PR0301MB0902.namprd03.prod.outlook.com; FPR:; MLV:sfv; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.onmicrosoft.com Cc: "freebsd-xen@freebsd.org" , "freebsd-virtualization@freebsd.org" X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2014 03:24:53 -0000 Hi Roger and John, I will request a free IDT slot instead of sharing the same vector with Xen.= It would be great to have an API to do this. Before the API is available, = I will probably use the same way as in vmm_ipi.c to find a free slot. Thanks so much for your help, Wei =20 -----Original Message----- From: Roger Pau Monn=E9 [mailto:roger.pau@citrix.com]=20 Sent: Thursday, August 21, 2014 12:33 AM To: John Baldwin; freebsd-drivers@freebsd.org Cc: Wei Hu; freebsd-xen@freebsd.org; freebsd-virtualization@freebsd.org Subject: Re: Directly reserve an interrupt IDT entry for Hyper-V On 20/08/14 17:31, John Baldwin wrote: > On Wednesday, August 20, 2014 9:31:54 am Roger Pau Monn=E9 wrote: >> Hello, >> >> I don't think using the same IDT vector is the right approach, I=20 >> would just pick a different IDT vector and use that for Hyper-V.=20 >> Using the same IDT vector (like your suggestion above) would prevent=20 >> shipping a kernel with with both Hyper-V and Xen support (like it's=20 >> done now in GENERIC). >> >> Roger. >=20 > Hmm, can't you make this a runtime check to only call setidt() if you=20 > detect you are under the appropriate hypervisor? >=20 > Also, bhyve currently has a hackish way of requesting a free IDT slot. =20 > Perhaps it would be best if I added little API to reserve an IDT slot=20 > assuming that callers could accept a dynamic IDT vector rather than a sta= tic one. That would work for Xen. The IDT vector doesn't need to be fixed since it's= registered with Xen when the system boots. Roger.