Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4863880rwb; Mon, 31 Jul 2023 13:36:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlGOqP68rapkP0I5U99CghiO32JnZD7TukSSFE2+mHYh8hE599IdO1Anew1zT2YpczygZnFL X-Received: by 2002:a17:906:9bf0:b0:99b:d098:1ffd with SMTP id de48-20020a1709069bf000b0099bd0981ffdmr643004ejc.62.1690835801832; Mon, 31 Jul 2023 13:36:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690835801; cv=none; d=google.com; s=arc-20160816; b=Qr+zA3odUZaHYtjfG6m0VNO9SE7bLgiOywNcQVy0cvlT0G3il7itASrl2PHyzzsFOM YlYUxwHunFV488s2a65E5s2SmNVIbjCipDvSZlFw2VvRJlp/r9O2w59mXiI3x1eieH/6 yKgxNE8I254CHZjxp99ZpRq6I1/4boO8uUH6l2q0OY2gDZJf48pLUJ5b47UlG58uovHG AoDLmJ3ddu7Gw/Gav6l128LHud/egZDwV4T7a+iZJHoMCxowypCgIgBFkK1vBdG0Fiio +2nkF8FkAhvWoJBRb2l+lEXjf+5Qq/Pbq7tfuwB8hcUUaol9d3F5num18/pb1fOPp1er +fuQ== 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=Q03jsirrcpz9THZTEToDjGsCufQsuiDSytShuzuhytQ=; fh=K+FoIp+ebRc/w0GRwPA6V6+rEYOwOD1e2udzALcnRL8=; b=oCTlTzKf74za9ZSm4KX32xMgeuMoE+AKszLIMqdi9dDiu7b4Cn/VZrOMGrCaNs7U2R YhBWKkm0d3iQvqDuRGnCMLHGweCKguOfiUHpYhwpyfOM5ftEqKdv0gzwZAQDzMtE42ZN UMQ+e9YzZ42VsVkPICbG5vAdiqKdUBDeJ5Xy7kXrTjvDu0HOM7pxH3XmEf45A5t9LGQS XhizEiF8YAUlOZnBQrBxt+P1iYE/FSDN23QyX6XQYL6RC2OI8XBOBqCfS89m8CHkUJ+v IB4avOio8suZgGKl3hztP0PhX2gaxciad/N9UKCZwbZduY7nvxhH930ZoE7pxVlsENn5 4ZmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=sORGvbtJ; 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 f9-20020a170906138900b009828e8bec17si7720143ejc.531.2023.07.31.13.36.16; Mon, 31 Jul 2023 13:36:41 -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=sORGvbtJ; 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 S230085AbjGaRbJ (ORCPT + 99 others); Mon, 31 Jul 2023 13:31:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229964AbjGaRbI (ORCPT ); Mon, 31 Jul 2023 13:31:08 -0400 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34614C7 for ; Mon, 31 Jul 2023 10:31:05 -0700 (PDT) Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-3460770afe2so5545ab.1 for ; Mon, 31 Jul 2023 10:31:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690824664; x=1691429464; 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=Q03jsirrcpz9THZTEToDjGsCufQsuiDSytShuzuhytQ=; b=sORGvbtJhHxz53qrI/C6oraxYpTnjnsD8fulzoT4dhIBDQX2BnR3JuUM9pXznh0fVK 0Q++QS9YBd6xZyRFZ45krv0aqCEokBCpd/ksYBupaCA6A92A58scXFedQYlh0k/k4C5r zId0p3PvqEPnRt5OU/Hwn5/TEFX9vZSKdXDZpHTqROf6CdWFvh35L9PfPXiugBLjPSJg 4xk332WGEOIjrUYIWqdFinZaga1dIOvxx0x/8JSRVskIc3FfZSLuGYh/O8Eto/p3IxhW UYrRZcZL2C+X0esJUx4cUe1XLN8KMhWEmZW1V/Lb6UhZ7IMDvhGKObCAe9xtsJhQgGWN hRLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690824664; x=1691429464; 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=Q03jsirrcpz9THZTEToDjGsCufQsuiDSytShuzuhytQ=; b=lQhNqmHgTKapuBlMKC57Il1zaAloDj6bSaR9WApI8U7RcnfWHkw+/HAfGB/qzsrtWj SjoOBZEkFxF3iL7i9iYmxveaYZwxhKUgX7ChanBqZhc4KGRkCYP7+0qUMZH4zsZugG5j PHMbpDbC7D00AYrMDjNGXx+jR4ydcjs+QShr6mkt4dYb/jOjl+ARUhRZ5VuuPUmCDkH+ kcLNebjqSc8YzdVmmxDTvAILmRL5qHhgDJLHDLvPAaoK/o3E9xi8lR7UD5OyHjO6Sp9M K4mU0cmABefMUYCcV9yqDj5uBsy+BVHFJsGRZkD48UvgJJ54TER3QI9MhmIX2GVcP2Hi GwRw== X-Gm-Message-State: ABy/qLbDGri5SYkVSHOLHHDg0/SWt8hle8iTnqBTXZW8wZqW9mXgPgYQ a3Ngukb6P2IR63/ev+sXDLLxoJTPMdtyKKtQF+X1BA== X-Received: by 2002:a05:6e02:1a09:b0:349:290:74e3 with SMTP id s9-20020a056e021a0900b00349029074e3mr505815ild.23.1690824664464; Mon, 31 Jul 2023 10:31:04 -0700 (PDT) MIME-Version: 1.0 References: <20230722022251.3446223-1-rananta@google.com> <20230722022251.3446223-6-rananta@google.com> <87sf99r5gz.wl-maz@kernel.org> In-Reply-To: <87sf99r5gz.wl-maz@kernel.org> From: Raghavendra Rao Ananta Date: Mon, 31 Jul 2023 10:30:53 -0700 Message-ID: Subject: Re: [PATCH v7 05/12] KVM: Move kvm_arch_flush_remote_tlbs_memslot() to common code To: Marc Zyngier Cc: Oliver Upton , James Morse , Suzuki K Poulose , Paolo Bonzini , Sean Christopherson , 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=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 Thu, Jul 27, 2023 at 3:53=E2=80=AFAM Marc Zyngier wrote= : > > On Sat, 22 Jul 2023 03:22:44 +0100, > Raghavendra Rao Ananta wrote: > > > > From: David Matlack > > > > Move kvm_arch_flush_remote_tlbs_memslot() to common code and drop > > "arch_" from the name. kvm_arch_flush_remote_tlbs_memslot() is just a > > range-based TLB invalidation where the range is defined by the memslot. > > Now that kvm_flush_remote_tlbs_range() can be called from common code w= e > > can just use that and drop a bunch of duplicate code from the arch > > directories. > > > > Note this adds a lockdep assertion for slots_lock being held when > > calling kvm_flush_remote_tlbs_memslot(), which was previously only > > asserted on x86. MIPS has calls to kvm_flush_remote_tlbs_memslot(), > > but they all hold the slots_lock, so the lockdep assertion continues to > > hold true. > > > > Also drop the CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT ifdef gating > > kvm_flush_remote_tlbs_memslot(), since it is no longer necessary. > > > > Signed-off-by: David Matlack > > Signed-off-by: Raghavendra Rao Ananta > > Reviewed-by: Gavin Shan > > Reviewed-by: Shaoqin Huang > > --- > > arch/arm64/kvm/arm.c | 6 ------ > > arch/mips/kvm/mips.c | 10 ++-------- > > arch/riscv/kvm/mmu.c | 6 ------ > > arch/x86/kvm/mmu/mmu.c | 16 +--------------- > > arch/x86/kvm/x86.c | 2 +- > > include/linux/kvm_host.h | 7 +++---- > > virt/kvm/kvm_main.c | 18 ++++++++++++++++-- > > 7 files changed, 23 insertions(+), 42 deletions(-) > > > > [...] > > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > > index 804470fccac7..58213cc4b9b9 100644 > > --- a/virt/kvm/kvm_main.c > > +++ b/virt/kvm/kvm_main.c > > @@ -379,6 +379,20 @@ void kvm_flush_remote_tlbs_range(struct kvm *kvm, = gfn_t gfn, u64 pages) > > kvm_flush_remote_tlbs(kvm); > > } > > > > +void kvm_flush_remote_tlbs_memslot(struct kvm *kvm, > > + const struct kvm_memory_slot *memslot) > > +{ > > + /* > > + * All current use cases for flushing the TLBs for a specific mem= slot > > + * related to dirty logging, and many do the TLB flush out of mmu= _lock. > > I appreciate this is a copy paste of an existing comment, but I can't > parse it. My command of the English language is notoriously > approximate, but it feels that something is missing in the first > sentence, such as a verb. > No, you are right. The sentence is broken, probably a missing "are" at the end of the first line. I'll fix it. - Raghavendra > M. > > -- > Without deviation from the norm, progress is not possible.