Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3378208pxb; Mon, 17 Jan 2022 19:03:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzYnFV1r+eaqTsPW6Cc1S1Bm70W+CdFspEMEuQBfTAvDw2jb7RZweKiGT1g0uwzVmX1WlAQ X-Received: by 2002:a17:90b:224c:: with SMTP id hk12mr28196436pjb.62.1642475021431; Mon, 17 Jan 2022 19:03:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642475021; cv=none; d=google.com; s=arc-20160816; b=S7dw1edIqK+F/W1mYkH2Ggcl+/yTLBPqR5QJr0pK3bIc5lipnWrPpCQnLR4t+7FXOa XMACfxfYuzTm8oOKKl9W+YfhP8BzppgqiOMFm9wI3AnDtLCJcWpaKG9954zbCXRkx6dw 243inp87eFiZmv5Q/Jl1oycM2iWW71S+tirDvWkETGHiix7bMJn14tt5qq5p+VWn30gv pe7Xuw6ER8SL8vAJSNaqmjSBdhpzke3vQpu1IAhcVGB41LdDjzNycuaBM9s3ZWHI75XB oyPzv3V84xrZ/jOtDyBMP1NZohqyZ2Mr3Zg0sbpLtN+EAmov+DGEY4Hd4iAUOqAgb54y v9JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=J6GKKmupfWWlnbgXJKPfzJduT4T53vFjxxafbxuWCWg=; b=tPw4DP8Z1HevzCDhXKCn1NdJDkjRH3GoQIRZDTen49VGEa66R6zE6S3wVEHcXnIEaM OgzTWQdAzNGhSlYdr8br9f6oM8/SIArg21Tq/EOjZHHy/pkq1nfZbHawFP3sCAnxE47B OjbI5RcEjnkQXBJqTQr9blMkiuCsxLtKeJ7pfMOf1gIqzjJpStaJXfxF6zIlrHDKTJC6 AreCfdxFdg0gaZiVdQf/7FpEpRZmdTHYyXYw0BE2LYCS4BwwhTbexIYN4r19HvHFCn1r 2Z5NwRIaeMZxHR1OgnZkYF9v/5Qt18t7+CAjjvKwxAVkzdNDFjpaKA6eNwnDwd3/uBhj gbwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=petsnc8l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t200si14891716pfc.292.2022.01.17.19.03.28; Mon, 17 Jan 2022 19:03:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=petsnc8l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243639AbiAQWeB (ORCPT + 99 others); Mon, 17 Jan 2022 17:34:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243622AbiAQWeA (ORCPT ); Mon, 17 Jan 2022 17:34:00 -0500 Received: from mail-ua1-x92e.google.com (mail-ua1-x92e.google.com [IPv6:2607:f8b0:4864:20::92e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0E1FC061574; Mon, 17 Jan 2022 14:33:59 -0800 (PST) Received: by mail-ua1-x92e.google.com with SMTP id m90so33227259uam.2; Mon, 17 Jan 2022 14:33:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=J6GKKmupfWWlnbgXJKPfzJduT4T53vFjxxafbxuWCWg=; b=petsnc8lPMN850o8bB7rXXqsr7jTek96Ibwh+lLVqGy1nC6IOknt0HnjXjpcmfOEqm N/8+yo35F8ZgjCaaeqzv1NMEfg7Pt8yXnHz6muenSeqEVoSTHjOUb8xy/SD9+ryVqwn6 Fj5lk09WqWsy0Kf+4puiN1ivWTVcYpLYEq9dkw1ntuRXpuYJsqjg/5AdiWeRYvAMh/iN k7pZNkMA5uha61nx/Z/SLrNpCkLup0vmUItmGaIpaQHallceNw9mza3k38ierx/W2LY8 aPSdCBM1OrasuuvSjuu8RVtTHKm6rIkCTLJs18gthrAO1slm8npdnXZLDIRFkAoEm8T9 4tSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=J6GKKmupfWWlnbgXJKPfzJduT4T53vFjxxafbxuWCWg=; b=Zk0L9Vy+w1wKF7NyZezZg6A0ZWJd4GAK12pysRr11xEoR8cBwR3qWAyFRermwB9chH i4N6RN0noLa8haNJD6whkT8CNpTkvlfuNe8WR5iB2SJfxxezOT/V950B/FDYKOsEONXb AjImBRD/1GShpHj8dYYnyJwkW5qV+22t4JrYosKcpdAsrqT3otEk3vfsTI02x2KToMjM HtxCd/Wrm7lzYc025XNHLJxsIrhY2OfzteulXqHEpCjKoNCi21pMRDN4U5rToGh6UD6v 059cOFdJs20wzrvjv9D89j25DF4HSXdAziFijnRpAPAu9fBi/PP9msfyx0DfySzNwgbT zMJA== X-Gm-Message-State: AOAM531LCUdEfe6HOx/pUsNy8Tx2MpgJ5rotVr4AIc/TC9AY7xOkhxRm 4tkDCxEPaVYdYPoowTBkLP0s+l7q6tNhhQRvuUw= X-Received: by 2002:a05:6102:3f56:: with SMTP id l22mr7888725vsv.20.1642458839004; Mon, 17 Jan 2022 14:33:59 -0800 (PST) MIME-Version: 1.0 References: <20220107052942.1349447-1-jim.cromie@gmail.com> <20220107052942.1349447-2-jim.cromie@gmail.com> <20220114115718.GB23983@axis.com> In-Reply-To: <20220114115718.GB23983@axis.com> From: jim.cromie@gmail.com Date: Mon, 17 Jan 2022 15:33:33 -0700 Message-ID: Subject: Re: [PATCH v11 01/19] dyndbg: add _DPRINTK_FLAGS_ENABLED To: Vincent Whitchurch Cc: "jbaron@akamai.com" , "gregkh@linuxfoundation.org" , "linux@rasmusvillemoes.dk" , "rostedt@goodmis.org" , "mathieu.desnoyers@efficios.com" , "daniel.vetter@ffwll.ch" , "seanpaul@chromium.org" , "robdclark@gmail.com" , "dri-devel@lists.freedesktop.org" , "amd-gfx@lists.freedesktop.org" , "intel-gvt-dev@lists.freedesktop.org" , "intel-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "quic_saipraka@quicinc.com" , "will@kernel.org" , "catalin.marinas@arm.com" , "quic_psodagud@quicinc.com" , "maz@kernel.org" , "arnd@arndb.de" , "linux-arm-kernel@lists.infradead.org" , "linux-arm-msm@vger.kernel.org" , "mingo@redhat.com" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 14, 2022 at 4:57 AM Vincent Whitchurch wrote: > > On Fri, Jan 07, 2022 at 06:29:24AM +0100, Jim Cromie wrote: > > #ifdef CONFIG_JUMP_LABEL > > - if (dp->flags & _DPRINTK_FLAGS_PRINT) { > > - if (!(modifiers->flags & _DPRINTK_FLAGS_PRINT)) > > + if (dp->flags & _DPRINTK_FLAGS_ENABLED) { > > + if (!(modifiers->flags & _DPRINTK_FLAGS_ENABLED)) > > static_branch_disable(&dp->key.dd_key_true); > > - } else if (modifiers->flags & _DPRINTK_FLAGS_PRINT) > > + } else if (modifiers->flags & _DPRINTK_FLAGS_ENABLED) > > static_branch_enable(&dp->key.dd_key_true); > > #endif > > dp->flags = newflags; > > -- > > 2.33.1 > > > > I haven't tested it so I could be mistaken, but when > _DPRINTK_FLAGS_ENABLED gets two flags in the next patch, it looks like > this code still has the problem which I mentioned in > https://lore.kernel.org/lkml/20211209150910.GA23668@axis.com/? > Yes, thanks for noticing. I missed that detail. Apriori, I dont know why bit-and of bit-or'd flags doesnt cover it, but I will take a careful look. > | I noticed a bug inside the CONFIG_JUMP_LABEL handling (also present > | in the last version I posted) which should be fixed as part of the > | diff below (I've added a comment). > | [...] > | #ifdef CONFIG_JUMP_LABEL > | - if (dp->flags & _DPRINTK_FLAGS_PRINT) { > | - if (!(modifiers->flags & _DPRINTK_FLAGS_PRINT)) > | + if (dp->flags & _DPRINTK_FLAGS_ENABLE) { > | + /* > | + * The newflags check is to ensure that the > | + * static branch doesn't get disabled in step > | + * 3: > | + * > | + * (1) +pf > | + * (2) +x > | + * (3) -pf > | + */ > | + if (!(modifiers->flags & _DPRINTK_FLAGS_ENABLE) && > | + !(newflags & _DPRINTK_FLAGS_ENABLE)) { > | static_branch_disable(&dp->key.dd_key_true); > | - } else if (modifiers->flags & _DPRINTK_FLAGS_PRINT) > | + } > | + } else if (modifiers->flags & _DPRINTK_FLAGS_ENABLE) { > | static_branch_enable(&dp->key.dd_key_true); > | + } > | #endif