[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tests/boot-serial-test: Allow the HPPA machine to shudown

From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] tests/boot-serial-test: Allow the HPPA machine to shudown
Date: Thu, 23 Jan 2020 19:37:26 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2

On 1/23/20 4:27 AM, Richard Henderson wrote:
On 1/22/20 2:36 PM, Philippe Mathieu-Daudé wrote:
The boot-serial test uses SeaBIOS on HPPA, and expects to read the
"SeaBIOS wants SYSTEM HALT" string, see [*]:

  122 void __VISIBLE __noreturn hlt(void)
  123 {
  124     if (pdc_debug)
  125         printf("HALT initiated from %p\n",  __builtin_return_address(0));
  126     printf("SeaBIOS wants SYSTEM HALT.\n\n");
  127     asm volatile("\t.word 0xfffdead0": : :"memory");
  128     while (1);
  129 }

A 'SYSTEM HALT' would really halts the CPU, but SeaBIOS implements
it as an infinite loop.

Well, SeaBIOS implements it as the magic QEMU halt instruction,

# These are artificial instructions used by QEMU firmware.
# They are allocated from the unassigned instruction space.
halt            1111 1111 1111 1101 1110 1010 1101 0000
reset           1111 1111 1111 1101 1110 1010 1101 0001

followed by an infinite loop, probably to avoid a compiler warning and Just In
Case.  We really should halt here, unless shutdown is disabled.

-    qts = qtest_initf("%s %s -M %s -no-shutdown "
+    qts = qtest_initf("%s %s -M %s %s "
                        "-chardev file,id=serial0,path=%s "
                        "-serial chardev:serial0 -accel tcg -accel kvm %s",
                        codeparam, code ? codetmp : "", test->machine,
+                      shutdown ? "" : "-no-shutdown",
                        serialtmp, test->extra);

And thus avoiding the -no-shutdown should in fact shutdown.

Are you saying this doesn't happen, or what?  I think I got lost with the rest
of the message...

"If the command-line option "-no-shutdown" has been specified,
 qemu will not exit, and a STOP event will eventually follow
 the SHUTDOWN event"

What I see is the HPPA firmware calling HALT, then QEMU doesn't exit.

The QTest keeps reading the console for "SeaBIOS wants SYSTEM HALT.".
When this string is displayed on the graphic output instead of the serial, the QTest keep reading indefinitely, and the test never succeeds/fails, it is just stuck.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]