Message ID | 20231125083400.1399197-5-pbonzini@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp1810862vqx; Sat, 25 Nov 2023 00:34:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFoEPEqexQMS9WE2hjYfU6g5tGG1b0msnO+5OJpX2qxv1CEO3mXRStq9i8Llz+USJmq/DoV X-Received: by 2002:a05:6a00:1914:b0:6c4:db03:d20f with SMTP id y20-20020a056a00191400b006c4db03d20fmr7209627pfi.17.1700901260526; Sat, 25 Nov 2023 00:34:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700901260; cv=none; d=google.com; s=arc-20160816; b=Wj/+91i2KVYZ8WqSdZwdax5dwF9WRo+S2RSg0o1f2dmVcVSJWfTleBCIHll0nayhom 1Bv8VIPbBtD6K2aE4dV7nHbp2fjDpybz6Flw0jatvg6FSU3sgRlRtzQK3fuCz9oVI1m8 +h/grgKrEla4TU4qseZ9KLW5z9xMRV+cU8EysBJfn+09MKBpS2w7m05Ih6zFNWTPVhy0 BlYhFYHFRVkSVVmBQVatiaW8LBvV4esUSy6Uh5Dwro/SINyrR4RuPcdLYjnDg3/LprOh ONiORkr4h5Q6lpZiSkSHjXOT4RLNanos1BKfOfz1Os8p7/nVUNjW32f1pxM3BWrTdQxC GvrQ== 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 Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id h22-20020a056a00219600b006b0cfed2c77si5314688pfi.135.2023.11.25.00.34.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 00:34:20 -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 CDD0780952D2; Sat, 25 Nov 2023 00:34:17 -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 <rfc822;ouuuleilei@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <pbonzini@redhat.com> 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: <linux-kernel.vger.kernel.org> 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:18 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783524240047051755 X-GMAIL-MSGID: 1783524240047051755 |
Series |
KVM: x86/mmu: small locking cleanups
|
|
Commit Message
Paolo Bonzini
Nov. 25, 2023, 8:34 a.m. UTC
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 <pbonzini@redhat.com>
---
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))