Message ID | 511b2f6009fb830b3f32b4be3dca99596c684fa3.1689759351.git.falcon@tinylab.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2445647vqt; Wed, 19 Jul 2023 06:38:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlFcL7Yyi4qghTD3Op6Sp+twTpDkjqnnGdnbzO66KRwPmhvCpu0lmcYUi+aQkuhHwd/ZmE+W X-Received: by 2002:a05:6e02:12e1:b0:345:3378:4251 with SMTP id l1-20020a056e0212e100b0034533784251mr6681407iln.23.1689773898476; Wed, 19 Jul 2023 06:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689773898; cv=none; d=google.com; s=arc-20160816; b=uOxaaC8gqQ1H2Q1PQcQ4vZt60JfdoS/URc5HZWVghk1Il7MAB18b62ekefNnPfBABX efb9fgTei77XFsvosw73R2V6YFG8B74fs+UAcOu+e8GpKORO4S3di5hJbsdQP0MXgR3Y kroyHC+hOpnFsPqMSuOcIaRRTcR0T/vbYgHp1ugSMfMniRRwUoz3e9LQSsE+15m3Imw6 9B7yvvcBduyVUvLuesgr7lVr/5HR/1Wm6M7Y9e4kp6MMRpzcNpnKM3BMjVfQYaPWogxp Qufuhb4kcFOiX3mpJ0mdzdmtLgWe95jkcpD79pfdtfidRifCfVR1T2FEE+VvZ7nwzlrQ CYMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=D1NFMzAyqXK+V5zRvfq/gdfOqq+SGNb8pHbrabwi0Bg=; fh=LUnDCxFG3oyWlcYTkiNww5x4+0V5pkm51/GfDl61ZDU=; b=RwXuhGX1N1JZ4KUamT3AyvzdNJP3Dhke2wGRex+JMVdiWTh8VbCyebWZA9rcd4d8g3 Cbdr1jcSvWlu0HXMCN+00Xp+d8YpaPiiK4HNqaJX+tRqnvJzhiL0gUOvL92FYkar+V1L OjQki8aiYnhTlQiTgGjEk2+xoLs3NM7t8F0j7s1NgaH9dLzzglpLzz4PsbiH3WbBJs7s GxqGEaLWpyfDlshiQu0EUAwLDLgP7jeqeOPzFMDIBSTK4fsYcGjxFL1F4GEbHygLhu9m L8pPuN4m9J0bigjFnbwdyyZTiSMojVrA2tQOy+hcPFZQqLV2XtPlx+K+ippGPTZHzWyd QUWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e2-20020a637442000000b0056350e75736si1503019pgn.529.2023.07.19.06.38.00; Wed, 19 Jul 2023 06:38:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231246AbjGSN1X (ORCPT <rfc822;chrisben.tianve@gmail.com> + 99 others); Wed, 19 Jul 2023 09:27:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbjGSN1W (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Jul 2023 09:27:22 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A53ACFD; Wed, 19 Jul 2023 06:27:19 -0700 (PDT) X-QQ-mid: bizesmtp73t1689773230tl41c04k Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:27:09 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: IcCSTr/hHjObbBazmsx/eCk6zRHzb4DLLNT0pf/dPkYF5A5ior6pI6BCHSsR6 Ls5QcnnivFHHZI0EX9chwHrUZo6HybXN+Cgzuoi7E6aZgU+1yfQ14crWCtNUDJ/gaGFW2uJ TKdt3NDsCDUgg5seMKn0J51fY8ToI5VZY/w04izFonbY4YFDEJIrnxYhSDjhxqDZ4ewz626 vd3bJFiAcB5340nsQBeWRtHGS1WbMKXJCRkw9OxxBQ3cEBkwgvFsiBlpF9UEwYQ2aus0rLT sWs48u3OS58LBsGC0E7Glr5gfeuoGQ6FzjBbri/cuFKmF1qd8LRLfgW5SjbRd2cwRmtU52L D1VhjIeI9q7iCTQGy8HU+Khonc1Zm4NC1RI2YdoZIiKSFIuXtWXikEGBVIvUtwlYWB1rwQd PjYxYlvgGZQ= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 11276070205488590152 From: Zhangjin Wu <falcon@tinylab.org> To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 09/14] selftests/nolibc: allow quit qemu-system when poweroff fails Date: Wed, 19 Jul 2023 21:27:08 +0800 Message-Id: <511b2f6009fb830b3f32b4be3dca99596c684fa3.1689759351.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <cover.1689759351.git.falcon@tinylab.org> References: <cover.1689759351.git.falcon@tinylab.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771856355264325670 X-GMAIL-MSGID: 1771856355264325670 |
Series |
selftests/nolibc: add minimal kernel config support - part1
|
|
Commit Message
Zhangjin Wu
July 19, 2023, 1:27 p.m. UTC
The kernel of some architectures can not poweroff qemu-system normally,
especially for tinyconfig.
Some architectures may have no kernel poweroff support, the others may
require more kernel config options and therefore slow down the
tinyconfig build and test. and also, it's very hard (and some even not
possible) to find out the exact poweroff related kernel config options
for every architecture.
Since the low-level poweroff support is heavily kernel & qemu dependent,
it is not that critical to both nolibc and nolibc-test, let's simply
ignore the poweroff required kernel config options for tinyconfig (and
even for defconfig) and quit qemu-system after a specified timeout or
with an expected system halt or poweroff string (these strings mean our
reboot() library routine is perfectly ok).
QEMU_TIMEOUT value can be configured for every architecture based on
their time cost requirement of boot+test+poweroff.
Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
---
tools/testing/selftests/nolibc/Makefile | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
Comments
On Wed, Jul 19, 2023 at 09:27:08PM +0800, Zhangjin Wu wrote: > The kernel of some architectures can not poweroff qemu-system normally, > especially for tinyconfig. > > Some architectures may have no kernel poweroff support, the others may > require more kernel config options and therefore slow down the > tinyconfig build and test. and also, it's very hard (and some even not > possible) to find out the exact poweroff related kernel config options > for every architecture. > > Since the low-level poweroff support is heavily kernel & qemu dependent, > it is not that critical to both nolibc and nolibc-test, let's simply > ignore the poweroff required kernel config options for tinyconfig (and > even for defconfig) and quit qemu-system after a specified timeout or > with an expected system halt or poweroff string (these strings mean our > reboot() library routine is perfectly ok). > > QEMU_TIMEOUT value can be configured for every architecture based on > their time cost requirement of boot+test+poweroff. > > Signed-off-by: Zhangjin Wu <falcon@tinylab.org> > --- > tools/testing/selftests/nolibc/Makefile | 23 +++++++++++++++++++++-- > 1 file changed, 21 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile > index 541f3565e584..a03fab020ebe 100644 > --- a/tools/testing/selftests/nolibc/Makefile > +++ b/tools/testing/selftests/nolibc/Makefile > @@ -93,6 +93,9 @@ QEMU_ARGS_s390 = -M s390-ccw-virtio -m 1G -append "console=ttyS0 panic=-1 > QEMU_ARGS_loongarch = -M virt -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)" > QEMU_ARGS = $(QEMU_ARGS_$(XARCH)) $(QEMU_ARGS_EXTRA) > > +# QEMU_TIMEOUT: some architectures can not poweroff normally, especially for tinyconfig > +QEMU_TIMEOUT = $(QEMU_TIMEOUT_$(XARCH)) > + > # OUTPUT is only set when run from the main makefile, otherwise > # it defaults to this nolibc directory. > OUTPUT ?= $(CURDIR)/ > @@ -224,16 +227,32 @@ kernel: extconfig > # common macros for qemu run/rerun targets > QEMU_SYSTEM_RUN = qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(KERNEL_IMAGE)" -serial stdio $(QEMU_ARGS) > > +ifneq ($(QEMU_TIMEOUT),) > +TIMEOUT_CMD = t=$(QEMU_TIMEOUT); \ > + while [ $$t -gt 0 ]; do \ > + sleep 5; t=$$(expr $$t - 5); echo "detecting power off ..."; \ > + if grep -qE "reboot: System halted|reboot: Power down" "$(RUN_OUT)"; then \ > + pkill -9 qemu-system-$(QEMU_ARCH); \ > + echo "powered off, test finish"; t=1; break; \ > + fi; \ > + done; \ > + if [ $$t -le 0 ]; then pkill -9 qemu-system-$(QEMU_ARCH); echo "qemu-system-$(QEMU_ARCH) timeout"; fi Please have a look at the "timeout" command whichi makes all this much simpler. Also, please get used to never ever use kill -9 first. This is exactly the way to leave temporary files and IPCs wandering around while many programs that care about cleanups at least try to do that upon a regular TERM or INT signal. Willy
Hi, Willy > On Wed, Jul 19, 2023 at 09:27:08PM +0800, Zhangjin Wu wrote: > > The kernel of some architectures can not poweroff qemu-system normally, > > especially for tinyconfig. > > > > Some architectures may have no kernel poweroff support, the others may > > require more kernel config options and therefore slow down the > > tinyconfig build and test. and also, it's very hard (and some even not > > possible) to find out the exact poweroff related kernel config options > > for every architecture. > > > > Since the low-level poweroff support is heavily kernel & qemu dependent, > > it is not that critical to both nolibc and nolibc-test, let's simply > > ignore the poweroff required kernel config options for tinyconfig (and > > even for defconfig) and quit qemu-system after a specified timeout or > > with an expected system halt or poweroff string (these strings mean our > > reboot() library routine is perfectly ok). > > > > QEMU_TIMEOUT value can be configured for every architecture based on > > their time cost requirement of boot+test+poweroff. > > > > Signed-off-by: Zhangjin Wu <falcon@tinylab.org> > > --- > > tools/testing/selftests/nolibc/Makefile | 23 +++++++++++++++++++++-- > > 1 file changed, 21 insertions(+), 2 deletions(-) > > > > diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile > > index 541f3565e584..a03fab020ebe 100644 > > --- a/tools/testing/selftests/nolibc/Makefile > > +++ b/tools/testing/selftests/nolibc/Makefile > > @@ -93,6 +93,9 @@ QEMU_ARGS_s390 = -M s390-ccw-virtio -m 1G -append "console=ttyS0 panic=-1 > > QEMU_ARGS_loongarch = -M virt -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)" > > QEMU_ARGS = $(QEMU_ARGS_$(XARCH)) $(QEMU_ARGS_EXTRA) > > > > +# QEMU_TIMEOUT: some architectures can not poweroff normally, especially for tinyconfig > > +QEMU_TIMEOUT = $(QEMU_TIMEOUT_$(XARCH)) > > + > > # OUTPUT is only set when run from the main makefile, otherwise > > # it defaults to this nolibc directory. > > OUTPUT ?= $(CURDIR)/ > > @@ -224,16 +227,32 @@ kernel: extconfig > > # common macros for qemu run/rerun targets > > QEMU_SYSTEM_RUN = qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(KERNEL_IMAGE)" -serial stdio $(QEMU_ARGS) > > > > +ifneq ($(QEMU_TIMEOUT),) > > +TIMEOUT_CMD = t=$(QEMU_TIMEOUT); \ > > + while [ $$t -gt 0 ]; do \ > > + sleep 5; t=$$(expr $$t - 5); echo "detecting power off ..."; \ > > + if grep -qE "reboot: System halted|reboot: Power down" "$(RUN_OUT)"; then \ > > + pkill -9 qemu-system-$(QEMU_ARCH); \ > > + echo "powered off, test finish"; t=1; break; \ > > + fi; \ > > + done; \ > > + if [ $$t -le 0 ]; then pkill -9 qemu-system-$(QEMU_ARCH); echo "qemu-system-$(QEMU_ARCH) timeout"; fi > > Please have a look at the "timeout" command whichi makes all this much > simpler. Yeah, I used 'timeout --forgeground' before, but it is still a dead wait and it is very hard for us to configure a just right wait time. If the configured wait time is short, the qemu will be killed during the test or before running the test, If the configured wait time is long, we will need to dead wait there even if the test is finished, although during interactive running, we can press 'CTRL + A X', but for background running, it is just time waste. To fix up this issue, the above method used at last allow to detect the output string, when the test finish and print something lines like: reboot: System halted reboot: Power down. We will use pkill to send signal to tell qemu quit, so, it is ok for us to configure a even'big' timeout, if the kernel can normally poweroff or if nolibc can successfully send the poweroff syscall, the above message will be detected and qemu will quit as expected, it will completely avoid dead wait, the configured timeout will never happen, this is comfortable. The worst case is only when qemu or kernel reject to boot, for example, a qemu bios missing or mismatch issue or a kernel regression or a wrong kernel config option, for these cases, the real timeout logic will work for us. As a summary, our timeout logic here include two parts: one is 'poweroff' related string detection, another is the real timeout logic. Based on current implementation, I even plan to add the test finish string in the expected strings: Leaving init with final status And even further, when a hang detected (no normal poweroff or test finish string detected), print the whole or last part of running log to tell users what happens. > Also, please get used to never ever use kill -9 first. This > is exactly the way to leave temporary files and IPCs wandering around > while many programs that care about cleanups at least try to do that > upon a regular TERM or INT signal. > Ok, thanks, will use TERM or INT signal instead. > Willy
On Tue, Jul 25, 2023 at 10:59:55PM +0800, Zhangjin Wu wrote: > > On Wed, Jul 19, 2023 at 09:27:08PM +0800, Zhangjin Wu wrote: > > > The kernel of some architectures can not poweroff qemu-system normally, > > > especially for tinyconfig. > > > > > > Some architectures may have no kernel poweroff support, the others may > > > require more kernel config options and therefore slow down the > > > tinyconfig build and test. and also, it's very hard (and some even not > > > possible) to find out the exact poweroff related kernel config options > > > for every architecture. > > > > > > Since the low-level poweroff support is heavily kernel & qemu dependent, > > > it is not that critical to both nolibc and nolibc-test, let's simply > > > ignore the poweroff required kernel config options for tinyconfig (and > > > even for defconfig) and quit qemu-system after a specified timeout or > > > with an expected system halt or poweroff string (these strings mean our > > > reboot() library routine is perfectly ok). > > > > > > QEMU_TIMEOUT value can be configured for every architecture based on > > > their time cost requirement of boot+test+poweroff. > > > > > > Signed-off-by: Zhangjin Wu <falcon@tinylab.org> > > > --- > > > tools/testing/selftests/nolibc/Makefile | 23 +++++++++++++++++++++-- > > > 1 file changed, 21 insertions(+), 2 deletions(-) > > > > > > diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile > > > index 541f3565e584..a03fab020ebe 100644 > > > --- a/tools/testing/selftests/nolibc/Makefile > > > +++ b/tools/testing/selftests/nolibc/Makefile > > > @@ -93,6 +93,9 @@ QEMU_ARGS_s390 = -M s390-ccw-virtio -m 1G -append "console=ttyS0 panic=-1 > > > QEMU_ARGS_loongarch = -M virt -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)" > > > QEMU_ARGS = $(QEMU_ARGS_$(XARCH)) $(QEMU_ARGS_EXTRA) > > > > > > +# QEMU_TIMEOUT: some architectures can not poweroff normally, especially for tinyconfig > > > +QEMU_TIMEOUT = $(QEMU_TIMEOUT_$(XARCH)) > > > + > > > # OUTPUT is only set when run from the main makefile, otherwise > > > # it defaults to this nolibc directory. > > > OUTPUT ?= $(CURDIR)/ > > > @@ -224,16 +227,32 @@ kernel: extconfig > > > # common macros for qemu run/rerun targets > > > QEMU_SYSTEM_RUN = qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(KERNEL_IMAGE)" -serial stdio $(QEMU_ARGS) > > > > > > +ifneq ($(QEMU_TIMEOUT),) > > > +TIMEOUT_CMD = t=$(QEMU_TIMEOUT); \ > > > + while [ $$t -gt 0 ]; do \ > > > + sleep 5; t=$$(expr $$t - 5); echo "detecting power off ..."; \ > > > + if grep -qE "reboot: System halted|reboot: Power down" "$(RUN_OUT)"; then \ > > > + pkill -9 qemu-system-$(QEMU_ARCH); \ > > > + echo "powered off, test finish"; t=1; break; \ > > > + fi; \ > > > + done; \ > > > + if [ $$t -le 0 ]; then pkill -9 qemu-system-$(QEMU_ARCH); echo "qemu-system-$(QEMU_ARCH) timeout"; fi > > > > Please have a look at the "timeout" command whichi makes all this much > > simpler. > > Yeah, I used 'timeout --forgeground' before, but it is still a dead wait > and it is very hard for us to configure a just right wait time. > > If the configured wait time is short, the qemu will be killed during the > test or before running the test, If the configured wait time is long, we > will need to dead wait there even if the test is finished, although > during interactive running, we can press 'CTRL + A X', but for > background running, it is just time waste. > > To fix up this issue, the above method used at last allow to detect the > output string, when the test finish and print something lines like: > > reboot: System halted > reboot: Power down. > > We will use pkill to send signal to tell qemu quit, so, it is ok for us > to configure a even'big' timeout, if the kernel can normally poweroff or > if nolibc can successfully send the poweroff syscall, the above message > will be detected and qemu will quit as expected, it will completely > avoid dead wait, the configured timeout will never happen, this is > comfortable. > > The worst case is only when qemu or kernel reject to boot, for example, > a qemu bios missing or mismatch issue or a kernel regression or a wrong > kernel config option, for these cases, the real timeout logic will work > for us. > > As a summary, our timeout logic here include two parts: one is > 'poweroff' related string detection, another is the real timeout logic. > > Based on current implementation, I even plan to add the test finish > string in the expected strings: > > Leaving init with final status > > And even further, when a hang detected (no normal poweroff or test > finish string detected), print the whole or last part of running log to > tell users what happens. Again, all of this seems ridiculously complicated for what seems to be a very unlikely issue. You mentioned earlier: > > > The kernel of some architectures can not poweroff qemu-system > > > normally, especially for tinyconfig. Till now all those I tested do power off correctly. So if the problem is related to one specific arch, first it should be mentioned in the commit message, and maybe we need to look closer why it's doing that instead of papering over it, and if it's caused by tinyconfig, it just means we need to produce a more reasonable config. But I still don't like the idea of causing a problem on one side, and making the other side totally ugly just because of the problem. The timeout solution should be a last resort one which clearly explains why we can't do differently. Also, defconfig and tinyconfig are for people who work on nolibc. These ones should support working in batch mode, being called from a script iterating over multiple archs. For other config, we should not interfer with what the user does. Maybe some will consider that it's fine to run a test slowly on a simulated platform for example. Willy
diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 541f3565e584..a03fab020ebe 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -93,6 +93,9 @@ QEMU_ARGS_s390 = -M s390-ccw-virtio -m 1G -append "console=ttyS0 panic=-1 QEMU_ARGS_loongarch = -M virt -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS = $(QEMU_ARGS_$(XARCH)) $(QEMU_ARGS_EXTRA) +# QEMU_TIMEOUT: some architectures can not poweroff normally, especially for tinyconfig +QEMU_TIMEOUT = $(QEMU_TIMEOUT_$(XARCH)) + # OUTPUT is only set when run from the main makefile, otherwise # it defaults to this nolibc directory. OUTPUT ?= $(CURDIR)/ @@ -224,16 +227,32 @@ kernel: extconfig # common macros for qemu run/rerun targets QEMU_SYSTEM_RUN = qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(KERNEL_IMAGE)" -serial stdio $(QEMU_ARGS) +ifneq ($(QEMU_TIMEOUT),) +TIMEOUT_CMD = t=$(QEMU_TIMEOUT); \ + while [ $$t -gt 0 ]; do \ + sleep 5; t=$$(expr $$t - 5); echo "detecting power off ..."; \ + if grep -qE "reboot: System halted|reboot: Power down" "$(RUN_OUT)"; then \ + pkill -9 qemu-system-$(QEMU_ARCH); \ + echo "powered off, test finish"; t=1; break; \ + fi; \ + done; \ + if [ $$t -le 0 ]; then pkill -9 qemu-system-$(QEMU_ARCH); echo "qemu-system-$(QEMU_ARCH) timeout"; fi + +TIMEOUT_QEMU_RUN = ($(QEMU_SYSTEM_RUN) $(LOG_OUT) &); $(TIMEOUT_CMD) +else +TIMEOUT_QEMU_RUN = $(QEMU_SYSTEM_RUN) $(LOG_OUT) +endif + # run the tests after building the kernel PHONY += $(KERNEL_IMAGE) $(KERNEL_IMAGE): kernel run: $(KERNEL_IMAGE) - $(Q)$(QEMU_SYSTEM_RUN) $(LOG_OUT) + $(Q)$(TIMEOUT_QEMU_RUN) $(Q)$(REPORT_RUN_OUT) # re-run the tests from an existing kernel rerun: - $(Q)$(QEMU_SYSTEM_RUN) $(LOG_OUT) + $(Q)$(TIMEOUT_QEMU_RUN) $(Q)$(REPORT_RUN_OUT) # report with existing test log