Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2480469imm; Mon, 10 Sep 2018 01:39:58 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY1HCRrwtiy5tjHEVPI6hgJG8mgO4858SCaGK3q3DQfkcoHi8iKbJS/HC6/8yR3WPWBBdfa X-Received: by 2002:a62:cdcf:: with SMTP id o198-v6mr22441434pfg.12.1536568798257; Mon, 10 Sep 2018 01:39:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536568798; cv=none; d=google.com; s=arc-20160816; b=VQD/yn9+6wW8dUswJ8YbRrT5ysrW1O4ImUgniNYdY85jSnO3w7xat4z6+wXa5fpDW3 WOQHHws+djLpZRBbRur2QnsT90P8zSGwmssAVW9KFkkyPP/ZW3qRzvc8u0TolhWMOBUU n0Q+xXJw76zjOTwaNMnSLk1bsBoEyvuuiHTEaciQZc9qE4g+0KL2xEGOkOm8pYO3aWGp JDMO46elEYkIitMHspcEnq1U4snapKuoGL/QX0wurHcUP8yvhd/E+/ckdS6UO0SMJQyl glm5cULuNagqlomnF2QwQd9nDihw5IQ446oKFwGg5Ci9jV8ms9YiATwuNZNDl1NaaLMw DPgA== 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:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:from:dkim-signature; bh=5mpZFTc5OkRGv+VOnRcQOFfJKYZcekpaWgK/PIteMvk=; b=SmXluyXJVxi8YLLCJx8VXZlPYK4V2bZuV/rJ9/dWl46bo5G6CLbfUbmIhIPQbMQayS CDPO0LbfLGSD0ZlUJHrrbXRP3S0pvak360iPV7Djkb1eHaLL26wlRao7b+xXeutX4Wib Ad8ZkJQ4blYnHLck0h/SFwhN8d3d2f8umrc+HUglhQmkMdB5Fw/o7dTKl6bPxwbvP6bV u9RVGxvqW0N2Jbm65Xl5wo1rxGHRjBUS82lGUj7hR0EQXZbb/VGE5bcks0ON7gZxmE2C BIPp3IX8ie/WW8JuddkyLWbI+pRt6nHFGeeoOGNZG5BjG3GlXJESesgoTU+O9HHgrMkU Aqsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=jHXadEkY; 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 o6-v6si15188736pgp.631.2018.09.10.01.39.42; Mon, 10 Sep 2018 01:39:58 -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=jHXadEkY; 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 S1728095AbeIJNbb (ORCPT + 99 others); Mon, 10 Sep 2018 09:31:31 -0400 Received: from mail-sg2apc01on0124.outbound.protection.outlook.com ([104.47.125.124]:30676 "EHLO APC01-SG2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727488AbeIJNbb (ORCPT ); Mon, 10 Sep 2018 09:31:31 -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=5mpZFTc5OkRGv+VOnRcQOFfJKYZcekpaWgK/PIteMvk=; b=jHXadEkYQT/QySpEfmkP2x25bfjWHiquWVZYB4FtSZhCvRvqmcqFGMih56tgPQ+Q1YNncYTeIcmfMQvFQ3XeJDIeWkr+9moYgDms47MSMvTV64cq3L4UO3i0PKxt7INZmFfoPk8VkX1uFJsxGWHf9OfjSoyVSvt+6H+nWd/sUzE= Received: from HK0P153MB0129.APCP153.PROD.OUTLOOK.COM (52.133.156.18) by HK0P153MB0097.APCP153.PROD.OUTLOOK.COM (52.133.156.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1164.5; Mon, 10 Sep 2018 08:38:28 +0000 Received: from HK0P153MB0129.APCP153.PROD.OUTLOOK.COM ([fe80::194c:c2f9:171:1890]) by HK0P153MB0129.APCP153.PROD.OUTLOOK.COM ([fe80::194c:c2f9:171:1890%5]) with mapi id 15.20.1143.010; Mon, 10 Sep 2018 08:38:28 +0000 From: Tianyu Lan CC: Tianyu Lan , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" , "x86@kernel.org" , "pbonzini@redhat.com" , "rkrcmar@redhat.com" , "devel@linuxdriverproject.org" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "Michael Kelley (EOSG)" , vkuznets , Jork Loeser Subject: [PATCH 1/13] KVM: Add tlb_remote_flush_with_range callback in kvm_x86_ops Thread-Topic: [PATCH 1/13] KVM: Add tlb_remote_flush_with_range callback in kvm_x86_ops Thread-Index: AQHUSOGlPYk0dzaap0aJJdx4SZcp6g== Date: Mon, 10 Sep 2018 08:38:27 +0000 Message-ID: <20180910083806.65177-2-Tianyu.Lan@microsoft.com> References: <20180910083806.65177-1-Tianyu.Lan@microsoft.com> In-Reply-To: <20180910083806.65177-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;HK0P153MB0097;6:X9KBhJiFnMisVOdAXQfydKmSgXJ65Y9wXGBu8do1OKxxzQnFkQTbn4nq1rSxA9U6EnsBah8kCJzhqDOXhBnAa/CeDVHONfPgbq8FmJDfYDc3nCcNN6YwY1ZOh6o0ET5A9s4J2ARVUm1Sfv2XPgd7ecaAhI6NRSJOLGmSOrX5gMHDBH3lqSYHEhIMtS+EstotV978rYDnJFAflrgsTClH2A6tl7HRFHytHPoiTcE2yoLBw3uCbE4+n/F3SV8zX8b8nyDLY2WaFKcrVevFxk+YbXAAdaDvV4x6BfVPJEbOsaVwqVfTrL6BHuT2xXURLgRBUoGQm2eG8NNvpuPkFrpi7NJ5DELZRc6eWExvIqk4agDozajrge7ITjWJBQKAlCpggZiOHpbrtbLwzEmxxFeP9EfOrRdNlR0YQe3WSN626iGBdRpnQSV5h8aTPrCP706N65AUJFOg+1/FWszC0Nkwog==;5:JWS2+v0VUws/WIhR8Bz/VZPd+/gx36Y2El5evOv9O15M6xxp+IHsbpQk3DdpaVEF7fE9fTc3E43Tn8gEIS5GNEbopneoG+iC6sCw9TtBqvNrPcdT5NW8B2G0WxG70CmByLZ59e9q6uZ0qmd4gZMsuveSzQjsVhu40PDASOOnmrU=;7:2AHtSKOPEiDzBphzR3iS3bVqR8fTHgdtNKYb8Yc2XRBWezGx9OYv7IDowjpd2iryfhpsMlEmVUfEOWFZ4iCYIWXFr2uaR+BNWGTm0oi38LC8JgmGeoA/nKPErHr+RAOmeYp6PAeVA0whpTXHbm93hns1TlvP9U/xxkFI58y/8zr2YMJRMXVhwiGV0ZZNva/FxzeyT5uIITyDjTiMJ1CsoCM7IL53WSJ+zQsSzoWTtOXIA/zDnJWd7MY0HFZLSXAA x-ms-office365-filtering-correlation-id: a9c0a983-73a1-4f59-61ec-08d616f8c80d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(4618075)(2017052603328)(7193020);SRVR:HK0P153MB0097; x-ms-traffictypediagnostic: HK0P153MB0097: x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050);SRVR:HK0P153MB0097;BCL:0;PCL:0;RULEID:;SRVR:HK0P153MB0097; x-forefront-prvs: 07915F544A x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(366004)(396003)(376002)(39850400004)(136003)(199004)(189003)(4326008)(68736007)(107886003)(109986005)(25786009)(81166006)(8936002)(81156014)(8676002)(86612001)(86362001)(102836004)(22452003)(26005)(2906002)(6506007)(53936002)(1076002)(10090500001)(97736004)(5250100002)(6512007)(6436002)(256004)(6486002)(2900100001)(14454004)(10290500003)(99286004)(446003)(2616005)(11346002)(478600001)(76176011)(476003)(316002)(36756003)(54906003)(6116002)(486006)(106356001)(105586002)(3846002)(1671002)(305945005)(7416002)(7736002)(59246006)(72206003)(66066001)(5660300001);DIR:OUT;SFP:1102;SCL:1;SRVR:HK0P153MB0097;H:HK0P153MB0129.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: 6M2NBZDQN66Hn+2LRFaKpj8UbYvM6N8Cbi4c3LlnpNsJbtbxl495egETX/vrhe+OJL/9YMXsArEkj6gyq47ts31WMnXNdWyMKxdD4Dh9GZS1isIKoRtveUbiLN3sXRjMN0Tl8K0pQ7mSv45wqxDsVyG5HLtXQyeYFXzJHdx4N5hdnnz/MHSwl7XdRO+nzgZtVmF4CyXV81fiRMmPGnISS0CU7WCzHGfgGbgrFpjhLl+HztuVtJI3UkMulotkUxfEDiLapIcBXEzHTF3/qR5lAXo2oQSShugldMKgaC5LThnE75aQHIIT3Z1BO8gohNLSXcocKiUdwoMckaB7Uy/34udFHbqkyCfRr0CXr59E0QU= 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: a9c0a983-73a1-4f59-61ec-08d616f8c80d X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Sep 2018 08:38:27.9561 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK0P153MB0097 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 Add flush range call back in the kvm_x86_ops and platform can use it to register its associated function. The parameter "kvm_tlb_range" accepts a single range and flush list which contains a list of ranges. Signed-off-by: Lan Tianyu --- arch/x86/include/asm/kvm_host.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_hos= t.h index e12916e7c2fb..dcdf8cc16388 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -402,6 +402,12 @@ struct kvm_mmu { u64 pdptrs[4]; /* pae */ }; =20 +struct kvm_tlb_range { + u64 start_gfn; + u64 end_gfn; + struct list_head *flush_list; +}; + enum pmc_type { KVM_PMC_GP =3D 0, KVM_PMC_FIXED, @@ -991,6 +997,8 @@ struct kvm_x86_ops { =20 void (*tlb_flush)(struct kvm_vcpu *vcpu, bool invalidate_gpa); int (*tlb_remote_flush)(struct kvm *kvm); + int (*tlb_remote_flush_with_range)(struct kvm *kvm, + struct kvm_tlb_range *range); =20 /* * Flush any TLB entries associated with the given GVA. --=20 2.14.4