From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Wolfgang Mauerer <wolfgang.mauerer@siemens.com>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] [PATCH 3/3] Fix IRQs-off-tracer for x86_64
Date: Thu, 13 Sep 2012 15:26:34 +0200 [thread overview]
Message-ID: <5051DF0A.7030901@xenomai.org> (raw)
In-Reply-To: <5051D85A.4090105@siemens.com>
On 09/13/2012 02:58 PM, Wolfgang Mauerer wrote:
> On 13/09/12 11:40, Gilles Chanteperdrix wrote:
>> On 09/13/2012 10:46 AM, Wolfgang Mauerer wrote:
>>> On 13/09/12 08:43, Gilles Chanteperdrix wrote:
>
> ... (some code with varying amounts of pops and pushed)...
>
>>> that fixes the bug, too -- thanks. However, I deliberately spent some
>>> extra assembler code (5 insns compared to your approach) to make the
>>> code easier to understand (the overall size of the resulting kernel
>>> binary is identical for both approaches on my machine, btw.). Since the
>>> overhead of 5 instructions is negligible compared to the two calls of
>>> __ipipe_trace that are necessary in any case, I'd argue that the more
>>> straightforward code is beneficial in the long run, but that's for the
>>> maintainers to decide.
>>
>> To the contrary, the profusion of pushq and popq looked confusing to me,
>> I wondered why so many were needed, so, I guess it is all a matter of taste.
>
> most certainly a matter of taste, agreed. I've rearranged your
> suggestion slightly, added a comment or two, and turned it into a
> patch. Repo at https://github.com/siemens/ipipe.git for-upstream
> is also updated.
Ok. Small nit:
+ movq ORIG_RAX+8-RBP(%rsp), %rdi # IRQ number...
notq %rdi # ...is inverted, fix up
+ leaq RIP-8+8-RBP(%rsp), %rbp # Show interrupted address in trace
I would avoid to use a register as a source in an instruction right
after an instruction where it was used as a destination, because I
believe in processors which do not have out of order execution, such as
Intel Atoms, the processor would have to wait for an instruction to be
finished to start the next. Though I do not know enough of the x86
architecture to know if that is true. That is the reason why I put leaq
before notq.
--
Gilles.
next prev parent reply other threads:[~2012-09-13 13:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-12 17:00 [Xenomai] [PULL, PATCH 0/3] ipipe tracer fixes Wolfgang Mauerer
2012-09-12 17:00 ` [Xenomai] [PATCH 1/3] ipipe: Remove superfluous symbol export of irq_to_desc Wolfgang Mauerer
2012-09-12 17:00 ` [Xenomai] [PATCH 2/3] ipipe, x86: Introduce hard_irqs_disabled_flags Wolfgang Mauerer
2012-09-12 17:00 ` [Xenomai] [PATCH 3/3] Fix IRQs-off-tracer for x86_64 Wolfgang Mauerer
2012-09-12 18:05 ` Gilles Chanteperdrix
2012-09-12 18:34 ` Gilles Chanteperdrix
2012-09-13 6:43 ` Gilles Chanteperdrix
2012-09-13 8:46 ` Wolfgang Mauerer
2012-09-13 9:40 ` Gilles Chanteperdrix
2012-09-13 12:58 ` Wolfgang Mauerer
2012-09-13 13:26 ` Gilles Chanteperdrix [this message]
2012-09-13 16:25 ` Wolfgang Mauerer
2012-09-13 16:40 ` Gilles Chanteperdrix
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=5051DF0A.7030901@xenomai.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=wolfgang.mauerer@siemens.com \
--cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.