Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1730231rdh; Sat, 25 Nov 2023 00:34:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2iXsnsda0w3IM0VyeQzmOoNE25/1C5ofZ3mZb5SgMoYlgMXmMZiRusPppxZGdyy9uhSkU X-Received: by 2002:a17:902:e5c6:b0:1cf:a246:6f4f with SMTP id u6-20020a170902e5c600b001cfa2466f4fmr6411820plf.27.1700901268481; Sat, 25 Nov 2023 00:34:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700901268; cv=none; d=google.com; s=arc-20160816; b=i1sPf5thMrgGNB4OBJzAdkglJKAzPDSzbUTTsA+c8lsBhOuCpiozytd0gccM5c3jVL 7MHomJUFOqbHoP9JtR4/btAR9HODoXRuxjxoBS3hSrzjgj0+3IrEigxIQCmzeIYj8XAv rFfIn2V9gVA3hC6Azo8X/iv+IPEHuHn8iiZO+1kEGxU2uNJBlRjeY0Tr6Kog3yRAT57X OtbbiRX2lKQjAMU45WsqOFoB447nu+FXFTTt+eoi1BrsOJCOgRkl5QJ+MVO+AoeD6gJa 3oOEnZ56qYllPRjOhoVpBTq+o4lWJMOqfG0NcWULH5TOI8UphCf9ZBXsFbr9o+TgVj2x VNJA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=37TsTYXqNHIurQZSI6nP6/rFe+8uy0S4I2sdRSNsCA0=; fh=N32iRfdmtUaFGM6Wv4hOFyVMk9QXa1NYAPuS9uUR97A=; b=H/u+dTulgxSJZNuETXx+0qDy5K/2ZBMSEFcQsZ0Kk/WHMU44HvDLeou59RNqwK3A3O omaZfZSOpnvGeeHKJmIGFdqacNQ2nc/YUncivuyU6/jnrQFawl8QETIK+Rrzpn7Tl0fn Lk4wvZqybSu4oP917DOtz5sI21cZulEW7LcFqNc1FcAQLixgZz1cy9jRf7SO0UVugSjp u2AlPP9UZMe9GW9s/BjGOzdi0HOvG6IOBhTpJSAdOVYyLU7aJ+kaLCG1SUpQxK1bKgu6 lP2rF3WXPO7T1n7a8aklI1Ki0CN1vkaENJp4VY5Otpzk1PSnYY9LUK8KvjcgcY5F5HrK q+Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HJZoy4TF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id i18-20020a17090332d200b001c9c3212c88si5443988plr.253.2023.11.25.00.34.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 00:34:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HJZoy4TF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 426B0809EE26; Sat, 25 Nov 2023 00:34:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231804AbjKYIeD (ORCPT + 99 others); Sat, 25 Nov 2023 03:34:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229550AbjKYId6 (ORCPT ); Sat, 25 Nov 2023 03:33:58 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E82F61B2 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=1700901244; 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: in-reply-to:in-reply-to:references:references; bh=37TsTYXqNHIurQZSI6nP6/rFe+8uy0S4I2sdRSNsCA0=; b=HJZoy4TFwsSlkfNj5t+rT8wY7NxVDiE8BUmvTbaKCnzDKS+IAPS7bsnYlYgAieKvTahgfQ c4QJREBt8Wnib362U3WJX/AXOrH0h2k30DxqZsRFV2hVv3Yw62CcZYhQq19VV6hczKl1CI HV1wlMhTHeJ8VUSAVhlgECKTqy3UWbo= 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-456-ekSR8i3BPkK372lj5BasCw-1; Sat, 25 Nov 2023 03:34:02 -0500 X-MC-Unique: ekSR8i3BPkK372lj5BasCw-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 EAD6A82BA81; Sat, 25 Nov 2023 08:34:01 +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 C8B081121306; Sat, 25 Nov 2023 08:34:01 +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 4/4] KVM: x86/mmu: fix comment about mmu_unsync_pages_lock Date: Sat, 25 Nov 2023 03:34:00 -0500 Message-Id: <20231125083400.1399197-5-pbonzini@redhat.com> In-Reply-To: <20231125083400.1399197-1-pbonzini@redhat.com> References: <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 fry.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 (fry.vger.email [0.0.0.0]); Sat, 25 Nov 2023 00:34:23 -0800 (PST) Fix the comment about what can and cannot happen when mmu_unsync_pages_lock is not help. The comment correctly mentions "clearing sp->unsync", but then it talks about unsync going from 0 to 1. Signed-off-by: Paolo Bonzini --- arch/x86/kvm/mmu/mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 1cb81573a60b..a71b8813febe 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -2840,9 +2840,9 @@ int mmu_try_to_unsync_pages(struct kvm *kvm, const struct kvm_memory_slot *slot, /* * Recheck after taking the spinlock, a different vCPU * may have since marked the page unsync. A false - * positive on the unprotected check above is not + * negative on the unprotected check above is not * possible as clearing sp->unsync _must_ hold mmu_lock - * for write, i.e. unsync cannot transition from 0->1 + * for write, i.e. unsync cannot transition from 1->0 * while this CPU holds mmu_lock for read (or write). */ if (READ_ONCE(sp->unsync)) -- 2.39.1