Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753027AbdHJS7S (ORCPT ); Thu, 10 Aug 2017 14:59:18 -0400 Received: from mail-sn1nam02on0110.outbound.protection.outlook.com ([104.47.36.110]:60128 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752552AbdHJS7P (ORCPT ); Thu, 10 Aug 2017 14:59:15 -0400 From: KY Srinivasan To: Peter Zijlstra , Simon Xiao , Haiyang Zhang , Jork Loeser , Stephen Hemminger , "torvalds@linux-foundation.org" , "luto@kernel.org" , "hpa@zytor.com" , "vkuznets@redhat.com" , "linux-kernel@vger.kernel.org" , "rostedt@goodmis.org" , "andy.shevchenko@gmail.com" , "tglx@linutronix.de" , "mingo@kernel.org" CC: "linux-tip-commits@vger.kernel.org" Subject: RE: [tip:x86/platform] x86/hyper-v: Use hypercall for remote TLB flush Thread-Topic: [tip:x86/platform] x86/hyper-v: Use hypercall for remote TLB flush Thread-Index: AQHTEgYxqT+ty8GCvECqOraLkxr4LaJ98McAgAAAZqA= Date: Thu, 10 Aug 2017 18:59:13 +0000 Message-ID: References: <20170802160921.21791-8-vkuznets@redhat.com> <20170810185646.GI6524@worktop.programming.kicks-ass.net> In-Reply-To: <20170810185646.GI6524@worktop.programming.kicks-ass.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Ref=https://api.informationprotection.azure.com/api/72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=kys@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2017-08-10T11:59:11.6222015-07:00; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General x-originating-ip: [24.19.246.157] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR21MB0123;6:GHzG1QnbBMNp8zK3bNGAT+crM6QkwELsnTwdkyn3+2rsjXeN7h6FsVGJHGaD7g52Q3upzO9xbkdEaRos7el4xZrIkrOJWmvn7jmRM3Ax7eE+xUERRAkcst90fRoKUzzaJYJ6WShcKyNmm7+Gg0Ba7mb0VU0dAR+WA7xbDzseWlET4r9Kh//xN4u8a5H+B580xZMnH/2iRKd3DMq0RVr05L3gtM3/S5VprKRSmRQMf1185BgxSygkgFVTaVv45tEDbJ9/lIa8mToMevfczYFEpy16jLQdX8QBJU/bzUek03d8fML324yOLeD+ATKEamzUicADVrbkwKeE5mggCYQyaA==;5:LE3cioHNj9YYvvRqbZszOwgKBRkqAeRFd0bStumpd4Aslh3fOYyFqVEit6s8NfHv7vmTOZH7o3hdCN53T6HgYNqa3BczJEZL496ByeMmDYAMsqWb2MBlzbUeygZaJ4yplIYS7IF5tC6mr5B0u1HMnw==;24:m9x5EWMsRNdGljAI5yhpKYSsA9OdHsyrnJ0LQO7ta9Mk8DgJ6V3w5b0nb8y9K0mwEnNEGV1KQzgbcsqSX4XXFD9AYmEslb9x6g8G4TrSHJ4=;7:AFqtT2QdW7JREbRP+06bhCpwMhozDIDZ389VLtXUhL1gFZreyUtf39CpklFUHHCgPJ0Sp+PCKevzYNzWpKyvXLL//W8/62rauEER/CMYsFHA+QJRv1Z3w1gIVp9phDJ2kGofNjXP8Xkc7GvSsQV7or51zehZr3i3HKYbVCNyHFBuCKhGXVUXskieafrx5Ib1hwHWmU/uWujeT0FqzgNc81/8q8aYKIYpmd165ftiknY= x-ms-office365-filtering-correlation-id: 4ae1a8a9-79ce-461b-642f-08d4e021e43f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603124)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DM5PR21MB0123; x-ms-traffictypediagnostic: DM5PR21MB0123: authentication-results: spf=none (sender IP is ) smtp.mailfrom=kys@microsoft.com; x-exchange-antispam-report-test: UriScan:(89211679590171)(9452136761055)(189930954265078)(219752817060721); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(61425038)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(6055026)(61426038)(61427038)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR21MB0123;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR21MB0123; x-forefront-prvs: 03950F25EC x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(47760400005)(189002)(377454003)(24454002)(199003)(13464003)(86362001)(7736002)(229853002)(2501003)(53936002)(2201001)(105586002)(2421001)(8676002)(6506006)(106356001)(97736004)(86612001)(77096006)(6116002)(68736007)(66066001)(10090500001)(2561002)(305945005)(102836003)(3846002)(2950100002)(6436002)(8936002)(2900100001)(189998001)(8990500004)(5005710100001)(39060400002)(4326008)(966005)(81156014)(7416002)(7696004)(3280700002)(3660700001)(81166006)(1511001)(5660300001)(50986999)(76176999)(54356999)(6306002)(9686003)(99286003)(55016002)(101416001)(6246003)(38730400002)(74316002)(2906002)(25786009)(10290500003)(33656002)(478600001)(14454004)(53546010)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR21MB0123;H:DM5PR21MB0476.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Aug 2017 18:59:13.2573 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR21MB0123 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v7AIxNh8007330 Content-Length: 2395 Lines: 56 > -----Original Message----- > From: Peter Zijlstra [mailto:peterz@infradead.org] > Sent: Thursday, August 10, 2017 11:57 AM > To: Simon Xiao ; Haiyang Zhang > ; Jork Loeser ; > Stephen Hemminger ; torvalds@linux- > foundation.org; luto@kernel.org; hpa@zytor.com; vkuznets@redhat.com; > linux-kernel@vger.kernel.org; rostedt@goodmis.org; > andy.shevchenko@gmail.com; tglx@linutronix.de; KY Srinivasan > ; mingo@kernel.org > Cc: linux-tip-commits@vger.kernel.org > Subject: Re: [tip:x86/platform] x86/hyper-v: Use hypercall for remote TLB > flush > > On Thu, Aug 10, 2017 at 11:21:49AM -0700, tip-bot for Vitaly Kuznetsov > wrote: > > Commit-ID: 2ffd9e33ce4af4e8cfa3e17bf493defe8474e2eb > > Gitweb: > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit.kern > el.org%2Ftip%2F2ffd9e33ce4af4e8cfa3e17bf493defe8474e2eb&data=02%7C > 01%7Ckys%40microsoft.com%7C2537372f38d3414e999e08d4e0218ec8%7C72 > f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636379882129411812&sdata > =odsJ2NnQdD8LCEtDPfVf5rL%2F2sQX4fKUhlqVSjKhjCI%3D&reserved=0 > > Author: Vitaly Kuznetsov > > AuthorDate: Wed, 2 Aug 2017 18:09:19 +0200 > > Committer: Ingo Molnar > > CommitDate: Thu, 10 Aug 2017 20:16:44 +0200 > > > > x86/hyper-v: Use hypercall for remote TLB flush > > > > Hyper-V host can suggest us to use hypercall for doing remote TLB flush, > > this is supposed to work faster than IPIs. > > > > Implementation details: to do HvFlushVirtualAddress{Space,List} hypercalls > > we need to put the input somewhere in memory and we don't really want > to > > have memory allocation on each call so we pre-allocate per cpu memory > areas > > on boot. > > > > pv_ops patching is happening very early so we need to separate > > hyperv_setup_mmu_ops() and hyper_alloc_mmu(). > > > > It is possible and easy to implement local TLB flushing too and there is > > even a hint for that. However, I don't see a room for optimization on the > > host side as both hypercall and native tlb flush will result in vmexit. The > > hint is also not set on modern Hyper-V versions. > > Hold on.. if we don't IPI for TLB invalidation. What serializes our > software page table walkers like fast_gup() ? Hypervisor may implement this functionality via an IPI. K. Y