Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5078820rwb; Mon, 31 Jul 2023 18:07:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlHwiqHuK2MrPEGOemCVXWfFm5/WzRgcdmAOYEq1X2eUK9LMMy/TCD+tAfnIph4TEIfkeA+O X-Received: by 2002:ac2:5f6a:0:b0:4fb:740a:81ae with SMTP id c10-20020ac25f6a000000b004fb740a81aemr839488lfc.16.1690852042393; Mon, 31 Jul 2023 18:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690852042; cv=none; d=google.com; s=arc-20160816; b=W9L5vkVmljrSEQyhc3aXW4oDLTZ1wpUVP9UNS8PLX1vOWNVNSX22WDTjuAHYowqDiM XGDz8MYgFBIpq3G5WUjYJu9/9GRfE3Tu98bvKN4LhyUoqxZk4SNsyF5XG76rhetBleki rzLUoVdqGGxYmxsLakFun/UjNStDkitVv/cyUqPSFJcTMNf1s6OCDT1P1G7PJ0tMqese AOWpFigyDEKDzEb3waGHLoxJxmUHLkbLYAD6L2Xh7g/zqFGW42kqs7bVIopZ4+0GtlC9 x7tLeMZaV3q8eP+PxhbIuL8QKQFtC3C9DQFUWXnCqqdlY+LIzG1RSqGaSiAbhhPbfKMq A9DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=lQaJrQRUIiWVDCsAsh3n8+ThLFrN8Bh/awGWXHsDQe0=; fh=5ayu//GcChPQdb9p5U1VIXpYysaqdDVq741q4bPk/7E=; b=CdR2ixLdglBcIyC+rnulzaDsMXQ1VYB9vp19pMqjDwXlGz27WskCUMy2PrJhQ/rT/Q Drqo/8obrQT9NbR6PfNXb2rJVekTB8tRYz32eePUwYGRN0YUVP1l4TLAZh6Q/o+Yuj3M ZcJwWqI81vO+6j0Pbf/Pgh6KrvuC6YPFCcgOK4PcLbf6v0s4zOlWGybgX/ZwJzEPKmk1 24iH3r2ts8j3wLJ1fLvR7pkKTV5oKNMYKdKa00gKvZeJXUzbClmrvfWDRQwkTHU8jmLm LIocQey2dZjEw6HRt4l43pOALf3QauF4cwKrbbJKFxaR/Qn+4UEAiuBOuRko+GwcAPcc nYwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=aVcAiHgZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020aa7d708000000b005221f6b4e8esi3947733edq.166.2023.07.31.18.06.58; Mon, 31 Jul 2023 18:07:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=aVcAiHgZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231173AbjHAAkO (ORCPT + 99 others); Mon, 31 Jul 2023 20:40:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbjHAAkM (ORCPT ); Mon, 31 Jul 2023 20:40:12 -0400 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0B09199F for ; Mon, 31 Jul 2023 17:40:10 -0700 (PDT) Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-3492e05be7cso52105ab.0 for ; Mon, 31 Jul 2023 17:40:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690850410; x=1691455210; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=lQaJrQRUIiWVDCsAsh3n8+ThLFrN8Bh/awGWXHsDQe0=; b=aVcAiHgZKSA41yfjau5sn0kLRmUefICGRUqWSxWFrJPabknpsf37xFnhkfkJC3slWo 91oO/teCA7rEBLT9/jqVl0I3w0vKM+fMIl1YqCUbA/rjydkD0AR/YZFtYf6nH1izkSrF xKBFggrAYblDXn/jMHHkbJNvSG33lwajusV8jSWSvb0c4Lz2rapmmWQHsqY/ONVhpByE 3XGtvM20VEgq7GbSzk7nxPKs8B3a5rMkGJmSBlg5uTV3XP2hOeCTee2K4YqKZoAzNQKt QrhnKxe+2Bc1BuNej97Pv2MDvN4e/17QXLgjAzxwLeABWuygJ1AgQBF7RM3ubeWKOPly cxpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690850410; x=1691455210; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lQaJrQRUIiWVDCsAsh3n8+ThLFrN8Bh/awGWXHsDQe0=; b=aAxUVoUOEMHdLo30j7SJVlLizKiCkF4jw3dCYqboUn4Xj8sZrjokXMUOdAUe+fSaRo pbTls3lurXNGxbgc+qTP79wjaIqUchSu/LGPCq42Jlbv3pGD6b3mQ4SkfN9aZriKMY00 6TcrX+sOdi9nDiJoNwC39J2NDTqDDs8ZdtgQnaEAa9G9KZ0Xlntp0aP8xjKGpgeER2r+ B5zW4v6ntA/URabTuWjQ/wWUnMA+TD9G/wfcGGG06XpuwzjJoR392zdZIA/pdrXnXmjy RtXfOA/4uM+CJZQf6p8f4NKC6jNAZCDjpSycOO6G7kJ9I0xHLIJnEF2f6WGbVHrQ4BTC oh+g== X-Gm-Message-State: ABy/qLb/z7dO9nXcjur/9v5CuuPy/j4VbtOykB+wUTxdD5cpOX6RLsRj Ucwap1Qk00dPccFyHL5chuS1Ibh8BihMm8YA3lWYBQ== X-Received: by 2002:a05:6e02:1a09:b0:349:290:74e3 with SMTP id s9-20020a056e021a0900b00349029074e3mr626628ild.23.1690850410184; Mon, 31 Jul 2023 17:40:10 -0700 (PDT) MIME-Version: 1.0 References: <20230722022251.3446223-1-rananta@google.com> <20230722022251.3446223-5-rananta@google.com> In-Reply-To: From: Raghavendra Rao Ananta Date: Mon, 31 Jul 2023 17:39:58 -0700 Message-ID: Subject: Re: [PATCH v7 04/12] KVM: Allow range-based TLB invalidation from common code To: Sean Christopherson Cc: Oliver Upton , Marc Zyngier , James Morse , Suzuki K Poulose , Paolo Bonzini , Huacai Chen , Zenghui Yu , Anup Patel , Atish Patra , Jing Zhang , Reiji Watanabe , Colton Lewis , David Matlack , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Gavin Shan , Shaoqin Huang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 31, 2023 at 2:55=E2=80=AFPM Sean Christopherson wrote: > > On Sat, Jul 22, 2023, Raghavendra Rao Ananta wrote: > > diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c > > index ec169f5c7dce..eb88d25f9896 100644 > > --- a/arch/x86/kvm/mmu/mmu.c > > +++ b/arch/x86/kvm/mmu/mmu.c > > @@ -278,16 +278,15 @@ static inline bool kvm_available_flush_remote_tlb= s_range(void) > > return kvm_x86_ops.flush_remote_tlbs_range; > > } > > > > -void kvm_flush_remote_tlbs_range(struct kvm *kvm, gfn_t start_gfn, > > - gfn_t nr_pages) > > +int kvm_arch_flush_remote_tlbs_range(struct kvm *kvm, gfn_t start_gfn,= u64 pages) > > Please keep "nr_pages", I have a very strong preference for that over jus= t "pages" > as the "nr_" makes it super obvious that it's a single number, as opposed= to an > array of pages or something. > Sure, I'll revert back to 'nr_pages'. - Raghavendra > And it doesn't truly matter, but IMO the gfn_t type is more appropriate s= ince > the gfn and the number of pages need to have the same type.