Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2850256imm; Mon, 10 Sep 2018 07:23:41 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYr1XANmo0RWDZwaObQZGVAbxSUqxVVSufWiqBqut3kEKJ4ll7qmXaibuGDMzdhIAYgJLnd X-Received: by 2002:a62:4fd9:: with SMTP id f86-v6mr24279278pfj.110.1536589421563; Mon, 10 Sep 2018 07:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536589421; cv=none; d=google.com; s=arc-20160816; b=0Zg9CuJqy086WBeFw69i8C6ZeeSV7mTm5z7T2T76Sxa+Oorecw8PInckhC4KDxpK2r u4FMYj/hBwxOC10ospF9YJG10bQ6BrKP+jGOv5dvPHISiQZ30F0In/D31FXA0i9RqkvX 4NbTFvxWwF756Z+OdIXy8G1sst+HLGnWlbK1S+SoLquBN0dDZpzbkhiTp4hfCVMMBk87 1CNqU9HfbU8atk06K+0vndz05y7MMsQcgAGblJXuYvzQv0R6CjlrJ/w8X/l3LhvqtBIy fPoT81jwzOoHHlTSiM2o0GZM5USVZXKpHL4FJv3EINXWOgExLFWNuA4DQum7uVlMQhmy GdGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=JhpcNeVEDeYYmRPni9CRyoW5IYjGas9yQfdmfmsD3so=; b=N2pSTJwKW9namz61m3z21ckYxz8yFMMVWMOhV1GmdKDSq75L/nP6VKWyhA2LPPOc3e RPUdt0WnwFAo9OoV6jopuf+GmBmIu0HWRd0w1Cy18Sgp00hGWQpGEx2lU2fP7fzaMv/I qlyYlXy18XnUTHAZvoRHgPmDsOasYkz87gsXOkfyRip4geqB3PtqJZl4/K81fPgGcBcp pje/OaXhNLbBvAU09n5lPa24lwAS9qrWRe2SNgrvsQ752QeovjAtuPXrg2L5BeTcMtwr +xW+Y13XDe9FtG8XtQaBwu0uRfiqAa6ouzmgDEP6Q44or4qj2F4GR4UyUfUX737g5Yjv vwfw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n5-v6si16700670plp.186.2018.09.10.07.23.26; Mon, 10 Sep 2018 07:23:41 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728615AbeIJTP2 (ORCPT + 99 others); Mon, 10 Sep 2018 15:15:28 -0400 Received: from mga17.intel.com ([192.55.52.151]:36784 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728327AbeIJTP2 (ORCPT ); Mon, 10 Sep 2018 15:15:28 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Sep 2018 07:21:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,356,1531810800"; d="scan'208";a="261352151" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.20]) by fmsmga005.fm.intel.com with ESMTP; 10 Sep 2018 07:21:03 -0700 Message-ID: <1536589263.11460.59.camel@intel.com> Subject: Re: [PATCH 1/13] KVM: Add tlb_remote_flush_with_range callback in kvm_x86_ops From: Sean Christopherson To: Tianyu Lan Cc: 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 Date: Mon, 10 Sep 2018 07:21:03 -0700 In-Reply-To: <20180910083806.65177-2-Tianyu.Lan@microsoft.com> References: <20180910083806.65177-1-Tianyu.Lan@microsoft.com> <20180910083806.65177-2-Tianyu.Lan@microsoft.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2-0ubuntu3.2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2018-09-10 at 08:38 +0000, Tianyu Lan wrote: > 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_host.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 */ >  }; >   > +struct kvm_tlb_range { > + u64 start_gfn; > + u64 end_gfn; IMO this struct and all functions should pass around the number of pages instead of end_gfn to avoid confusion as to whether end_gfn is inclusive or exlusive. > + struct list_head *flush_list; > +}; > + >  enum pmc_type { >   KVM_PMC_GP = 0, >   KVM_PMC_FIXED, > @@ -991,6 +997,8 @@ struct kvm_x86_ops { >   >   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); >   >   /* >    * Flush any TLB entries associated with the given GVA.