Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp308812imm; Mon, 9 Jul 2018 02:03:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfMIJ3W9s85/eESzya8NyAlCHpYRoKltXGNqYJugbWcJGJb3//jRWb8EUzE3jKugVUNCnIc X-Received: by 2002:a17:902:bb8a:: with SMTP id m10-v6mr19694732pls.236.1531127015190; Mon, 09 Jul 2018 02:03:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531127015; cv=none; d=google.com; s=arc-20160816; b=Du6piIgHomvP0pIIEu42YNyGqk9DE44e6fPLiz8udiIxb2k5Bn3Jevvaby0ke4IPD5 qLYHJXP22oLCSy56bvW6lJFPjGxIn6pROjo9HGOW9WtGEpi4rCmX0d0kuV5pbgyZRkqD UZ4Wdoy2Tpp7voqaBoIRFwLeBaFXiso0l4RUCPNWPOQseYuaR8bnCMJReHzBW5GX0OtJ vfG34aa/UMfqA8Uyy8hs+fLMf1cyTtfmBgMMfKQq4M2/qmiCGUlJ4AHSN6IQADH0l2NL QE2tBi7U3MdwOVpzKlvh8EWhmgYpoH4EYC4h79MJgp8YbCmep3tvXZBXKsPc30TJf7XH ZH4A== 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=IlPBDu7bxJdu3Eig+KRPR5gScMsOEQ2e2iKT2V3Y988=; b=ABK5r+BN27qk5X6c8j34ae4okSP3KL7giOlZ+vmS3C8dCoFnVA1BNjt2JdBHFZfsvn Zg2xhRxl0iafsdESVtcTQX4b+8JSNT/VzcpxLT6QHOPefCfEKURQMnUzR51y5mkdau36 XMx1KEAQp6q1VkUh+dRsGTWUM1UfL/xLu+yMRO2hGrQa+XQmXn0psR/+mmUAJezM1z4T 0FojmKchoO7B0z0nAlp3ISSFYkXXHTxD2pv7POiFy67nmWFA9FKouaLbXwW2sYr30SY5 41lG6wMvaF9DaW95w3yLuBefFZ34ttACtgaBqXjmRimehuDcRDj0nFKQEjv7WfPNwrNl S9Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=h2htL27f; 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 a1-v6si3593810pls.311.2018.07.09.02.03.20; Mon, 09 Jul 2018 02:03:35 -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=h2htL27f; 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 S932685AbeGIJCi (ORCPT + 99 others); Mon, 9 Jul 2018 05:02:38 -0400 Received: from mail-sg2apc01on0127.outbound.protection.outlook.com ([104.47.125.127]:32416 "EHLO APC01-SG2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754398AbeGIJCg (ORCPT ); Mon, 9 Jul 2018 05:02:36 -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=IlPBDu7bxJdu3Eig+KRPR5gScMsOEQ2e2iKT2V3Y988=; b=h2htL27fCmC0JiPvI2FwjVaMsfFFaJ3gRnynShqfbJaHQ19Ra5Id6zLebsOJ37q/KvuhyeHVxLPvawSZNZzqILlN8di0fD9Nk2nO2h0qChbPeFM6P95RWh9x46HbbQOLNyeGlO0uyCPc2agD8IdFGmZTOuJXXFhIPYbdWAScXeo= Received: from SG2P15301MB0093.APCP153.PROD.OUTLOOK.COM (10.170.136.145) by SG2P15301MB0063.APCP153.PROD.OUTLOOK.COM (10.170.136.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.15; Mon, 9 Jul 2018 09:02:29 +0000 Received: from SG2P15301MB0093.APCP153.PROD.OUTLOOK.COM ([fe80::f916:a637:8730:be25]) by SG2P15301MB0093.APCP153.PROD.OUTLOOK.COM ([fe80::f916:a637:8730:be25%4]) with mapi id 15.20.0952.013; Mon, 9 Jul 2018 09:02:29 +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" , "Michael Kelley (EOSG)" , "vkuznets@redhat.com" Subject: [PATCH V2 0/5] KVM/x86/hyper-V: Introduce PV guest address space mapping flush support Thread-Topic: [PATCH V2 0/5] KVM/x86/hyper-V: Introduce PV guest address space mapping flush support Thread-Index: AQHUF2OPc6l/VDQYCUCP6LQoqrm/2w== Date: Mon, 9 Jul 2018 09:02:28 +0000 Message-ID: <20180709090218.15342-1-Tianyu.Lan@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;SG2P15301MB0063;7:SwgFGpw5IJ1rRO0PRi8zs0IC6X3xwjgSBklCITNoJBH5nrLzuj+kk2Q1CgCgUgmE+9RqLRFS4ybCpTMFGLxxb18xGUMbQEmvyMPcBmT6PrD+a9qC4ATdjwNOpdFBuB4oH4gA2uD1qma6e5rOqTn+sfTf+WGjoPeZ6quefzy28JTtk3681kFY4xLrWUXwGePEMhfux7gVVvgodpve95DXcbX6uyKJlHqH8zgLyWqZeYswzcBkvz060nv65yoWa+Vm x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 8c0f876f-1a53-4611-bb8e-08d5e57ab2cd x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(48565401081)(2017052603328)(7193020);SRVR:SG2P15301MB0063; x-ms-traffictypediagnostic: SG2P15301MB0063: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tianyu.Lan@microsoft.com; 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)(93006095)(93001095)(3002001)(3231311)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:SG2P15301MB0063;BCL:0;PCL:0;RULEID:;SRVR:SG2P15301MB0063; x-forefront-prvs: 07283408BE x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(136003)(396003)(366004)(39860400002)(346002)(199004)(189003)(256004)(105586002)(86362001)(6486002)(72206003)(66066001)(59246006)(86612001)(6512007)(97736004)(6436002)(2616005)(476003)(8936002)(486006)(14454004)(7416002)(81156014)(81166006)(8676002)(4326008)(109986005)(68736007)(25786009)(2900100001)(106356001)(6116002)(3846002)(1076002)(36756003)(5660300001)(53936002)(305945005)(7736002)(1671002)(5250100002)(54906003)(99286004)(26005)(102836004)(22452003)(10090500001)(10290500003)(2906002)(478600001)(6506007)(316002);DIR:OUT;SFP:1102;SCL:1;SRVR:SG2P15301MB0063;H:SG2P15301MB0093.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: X0zPcJ3BRbu+7p0m7u181Q6hKGMdFqI+OcANva44dCCW+bBttIDQAsrK8qbktPZtWeB+1RJAq2Ta4bIv+Pl3x5EwXfwUlipwIvO9Kp7RUcHYaEqakmnwHj/rbTQajZPmR1M1h0XvQYm8cVJgisneyfgyuJ0wtFuiy3CH19IXoMToZ8sVTRhy4mvRBUf2FNi6wZxnD0MmoZWcvmUxTFzse/kyFaisRifB9xHx8JxcGRfG2Qfn8pqC9OULNlOnhy3IKb/iZgwnKmwx4ochRDN786ngom9KmBwfw+OU1zDAlHa2NDBydR5HyhB0NKpiYDkrRvtHwHdrSrEnsqE4LWnnamG5Lnb3y4mYWP8R2exXuNA= 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: 8c0f876f-1a53-4611-bb8e-08d5e57ab2cd X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2018 09:02:28.6287 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2P15301MB0063 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. Change since v1: - Fix compilation error for non-x86 platform. - Use ept_pointers_match to check condition of identical ept table pointer and get ept pointer from struct vcpu_vmx->ept_pointer. - Add hyperv_nested_flush_guest_mapping ftrace support Lan Tianyu (5): 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 vmx X86/Hyper-V: Add hyperv_nested_flush_guest_mapping ftrace support arch/x86/hyperv/Makefile | 2 +- arch/x86/hyperv/nested.c | 67 +++++++++++++++++++++++++++++++++= ++++ arch/x86/include/asm/hyperv-tlfs.h | 8 +++++ arch/x86/include/asm/kvm_host.h | 11 ++++++ arch/x86/include/asm/mshyperv.h | 2 ++ arch/x86/include/asm/trace/hyperv.h | 14 ++++++++ arch/x86/kvm/vmx.c | 59 ++++++++++++++++++++++++++++++++ include/linux/kvm_host.h | 7 ++++ virt/kvm/kvm_main.c | 11 +++++- 9 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 arch/x86/hyperv/nested.c --=20 2.14.3