From owner-freebsd-current@freebsd.org Fri Apr 8 14:47:32 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8345B07729 for ; Fri, 8 Apr 2016 14:47:32 +0000 (UTC) (envelope-from decui@microsoft.com) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0132.outbound.protection.outlook.com [207.46.100.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (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 49EFC1BCC; Fri, 8 Apr 2016 14:47:31 +0000 (UTC) (envelope-from decui@microsoft.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=uqxOXx/crA0akWaI59e0huIgGSoEiUiiW+TYoFXwutY=; b=fAXqlttqeP3yBPPIRSjP3LZxs2hN8DimjpKsA991nfQZAwho8EteWnVb1mzWd+l4KOZ/iDTGm5LMRY91po/dQuJran1phhYWWXza6DOsYDwnUPucymzrnO5oTrchHFzfTXcWwg48oCjYUFyZinAMQLrEAXYoBx1D6yRJv+ugYes= Received: from BLUPR03MB1410.namprd03.prod.outlook.com (10.163.81.144) by BLUPR03MB1409.namprd03.prod.outlook.com (10.163.81.143) with Microsoft SMTP Server (TLS) id 15.1.447.15; Fri, 8 Apr 2016 14:15:05 +0000 Received: from BLUPR03MB1410.namprd03.prod.outlook.com ([10.163.81.144]) by BLUPR03MB1410.namprd03.prod.outlook.com ([10.163.81.144]) with mapi id 15.01.0447.029; Fri, 8 Apr 2016 14:15:05 +0000 From: Dexuan Cui To: Konstantin Belousov CC: Sepherosa Ziehau , "smokehydration@tutanota.com" , "freebsd-current@freebsd.org" Subject: RE: Revision 297176 - hyperv/evttimer: Use an independent message slot so that it can work Thread-Topic: Revision 297176 - hyperv/evttimer: Use an independent message slot so that it can work Thread-Index: AQHRkXkiMx921mGqikmAHSfbkel4Ap9/174ggABDyoCAAAFIAA== Date: Fri, 8 Apr 2016 14:15:05 +0000 Message-ID: References: <20160408140208.GN1741@kib.kiev.ua> In-Reply-To: <20160408140208.GN1741@kib.kiev.ua> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [167.220.255.14] x-ms-office365-filtering-correlation-id: 93c1434e-01bc-42c6-c3fc-08d35fb82ec4 x-microsoft-exchange-diagnostics: 1; BLUPR03MB1409; 5:72TG1WxREEFg7/NR4tBszmPvRuorDVecM89O8k2wWKrcH/PkFOR+6TFzkO1zXXkdYDZ+QJkg76sQBsaL3+bEiz7lpLJfvkOqXzevbyQ7TjYoZN26aU+sq6CnwCfb0q7OISH62IfDVDbauD5JCEHLqg==; 24:18oWSizWuCNlmz2h7zBQFLmsv3QPDHBRwYsemgn5KNCf7rwo1AfJfbmmMxQAoBoPw8fRhwDeuUhX+CTgGS8x4gy+U6P5fxA3U7RI/+UnpsE= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1409; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(61426038)(61427038); SRVR:BLUPR03MB1409; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB1409; x-forefront-prvs: 0906E83A25 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(24454002)(10400500002)(8990500004)(5005710100001)(10290500002)(10090500001)(15650500001)(3660700001)(74316001)(3280700002)(110136002)(189998001)(2906002)(4326007)(76576001)(50986999)(76176999)(54356999)(5004730100002)(106116001)(575784001)(77096005)(15975445007)(86612001)(122556002)(2950100001)(81166005)(2900100001)(33656002)(87936001)(5002640100001)(86362001)(99286002)(5003600100002)(92566002)(93886004)(5008740100001)(1411001)(9686002)(6116002)(102836003)(3846002)(66066001)(19580405001)(1096002)(19580395003)(11100500001)(586003)(1220700001)(21314002); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB1409; H:BLUPR03MB1410.namprd03.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Apr 2016 14:15:05.1077 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1409 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2016 14:47:32 -0000 > From: Konstantin Belousov [mailto:kostikbel@gmail.com] > Sent: Friday, April 8, 2016 22:02 > To: Dexuan Cui > Cc: Sepherosa Ziehau ; smokehydration@tutanota.com; > freebsd-current@freebsd.org > Subject: Re: Revision 297176 - hyperv/evttimer: Use an independent messag= e > slot so that it can work >=20 > On Fri, Apr 08, 2016 at 11:03:46AM +0000, Dexuan Cui wrote: > > Hi smokehydration, > > I guess your VM config file has something like "viridian =3D 1" or > > "viridian_enlightenment=3Dxxx". > > > > With this, Xen tries to pretend to be Hyper-V, but obviously Xen can't = be 100% > Hyper-V. > > BTW, I know at least KVM can have the same behavior. > > > > We have to find a reliable way to distinguish Hyper-V from other hyperv= isors > that > > try to pretend to be Hyper-V... >=20 > At the time when the probe is done, the IDT entries for exceptions are > already set. You can use rdmsr_safe() instead of rdmsr() to read Hyper-V > timecounter register. Then, a fault definitely indicates that the kernel > is not executing on the compatible Hyper-V emulator. Hopefully, a > non-fault read is not impossible for undesired cases. Hi Konstantin, Thanks for the suggestion! We're trying to solve the issue with "hv_features/hv_recommendations" of some Hyper-V specific CPUIDs -- the other hypervisors are unlikely to touch these CPUIDs; even if they do touch the CPUIDs, I think they should respect the meanings of the CPUIDs and shouldn't incorrectly report capabilities they doesn't really have. A drafted patch is here: https://github.com/howard0su/freebsd/commit/d1d031e0d8991ab1f94de00325705d2= 66829c647 We'll clean up & post it -- Dexuan