Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1513263imn; Sun, 31 Jul 2022 09:56:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t8x7zVTYHjEld8qOrHSpH9tCHh/gZKQF6Tn0+f8Pqn4O97LJACs+ojJr4B8tz99XDkdcPP X-Received: by 2002:a17:907:1c95:b0:72b:4e37:7736 with SMTP id nb21-20020a1709071c9500b0072b4e377736mr9530321ejc.516.1659286577048; Sun, 31 Jul 2022 09:56:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659286577; cv=none; d=google.com; s=arc-20160816; b=BYmp6t12ptvqXgg5PJP931Fp8GcTsyMhI/TgGctB1+vVxGbh4SqKQwdePNsZXRU0/Y 2ZZgF3uA0AFc0J/H5Rs7ObyMUxCSr/yvDs2EcPYAkcZBqP3gbLr8dFdMQvoQr4t5JVgR 67yUzTD1e+CAB8S/otjGDGIL5lfR85TsTpl7bwmQfiKyYvRDsDSG3kBkwx5TawbD0XRC /u8r8a67G8Gvpc+dT7r5JaSE3D77R1oETYeQ1ikr70KPZJqasaSRg/6Us6d5srk4fSnC ZkXp+0Q5eHqa+oZTqhoT+il6ui5rGwnDldxwfPd37c7C4Ic6BUj+iHIQPljFGQujutdI 3Bvg== 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=+A9asodcLBgYni0HP+2v1ii7zhl6U3O/HEiJb8QUemg=; b=Ea9Y3o5PLxp6bsfmVTm+7R1aA9mX2SSthLPQ27YNgbQkmcb+UnLSEwRrvBjZuVOUP8 eWOIHtRRd/nLbqBTl9PsStFVgPbgRJw9Yvv30aZfGsmiqWUxJvQPHx0pFPBzaMWvDVG/ pYGCVxx0R7axZGqc9gN/sif0acB/8xXSSnIrB66pAANSo1iPfErdeIiYEU/g1EzpyDIx sZ/wh53NKOBYC/tsHmqr6bFnt3Lu5yx6Eoyzv3K55wiQ1VJp1sHb41idHaOX+8RXaLmk bTOtw6JtGdSPa/QuCbo/uwfoG3XaYQa/DFVYqkhhvztV1sS0MJkt430yrDjpZKot7/Rs nhww== 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 gr19-20020a170906e2d300b00718d2d8bfbfsi8644313ejb.316.2022.07.31.09.55.51; Sun, 31 Jul 2022 09:56:17 -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 S229577AbiGaQrl (ORCPT + 99 others); Sun, 31 Jul 2022 12:47:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229558AbiGaQrj (ORCPT ); Sun, 31 Jul 2022 12:47:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B097DE011; Sun, 31 Jul 2022 09:47:38 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4A57360F68; Sun, 31 Jul 2022 16:47:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4F1AC433C1; Sun, 31 Jul 2022 16:47:36 +0000 (UTC) Date: Sun, 31 Jul 2022 12:47:30 -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 , Randy Dunlap , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org Subject: Re: [PATCH V9 01/16] rv: Add Runtime Verification (RV) interface Message-ID: <20220731124730.311c8207@rorschach.local.home> In-Reply-To: References: <0197dd47-ea15-4d8b-5fc7-e466d8a501a7@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 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, 31 Jul 2022 23:06:31 +0800 Tao Zhou wrote: > > All things above are misled by the first interpretation but,,, > > Yeah, this is not that clear from my above words expression. I said the return > value of da_monitor_init_*() will be 0, but it is not right. Global and per-cpu > monitor will return 0, per-task monitor may return a positive value when the > slot is equal or greater than RV_PER_TASK_MONITOR_INIT(how possible this will > happen I do know yet). This is from reading the current code implementation. > I just want to say that there may be a bug here. Well, rv_get_monitor_slot() can currently only return 0 or negative. This is because PER_TASK_MONITORS is just 1 and we can not return that or greater. > If rv_enable_monitor() return a positive value and the error happened(as above With the current code this can not happen, as we only allow for a single PER_TASK_MONITORS. But in the future, if we increment this, then you are correct. We can not just check retval, but need to check retval < 0. This does need to be fixed. But because it currently isn't an issue because we they can only return 0 or negative, I'm going to pull this series in. But Daniel, these checks do need to be updated. Please send patches on top of this series to address it. -- Steve > said), user space will not know this is a error return value, but regard it as a > right writing. Even if the return value(the slot value not in [0..RV_PER_TASK_MONITOR_INIT)) > is equal to count of charaters that are writen to the file(the string length of monitor name), > it will still be not a right writing. >