* objtool failures with -march=atom
@ 2017-07-26 10:12 Arnd Bergmann
2017-07-26 13:55 ` Josh Poimboeuf
0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2017-07-26 10:12 UTC (permalink / raw)
To: Josh Poimboeuf, Linux Kernel Mailing List, Ingo Molnar
With the latest objtool failure, I get countless warnings when
-march=atom or -mtune=atom is used,
at least with gcc-4.9 through gcc-7 (I did not try older versions:
kernel/sched/core.o: warning: objtool:
trace_raw_output_sched_stat_runtime()+0x9a: return with modified stack
frame
kernel/sched/core.o: warning: objtool: cpu_cgroup_fork()+0x7c: return
with modified stack frame
kernel/sched/core.o: warning: objtool: walk_tg_tree_from()+0xd3:
return with modified stack frame
kernel/sched/core.o: warning: objtool: ttwu_do_wakeup()+0x2a8: return
with modified stack frame
kernel/sched/core.o: warning: objtool: do_set_cpus_allowed()+0x1fe:
return with modified stack frame
kernel/sched/core.o: warning: objtool: sched_ttwu_pending()+0xf2:
return with modified stack frame
kernel/sched/core.o: warning: objtool: sched_exec()+0xd0: return with
modified stack frame
kernel/sched/core.o: warning: objtool: task_sched_runtime()+0x148:
return with modified stack frame
kernel/sched/core.o: warning: objtool: sched_move_task()+0x176: return
with modified stack frame
kernel/sched/core.o: warning: objtool: sched_init()+0x6cb: return with
modified stack frame
Can you have a look?
There are probably other failures as well, I'm trying to reproduce the
others now with atom
optimizations disabled.
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: objtool failures with -march=atom
2017-07-26 10:12 objtool failures with -march=atom Arnd Bergmann
@ 2017-07-26 13:55 ` Josh Poimboeuf
2017-07-26 14:04 ` Arnd Bergmann
0 siblings, 1 reply; 3+ messages in thread
From: Josh Poimboeuf @ 2017-07-26 13:55 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Linux Kernel Mailing List, Ingo Molnar
On Wed, Jul 26, 2017 at 12:12:04PM +0200, Arnd Bergmann wrote:
> With the latest objtool failure, I get countless warnings when
> -march=atom or -mtune=atom is used,
> at least with gcc-4.9 through gcc-7 (I did not try older versions:
>
> kernel/sched/core.o: warning: objtool:
> trace_raw_output_sched_stat_runtime()+0x9a: return with modified stack
> frame
> kernel/sched/core.o: warning: objtool: cpu_cgroup_fork()+0x7c: return
> with modified stack frame
> kernel/sched/core.o: warning: objtool: walk_tg_tree_from()+0xd3:
> return with modified stack frame
> kernel/sched/core.o: warning: objtool: ttwu_do_wakeup()+0x2a8: return
> with modified stack frame
> kernel/sched/core.o: warning: objtool: do_set_cpus_allowed()+0x1fe:
> return with modified stack frame
> kernel/sched/core.o: warning: objtool: sched_ttwu_pending()+0xf2:
> return with modified stack frame
> kernel/sched/core.o: warning: objtool: sched_exec()+0xd0: return with
> modified stack frame
> kernel/sched/core.o: warning: objtool: task_sched_runtime()+0x148:
> return with modified stack frame
> kernel/sched/core.o: warning: objtool: sched_move_task()+0x176: return
> with modified stack frame
> kernel/sched/core.o: warning: objtool: sched_init()+0x6cb: return with
> modified stack frame
>
> Can you have a look?
>
> There are probably other failures as well, I'm trying to reproduce the
> others now with atom
> optimizations disabled.
Does this fix them all?
diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c
index a36c2eba64e7..4559a21a8de2 100644
--- a/tools/objtool/arch/x86/decode.c
+++ b/tools/objtool/arch/x86/decode.c
@@ -271,7 +271,7 @@ int arch_decode_instruction(struct elf *elf, struct section *sec,
case 0x8d:
if (rex == 0x48 && modrm == 0x65) {
- /* lea -disp(%rbp), %rsp */
+ /* lea disp(%rbp), %rsp */
*type = INSN_STACK;
op->src.type = OP_SRC_ADD;
op->src.reg = CFI_BP;
@@ -281,6 +281,30 @@ int arch_decode_instruction(struct elf *elf, struct section *sec,
break;
}
+ if (rex == 0x48 && (modrm == 0xa4 || modrm == 0x64) &&
+ sib == 0x24) {
+
+ /* lea disp(%rsp), %rsp */
+ *type = INSN_STACK;
+ op->src.type = OP_SRC_ADD;
+ op->src.reg = CFI_SP;
+ op->src.offset = insn.displacement.value;
+ op->dest.type = OP_DEST_REG;
+ op->dest.reg = CFI_SP;
+ break;
+ }
+
+ if (rex == 0x48 && modrm == 0x2c && sib == 0x24) {
+
+ /* lea (%rsp), %rbp */
+ *type = INSN_STACK;
+ op->src.type = OP_SRC_REG;
+ op->src.reg = CFI_SP;
+ op->dest.type = OP_DEST_REG;
+ op->dest.reg = CFI_BP;
+ break;
+ }
+
if (rex == 0x4c && modrm == 0x54 && sib == 0x24 &&
insn.displacement.value == 8) {
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: objtool failures with -march=atom
2017-07-26 13:55 ` Josh Poimboeuf
@ 2017-07-26 14:04 ` Arnd Bergmann
0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2017-07-26 14:04 UTC (permalink / raw)
To: Josh Poimboeuf; +Cc: Linux Kernel Mailing List, Ingo Molnar
On Wed, Jul 26, 2017 at 3:55 PM, Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> On Wed, Jul 26, 2017 at 12:12:04PM +0200, Arnd Bergmann wrote:
>> With the latest objtool failure, I get countless warnings when
>> -march=atom or -mtune=atom is used,
>> at least with gcc-4.9 through gcc-7 (I did not try older versions:
>>
>> kernel/sched/core.o: warning: objtool:
>> trace_raw_output_sched_stat_runtime()+0x9a: return with modified stack
>> frame
>> kernel/sched/core.o: warning: objtool: cpu_cgroup_fork()+0x7c: return
>> with modified stack frame
>> kernel/sched/core.o: warning: objtool: walk_tg_tree_from()+0xd3:
>> return with modified stack frame
>> kernel/sched/core.o: warning: objtool: ttwu_do_wakeup()+0x2a8: return
>> with modified stack frame
>> kernel/sched/core.o: warning: objtool: do_set_cpus_allowed()+0x1fe:
>> return with modified stack frame
>> kernel/sched/core.o: warning: objtool: sched_ttwu_pending()+0xf2:
>> return with modified stack frame
>> kernel/sched/core.o: warning: objtool: sched_exec()+0xd0: return with
>> modified stack frame
>> kernel/sched/core.o: warning: objtool: task_sched_runtime()+0x148:
>> return with modified stack frame
>> kernel/sched/core.o: warning: objtool: sched_move_task()+0x176: return
>> with modified stack frame
>> kernel/sched/core.o: warning: objtool: sched_init()+0x6cb: return with
>> modified stack frame
>>
>> Can you have a look?
>>
>> There are probably other failures as well, I'm trying to reproduce the
>> others now with atom
>> optimizations disabled.
>
> Does this fix them all?
Looks good so far, thanks! I'll let you know if something comes back.
For the others, I'll try to gather a little more information and start
separate email threads for each class. From what I can tell, we
still get about a dozen warnings with gcc-7, same as with older
kernels, but I also see a few new warnings with your latest objtool.
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-26 14:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-26 10:12 objtool failures with -march=atom Arnd Bergmann
2017-07-26 13:55 ` Josh Poimboeuf
2017-07-26 14:04 ` Arnd Bergmann
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®