Skip to contentSkip to conversation

Build errors in v4.4-stable-queue (i386)

DISCUSSION Guenter Roeck 3 participants 9 messages Jan 18, 2018 – Jan 20, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Building i386:defconfig ... failed
--------------
Error log:
arch/x86/entry/entry_32.S: Assembler messages:
arch/x86/entry/entry_32.S:230: Error: too many memory references for `mov'

Guenter

#1 lore raw
Quoted 5 lines · Guenter Roeck

Building i386:defconfig ... failed
--------------
Error log:
arch/x86/entry/entry_32.S: Assembler messages:
arch/x86/entry/entry_32.S:230: Error: too many memory references for `mov'

Ick, no good, 0-day has pointed this out as well.

Razvan and David, any ideas?

thanks,

greg k-h

#2 lore raw
Quoted 11 lines · Greg Kroah-Hartman
Quoted 7 lines · Guenter Roeck

Building i386:defconfig ... failed
--------------
Error log:
arch/x86/entry/entry_32.S: Assembler messages:
arch/x86/entry/entry_32.S:230: Error: too many memory references for `mov'

Ick, no good, 0-day has pointed this out as well.

Razvan and David, any ideas?

CALL_NOSPEC PT_EBX(%esp)

That turns into a retpoline with

        mov PT_EBX(%esp), 0(%esp)

Which is doubly wrong, because not only can't you have two memory operands to a 'mov' but %esp has already *moved* by the time we get here so we'd be using the wrong source anyway.

We need to pick a victim register and load PT_EBX(%esp) into it, then CALL_NOSPEC %\reg.

We'll fix this and also the RSP-clobbering in context switch that you just sent a "fails to apply" message for.

#3 lore raw
Quoted 25 lines · David Woodhouse
Quoted 10 lines · Greg Kroah-Hartman
Quoted 8 lines · Guenter Roeck

Building i386:defconfig ... failed
--------------
Error log:
arch/x86/entry/entry_32.S: Assembler messages:
arch/x86/entry/entry_32.S:230: Error: too many memory references for `mov'

Quoted 3 lines

Ick, no good, 0-day has pointed this out as well.

Razvan and David, any ideas?

CALL_NOSPEC PT_EBX(%esp)

That turns into a retpoline with

        mov PT_EBX(%esp), 0(%esp)

Which is doubly wrong, because not only can't you have two memory operands to a 'mov' but %esp has already *moved* by the time we get here so we'd be using the wrong source anyway.

Quoted 5 lines

We need to pick a victim register and load PT_EBX(%esp) into it, then CALL_NOSPEC %\reg.

We'll fix this and also the RSP-clobbering in context switch that you just sent a "fails to apply" message for.

Try this. Not even build tested. I think we can have %edx here, as it would be the second argument to the kthread function, and clobbered by it too.

Signed-off-by-if-it-works: David Woodhouse <[email protected]>

arch/x86/entry/entry_32.S +0 -0
@@ -227,7 +227,8 @@ ENTRY(ret_from_kernel_thread)

        pushl   $0x0202                         # Reset kernel eflags popfl
        movl    PT_EBP(%esp), %eax
-       CALL_NOSPEC PT_EBX(%esp)
+       movl    PT_EBX(%esp), %edx
+       CALL_NOSPEC %edx
        movl    $0, PT_EAX(%esp)

#4 lore raw
Quoted 41 lines · David Woodhouse
Quoted 25 lines · David Woodhouse
Quoted 10 lines · Greg Kroah-Hartman
Quoted 8 lines · Guenter Roeck

Building i386:defconfig ... failed
--------------
Error log:
arch/x86/entry/entry_32.S: Assembler messages:
arch/x86/entry/entry_32.S:230: Error: too many memory references for `mov'

Quoted 3 lines

Ick, no good, 0-day has pointed this out as well.

Razvan and David, any ideas?

CALL_NOSPEC PT_EBX(%esp)

That turns into a retpoline with

� � � � mov PT_EBX(%esp), 0(%esp)

Which is doubly wrong, because not only can't you have two memory operands to a 'mov' but %esp has already *moved* by the time we get here so we'd be using the wrong source anyway.

Quoted 5 lines

We need to pick a victim register and load PT_EBX(%esp) into it, then CALL_NOSPEC %\reg.

We'll fix this and also the RSP-clobbering in context switch that you just sent a "fails to apply" message for.

Try this. Not even build tested. I think we can have %edx here, as it would be the second argument to the kthread function, and clobbered by it too.

Signed-off-by-if-it-works: David Woodhouse <[email protected]>

arch/x86/entry/entry_32.S +0 -0
@@ -227,7 +227,8 @@ ENTRY(ret_from_kernel_thread)
Quoted 8 lines

��������pushl���$0x0202�������������������������# Reset kernel eflags ��������popfl
��������movl����PT_EBP(%esp), %eax
-�������CALL_NOSPEC PT_EBX(%esp)
+�������movl����PT_EBX(%esp), %edx
+�������CALL_NOSPEC %edx
��������movl����$0, PT_EAX(%esp)
�

I don't have a way to test this, I'll merge it into the existing patch and push out a new tree to see how 0-day and Guenter's build-farm handle it.

thanks,

greg k-h

#5 lore raw
Quoted 4 lines · Greg Kroah-Hartman

I don't have a way to test this, I'll merge it into the existing patch and push out a new tree to see how 0-day and Guenter's build-farm handle it.

It seems to work (and boot in qemu) here.

#6 lore raw
Quoted 7 lines · David Woodhouse
Quoted 4 lines · Greg Kroah-Hartman

I don't have a way to test this, I'll merge it into the existing patch and push out a new tree to see how 0-day and Guenter's build-farm handle it.

It seems to work (and boot in qemu) here.

Ok, great, thanks for the fix.

greg k-h

#7 lore raw
In reply to David Woodhouse
Quoted 7 lines · David Woodhouse
Quoted 4 lines · Greg Kroah-Hartman

I don't have a way to test this, I'll merge it into the existing patch and push out a new tree to see how 0-day and Guenter's build-farm handle it.

It seems to work (and boot in qemu) here.

Same here.

Guenter

#8 lore raw
Quoted 10 lines · Guenter Roeck
Quoted 7 lines · David Woodhouse
Quoted 4 lines · Greg Kroah-Hartman

I don't have a way to test this, I'll merge it into the existing patch and push out a new tree to see how 0-day and Guenter's build-farm handle it.

It seems to work (and boot in qemu) here.

Same here.

Great, thanks for letting me know. It also looked to pass the 0-day bot, so I'll keep the update in the patch queue.

greg k-h