From: jim.cromie@gmail.com
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
X86 ML <x86@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
Andy Lutomirski <luto@kernel.org>,
Kees Cook <keescook@chromium.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Masahiro Yamada <masahiroy@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Nathan Chancellor <nathan@kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Bill Wendling <morbo@google.com>,
Sami Tolvanen <samitolvanen@google.com>,
Arvind Sankar <nivedita@alum.mit.edu>,
Joerg Roedel <jroedel@suse.de>, Nick Terrell <terrelln@fb.com>,
Dave Young <dyoung@redhat.com>,
Pingfan Liu <kernelfans@gmail.com>,
Atish Patra <atish.patra@wdc.com>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"open list:SPARC + UltraSPARC (sparc/sparc64)"
<sparclinux@vger.kernel.org>,
linux-efi <linux-efi@vger.kernel.org>,
Linux Memory Management List <linux-mm@kvack.org>,
kbuild test robot <lkp@intel.com>
Subject: Re: [RFC PATCH v5 17/28] dyndbg: prevent build bugs via -DNO_DYNAMIC_DEBUG_TABLE
Date: Wed, 12 May 2021 12:03:47 -0600 [thread overview]
Message-ID: <CAJfuBxz+vW_aT=ZVM+UgDxDxwph4D+MKB6r518J9vk2YopX+KA@mail.gmail.com> (raw)
In-Reply-To: <CAMj1kXGLKJ19oThbXPhboHzCHfX_oZscxRHn6M7s4jt9Gk8SEA@mail.gmail.com>
On Wed, May 12, 2021 at 8:55 AM Ard Biesheuvel <ardb@kernel.org> wrote:
>
> On Tue, 11 May 2021 at 20:51, Jim Cromie <jim.cromie@gmail.com> 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
next prev parent reply other threads:[~2021-05-12 18:04 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-11 18:50 [RFC PATCH v5 00/28] dynamic debug diet plan Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 01/28] dyndbg: avoid calling dyndbg_emit_prefix when it has no work Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 02/28] dyndbg: drop uninformative vpr_info Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 03/28] dyndbg: split struct _ddebug's display fields to new _ddebug_site Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 04/28] dyndbg: __init iterate over __dyndbg & __dyndbg_site in parallel Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 05/28] dyndbg: refactor part of ddebug_change to ddebug_match_site Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 06/28] dyndbg: accept null site in ddebug_match_site Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 07/28] dyndbg: hoist ->site out of ddebug_match_site Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 08/28] dyndbg: accept null site in ddebug_change Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 09/28] dyndbg: accept null site in dynamic_emit_prefix Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 10/28] dyndbg: accept null site in ddebug_proc_show Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 11/28] dyndbg: refactor ddebug_alter_site out of ddebug_change Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 12/28] dyndbg: allow deleting site info via control interface Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 13/28] dyndbg+module: expose ddebug_sites to modules Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 14/28] dyndbg: add ddebug_site(_get|_put) abstraction Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 15/28] dyndbg: ddebug_add_module avoid adding empty modules Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 16/28] dyndbg: add _index to struct _ddebug Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 17/28] dyndbg: prevent build bugs via -DNO_DYNAMIC_DEBUG_TABLE Jim Cromie
2021-05-12 14:55 ` Ard Biesheuvel
2021-05-12 18:03 ` jim.cromie [this message]
2021-05-11 18:50 ` [RFC PATCH v5 18/28] dyndbg: RFC - DEFINE_DYNAMIC_DEBUG_TABLE Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 19/28] dyndbg: RFC handle __dyndbg* sections in module.lds.h Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 20/28] dyndbg: ddebug_add_module() handle headers Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 21/28] dyndbg: validate ddebug_site_get invariants Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 22/28] dyndbg: fix NULL deref after deleting sites Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 23/28] dyndbg: dont show header records in control Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 24/28] dyndbg: make site pointer and checks on it optional (not quite) Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 25/28] dyndbg: swap WARN_ON for BUG_ON see what 0-day says Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 26/28] dyndbg: fixup protect header when deleting site Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 27/28] dyndbg: unionize _ddebug*_headers with struct _ddebug* Jim Cromie
2021-05-11 18:50 ` [RFC PATCH v5 28/28] dyndbg: RFC drop _ddebug.site pointer Jim Cromie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJfuBxz+vW_aT=ZVM+UgDxDxwph4D+MKB6r518J9vk2YopX+KA@mail.gmail.com' \
--to=jim.cromie@gmail.com \
--cc=ardb@kernel.org \
--cc=atish.patra@wdc.com \
--cc=bp@alien8.de \
--cc=davem@davemloft.net \
--cc=dyoung@redhat.com \
--cc=geert+renesas@glider.be \
--cc=hpa@zytor.com \
--cc=jroedel@suse.de \
--cc=keescook@chromium.org \
--cc=kernelfans@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@armlinux.org.uk \
--cc=lkp@intel.com \
--cc=luto@kernel.org \
--cc=masahiroy@kernel.org \
--cc=mingo@redhat.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=nivedita@alum.mit.edu \
--cc=samitolvanen@google.com \
--cc=sparclinux@vger.kernel.org \
--cc=terrelln@fb.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox