From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC509C00140 for ; Sun, 31 Jul 2022 17:01:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232894AbiGaRBy (ORCPT ); Sun, 31 Jul 2022 13:01:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229879AbiGaRBx (ORCPT ); Sun, 31 Jul 2022 13:01:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC89F765E; Sun, 31 Jul 2022 10:01:52 -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 7940F60F52; Sun, 31 Jul 2022 17:01:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02B2EC433D6; Sun, 31 Jul 2022 17:01:50 +0000 (UTC) Date: Sun, 31 Jul 2022 13:01:44 -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: <20220731130144.26576a6a@rorschach.local.home> In-Reply-To: <20220731124730.311c8207@rorschach.local.home> References: <0197dd47-ea15-4d8b-5fc7-e466d8a501a7@kernel.org> <20220731124730.311c8207@rorschach.local.home> 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 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org On Sun, 31 Jul 2022 12:47:30 -0400 Steven Rostedt wrote: > But Daniel, these checks do need to be updated. Please send patches on > top of this series to address it. I believe what Tao is trying to say is this: If we set RV_PER_TASKS_MONITORS greater than 1 we have: int rv_enable_monitor(struct rv_monitor_def *mdef) { int retval; lockdep_assert_held(&rv_interface_lock); if (mdef->monitor->enabled) return 0; retval = mdef->monitor->enable(); <- if that returns positive, then things break. if (!retval) mdef->monitor->enabled = 1; <- this is not set. return retval; } static int enable_wip(void) { int retval; retval = da_monitor_init_wip(); <- if that returns positive, things break if (retval) return retval; static int da_monitor_init_##name(void) \ { \ int slot; \ \ slot = rv_get_task_monitor_slot(); <- if this returns positive, things break \ if (slot < 0 || slot >= RV_PER_TASK_MONITOR_INIT) \ And we probably need slot to be negative if it is greater or equal to RV_PER_TASK_MONITOR_INIT. return slot; \ int rv_get_task_monitor_slot(void) { int i; lockdep_assert_held(&rv_interface_lock); if (task_monitor_count == RV_PER_TASK_MONITORS) return -EBUSY; task_monitor_count++; for (i = 0; i < RV_PER_TASK_MONITORS; i++) { if (task_monitor_slots[i] == false) { task_monitor_slots[i] = true; return i; <- if RV_PER_TASK_MONITORS > 1 then it can return positive! } } -- Steve