Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp305714rwb; Wed, 18 Jan 2023 18:05:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXtNTIAHWRTJwKWoDFEj0Aj47iM5FarJuR13n1+kgQGTcMgbPFp5nZPcTFekRSbGjxeqcBFM X-Received: by 2002:a05:6a20:939f:b0:b2:3b40:32b1 with SMTP id x31-20020a056a20939f00b000b23b4032b1mr10507628pzh.57.1674093938778; Wed, 18 Jan 2023 18:05:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674093938; cv=none; d=google.com; s=arc-20160816; b=wfYcOOc5jcluwqcsn3C+AMPIHPb5oam4m0PwmMDTMYJnEfFnhsUSErwnYmuTAeAQjy Np5zx9ayQQGbv7uRK0uvbP/+cCK0i4prQDOMWsiILSG47fVdrxSsDzN+u8/IM5v07eA2 6tmwl6czbr53tvZZvmH9TreWpT84sASDd4WtKqde02+DpSmEddp00YBw/NLN8EITs/FW 1lX18BVIDdsbVd5deit/LilqRR+oSYtEl8WFmo06JDjh/QOpQrfuzf0fUrOqBzfFehzA Gzhj/xBkmkxEYvSmt+z12JOcibZQzPuLMNJtLGwgDk1fY/1yj7aZa+5ClgH/9iYugY54 Iyug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:reply-to:dkim-signature; bh=ZZv107PEoZ7dUU2ogNbtUnijM5vb3Ufn5L+9+EzCAVI=; b=Jv0ttxG+Iv5+9yHFahTQEmcMaPZsiYGH18o2ONpgjn60NJgcX/rqUqnzDfKi1y3D0l G9qmdGgRwLnuWGVkSB9812LlQY2OrObFvw+IUn5rbD9r9z529ze/waqrgai2x8L1ifsM Pz8ze0L4llA9o1uKZpPa75hUEnJbEovSHmYjZ21fpog610W1ViGANpHoQHI7WfWwAxK4 bcdmDim2DDNWKjz8cnaOu9/aTl555q+b0MnKUGyskFERYBkBhc0nSwyeMdZe67AoPksb cOMZoCJjCe7pkHhZ0lEPpK0igRA6/Lb5e4Bfii6pCuApAfwmKcTyyxlAmlDmu9iMAiDx 1xVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P1TkrBeA; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y70-20020a638a49000000b004d0b91d7f1fsi3408786pgd.37.2023.01.18.18.05.16; Wed, 18 Jan 2023 18:05:38 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=P1TkrBeA; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229917AbjASBUO (ORCPT + 44 others); Wed, 18 Jan 2023 20:20:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229813AbjASBSa (ORCPT ); Wed, 18 Jan 2023 20:18:30 -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 72099689F8 for ; Wed, 18 Jan 2023 17:15:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674090931; h=from:from:reply-to: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=ZZv107PEoZ7dUU2ogNbtUnijM5vb3Ufn5L+9+EzCAVI=; b=P1TkrBeAk0yTjEc9N7HL3qmsdBJ/Yg3NRfT6uq4jdi0QulREWRyQBthMK81tBZtjiqznKR JF+VdeWrSwvi1dZaBSFhJFuK+/vRAvVgJ/ZhOsiBKCjgdPnNM4k7WZ8AxwviIqH6rvJbcJ Bb3Q+kSiICJCQvjaBpZvrmw72om3R3A= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-576-sWqiQAGPNpGZJVwQZ2CABw-1; Wed, 18 Jan 2023 20:15:26 -0500 X-MC-Unique: sWqiQAGPNpGZJVwQZ2CABw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8BE1F8A0109; Thu, 19 Jan 2023 01:15:25 +0000 (UTC) Received: from [10.64.54.98] (vpn2-54-98.bne.redhat.com [10.64.54.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A89452026D4B; Thu, 19 Jan 2023 01:15:18 +0000 (UTC) Reply-To: Gavin Shan Subject: Re: [PATCH 4/4] KVM: Improve warning report in mark_page_dirty_in_slot() To: Sean Christopherson Cc: kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, pbonzini@redhat.com, maz@kernel.org, corbet@lwn.net, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, ricarkol@google.com, eric.auger@redhat.com, yuzhe@nfschina.com, renzhengeek@gmail.com, ardb@kernel.org, peterx@redhat.com, shan.gavin@gmail.com References: <20230116040405.260935-1-gshan@redhat.com> <20230116040405.260935-5-gshan@redhat.com> From: Gavin Shan Message-ID: Date: Thu, 19 Jan 2023 12:15:16 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 Hi Sean, On 1/18/23 2:42 AM, Sean Christopherson wrote: > On Mon, Jan 16, 2023, Gavin Shan wrote: >> There are two warning reports about the dirty ring in the function. >> We have the wrong assumption that the dirty ring is always enabled when >> CONFIG_HAVE_KVM_DIRTY_RING is selected. > > No, it's not a wrong assumption, becuase it's not an assumption. The intent is > to warn irrespective of dirty ring/log enabling. The orignal code actually warned > irrespective of dirty ring support[1], again intentionally. The > CONFIG_HAVE_KVM_DIRTY_RING check was added because s390 can mark pages dirty from > an worker thread[2] and s390 has no plans to support the dirty ring. > > The reason for warning even if dirty ring isn't enabled is so that bots can catch > potential KVM bugs without having to set up a dirty ring or enable dirty logging. > > [1] 2efd61a608b0 ("KVM: Warn if mark_page_dirty() is called without an active vCPU") > [2] e09fccb5435d ("KVM: avoid warning on s390 in mark_page_dirty") > Thanks for the linker. I was confused when looking at the code, but now it's clear to me. Thanks for your explanation. How about to add a comment there? /* * The warning is expected when the dirty ring is configured, * but not enabled. */ Thanks, Gavin