Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4965556rwb; Mon, 31 Jul 2023 15:44:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlG+7hQqBK3qhg8INWXwJR5YeCMMrGVq7LEzJZKe3bbNkoX9Q4HwidwBnbVG+q8bbFlLva0u X-Received: by 2002:adf:e8c7:0:b0:313:fbd0:9810 with SMTP id k7-20020adfe8c7000000b00313fbd09810mr821630wrn.4.1690843450430; Mon, 31 Jul 2023 15:44:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690843450; cv=none; d=google.com; s=arc-20160816; b=F3h7bpw2sz/WZdGk896TnC8m7kxYJK0GYVwsQykrFvHa4j9zhlKp4CnAChp41MqOmd kO2oW+ph9toqE07LjAcCcCCnlb3ZHHcOoB0u5VahEVc3jP8rxTG5FWFLl2KmdMOeJB5/ 73AJomRD3j2N2q5gFn/CIVbxKdsu38jgyQv1utP3cb+EHEp43y47Eh4Lk3dUKWndFWug zjSv2Wiyw9+ktZGNWs8LF5LaAagAvTxKYGo6qFx0z0Pp9162L2nGUGGmIqK/E1MYmQPk f5E2SsUeOHHZuUnT43bfVGfaJRXpB6BVI+4jqjhCHw6mZDTVwrw9nxc6e/ex7iN/gQZS 7/Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=mxm0zlWAhsdwPNs5iJKIB42nBu2Sipk2tDe8KMVu/ek=; fh=NIvXR3Yvzh5+Gdyb5sXV7K4BPkiHvBMR38XDYHoCna8=; b=EcD64w9Yq2QEK1BHiYYO3DDTjiCgg/UpCSp2gRRNikklEF/FXMYyEbHky5fw7ckDv/ TCX8h0cQVSKvmOeFZugbA+xeKEosZSDwGdn8JwkBK+mQ+Qd9ZqYAZFWK3XpzhD0QO0vX SvybT2FBgKALYnYj5kB5rKGpKzMGgSuTxwpC4cePItMAoDPtrjjfrB3Rfdmf8T/Asd7n VZeG7hfa1jGUKJ+ImtBnEEJ/ZmHPVQxdM3q87w9iNWLy6tkvkym1Nmipn+BxbGRIvw7h zGKthwkf40oBWq4KlnliLN+octj9/Lf7L+TPzOn2rWaSJlcsb19+H+hAMbiEDV81yv5r FmWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=ytmpshOA; 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 y25-20020aa7d519000000b00522d7f11785si868684edq.501.2023.07.31.15.43.46; Mon, 31 Jul 2023 15:44:10 -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=ytmpshOA; 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 S231655AbjGaVzW (ORCPT + 99 others); Mon, 31 Jul 2023 17:55:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231599AbjGaVzR (ORCPT ); Mon, 31 Jul 2023 17:55:17 -0400 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49777139 for ; Mon, 31 Jul 2023 14:55:16 -0700 (PDT) Received: by mail-pl1-x64a.google.com with SMTP id d9443c01a7336-1bb982d2572so31501465ad.0 for ; Mon, 31 Jul 2023 14:55:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690840516; x=1691445316; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=mxm0zlWAhsdwPNs5iJKIB42nBu2Sipk2tDe8KMVu/ek=; b=ytmpshOAB12qGqTyFlWk5nuibqbjszjzG8HlzRak1nXLBRIW7mqhUOB3pdnUEqnw9p ULxnWPLZRD2mRlVyB/5q0bX5aw1YvfLLdUMnRf4zI7SyNr0EH4R4tqZ2ZiseNI/YvKYQ OZ7Y8CSXug8EnjUACyUdgtTfIF4qmkOQgAhYTbRl3Yf5EpZjTT6Y30q2mELLLrGNzfAI TWHiUWWZhxH6y1Ge+v/UQbVXBXj23ItOQKCwVAD9/GNOUpV5F9QWb/vBOmkWUJSZ5ia8 2yt2+GgEWjOZeaHfuSn3YEhuGE3VZrD7PEIEAsa/FVk3PFxtUHAMyfY0BGbbF9GkdiQc vKOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690840516; x=1691445316; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mxm0zlWAhsdwPNs5iJKIB42nBu2Sipk2tDe8KMVu/ek=; b=HpTvvokJ/7mICG6PMqvYFpp9KyhdyLuLOjX/SojqgnPCSClQcaeDQCZks/36rOD2qZ +ntmTu9+1Z5FWHnrnkBQUyMihz4HH9sr/tbpjq6Xr36AuC4YVaDu/9PnmZSdPyklyoba /XWIN0wSZU8UMyNZi09reN3yBcAFovrmjg6UWDDXH5Xsot1wVzwEdR9yOLlRhcSVwHNt +qD48nq2r9v391H4rxBFZJssVd2k0v5Kqqm9QL2WbJkwIGI0UaEUzb3E//uUYLVbP0PL YEsFUktpybxLvtj6XjPx3OGTWQeg7fO1JJiRF0MYlRaBy2I8hLlkO9dlW9omgtH9O16c ZbfQ== X-Gm-Message-State: ABy/qLawUTIgfwFe7sBdiCXObLg8rOZaWflXTBzJ0ms4VvAvURtnDeHk uPQDaEM0ZuMBzIGWaugPx9koH/46WUc= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:903:2309:b0:1b3:bfa6:d064 with SMTP id d9-20020a170903230900b001b3bfa6d064mr49693plh.1.1690840515767; Mon, 31 Jul 2023 14:55:15 -0700 (PDT) Date: Mon, 31 Jul 2023 14:55:14 -0700 In-Reply-To: <20230722022251.3446223-5-rananta@google.com> Mime-Version: 1.0 References: <20230722022251.3446223-1-rananta@google.com> <20230722022251.3446223-5-rananta@google.com> Message-ID: Subject: Re: [PATCH v7 04/12] KVM: Allow range-based TLB invalidation from common code From: Sean Christopherson To: Raghavendra Rao Ananta 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="us-ascii" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable 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 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_tlbs_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 just "pages" as the "nr_" makes it super obvious that it's a single number, as opposed to an array of pages or something. And it doesn't truly matter, but IMO the gfn_t type is more appropriate since the gfn and the number of pages need to have the same type.