Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1526627imn; Sun, 31 Jul 2022 10:28:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vgUMixTWFAoImVIIS3PoN4c+Akhm8A/M+TIpWK4tJpr5c+fZfpqjxNI2Gg4/9DfedNs4XX X-Received: by 2002:a63:164d:0:b0:416:4bc:1c28 with SMTP id 13-20020a63164d000000b0041604bc1c28mr10340949pgw.302.1659288487432; Sun, 31 Jul 2022 10:28:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659288487; cv=none; d=google.com; s=arc-20160816; b=LC8o0AesRl5PUT+5xqJSlpHBMJbPIfWHQb3rAGlheiLFqEIuyX0DgRiRDUFefr53NC bvF7mRncms/bt1n7FfHmJN0iRsG1jMjTPIFL/IVjVAgbJN9Gs7jAETYokK7LSQpuW2nd uLJlVb5HvpDq1APDyY2ZzoJn4IYy284snubzQgr4cSf9F0BLenOPz29qO8BBUwMMKnlW D1aMM1+stSH6wh7VOdU5nHcQYtAnVmT3mYfCxLw6Jxds3HIx3yZNMsMUCxTd+JqxujsX /Ab8fHaUrZVCV/R4ygiNFzU7ELs2USO23IivaugTatincvp/AIoKRoyV5xORGU2QkLXa rVfA== 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=24i1iP17Pys2EgrxvKMIZ67cALEcVNy3fXkRCteg5Wc=; b=UEzeBBHDKW31fN7aaFVyDsOTDdYVG6adCChqF2/IlqO8GGXBstKtIlRorgsjDm2k32 DFNsBi2HyG+iAx3x6uiYW9kqRXmNjdx69V8lorBQWnVw+HIk3+6/NUUZnve6Au33JOr3 GGKJG2sTZmwNjrmhupYtuk01n4jJMFI9zBKJmrm5bS89SVaJhVUqz60jzQQd7697FnOc 2inCZxpHuKzst8XzBlurmooMmhAVzSQov4J6saHkPc3Bl/KwWnUsRxFeD4mTATaPVFUN Ej1C8XkKEW7NIivJqgjI4st0RMSafgeRrM1i9FNUbuIlljNLU+n2cjp2fFKtJ0pYRRQk Jdsw== 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 li5-20020a17090b48c500b001f4fc831538si1134150pjb.64.2022.07.31.10.27.52; Sun, 31 Jul 2022 10:28:07 -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 S237383AbiGaRBz (ORCPT + 99 others); Sun, 31 Jul 2022 13:01:55 -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 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 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