Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp40931imm; Mon, 2 Jul 2018 07:20:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc4hj3RZRKwbwzc1AB5kWHArUpQO7tptqZg+V91KNa1OwEjH1DC8zGF2ReVEKhieBqsSJN+ X-Received: by 2002:a62:a05:: with SMTP id s5-v6mr17908620pfi.147.1530541252967; Mon, 02 Jul 2018 07:20:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530541252; cv=none; d=google.com; s=arc-20160816; b=merzTPWTaNheNNiqU/fS9bTAQSckPz7YkjqETqzifX38x6VRvmcxQLp6quXTX5PDPF fdEnA9D+ZZ6c7kkw5whtAcLAAHpGWnJck5cFV7tjx8U29USyv4y1KzeS5GUD1WD6XY0K Hl4TiImpbhYRMWJT01WB1cgfSIM7q3CbWlZ4iCAbPyXhWN8v481UnXtlbpRM3zF9wfO8 ooEeHYx8o8tROhTdksMzkrBKnBFDFlIiCu9FSGZbKS2Wau6T5pvXngqVitqKP0R3ArBq o5rHZl84mRgbSca73w8IQP4b2aNQ7kTX9d/JC7F3zcqC6YLYJQROsPG0eghlTxYUQHUA gyDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:message-id:date:thread-index:thread-topic:subject :cc:from:dkim-signature:arc-authentication-results; bh=iHoO5zQgmEW2+m957lZvYVglqGO13ocqh2JO1BVl1Gw=; b=V51ilfyjQdYCzEbP25Mg+nWnt2A2LVnI9nQWfAcv4ZKIpN1i/2X4csnFDJPETLuP1b iHWXxWZ576zENRfcI2QhSB7lA3Wquzo5Kq7+SICTWLcLoEgOgDjgtQE566LDRligh53D SJYv6zT8JeAttyK0fJv+VIfCWUMKOUz5VedI4vcZGkJclQXMocpDvqbhJ5z5PdhIF4Wv jW3Yt6oV8W/uv8pJPccTj7wOlp3N/vI1ghtaXo2YFxkrS+cnWkT5oRX7vsVvf1vMk0E3 ScKaWrqyQyoy9Rf04wkpSBQIBJOYaRXvpW3W5pHAN5TJbuunXrh2CDIWzRZLo3FB3cMa D+Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=T6ugVuy+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1-v6si9716525pfl.215.2018.07.02.07.20.24; Mon, 02 Jul 2018 07:20:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=T6ugVuy+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752152AbeGBORX (ORCPT + 99 others); Mon, 2 Jul 2018 10:17:23 -0400 Received: from mail-hk2apc01on0111.outbound.protection.outlook.com ([104.47.124.111]:53440 "EHLO APC01-HK2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751443AbeGBORV (ORCPT ); Mon, 2 Jul 2018 10:17:21 -0400 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:X-MS-Exchange-SenderADCheck; bh=iHoO5zQgmEW2+m957lZvYVglqGO13ocqh2JO1BVl1Gw=; b=T6ugVuy+C/q2epECdP31j9dRpm63B9ck26R3pvhh/VQ3U1MA6cZO0OJa1be+VjcF4Nz2WBNEPL6yNGfyHAr6aFsc7Eypa/Z4EdUTDnDwdCcIB2oZhZ82EMXzON65cJn8V+iYNap2EdL2uFqCvv1jRbRyGyTASJfJIedABcI/2u0= Received: from KU1P153MB0150.APCP153.PROD.OUTLOOK.COM (10.170.172.151) by KU1P153MB0133.APCP153.PROD.OUTLOOK.COM (10.170.172.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.4; Mon, 2 Jul 2018 14:17:13 +0000 Received: from KU1P153MB0150.APCP153.PROD.OUTLOOK.COM ([fe80::3117:172e:121:d0e]) by KU1P153MB0150.APCP153.PROD.OUTLOOK.COM ([fe80::3117:172e:121:d0e%5]) with mapi id 15.20.0952.005; Mon, 2 Jul 2018 14:17:13 +0000 From: Tianyu Lan CC: Tianyu Lan , "devel@linuxdriverproject.org" , Haiyang Zhang , "hpa@zytor.com" , "kvm@vger.kernel.org" , KY Srinivasan , "linux-kernel@vger.kernel.org" , "mingo@redhat.com" , "pbonzini@redhat.com" , "rkrcmar@redhat.com" , Stephen Hemminger , "tglx@linutronix.de" , "x86@kernel.org" , "vkuznets@redhat.com" , "Michael Kelley (EOSG)" Subject: [PATCH 0/4] KVM/x86/hyper-V: Introduce PV guest address space mapping flush support Thread-Topic: [PATCH 0/4] KVM/x86/hyper-V: Introduce PV guest address space mapping flush support Thread-Index: AQHUEg9fC6qx6UW5u0mOloIreXNs2A== Date: Mon, 2 Jul 2018 14:17:13 +0000 Message-ID: <20180702141653.88936-1-Tianyu.Lan@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tianyu.Lan@microsoft.com; x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;KU1P153MB0133;7:Hy83VrnyLVMGhJB8waIPHMYMbbtuX28MyjTVQCcRTMvLiFuxNgxgYTF+BL8ftXurED+OEnb7+ObBN6berFvG/McBinQIAesAHSwLOqv8Qfm5ix/EaEaLbrQ9FPQGdqy6oMDCdo4nGag63e5B6Qt5unKm5S6JpXbsjRCLrzFcMsmg4WvFEiiQFwzAavhz8/IJhyoRlPkoMBvK01j+c5EGc291XOfNOL5mvY6fniGNs2NCltmp0COQN1Lu1yvf/hDD x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: a8fba746-65a8-4e2e-0d36-08d5e02681f1 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(48565401081)(2017052603328)(7193020);SRVR:KU1P153MB0133; x-ms-traffictypediagnostic: KU1P153MB0133: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231254)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:KU1P153MB0133;BCL:0;PCL:0;RULEID:;SRVR:KU1P153MB0133; x-forefront-prvs: 07215D0470 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(366004)(136003)(39860400002)(346002)(376002)(199004)(189003)(1671002)(54906003)(476003)(486006)(59246006)(107886003)(36756003)(26005)(102836004)(22452003)(2616005)(316002)(97736004)(2900100001)(14454004)(6486002)(109986005)(86362001)(86612001)(68736007)(6512007)(4326008)(25786009)(6436002)(10090500001)(53936002)(66066001)(5660300001)(105586002)(106356001)(7416002)(8936002)(2906002)(305945005)(7736002)(99286004)(256004)(72206003)(6506007)(10290500003)(3846002)(8676002)(1076002)(81166006)(81156014)(478600001)(5250100002)(6116002);DIR:OUT;SFP:1102;SCL:1;SRVR:KU1P153MB0133;H:KU1P153MB0150.APCP153.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 8qxTOeluL1+yH2uw4ZYC3nESOeNx6TVLyLrBfGkvO+8JdD2PfP8xF+fbL5LhB9Dakrli3YO/wDoA88b2h8IdYhaf0uBLyXrP48kNhvs5IsAhxxEnP9nscQQp1nFuCLmcjBeGYFGf8vfzLvFMNCYHOu1m9tToZodTjb8SYB9QJ4n0UNMLFgfhxbncf0xXfhNCAHoKuYGP9z00lP0zuXTFnKEzT91eihiZBaqcPB752xEBsoatB3dF3DbPEQbullM+uZzqS0XHVVDJIPOEPwhgmPwDMtrmTTrvrTtO2PTrwN8xg9txEBaVtBXUm5kN7S9eyMMfmbMySuTq2+ONujxDhkmLFFefb51FF7wFkt5dA88= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8fba746-65a8-4e2e-0d36-08d5e02681f1 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2018 14:17:13.0761 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: KU1P153MB0133 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hyper-V provides a para-virtualization hypercall HvFlushGuestPhysicalAddres= sSpace to flush nested VM address space mapping in l1 hypervisor and it's to reduc= e overhead of flushing ept tlb among vcpus. The tradition way is to send IPIs to all a= ffected vcpus and executes INVEPT on each vcpus. It will trigger several vmexits fo= r IPI and INVEPT emulation. The pv hypercall can help to flush specified ept table on= all vcpus via one single hypercall. Lan Tianyu (4): X86/Hyper-V: Add flush HvFlushGuestPhysicalAddressSpace hypercall support KVM: Add tlb remote flush callback in kvm_x86_ops. KVM/VMX: Add identical ept table pointer check KVM/x86: Add tlb_remote_flush callback support for vmcs arch/x86/hyperv/Makefile | 2 +- arch/x86/hyperv/nested.c | 64 ++++++++++++++++++++++++++++++++++= ++++ arch/x86/include/asm/hyperv-tlfs.h | 8 +++++ arch/x86/include/asm/kvm_host.h | 1 + arch/x86/include/asm/mshyperv.h | 2 ++ arch/x86/kvm/vmx.c | 56 +++++++++++++++++++++++++++++++++ virt/kvm/kvm_main.c | 12 ++++++- 7 files changed, 143 insertions(+), 2 deletions(-) create mode 100644 arch/x86/hyperv/nested.c --=20 2.14.3