Messages in this thread | | | Date | Wed, 19 Nov 2008 11:34:15 +0100 | From | Ingo Molnar <> | Subject | Re: [RFC,v2] x86_64: save_args out of line |
| |
* Roland McGrath <roland@redhat.com> wrote:
> > but that's the exception. Most of the annotations could be > > auto-generated. > > Not really. An implicit .cfi_undefined can be auto-generated for an > unannotated instruction with an output register. An implicit > .cfi_register can be auto-generated for an unannotated > register-to-register move. An implicit .cfi_same_value can be > auto-generated when you can tell a register is being written with > the register or stack slot tha the current CFI state says holds the > caller's value of that register. Beyond that, it gets into either > assumptions or hairy analysis of how stack slots are being used and > so forth.
i dont buy that argument at all.
Yes, of course full "no changes to the current code at all" automation is hard.
But _at minimum_ GAS should automate a large part of this and help us out syntactically: make it really easy to human-annotate instructions in a _minimal way_. Also, automate the easy bits while at it. Plus warn about missing annotations - nesting errors, etc. etc.
there's a ton of easy things GAS could do here that it does not do.
> [...] Explicit (but simple) macros in the assembly is what I favor.
Yeah. This is the second-best option - but has some limitations. Still it is much better than what we have now.
What _clearly_ sucks is the current mess of:
CFI_ADJUST_CFA_OFFSET 8 /*CFI_REL_OFFSET ss,0*/ pushq %rax /* rsp */ CFI_ADJUST_CFA_OFFSET 8 CFI_REL_OFFSET rsp,0 pushq $(1<<9) /* eflags - interrupts on */ CFI_ADJUST_CFA_OFFSET 8 /*CFI_REL_OFFSET rflags,0*/ pushq $__KERNEL_CS /* cs */ CFI_ADJUST_CFA_OFFSET 8 /*CFI_REL_OFFSET cs,0*/ pushq \child_rip /* rip */ CFI_ADJUST_CFA_OFFSET 8 CFI_REL_OFFSET rip,0 pushq %rax /* orig rax */ CFI_ADJUST_CFA_OFFSET 8
Compared to what we could have (stupid mockup):
pushq_cf1 %rax /* rsp */ pushq_cf1 $(1<<9) /* eflags - interrupts on */ pushq_cf1 $__KERNEL_CS /* cs */ pushq_cf2 \child_rip /* rip */ pushq_cf1 %rax /* orig rax */
Whoever claims that this cannot be automated in _large_ part isnt thinking it through really. Those CFI annotations should never have been added in this form.
Ingo
| |