Skip to contentSkip to conversation

expecting string instruction after `rep' with latest SeaBIOS

DISCUSSION Ian Campbell 3 participants 5 messages Jun 30, 2014 – Jul 1, 2014 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Building the seabios defconfig on a 64-bit Debian Wheezy system I'm seeing:

Compiling (16bit) out/romlayout.o
src/romlayout.S: Assembler messages:
src/romlayout.S:285: Error: expecting string instruction after `rep'
make: *** [out/romlayout.o] Error 1

That line is:
// Acquire lock and take ownership of shared stack
1: rep nop

I've also checked the preprocessed version and the nop isn't being disappeared or anything like that.

This is with 083ee297ef88d "ohci: Update usb command timeouts to use usb_xfer_time()". I don't see it with the rel-1.7.5 tag.

git bisect has fingered 0673b7870063a ""smp: Replace QEMU SMP init assembler code with C; run only in 32bit mode.", which makes sense since it made those additions to romlayout.S

Other than a compiler bug I can't think what might be going on. Debian Wheezy has gcc 4.7.2 and binutils 2.22.

Ian.

#1 lore raw

Il 30/06/2014 15:03, Ian Campbell ha scritto:

Quoted 6 lines

That line is:
// Acquire lock and take ownership of shared stack
1: rep nop

I've also checked the preprocessed version and the nop isn't being disappeared or anything like that.

"rep nop" is really just "pause".

I think the assembler wants "rep; nop" instead.

Paolo

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 9 lines · Paolo Bonzini

Il 30/06/2014 15:03, Ian Campbell ha scritto:

Quoted 6 lines

That line is:
// Acquire lock and take ownership of shared stack
1: rep nop

I've also checked the preprocessed version and the nop isn't being disappeared or anything like that.

"rep nop" is really just "pause".

Yes, that's how I was translating it in my head, which is why I thought it was fine to write it like that.

Quoted 1 line

I think the assembler wants "rep; nop" instead.

That's right, I was just reaching the same conclusion. Build-tested patch:

8<------------------------

Quoted 1 line

From 0b05042b582a8992c15030406dcb220be82da8ce Mon Sep 17 00:00:00 2001

From: Ian Campbell <[email protected]>
Date: Mon, 30 Jun 2014 14:10:02 +0100
Subject: [PATCH] romlayout: Use "rep ; nop" not "rep nop".

Fixes:
Compiling (16bit) out/romlayout.o
src/romlayout.S: Assembler messages:
src/romlayout.S:285: Error: expecting string instruction after `rep'
make: *** [out/romlayout.o] Error 1

---
 src/romlayout.S |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/romlayout.S +1 -1
index a931b32..a3ba965 100644
@@ -282,7 +282,7 @@ entry_smp:
         jmp transition32
         .code32
         // Acquire lock and take ownership of shared stack
-1:      rep nop
+1:      rep ; nop
 2:      lock btsl $0, SMPLock
         jc 1b
         movl SMPStack, %esp
Signature · 1 line
1.7.10.4
Reviewed-by
#4 lore raw

Il 30/06/2014 15:11, Ian Campbell ha scritto:

Quoted 43 lines · Paolo Bonzini
Quoted 9 lines

Il 30/06/2014 15:03, Ian Campbell ha scritto:

Quoted 6 lines

That line is:
// Acquire lock and take ownership of shared stack
1: rep nop

I've also checked the preprocessed version and the nop isn't being disappeared or anything like that.

"rep nop" is really just "pause".

Yes, that's how I was translating it in my head, which is why I thought it was fine to write it like that.

Quoted 1 line

I think the assembler wants "rep; nop" instead.

That's right, I was just reaching the same conclusion. Build-tested patch:

8<------------------------

From 0b05042b582a8992c15030406dcb220be82da8ce Mon Sep 17 00:00:00 2001
From: Ian Campbell <[email protected]>
Date: Mon, 30 Jun 2014 14:10:02 +0100
Subject: [PATCH] romlayout: Use "rep ; nop" not "rep nop".

Fixes:
Compiling (16bit) out/romlayout.o
src/romlayout.S: Assembler messages:
src/romlayout.S:285: Error: expecting string instruction after `rep'
make: *** [out/romlayout.o] Error 1

---
 src/romlayout.S |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/romlayout.S +0 -0
index a931b32..a3ba965 100644

src/romlayout.S entry_smp: · line 288

Quoted 8 lines
src/romlayout.S +1 -1
@@ -282,7 +282,7 @@ entry_smp:
         jmp transition32
         .code32
         // Acquire lock and take ownership of shared stack
-1:      rep nop
+1:      rep ; nop
 2:      lock btsl $0, SMPLock
         jc 1b
         movl SMPStack, %esp
#5 lore raw
In reply to Ian Campbell
Quoted 4 lines · Ian Campbell
Quoted 1 line

I think the assembler wants "rep; nop" instead.

That's right, I was just reaching the same conclusion. Build-tested patch:

Thanks - I applied this change.

-Kevin