Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1525899imm; Wed, 26 Sep 2018 20:49:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV63zIFWyvN0r5PEZPkJlsMzEX8cNm/4/5CDBY7FnOMCVYh5uZRg8EoD/UAwBCmXuZj1kwhfZ X-Received: by 2002:a63:5c5d:: with SMTP id n29-v6mr8322485pgm.253.1538020192199; Wed, 26 Sep 2018 20:49:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538020192; cv=none; d=google.com; s=arc-20160816; b=JHzla8SoUobWH6SZ2HapAErh7RObuCi/A3I2/9A2xnb7IYCwS1CnhpIHG1mKpM6PfB TIztvSlvHK1ldm0Z7c61dlJJah5+UwwxYhGqHRLrcg+4VIca1wYoCelYVcRxzR8mMCW+ 2GWeEos1S57uIjL6czhI7y5OwfCGagU0MypGTZ8iZxwj7rHo32y1OZh0+ktiHzD6OWA8 YMebZwYYbycXDOH8vs4j2AsxfJPVxtmNFW87VNmaDPguB9YEqE8+tYG8HvStrwzwuY7V c8FoCB2Q/+yInsmnbeLV2hn+8SS9k5gfBExXDreHqvuXilr1IOAD6qp9/+FTMjcQRwKN 1cfQ== 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=2BeI0r2RU14yEwo8VLsuoeXY3JA3CxXIBR28gVEn6eY=; b=nh7deqG6y4z0n5pQOXvAOTTmj/r1+05yhaK2PUA/EGMjXOIb5jpk9zxv/COWzFE3IY tvcvOo0T3T7zh+/9RqkZBgK74FTTkBmx0VgLX9yNq0c49aURpau74d3b+JUvO+Jy8EgI GpSxHP+L7LWjxJro+uQE4AZm5hMOLDtSmEh3sG1IQ1ZQqQ+5Qy3hgsAPXldlsLcoI3cU L6iJw68XT3fNmq0iIvSI5R4GJVqnEulBn/Zb5xxUbLq4BbDIFzryPU0ARfKLW1UAD2CM 46QmMrPWMSKm9pWXWKjRWj2Tv0jqUwmU3LKksmUAKcesGWRpLsewd6gv/ZeH3jgRbC4h JfdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=EAd74jMn; 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 27-v6si832794pgo.671.2018.09.26.20.49.36; Wed, 26 Sep 2018 20:49: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=EAd74jMn; 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 S1727027AbeI0KFd (ORCPT + 99 others); Thu, 27 Sep 2018 06:05:33 -0400 Received: from mail-hk2apc01on0109.outbound.protection.outlook.com ([104.47.124.109]:28856 "EHLO APC01-HK2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726953AbeI0KFd (ORCPT ); Thu, 27 Sep 2018 06:05:33 -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=2BeI0r2RU14yEwo8VLsuoeXY3JA3CxXIBR28gVEn6eY=; b=EAd74jMnLVBbxoVdT65bUbq/jDZZnjhtiNClkpQu9WI4yKwLBaSOgOjmXBvQRi6QsWhxNFBvM3j1HcKEAQCmS9PIBQkktBChbHsRl9j/Rwup+MhhyaCju7pwFR4dxHrI9v2ahE1jCSSFIJE279pEY1rrJ+i0Iv8tk0nkpUE2yfY= Received: from HK0P153MB0129.APCP153.PROD.OUTLOOK.COM (52.133.156.18) by HK0P153MB0130.APCP153.PROD.OUTLOOK.COM (52.133.156.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.2; Thu, 27 Sep 2018 03:48:51 +0000 Received: from HK0P153MB0129.APCP153.PROD.OUTLOOK.COM ([fe80::8584:ad93:130a:6267]) by HK0P153MB0129.APCP153.PROD.OUTLOOK.COM ([fe80::8584:ad93:130a:6267%3]) with mapi id 15.20.1207.011; Thu, 27 Sep 2018 03:48:51 +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 V3 1/13] KVM: Add tlb_remote_flush_with_range callback in kvm_x86_ops Thread-Topic: [PATCH V3 1/13] KVM: Add tlb_remote_flush_with_range callback in kvm_x86_ops Thread-Index: AQHUVhUAv0Q4r8KpOkWhsnpVLEa0CA== Date: Thu, 27 Sep 2018 03:48:51 +0000 Message-ID: <20180927034829.2230-2-Tianyu.Lan@microsoft.com> References: <20180927034829.2230-1-Tianyu.Lan@microsoft.com> In-Reply-To: <20180927034829.2230-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;HK0P153MB0130;6:zdo/+AZwHRQwTyAsUtVhNTyhCyzqDnpT8lFHLsTcpEQ9m/oDtmCyizVUzPnTO5hdV3nCfmbIUfPJbnjzXyRJjfuXFacZCIgSEUzrS3oKNoUwNIC+JddCJasp3apECqy4ww3Tiv/beCp3F6rPEUi90SeC/wAFcmd9y1rLs0TKDMi4Qye00ce5bkyt3oD5sClqgNwESd0+ZiEcCRqHwJQPgmPjNxiHIMsV/3Sa0E5wv2TJVtKpPMZiIaaBwkDzdPU4ApW+m8pdlfBqfPtkIvRbHlR5A2ZuxTdSewphF4UXv+ei5M2wgDB4HQXFtFP36kdIKr6ipvuMo97l28UIlU5rsrgKGynEP7/Myugpoku1+K/ZCWweYm/2Nzb85PF9pXdVCjVX8/6LKFT43u6QdidB8itgw6O/iAHd6q31I5wVPcxHOd31EzyCJdgkJiGsnPDaEeMnc1gIPkSr6/tg0mDbaA==;5:g+nC5oEK8oG1juz0ryUDhIMWWw70dnJQzD8JwnoHPlkueBum5sF1GkDgjv+dqLZnJBwJFCHS0oY1c5tHG6hFg8VNqq7GYOl/POQX5VNUfhXRAJ4+F6xFe5UtreYV3j86JeZxKApSsG+NPGJSpQ//EZM5ZDSqYAdQAzlgD+ofTQ0=;7:O+XW/9UgiHdnV08KLszr/cfMwj9E27N0xNKdjJc5DAbI0EbN9dswd706uWk6EXLCNPm6vn2dP8qbRXFGu3BUKTUFepBU+MfwPpNlfJOUVqSmHFo5OEZOFfFyC59tKaKYfgEBGN3FsKl1JpoydZlN0Rjxndf9YG1jXpZoGV+2xrlpNd1x3lklswhUU9ZDXtWVrsEMfLidZ9AHekYBeuKU1kkaYbzFOHJWH0ao6j0Kxiyn09IymqRN9zQ1xY6XtBmm x-ms-office365-filtering-correlation-id: 95a8b254-5867-412d-1651-08d6242c2399 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(2017052603328)(7193020);SRVR:HK0P153MB0130; x-ms-traffictypediagnostic: HK0P153MB0130: 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)(5005006)(8121501046)(3231355)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051);SRVR:HK0P153MB0130;BCL:0;PCL:0;RULEID:;SRVR:HK0P153MB0130; x-forefront-prvs: 0808323E97 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(366004)(396003)(39860400002)(376002)(346002)(199004)(189003)(102836004)(478600001)(6506007)(26005)(72206003)(10290500003)(8936002)(36756003)(54906003)(53936002)(22452003)(6486002)(8676002)(5660300001)(5250100002)(14454004)(107886003)(6512007)(7736002)(76176011)(34290500001)(1671002)(6436002)(256004)(86612001)(305945005)(86362001)(59246006)(97736004)(6116002)(66066001)(11346002)(486006)(68736007)(2906002)(7416002)(99286004)(106356001)(3846002)(105586002)(4326008)(2616005)(1076002)(71200400001)(109986005)(81166006)(81156014)(71190400001)(476003)(25786009)(2900100001)(10090500001)(316002)(446003);DIR:OUT;SFP:1102;SCL:1;SRVR:HK0P153MB0130;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: XCWzrJ5xFuS25lANNbO+hEBKXh+phNs5L/E7WgyWO54NOQoSBDjAWBZKjXsk6BGbjYoqWxQLJmIhcqbiEXMil/RulSnuUzUTH2f9RHH2rRlI7U4ZLcqwVuj9u2PP/zRPhAzkjHZlFqaR2e8Kk/eLasXQ0Ef8c+/Q4lZJ+X56JQ57RK5XFJ/JdtldSTfd8roRG4EO+Pduaq5m2Jmqaqa5HTxmJrmg98GfWsC6WaKa8GmQyRnKAGPfTT1Ta6wCSt8RrJsZyt9fUColdwlVallE3aCc94uzlPXCmgHFAcx33ApKOD/juNcEvqONaKfM2oyiBYK7ySXU7xRlCuOJ8u644w7METAr6KEU/GSI21KvV8I= 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: 95a8b254-5867-412d-1651-08d6242c2399 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Sep 2018 03:48:51.0467 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK0P153MB0130 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 --- Change since v1: Change "end_gfn" to "pages" to aviod confusion as to whether "end_gfn" is inclusive or exlusive. --- 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 8e90488c3d56..a6b77978502e 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 pages; + 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