From: "Jan Beulich" <JBeulich@suse.com>
To: "Ingo Molnar" <mingo@kernel.org>
Cc: "Andy Lutomirski" <luto@amacapital.net>, <mingo@elte.hu>,
"Brian Gerst" <brgerst@gmail.com>, <tglx@linutronix.de>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
"Denys Vlasenko" <dvlasenk@redhat.com>,
<linux-kernel@vger.kernel.org>, <hpa@zytor.com>
Subject: Re: [PATCH] x86-64: fix unwind info for incomplete frames
Date: Thu, 28 May 2015 10:45:33 +0100 [thread overview]
Message-ID: <5566FFDD020000780007E711@mail.emea.novell.com> (raw)
In-Reply-To: <20150528090133.GA469@gmail.com>
>>> On 28.05.15 at 11:01, <mingo@kernel.org> wrote:
> * Jan Beulich <JBeulich@suse.com> wrote:
>> --- 4.1-rc5/arch/x86/kernel/entry_64.S
>> +++ 4.1-rc5-x86_64-unwind-info/arch/x86/kernel/entry_64.S
>> @@ -148,7 +148,7 @@ ENDPROC(native_usergs_sysret64)
>> /*
>> * frame that enables passing a complete pt_regs to a C function.
>> */
>> - .macro DEFAULT_FRAME start=1 offset=0
>> + .macro DEFAULT_FRAME start=1 offset=0 extra=1
>> XCPT_FRAME \start, ORIG_RAX+\offset
>> CFI_REL_OFFSET rdi, RDI+\offset
>> CFI_REL_OFFSET rsi, RSI+\offset
>> @@ -159,12 +159,14 @@ ENDPROC(native_usergs_sysret64)
>> CFI_REL_OFFSET r9, R9+\offset
>> CFI_REL_OFFSET r10, R10+\offset
>> CFI_REL_OFFSET r11, R11+\offset
>> + .if \extra
>> CFI_REL_OFFSET rbx, RBX+\offset
>> CFI_REL_OFFSET rbp, RBP+\offset
>> CFI_REL_OFFSET r12, R12+\offset
>> CFI_REL_OFFSET r13, R13+\offset
>> CFI_REL_OFFSET r14, R14+\offset
>> CFI_REL_OFFSET r15, R15+\offset
>> + .endif
>> .endm
>
> I have a couple of code cleanliness complaints:
>
> - So 'extra' isn't very expressive, I'd name it 'full' to signal a full frame,
> and full=0 denotes
I can certainly do this; as easy as "sed s/extra/full/g" on the patch -
perhaps you could even do this while committing?
> - So I had to go into the source and double check various nested macros to see
> that DEFAULT_FRAME is only defining debug information, it's not emitting any
> actual code. This should have been glaringly obvious from the macro name!
CFI_DEFAULT_FRAME? Anyway - clearly not in this patch.
> - So I hate these 'default values' vararg-ish assembly macros:
>
> arch/x86/kernel/entry_64.S: DEFAULT_FRAME 0, 8 /* offset 8: return address */
> arch/x86/kernel/entry_64.S: DEFAULT_FRAME 0, 8
> arch/x86/kernel/entry_64.S: DEFAULT_FRAME 0, 8
> arch/x86/kernel/entry_64.S: DEFAULT_FRAME 0, 8
> arch/x86/kernel/entry_64.S: DEFAULT_FRAME 0, 8
> arch/x86/kernel/entry_64.S: DEFAULT_FRAME 0, 8
> arch/x86/kernel/entry_64.S: DEFAULT_FRAME 0, 8
> arch/x86/kernel/entry_64.S: DEFAULT_FRAME
> arch/x86/kernel/entry_64.S: DEFAULT_FRAME 0
> arch/x86/kernel/entry_64.S: DEFAULT_FRAME 0
> arch/x86/kernel/entry_64.S: DEFAULT_FRAME
> arch/x86/kernel/entry_64.S: DEFAULT_FRAME
> arch/x86/kernel/entry_64.S: DEFAULT_FRAME
> arch/x86/kernel/entry_64.S: DEFAULT_FRAME 0
>
> because unlike C functions they make the actual arguments a guessing game:
> you always have to double check the macro definition itself - while the
> 'savings' in terms of less code written are miniscule. So it actually obscures
> macros.
>
> So these should be flattened, with clear, fixed length parameter signatures,
> to make them as similar to regular C code as syntactically possible.
Not sure why assembly code should look like C code. It's a matter
of taste perhaps, and I can see your point, but I'm also not really
eager to do changes just to match other people's taste. And just
like above - certainly not something for this patch I would think.
Jan
next prev parent reply other threads:[~2015-05-28 9:45 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-28 8:20 Jan Beulich
2015-05-28 9:01 ` Ingo Molnar
2015-05-28 9:45 ` Jan Beulich [this message]
2015-05-28 11:20 ` [PATCH] x86/debug: Remove perpetually broken, unmaintainable dwarf annotations Ingo Molnar
2015-05-28 11:39 ` [PATCH v2] " Ingo Molnar
2015-05-28 11:51 ` [PATCH] " Jan Beulich
2015-05-28 13:17 ` Ingo Molnar
2015-05-29 17:47 ` Andy Lutomirski
2015-05-29 20:27 ` Josh Poimboeuf
2015-05-29 21:39 ` Frank Ch. Eigler
2015-06-01 19:45 ` Josh Poimboeuf
2015-06-01 19:53 ` Andy Lutomirski
2015-06-01 20:19 ` Josh Poimboeuf
2015-06-02 5:57 ` Ingo Molnar
2015-06-02 14:46 ` Josh Poimboeuf
2015-06-02 17:00 ` Andy Lutomirski
2015-06-05 17:11 ` Andi Kleen
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=5566FFDD020000780007E711@mail.emea.novell.com \
--to=jbeulich@suse.com \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@elte.hu \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®