Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1730154rdh; Sat, 25 Nov 2023 00:34:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFNOGMaM6yPNRpRrtAXTetw2OtJpwkoPJsY5C/54QIbf2W8LEzAzd2pFyoFFnCf092e1Yoq X-Received: by 2002:a9d:7598:0:b0:6d7:f9f3:f7c1 with SMTP id s24-20020a9d7598000000b006d7f9f3f7c1mr6818427otk.8.1700901257037; Sat, 25 Nov 2023 00:34:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700901257; cv=none; d=google.com; s=arc-20160816; b=X8Xyw5anyGbd3GQRH8ztIVzf2CuhdTqGJN7Glp+js3tytKRL4iPOChawlfZ8jPe/I3 9Dhb5pcsgPGYMqPvLImaxs0tyNKNBDLn37r1Sn+Z9PoiFn7VCQIJLJxge1DWwyDVdl/F 2VBfOuMKGd5F6JWlwmSbyzxpnTXXK4NVZlSt52dvHpt7DzBMr+zYPL4ugk0C+IawwSGw ELsrN0vczuXtO0C6Pz65zLto98jC+BQYE1GrHQcPMn69Fszo5z1usxxOrpvOznsFaM9/ V/BFjyca4vvxHpNhp3KOA7qfXnqAuw+Z7LcA5cyz7dE3yH2yEZN+VLwwNhZxjDg7/LLw Zp2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=gbnARVNy5E0hGES1ua4xRZ6a56me/D63RWZkoJuQ94E=; fh=N32iRfdmtUaFGM6Wv4hOFyVMk9QXa1NYAPuS9uUR97A=; b=i9KmGdu9xZx0Bjsvipc/T3RZ9YcWp6vMH9Lyd5iBa49DCRojkwKb7w1s2A3XQl8Pmp ZaKqknqEPrdJeaFohU7xsDe1X11sDP66MDrDDbTXmkwZYVvJe7nEqOS7bW3WuwrkMwHf JYd/a0zWQ1OWeHyof1cALFqylhAQlVYrgZlouAUgl03iPT+jf3PeOYEC8XZNblcW5H3V 5yofz0MSrjdFT1KM1Zn0+3hAsoYOGQYkkZqWj6W0HfxU5fxiq9BlQf4Kkp9fjTi6XCuC Y/FP/i2Mf3fKw+nVJupHiwJm+EAQLVwlu4cUIqhtZUyEjlSDZRZ5HBvk/HvXMMCZoKqz x2Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="DVU/aB9L"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id q11-20020a635c0b000000b005a9fde46fa1si5262711pgb.343.2023.11.25.00.34.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 00:34:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="DVU/aB9L"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 7069F80CEF2E; Sat, 25 Nov 2023 00:34:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229584AbjKYId7 (ORCPT + 99 others); Sat, 25 Nov 2023 03:33:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbjKYId5 (ORCPT ); Sat, 25 Nov 2023 03:33:57 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17693E6 for ; Sat, 25 Nov 2023 00:34:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700901243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gbnARVNy5E0hGES1ua4xRZ6a56me/D63RWZkoJuQ94E=; b=DVU/aB9Lx+xRjUeBUPaiA4D8+hly/PJYRZZ09MataNBVTh/KQvuWbfIK/zQTtla9AF/e0b B/649h8y3xSdFZ5D0zRb5pw6moKGizOdu/udO5xES0RJFbFG8mdf1QIx4Uyq0+0+tqRfvL dy7OXW3jgfc1rbCxtWglJU+6EQuUDNE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-187-P13XO4xENne2rqMu9Rhw2g-1; Sat, 25 Nov 2023 03:34:01 -0500 X-MC-Unique: P13XO4xENne2rqMu9Rhw2g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E5203811E7B; Sat, 25 Nov 2023 08:34:00 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id BEB751121306; Sat, 25 Nov 2023 08:34:00 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: seanjc@google.com, mlevitsk@redhat.com Subject: [PATCH v2 0/4] KVM: x86/mmu: small locking cleanups Date: Sat, 25 Nov 2023 03:33:56 -0500 Message-Id: <20231125083400.1399197-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 25 Nov 2023 00:34:14 -0800 (PST) Remove "bool shared" argument from functions and iterators that need not know if the lock is taken for read or write. This is common because protection is achieved via RCU and tdp_mmu_pages_lock or because the argument is only used for assertions that can be written by hand. Also always take tdp_mmu_pages_lock even if mmu_lock is currently taken for write. Paolo Bonzini (4): KVM: x86/mmu: remove unnecessary "bool shared" argument from functions KVM: x86/mmu: remove unnecessary "bool shared" argument from iterators KVM: x86/mmu: always take tdp_mmu_pages_lock KVM: x86/mmu: fix comment about mmu_unsync_pages_lock Documentation/virt/kvm/locking.rst | 7 +-- arch/x86/include/asm/kvm_host.h | 11 ++-- arch/x86/kvm/mmu/mmu.c | 6 +- arch/x86/kvm/mmu/tdp_mmu.c | 90 ++++++++++++++---------------- arch/x86/kvm/mmu/tdp_mmu.h | 3 +- 5 files changed, 54 insertions(+), 63 deletions(-) -- 2.39.1