Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2543033imw; Sun, 10 Jul 2022 08:56:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1segG/FDWpdt/p3lJLmkL2TbvXg1TyS30PPYWY0soKxN485bOrKgfYFEU756qlg+JKzSdPQ X-Received: by 2002:a05:6402:b34:b0:435:d064:8762 with SMTP id bo20-20020a0564020b3400b00435d0648762mr19081271edb.238.1657468563879; Sun, 10 Jul 2022 08:56:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657468563; cv=none; d=google.com; s=arc-20160816; b=eyNr5/IRjKoD5saE3WvlZO2dYPtLWAk51XTxF3VrmW8BmYHxoVShYABmMG1hOCRsrv 8GyH6CFyRLkS5JPl6upeVgkdEVuGxwEfEdh6qjHVyUXEhAMXIxVLyL5cVp8rAhNAh7hI lSBB/YqLXJ5sU7nLJCZF95QSetmbwfAr0+/7LXNrx2t5rwdSDcU+Wq+qakmZvtrX6iWw k8qIylydSA5t9kvYm6kSTIs03rhVMDljg6um0LJno65fjXJ3KrAmrIvHelqPQTttz2VA v5id0cSem7yhogroNJ17M5m01k4vwWWIivpwDfqMsTsLV7n3dDlkev5MasYS9PuLft4M z7Iw== 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:subject:cc:to:from:date; bh=EfIqAFJA/5JlGUKWO69sU4SJTjkVnoD8LWpVrZu/i2A=; b=HUTpER+6dMmXdhp+zafwBhQQUKpn98fg4FROW4eMmnsKeVbGmS0fEx2ke7SOLnaFFZ RL10nYQexq1c1Knocg3xlMbr7kml3Ka5DR4KJPbH9wLCyqTHviDmRT6Ec+/HkIemvG0B XsIHQYvl8srR7UnYeqbdnAHgq6wmsx01bRZ0yioI+O3Y7Sz0jNBZaMgpgohjITceU/I3 AilVfbZaBO/yU8yYGwYUce+AB80VyaH7witacqA24ExUGvyqoB3289ZAr8BP2NJE3DzJ M+paC/PIJ5cdOWPi7medgoWqeUgVBbOa7H9kIm+LNjIuqV5QNYnXIunJG2xRM028F1E6 WI+w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq37-20020a1709073f2500b006f3969d2189si8069699ejc.576.2022.07.10.08.55.38; Sun, 10 Jul 2022 08:56:03 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229614AbiGJPmv (ORCPT + 99 others); Sun, 10 Jul 2022 11:42:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbiGJPmt (ORCPT ); Sun, 10 Jul 2022 11:42:49 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4C7412A82; Sun, 10 Jul 2022 08:42:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 66FD1B80AB1; Sun, 10 Jul 2022 15:42:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0595EC3411E; Sun, 10 Jul 2022 15:42:43 +0000 (UTC) Date: Sun, 10 Jul 2022 11:42:42 -0400 From: Steven Rostedt To: Tao Zhou Cc: Daniel Bristot de Oliveira , Wim Van Sebroeck , Guenter Roeck , Jonathan Corbet , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Will Deacon , Catalin Marinas , Marco Elver , Dmitry Vyukov , "Paul E. McKenney" , Shuah Khan , Gabriele Paoloni , Juri Lelli , Clark Williams , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org Subject: Re: [PATCH V4 01/20] rv: Add Runtime Verification (RV) interface Message-ID: <20220710114242.745d65b3@rorschach.local.home> In-Reply-To: References: <60548902dbccaa7ba420e40e46835693e27f643f.1655368610.git.bristot@kernel.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Sun, 10 Jul 2022 23:11:43 +0800 Tao Zhou wrote: > The @*pos of enable_monitors_start() can not be -1 or other negative value. > And I checked that the *pos is 0(right?). That is safe. Sorry for not being > that ture and maybe this is a notice here. Because if it is a negative value, > the returned m_def is a point to a data place 16 bytes before &rv_monitors_list. > That is a not ture rv_monitors_list stucture data. But it is not possiable now. > Maybe "inspired" from your question. Look it more, I image this simulation. > If the monitor(and all is enabled) is more enough to let the *pos to increase > to -1. And the returned m_def is last monitor that returned from enable_monitors_start(). > The enable_monitors_next() check from the last monitor and return NULL. > Only show the last monitor. This will not really happen I think. > But I am not focus enough to the seq file code or others now, so this may be > more possible to be not right. Late reply continued from me.. So basically you are saying we should have: > +static void *enabled_monitors_start(struct seq_file *m, loff_t *pos) > +{ > + struct rv_monitor_def *m_def; > + loff_t l; > + > + mutex_lock(&rv_interface_lock); if (list_empty(&rv_monitors_list->list)) return NULL; ? Probably safer to have that. -- Steve > + m_def = list_entry(&rv_monitors_list, struct rv_monitor_def, list); > + > + for (l = 0; l <= *pos; ) { > + m_def = enabled_monitors_next(m, m_def, &l); > + if (!m_def) > + break; > + } > + > + return m_def; > +}