From owner-svn-src-head@freebsd.org Tue Apr 18 12:41:17 2017 Return-Path: Delivered-To: svn-src-head@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 2F61DD42292; Tue, 18 Apr 2017 12:41:17 +0000 (UTC) (envelope-from decui@microsoft.com) Received: from APC01-HK2-obe.outbound.protection.outlook.com (mail-hk2apc01on0133.outbound.protection.outlook.com [104.47.124.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0D603B4; Tue, 18 Apr 2017 12:41:15 +0000 (UTC) (envelope-from decui@microsoft.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=tfuZLnZJaSC/Xb6tOYgaDMMf6RYomWx8ZsnfoPe7B64=; b=LL5QP7iO0GhTXhfSPiJISCHHZR8zY18YWxxfd5TVZ/IKE9a6bh4TEX7bTFLqidmUTakqHrewFvURYrszq7FAmGg+sl1Gx/9+96AFL6xRbXvaAnCg40T2/hYS5kMiZkxaSS6y/A21ZWpAoHxYASBoutKdwWTEb1V+6sVJV/xAznU= Received: from HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM (10.170.151.145) by HK2P15301MB0002.APCP153.PROD.OUTLOOK.COM (10.170.151.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.1; Tue, 18 Apr 2017 12:41:09 +0000 Received: from HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM ([10.170.151.145]) by HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM ([10.170.151.145]) with mapi id 15.01.1061.000; Tue, 18 Apr 2017 12:41:09 +0000 From: Dexuan Cui To: Konstantin Belousov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" CC: Sepherosa Ziehau , Hongjiang Zhang Subject: RE: svn commit: r316767 - head/sys/amd64/amd64 Thread-Topic: svn commit: r316767 - head/sys/amd64/amd64 Thread-Index: AQHStG2iSg+v8T4ZWE2jvrgFLfQZk6HLFDPw Date: Tue, 18 Apr 2017 12:41:09 +0000 Message-ID: References: <201704131549.v3DFnt9I004050@repo.freebsd.org> In-Reply-To: <201704131549.v3DFnt9I004050@repo.freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: FreeBSD.org; dkim=none (message not signed) header.d=none;FreeBSD.org; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [167.220.255.20] x-microsoft-exchange-diagnostics: 1; HK2P15301MB0002; 7:4GhIlL3Qh3pTjHsUAei9Ttarff0AczGjd38IDladTG9GuoyJGIPDfwoHrA5I7DrRGBJYtgxyAj9J3teBTy7ZL1rV1TkdMSgCp0rs3zbzvaGcD4amB9kaEW7WzPsnvR/HxxT2LSefgLyfqDLC76UhZUTKsmZuSPveoEM4nV5Wo2JmIGJvafX0ChFL9PyHQV8hmDMFPb5GZWEBFUg1peWCZCSwSscJUdpjNRGdJfroAza/e3/E8eaVfSDKjctXnWBexz9thdtjV0VD6YbpetZLEgs2lHNPni4n5fm+DZe0xobd7FMq2lcEdJ7QJ97l8AS8xeItiwFekviDDCtACn+rSO9Jx6N/Ag71t8ZOKYeiB5o= x-ms-office365-filtering-correlation-id: caffda02-1912-434d-9346-08d4865830c5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075); SRVR:HK2P15301MB0002; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(6055026)(61426038)(61427038)(6041248)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(6072148); SRVR:HK2P15301MB0002; BCL:0; PCL:0; RULEID:; SRVR:HK2P15301MB0002; x-forefront-prvs: 028166BF91 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(39450400003)(39860400002)(39410400002)(39850400002)(39400400002)(39840400002)(6506006)(107886003)(38730400002)(55016002)(4326008)(77096006)(74316002)(6436002)(66066001)(3846002)(9686003)(54356999)(76176999)(50986999)(6246003)(53936002)(25786009)(8676002)(5660300001)(81166006)(8936002)(7696004)(6116002)(229853002)(2900100001)(450100002)(305945005)(2950100002)(102836003)(7736002)(86362001)(10290500002)(5005710100001)(10090500001)(2201001)(8990500004)(33656002)(3280700002)(3660700001)(2906002)(122556002)(2501003)(189998001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2P15301MB0002; H:HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 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: 18 Apr 2017 12:41:09.4507 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2P15301MB0002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Tue, 18 Apr 2017 12:41:17 -0000 > From: owner-svn-src-head@freebsd.org [mailto:owner-svn-src- > head@freebsd.org] On Behalf Of Konstantin Belousov > Sent: Thursday, April 13, 2017 23:50 >=20 > Author: kib > Date: Thu Apr 13 15:49:55 2017 > New Revision: 316767 > URL: >=20 > Log: > Map DMAP as nx. >=20 > Demotions preserve PG_NX, so it is enough to set nx bit for initial > lowest-level paging entries. >=20 > Modified: > head/sys/amd64/amd64/pmap.c =20 Hi kib, Unluckily this patch breaks Hyper-V VM: In dev/hyperv/vmbus/hyperv.c: hypercall_create() we allocate one page and pass its physical address to the hypervisor, which initializes the page with executable code. Later in dev/hyperv/vmbus/hyperv.c: hypercall_post_message(), we "call" the executable code in the above page. Now with NX, the "call" gets a fault and as a result FreeBSD VM can't boot on Hyper-V. It looks memory allocated by bus_dmamem_alloc() and malloc() is not executable now. What else can we use? I guess we can only use contigmalloc() or kmem_malloc() to get a page that can be executable and use vtophys() to get its physical address? Looking forward to your suggestion! Thanks! -- Dexuan