From patchwork Thu May 20 06:49:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12269199 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BB6BC433B4 for ; Thu, 20 May 2021 06:50:19 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A55661019 for ; Thu, 20 May 2021 06:50:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A55661019 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljcVe-00012I-2T for qemu-devel@archiver.kernel.org; Thu, 20 May 2021 02:50:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljcUb-0008Mh-EE for qemu-devel@nongnu.org; Thu, 20 May 2021 02:49:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49863) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljcUV-0000Ex-15 for qemu-devel@nongnu.org; Thu, 20 May 2021 02:49:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621493345; 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=Qb2jTKgpI/8jzWMA/fGcIeY07/BtSeOxotYpWWJgiMA=; b=W0udbSbZ7Tq4VPP88lfpnrL+l54x0DBrLf4tEvB1nPq8Y25VbIfZlsosQnJ+IoBhQNhsBV bgPW2DUUHCbUh1A4Tch0JqJFgCiYWmqfW/qV16g0n75hfX6oLTU+c9T2Kk8ZPRbC49RNFe zn2srKl+fl1xYJb29Yz/IPRW8Hkn8Ck= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-449-Fw5zq195O-qDdhr_9B34CA-1; Thu, 20 May 2021 02:49:03 -0400 X-MC-Unique: Fw5zq195O-qDdhr_9B34CA-1 Received: by mail-wr1-f71.google.com with SMTP id j33-20020adf91240000b029010e4009d2ffso8294258wrj.0 for ; Wed, 19 May 2021 23:49:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Qb2jTKgpI/8jzWMA/fGcIeY07/BtSeOxotYpWWJgiMA=; b=cLZ7U/aPmjLw1OUdSFRtEvw9QAivZcbz2r4DdsosKvuNTTAEsTmLe8cT1Z9inOqVUt Kw+b8nuFsUJfb7OuZ56CQZt/nXDMps6kLl7YHTAa69pPfSX5IRULJDHLwNnKcNPnisdu SvuqIuM2SkHzihHn3Vwlfmo9EZKHj94G/w8oYEneTX948RQZNCfhtdDjJoOcHe/h+e7m B5DfiogaZp6YFF23d0D3EnYyKPJBE3FrM/fkOuWigy00cgwsnzaP1P0ubyuoyYpsAhd5 Vwah+RbMBaBxFxfMjwJv7OvYlPdQrLrX48xwcfFH09kCfrRnSXVh+rB3608zK3nv833w boEA== X-Gm-Message-State: AOAM531rMrcLFVUqrKUhJIUexu5pl5ewL9/IGMD6hE5A3BzqreCsYCeZ +Cd+GP6YeYaV/014wjumTKjy0vikqYHY1vgcBgnmNBlJkYGbad2gRhhNuxrcWni/EbsPqkPzZak QVwdQ1j5RQKbTUQIkawdMLP8SVQ6oF+JK8a2G2o14wGsQMzF+DsA3TAThd71olPxA X-Received: by 2002:a5d:638b:: with SMTP id p11mr2598947wru.90.1621493342542; Wed, 19 May 2021 23:49:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxglwyztEVEdE7RE97jv69WDujaCXZDD23lEnshfpec5hG0doeGDUiwGAL4x6ES7ZT4n/UPJg== X-Received: by 2002:a5d:638b:: with SMTP id p11mr2598931wru.90.1621493342351; Wed, 19 May 2021 23:49:02 -0700 (PDT) Received: from x1w.redhat.com (31.red-83-51-215.dynamicip.rima-tde.net. [83.51.215.31]) by smtp.gmail.com with ESMTPSA id u126sm9580157wmb.9.2021.05.19.23.49.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 23:49:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH] hw/virtio: Document *_should_notify() are called within rcu_read_lock() Date: Thu, 20 May 2021 08:49:00 +0200 Message-Id: <20210520064900.2413612-1-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.39, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Such comments make reviewing this file somehow easier. Signed-off-by: Philippe Mathieu-Daudé --- hw/virtio/virtio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index e02544b2df7..2b4c6c4b875 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2449,6 +2449,7 @@ static void virtio_set_isr(VirtIODevice *vdev, int value) } } +/* Called within rcu_read_lock(). */ static bool virtio_split_should_notify(VirtIODevice *vdev, VirtQueue *vq) { uint16_t old, new; @@ -2485,6 +2486,7 @@ static bool vring_packed_need_event(VirtQueue *vq, bool wrap, return vring_need_event(off, new, old); } +/* Called within rcu_read_lock(). */ static bool virtio_packed_should_notify(VirtIODevice *vdev, VirtQueue *vq) { VRingPackedDescEvent e;