Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1167902rdh; Fri, 24 Nov 2023 06:39:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGoglS5JCXAePOH0IxviEVhpsA//GqdMAqxDa5v69vm/5dJA6nxJgEX52wuuZE3vA0nFtCb X-Received: by 2002:a17:90b:3b4a:b0:285:8cb1:7f1d with SMTP id ot10-20020a17090b3b4a00b002858cb17f1dmr2034035pjb.5.1700836758115; Fri, 24 Nov 2023 06:39:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700836758; cv=none; d=google.com; s=arc-20160816; b=aDs7BUuHKB+F7iygK0amgz3RclaC51ctxCeELXAFNzVAvM+FFzOZQrmwRY4TnYaZrB ClEQzgqUNI/NiMPXXU6D9g9vhVk0Gp535ZGGsSvRJ+VVrnQGSujIk3WCkOEqDtoPUvW5 LZ/kxwn9qwbIcQJIdoXQCbL62RNPVZcMvZdk33TGZ4mWFCjka5BysF4SZ6fpiC+s2U5u TWsvKoYvz5S9cmcseI8wiQD1IocM3kalULEKrbQ0DwEVDkHLNRGmCUPtqknZ9BlBW7uN xZpGEYOUZ7PeqDcGu1qiFai7pL0z5S6XfrgIVD8p7XuBZpH3/GfA+XvrC9cPkJbf0OXk uKdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=oIB5HI2zbPMViiXeUmcjMKe9UaMCUWxP4QpCG/rkGCE=; fh=NMgy5oHahtbhy9u5zn+3x1JMf5lox5NTaDL9xJ5QA8M=; b=E5bOWevzWRXPQoBbMCJARO/jk9tJgzIvqsVStsJO8+Ge/gJjOjSZjGUmaJJNZxg8E0 BWS6ZYSIPSOrv/ewX6ovD1hHYHSzE7cYxM9uQRsov9A/s6fZQLAECHMzmDqUN8vkRnrv Ia1Yjm5Ua4QdJUoTX+QeqUkffS3KlKKzM/Uf+M4/qOMxYjt7oqj2hkTNFthTam7JJMDQ CIdvuhfPJXLrHOO8A/VlsQoqu/dX7piEhHiHGA7JAUJJDLR+ZzH36SAb1F2STbCk/p37 yS+DCkO53lSFg0IyjYNCQ3F/kW61yGoPnySm6u5Gmqk+LCWn0t4KgOJj2FpMfGh5irFj JyIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=C424cdNR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=semihalf.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id y8-20020a17090322c800b001ce6693d6edsi3676954plg.370.2023.11.24.06.39.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 06:39:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=C424cdNR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=semihalf.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2D5A281668B2; Fri, 24 Nov 2023 06:39:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230523AbjKXOjB (ORCPT + 99 others); Fri, 24 Nov 2023 09:39:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230499AbjKXOi6 (ORCPT ); Fri, 24 Nov 2023 09:38:58 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 757E11718 for ; Fri, 24 Nov 2023 06:39:04 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-50ba71356ddso170380e87.1 for ; Fri, 24 Nov 2023 06:39:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; t=1700836742; x=1701441542; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=oIB5HI2zbPMViiXeUmcjMKe9UaMCUWxP4QpCG/rkGCE=; b=C424cdNRJxG2M7uQnzJ/m+1NW+UG8kkgo9DVjdW424urv97A9F+VYO8P8f6M8yMS9F tubI70+/qnoDNHzqcpk/SFRA7ia5DDcs9z8uVI69PygLLFstoZYS1FeVjUy3G3/NO/8t 6RkaVxXv3RfINyD4GOLdyVPCCe3FRfoLEKBS/DinkkywmfwLDnlfDaYhtO7If6CQF0cG kwhpMk29JQ1JIQUAaibw3xAFN2hT2ogT8m/lqXzWH5eWXCXgKrv+C9OsoiQKhgGDP6U+ jiQp91cnMiqpe1yvo6/w+M0PmTBjOl03t40ES3IbuoIg95DBotH1Fu94vLzzhsgGXfD2 kiyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700836742; x=1701441542; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oIB5HI2zbPMViiXeUmcjMKe9UaMCUWxP4QpCG/rkGCE=; b=n3ekCLhXER1HGvuZFpMHdZ0zI9spJlJD0Uy6EeF1FRipuzn5ozUds/vSCi3Ck3hA+h Ux/v/LRk+fopIHdSU0JmUy+FAMh3aj/uSaZ99BSy5Vr7oIHVosS69Sx7SErg+uiR2t+R qiR7P7qKde+Ew1B4iUNKsuePhhhd/3v7itUb1BLN91QRyjtfdfRlXKDfX7dZED0Gr7xw 8wWQyaAvmbnIewjfUsxNSDWA1fxp6pTMtDZ/I2Fy+c+AKhidiUKyKrNymwSKVOZEuBA5 zapIC9hxawQ+jHpFeXsD9HYI97Ngi485fgaHBHazD6aDIFhulqV1yYvO4ILoCyAzKcHo gceA== X-Gm-Message-State: AOJu0YzDZCsR/x/f+E81nHFSqtVhg6YWDHSGnglOgwQll4UO2C4wZlOZ 2WnDD+4e/TunN8iT5oEvpzgT4c/SMuxGyQMgbmBO X-Received: by 2002:a05:6512:2805:b0:509:5d4b:44c4 with SMTP id cf5-20020a056512280500b005095d4b44c4mr2977498lfb.1.1700836742323; Fri, 24 Nov 2023 06:39:02 -0800 (PST) MIME-Version: 1.0 References: <20231103131011.1316396-1-lb@semihalf.com> <20231103131011.1316396-8-lb@semihalf.com> In-Reply-To: From: =?UTF-8?Q?=C5=81ukasz_Bartosik?= Date: Fri, 24 Nov 2023 15:38:51 +0100 Message-ID: Subject: Re: [PATCH v1 07/12] dyndbg: repack struct _ddebug To: jim.cromie@gmail.com Cc: Jason Baron , Andrew Morton , Kees Cook , Douglas Anderson , Guenter Roeck , Yaniv Tzoreff , Benson Leung , Steven Rostedt , Vincent Whitchurch , Pekka Paalanen , Sean Paul , Daniel Vetter , linux-kernel@vger.kernel.org, upstream@semihalf.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 24 Nov 2023 06:39:16 -0800 (PST) niedz., 12 lis 2023 o 17:28 =C5=81ukasz Bartosik napisa= =C5=82(a): > > pt., 10 lis 2023 o 22:01 napisa=C5=82(a): > > > > On Fri, Nov 10, 2023 at 7:51=E2=80=AFAM =C5=81ukasz Bartosik wrote: > > > > > > sob., 4 lis 2023 o 02:49 napisa=C5=82(a): > > > > > > > > On Fri, Nov 3, 2023 at 7:10=E2=80=AFAM =C5=81ukasz Bartosik wrote: > > > > > > > > > > From: Jim Cromie > > > > > > > > > > Move the JUMP_LABEL to the top of the struct, since theyre both > > > > > align(8) and this closes a pahole (unfortunately trading for padd= ing, > > > > > but still). > > > > > > > > > > Signed-off-by: Jim Cromie > > > > > > > > let me add, I havent really tested this, nevermind thorough. > > > > specifically, I didnt look for any offset dependence on the static-= key > > > > inside their container. > > > > Conversely, maybe theres a free default or something in there. > > > > > > > > > > Any idea how to properly test the relocation of the key ? > > > > I was hoping Jason knew it from memory. > > > > I have booted dd-kitchen-sink, which includes it, and it didnt melt the= box. > > > > I just checked `pahole vmlinux` output for the existence of 0-offset ke= ys. > > Its not conclusive, cuz im only looking at x86. > > > > it does occur, but only for "sub-types". > > > > struct static_key_true { > > struct static_key key; /* 0 16= */ > > > > /* size: 16, cachelines: 1, members: 1 */ > > /* last cacheline: 16 bytes */ > > }; > > struct static_key_false { > > struct static_key key; /* 0 16= */ > > > > /* size: 16, cachelines: 1, members: 1 */ > > /* last cacheline: 16 bytes */ > > }; > > struct static_key_false_deferred { > > struct static_key_false key; /* 0 16= */ > > ...}; > > struct static_key_mod { > > struct static_key_mod * next; /* 0 8= */ > > ...}; > > struct static_key_deferred { > > struct static_key key; /* 0 16= */ > > I will test it on arm64. Hi Jim, I verified that relocation of JUMP_LABEL to the top of the _ddebug struct does not brak dynamic debug functionality on arm64. I double checked I had CONFIG_JUMP_LABEL enabled in the kernel config for a= rm64. I was able to enable/disable callsites and see debug logs being written. But if you're concerned there might be issue related to that relocation on other architectures then let's drop this patch and I will use pahole instead of padding for location of flags and trace destination fields. What do you think ? Thanks, Lukasz