FreeBSDFoundation / freebsd

FreeBSD source tree for FreeBSD Foundation-sponsored projects
https://www.freebsdfoundation.org/
Other
9 stars 3 forks source link

hang in qemu when starting multiuser with -serial telnet #10

Closed emaste closed 7 years ago

emaste commented 9 years ago

qemu invoked as:

% qemu-system-aarch64 -m 1024 -cpu cortex-a57 -M virt -bios /tank/emaste/projects/arm64/arm64-20150108/QEMU_EFI.fd -nographic -serial telnet::4444,server -drive if=none,file=arm64_img,id=hd0 -device virtio-blk-device,drive=hd0

After connecting via telnet it hangs here:

Trying to mount root from ufs:/dev/ufs/freebsd_root [rw,noatime]...
warning: no time-of-day clock registered, system time will not be set accurately
start_init: trying /sbin/init

FWIW the QEMU monitor shows:

(qemu) info registers
PC=ffffff800013e1c0  SP=ffffff80685b2900
X00=ffffff80403fc558 X01=0000000000000000 X02=ffffff8000406c87 X03=0000000000000922
X04=ffffff80685b28f0 X05=000000000000000c X06=ffffff80685b2927 X07=ffffff80685b2920
X08=00000000000003c0 X09=0000000000000001 X10=ffffff8000539ac0 X11=0000000000000004
X12=0000000000000000 X13=0000000000000000 X14=0000000000000000 X15=0000000000000000
X16=0000000000000000 X17=0000000000000000 X18=ffffff8000566240 X19=ffffff80403fc520
X20=ffffff8000406c87 X21=ffffff80403fc558 X22=ffffff80404044a0 X23=ffffff80685b29e0
X24=ffffff8040404538 X25=0000000000000000 X26=00000000ffffffff X27=0000000000000000
X28=0000000000000003 X29=ffffff80685b2960 X30=ffffff8000158e28 PSTATE=200003c5 (flags --C-)

q00=6463620061746164:5f69696373613278 q01=6362326e69620061:7461645f6e696232
q02=0000000000000000:000000000000000a q03=0000000000000000:0000000000000007
q04=0000000000000000:00000000000002b0 q05=0000000000000000:0000000000000009
q06=0000000000000000:000000007ff8c664 q07=0000000000000000:0000000000000300
q08=0000000000000000:0000000000000000 q09=0000000000000000:0000000000000000
q10=0000000000000000:0000000000000000 q11=0000000000000000:0000000000000000
q12=0000000000000000:0000000000000000 q13=0000000000000000:0000000000000000
q14=0000000000000000:0000000000000000 q15=0000000000000000:0000000000000000
q16=0000000000000000:00000000001e924f q17=0000000000000000:0000000000000008
q18=0000000000000000:000000000000000b q19=0000000000000000:000000007ff8ce6c
q20=0000000000000000:0000000000000000 q21=0000000000000000:0000000000000000
q22=0000000000000000:0000000000000000 q23=0000000000000000:0000000000000000
q24=0000000000000000:0000000000000000 q25=0000000000000000:0000000000000000
q26=0000000000000000:0000000000000000 q27=0000000000000000:0000000000000000
q28=0000000000000000:0000000000000000 q29=0000000000000000:0000000000000000
q30=0000000000000000:0000000000000000 q31=0000000000000000:0000000000000000
FPCR: 00000000  FPSR: 00000000
emaste commented 9 years ago

Another hang while running buildkernel,

(qemu) info registers
PC=ffffff80003c2a00  SP=ffffff8056fa4fb0
X00=ffffff8000437bdb X01=ffffff8000195700 X02=ffffff8056fa50b0 X03=000000000000000a
X04=ffffff8056fa5090 X05=0000000000000020 X06=0000000000000078 X07=ffffff8000194368
X08=ffffff8056fa50b0 X09=0000000000125b20 X10=ffffff8056fa5110 X11=ffffff8056fa51b0
X12=ffffff8056fa5200 X13=0000000000000000 X14=0000000000000000 X15=0000000000000000
X16=0000000000000000 X17=0000000000000000 X18=0000000042c04548 X19=ffffff8000524190
X20=ffffff8000437bdb X21=ffffff80005240f0 X22=00000000ffffffc8 X23=ffffff8056fa5110
X24=ffffff8056fa51b0 X25=000000000256a000 X26=000000000000007e X27=000000000000007e
X28=0000000042cd27e8 X29=ffffff8056fa5080 X30=ffffff80001956dc PSTATE=000003c5 (flags ----)

