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 X-Spam-Level: X-Spam-Status: No, score=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75C26C433B4 for ; Wed, 12 May 2021 18:04:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D9EA661480 for ; Wed, 12 May 2021 18:04:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9EA661480 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F32446B006C; Wed, 12 May 2021 14:04:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EE2156B006E; Wed, 12 May 2021 14:04:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DAAC96B0070; Wed, 12 May 2021 14:04:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0196.hostedemail.com [216.40.44.196]) by kanga.kvack.org (Postfix) with ESMTP id A8AAF6B006C for ; Wed, 12 May 2021 14:04:15 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3AC92A2AD for ; Wed, 12 May 2021 18:04:15 +0000 (UTC) X-FDA: 78133353270.03.713C78E Received: from mail-vk1-f174.google.com (mail-vk1-f174.google.com [209.85.221.174]) by imf23.hostedemail.com (Postfix) with ESMTP id 4289EA0003B3 for ; Wed, 12 May 2021 18:04:04 +0000 (UTC) Received: by mail-vk1-f174.google.com with SMTP id s131so4932006vka.11 for ; Wed, 12 May 2021 11:04:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=d6PyBDz5Hz+HLZJQx9m2fhDjeQhvfMXZj/HKgsByeXo=; b=EwWfS3nUxUd6F4Hza9Wih48U/DhHt7dkvd7SLfXZB9AGGY0vfd4pqFrdusmN8cEYyS lQKD0SvIknzYN1dLg9K0qeIpr0aJTt96qaYa6V4J/wf4mjLc7k/lK18/sRp6PhSws5dv r14mRXobZqw+H/tl/bTwJK1xulWqG1EF93+eSdX519DzA3USBFSPV3TRhpryr/imW6/h IWEqrrl1Wlc5lDzEUm25bGumfYBqVBftmsSBUcMiOFXjEvh3NzJaGQVLR8+NzPj8bhpr mLyRO8xnT7z4aaJ9s2rAEczBml/s9ZWy6r7SvVTO0mFtUSciYzUZLTWk7D1GcQbJdi3a CZFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=d6PyBDz5Hz+HLZJQx9m2fhDjeQhvfMXZj/HKgsByeXo=; b=BqCdzrRe4g9YCwRNzEqPHDNYHiHO1t1inxE0Fz6y10O8EVsVbhusg9BbHP9lw7Vm0q CoMFIoqRXDDs5JHj1DrpuIAxapz5bvLLlKOhQlh9407MoCH9iBub4VAR2uWmZRJgWaXH N/+hr9uQQa66QeK8S/SwQdssClt4jWdeq291qTKdXvuc3KnHbus+vlxBmHXh+NA9aeBy 0CUU5MyjDA9vxgvzYIz+yO4qqfgpvobzZo6uSwlD+5wxe9L5n3WftLWWgFgy8T5RY25c cqUpD9BQXFErbF2P0IC4oxgBP60lHWZNdpLDyvfvrcb9ouOyePB+Pndyr/CPNqVRQfIL BYqA== X-Gm-Message-State: AOAM533GSV5pbKzpDrVuzbZxdc355aLHLkc2hs3mS4V7wtPoKfBKEn/a 9CMw41it3yIPfBAW2L9cQWueJsxGHJ34A1itH4M= X-Google-Smtp-Source: ABdhPJzu/KIleZZfDrE9427pC4pMWBUduSAchOxtS5+3xBoN5DZNk5IQG0YwqS/XFE66PwTAAAZ4EwHDIAjCHjv9kbA= X-Received: by 2002:a1f:20c9:: with SMTP id g192mr4453848vkg.8.1620842654032; Wed, 12 May 2021 11:04:14 -0700 (PDT) MIME-Version: 1.0 References: <20210511185057.3815777-1-jim.cromie@gmail.com> <20210511185057.3815777-18-jim.cromie@gmail.com> In-Reply-To: From: jim.cromie@gmail.com Date: Wed, 12 May 2021 12:03:47 -0600 Message-ID: Subject: Re: [RFC PATCH v5 17/28] dyndbg: prevent build bugs via -DNO_DYNAMIC_DEBUG_TABLE To: Ard Biesheuvel Cc: Russell King , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , X86 ML , "H. Peter Anvin" , Andy Lutomirski , Kees Cook , Nick Desaulniers , Masahiro Yamada , Linus Walleij , Nathan Chancellor , Geert Uytterhoeven , Bill Wendling , Sami Tolvanen , Arvind Sankar , Joerg Roedel , Nick Terrell , Dave Young , Pingfan Liu , Atish Patra , Linux ARM , Linux Kernel Mailing List , "open list:SPARC + UltraSPARC (sparc/sparc64)" , linux-efi , Linux Memory Management List , kbuild test robot Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=EwWfS3nU; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf23.hostedemail.com: domain of jimcromie@gmail.com designates 209.85.221.174 as permitted sender) smtp.mailfrom=jimcromie@gmail.com X-Stat-Signature: kq9nn7ouqbypndu5wbsaaqfmwtn4jnny X-Rspamd-Queue-Id: 4289EA0003B3 X-Rspamd-Server: rspam02 Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf23; identity=mailfrom; envelope-from=""; helo=mail-vk1-f174.google.com; client-ip=209.85.221.174 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620842644-644483 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, May 12, 2021 at 8:55 AM Ard Biesheuvel wrote: > > On Tue, 11 May 2021 at 20:51, Jim Cromie wrote: > > > > The next patch adds DEFINE_DYNAMIC_DEBUG_TABLE(), which broke several > > subtrees, including efi, vdso, and some of arch/*/boot/compressed, > > with various relocation errors, iirc. > > > > Avoid those problems by adding a define to suppress the "transparent" > > DEFINE_DYNAMIC_DEBUG_TABLE() invocation. I found the x86 problems > > myself, lkp@intel.com found arm & sparc problems, and may yet find > > others. > > > > Given that I was only cc'ed on this patch in isolation, would you mind > adding more clarification here? What is DEFINE_DYNAMIC_DEBUG_TABLE() > supposed to do, and why is it breaking standalone binaries? > > hi Ard, the thread starts here: https://lore.kernel.org/linux-mm/20210511185057.3815777-1-jim.cromie@gmail.com/ the _TABLE macro derives from DEFINE_DYNAMIC_DEBUG_METADATA, which puts private static struct _ddebug's in section("__dyndbg") the _TABLE macro populates a different section(".gnu.linkonce.dyndbg"), which is then placed by linker script at the start of the section. ISTM that the new section might be whats breaking things. And maybe that the vmlinux linker script isnt involved. so the storage the _TABLE wants to define is unbound (and unused, since there are no pr_debugs) I did see relocation errors somewhere... This is my 1st time doing something creative with the linker As to larger purpose, I'll try to restate the patchset mission: theres ~45kb savings possible by compressing the highly redundant data (~70kb) which decorates pr_debug messages. 1 - split the compressible/decoration columns to a different section|block, for block compression this adds temporary .site pointer from _ddebug -> _ddebug_site 2 - change code so !site is safe. _TABLEs only real job is to provide a header record, at the beginning of the section/array, for a single .site pointer to the _dyndbg_sites section added in 1. Because the header has a fixed offset from any pr_debug in the vector, all pr_debugs can use the headers copy of .site, and dont need their own. specialize & unionize So it allows to drop the temporary pointer, restoring memory size parity with master. And we then have the _dyndbg_sites section, full of redundant data, ready to compress. suppression with -DNO_DYNAMIC_DEBUG was a workaround, didnt think about it afterwards does this clarify ? thanks Jim