q00=0000000000000000:0000000000000000 q01=7261795f646d5f61:7461646174656d5f
q02=000000000000070e:0000000000000000 q03=0000007f00000000:000000001c6e4b44
q04=0000000400000005:0000000600000007 q05=0000000100000005:0000000600000007
q06=97fffbc2aa1603e2:2a1703e1aa1503e0 q07=b9400fe8b40003d8:f90003f8aa0003f8
q08=0000000000000000:4059000000000000 q09=0000000000000000:5ac009495ac00928
q10=0000000000000000:540006cb721e757f q11=0000000000000000:8b0c02aa93407d0b
q12=0000000000000000:11000e8d540005e8 q13=0000000000000000:cb0b01b093407dcd
q14=0000000000000000:540001cdeb2f419f q15=0000000000000000:3100041fb9400fe0
q16=2a1403e3aa1603e2:2a1703e1aa1503e0 q17=4b0801d614000013:3500034094000021
q18=cb09014291003100:8b0901698b0d0308 q19=0b1601085ac00908:b94026a8940f1a9c
q20=5ac00908b9400ea8:b90026a85ac00908 q21=b9000ea85ac00908:5ac00a890b160108
q22=93407e8291003100:f94003e8b9000709 q23=d100c3bf2a1f03e0:940ed986aa1303e1
q24=a8c45ff8a94157f6:a9424ff4a9437bfd q25=a90257f6a9015ff8:a9bb67fad65f03c0
q26=aa0403f3910103fd:a9047bfda9034ff4 q27=97fff8d8aa0003f4:aa0203f72a0303f5
q28=b9400e8854000a8b:710002df2a0003f6 q29=94082863aa1703e0:8b1a02985ac0091a
q30=aa1803e05ac00901:aa0003f9b9402288 q31=cb180017b4000260:97fff935aa1703e2
FPCR: 01000200  FPSR: 5000001b

The associated PC addresses are:

(lldb) image lookup -a ffffff800013e1c0
      Address: kernel[0xffffff800013e1c0] (kernel..text + 1298880)
      Summary: kernel`__mtx_unlock_spin_flags
(lldb) image lookup -a ffffff80003c2a00
      Address: kernel[0xffffff80003c2a00] (kernel..text + 3938816)
      Summary: kernel`exception_vectors + 512
emaste commented 9 years ago

Using stdio for serial results in the same hang, either while trying to run a build or (oddly) often when pressing "up" in the shell.

For exmple:

config.status: creating libpkg/pkg.pc
config.status: creating scripts/periodic/400.status-pkg
config.status: creating scripts/periodic/410.pkg-audit
<<< hang here, press Ctrl-a c >>>
QEMU 2.2.0 monitor - type 'help' for more information
(qemu) info registers 
PC=ffffff80003c2a00  SP=ffffff8056fa4fb0
X00=ffffff8000437beb X01=ffffff8000195700 X02=ffffff8056fa50b0 X03=000000000000000a
X04=ffffff8056fa5090 X05=0000000000000020 X06=0000000000000078 X07=ffffff8000194368
X08=ffffff8056fa50b0 X09=0000000000000000 X10=ffffff8056fa5110 X11=ffffff8056fa51b0
X12=ffffff8056fa5200 X13=0000000000000000 X14=0000000000000000 X15=0000000000000000
X16=0000000000000000 X17=0000000000000000 X18=0000000000000000 X19=ffffff8000524190
X20=ffffff8000437beb X21=ffffff80005240f0 X22=00000000ffffffc8 X23=ffffff8056fa5110
X24=ffffff8056fa51b0 X25=ffffff80005592b4 X26=ffffff8000558980 X27=ffffff8000539ac0
X28=ffffff8000524020 X29=ffffff8056fa5080 X30=ffffff80001956dc PSTATE=000003c5 (flags ----)

q00=0000000d00000000:0000000000000000 q01=20632d206c6c6174:736e692f6e69622f
q02=0000000300000002:0000000100000000 q03=0000001000000011:0000001200000013
q04=0000001000000011:0000001200000013 q05=0000001000000011:0000001200000013
q06=0000000000000001:0000000000000001 q07=b9400fe8b40003d8:f90003f8aa0003f8
q08=0000000000000000:4059000000000000 q09=0000000000000000:5ac009495ac00928
q10=0000000000000000:540006cb721e757f q11=0000000000000000:8b0c02aa93407d0b
q12=0000000000000000:11000e8d540005e8 q13=0000000000000000:cb0b01b093407dcd
q14=0000000000000000:540001cdeb2f419f q15=0000000000000000:3100041fb9400fe0
q16=2a1403e3aa1603e2:2a1703e1aa1503e0 q17=4b0801d614000013:3500034094000021
q18=cb09014291003100:8b0901698b0d0308 q19=0b1601085ac00908:b94026a8940f1a9d
q20=5ac00908b9400ea8:b90026a85ac00908 q21=b9000ea85ac00908:5ac00a890b160108
q22=93407e8291003100:f94003e8b9000709 q23=d100c3bf2a1f03e0:940ed986aa1303e1
q24=a8c45ff8a94157f6:a9424ff4a9437bfd q25=a90257f6a9015ff8:a9bb67fad65f03c0
q26=aa0403f3910103fd:a9047bfda9034ff4 q27=97fff8d8aa0003f4:aa0203f72a0303f5
q28=b9400e8854000a8b:710002df2a0003f6 q29=94082863aa1703e0:8b1a02985ac0091a
q30=aa1803e05ac00901:aa0003f9b9402288 q31=cb180017b4000260:97fff935aa1703e2
FPCR: 01000200  FPSR: 5000001b

(lldb) image lookup -a ffffff80003c2a00
      Address: kernel[0xffffff80003c2a00] (kernel..text + 3938816)
      Summary: kernel`exception_vectors + 512
emaste commented 9 years ago

With my build at ec34ba2419d7ffc9f09cd8013539b69dba94c926 + WIP I cannot reproduce this hang (with -serial telnet::4444,server) or a hang upon pressing "up" (with -serial stdio). I can still reproduce the QEMU serial hang with -nographic.

My rev from uname is r279320+1ca4b1d(merge_head)-dirty

emaste commented 7 years ago

cb9e4cd652ce4c5aaaa4d85b1c797e5bbfe83cd6