From patchwork Thu May 23 10:25:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164953 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1986088ili; Thu, 23 May 2019 03:27:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxNX6qUnugL3nf6qavg/9CLem9tTtbH5e5SXjlP7AvBOiH5J5MwXPnFX8EajHIp2A1UZDx X-Received: by 2002:a17:906:b84d:: with SMTP id ga13mr76936192ejb.236.1558607246388; Thu, 23 May 2019 03:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558607246; cv=none; d=google.com; s=arc-20160816; b=ZaWsxuEW8YTdYgR5LJ3KqdM1kdoMHddcHMwuQ8IDoAmqr5aSiCeIPZMVGvriBN722Q CkHvU+jnmtmvgw/EuqOjxnCrM9u4vb3wWzCy4DW5XMsUjy9B3fD3uVNyXZAJN/QdusuP koJGOD/2CwW/Dhcf1659kHMEEM0HWew8GOKD8rF7hi1U6ewAu0aXmSLQqSYBrwQRGrGj h/6p5yoSZemjt0+XA+2WGVb8QDYbEj3Z051+T7cJbGuItiBeEXl8R+UHzxKnRbJeGsCT o+0uqh4iMAhYCJ6aY7/iwy6Wge2q5eKW1DwdBIIlirKymO66CvjD4ObetoH9Sm42M/Lh MVsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=iuJju+zdPT7iceeAnurMB98v66ii11jMwZw4RWJ0mLs=; b=khdUYBJmKTopj9GpunIYikK7VwqFk/zxuo+ejbvMrH2jSctIgVwdt4HTXGk1Z6BcG7 KNUpvXNqbeROwVNGj3CB5PDgUO702RJd2d5wdGUahqK+LTHfKcDlT2SBva6CoYUi8alf s+nJaI1Sm8r4Bsm7X3kP60npRflwlUPR41da//uFVzINRoZgzyFL4r3oyWZEgV4wH79o Pv9Xw6V50c1MoHwUABE9ekQzSqYvChVBC8UWYlPQnS0aS4fvl6FXm3y93gGYM8W1xroN 5WBKh+uZPzAMeaaiDVZEvYykv63zCjbA2ckzlWWJ/7gJ1RySGtDEJ8bqMumTFwDEeOBU pGaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=zOBIaOPC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a4si6157700ejs.276.2019.05.23.03.27.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:27:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=zOBIaOPC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33070 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkwX-0006ZD-5E for patch@linaro.org; Thu, 23 May 2019 06:27:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkuy-0005SJ-4W for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkut-0000zC-Dx for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:47 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:43452) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkuo-0000r6-0t for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:41 -0400 Received: by mail-wr1-x442.google.com with SMTP id t7so5339817wrr.10 for ; Thu, 23 May 2019 03:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iuJju+zdPT7iceeAnurMB98v66ii11jMwZw4RWJ0mLs=; b=zOBIaOPCAtci9VUXZuZmO52h461g4aeHlo5uME49gsa8cZzWgkeWajAxvkuVPrLD1J H/UeAX9l0UoOhilm6Mc4AZAlpFf1rC7slgwOCaHw62OzT1tM6Dyn5pXKuXAHK7SoV0pD p/szUnm1kPgJxUBFnfUnfrZVEcAj0VmGizMSwRjNoLrWw5y7zjhhM9JXCrAuSoB/8Vg8 bLRLm2ZzFYzER4LJR82VqVZ689T+4uUpQ1+sN4Pgj6Fg6/eZ/8b5mdGYcjRvuOYzPisi v/xqYakEl3NlftvuH96E3Vv98B3Gz9JsbPg8S5RmK/NwYzGbLLpSSpI/44msa66ShBKj LYJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iuJju+zdPT7iceeAnurMB98v66ii11jMwZw4RWJ0mLs=; b=fv2rmt5aFNKDFEu4xWZsDAScGHD/vpMM7s87+MuvbzEWRX3WHKRl5qotJACw5HWwvF FsWBl4sBqGl62jBsPdCxP8zGrecvgztVLoTmxD+m8DGt1dRfMik4Kl49BGbpDgeejBAM fICflbOYHgoh3JqCDo30fwFR5OxyQEnfJk3vniYXFJSG03puAMGjlBDv0jVUAafOUdIf v0s99JqGQS9MWuodu4L4tOx3EaYXgD/gqIf7JRXOodkWq8S3z1aqCjkr+7i2kzrw63aI U3rt6GsmWCYkxF16p1orWkTa6sH+jX8HCW9obzdIqvXF/X71C31627sURvk1vni4rE7n DHVA== X-Gm-Message-State: APjAAAXLi8QIEfxUbcPQesabbqVE70kNWfsKwVDoO5Xojug2ZTtPWR4y SfbEORI/JYwa5v+iM4+sC3zsjw== X-Received: by 2002:adf:eb02:: with SMTP id s2mr53026004wrn.29.1558607133794; Thu, 23 May 2019 03:25:33 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id q11sm11417258wmc.15.2019.05.23.03.25.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:33 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 741F01FF8C; Thu, 23 May 2019 11:25:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:05 +0100 Message-Id: <20190523102532.10486-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 Subject: [Qemu-devel] [PATCH v2 01/28] semihosting: move semihosting configuration into its own directory X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Peter Maydell , Aleksandar Rikalo , =?utf-8?q?Alex_Benn=C3=A9e?= , Chris Wulff , Laurent Vivier , Max Filippov , Michael Walle , qemu-arm@nongnu.org, Aleksandar Markovic , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In preparation for having some more common semihosting code let's excise the current config magic from vl.c into its own file. We shall later add more conditionals to the build configurations so we can avoid building this if we don't need it. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- gdbstub.c | 2 +- hw/Makefile.objs | 1 + hw/mips/mips_malta.c | 2 +- hw/semihosting/Makefile.objs | 1 + hw/semihosting/config.c | 160 ++++++++++++++++++++ include/{exec => hw/semihosting}/semihost.h | 10 +- include/sysemu/sysemu.h | 1 + target/arm/arm-semi.c | 2 +- target/arm/helper.c | 2 +- target/arm/translate-a64.c | 2 +- target/arm/translate.c | 2 +- target/lm32/helper.c | 2 +- target/m68k/op_helper.c | 2 +- target/mips/mips-semi.c | 2 +- target/mips/translate.c | 2 +- target/nios2/helper.c | 2 +- target/xtensa/translate.c | 2 +- target/xtensa/xtensa-semi.c | 2 +- vl.c | 126 +-------------- 19 files changed, 186 insertions(+), 139 deletions(-) create mode 100644 hw/semihosting/Makefile.objs create mode 100644 hw/semihosting/config.c rename include/{exec => hw/semihosting}/semihost.h (85%) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/gdbstub.c b/gdbstub.c index d54abd17cc2..793218bb43a 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -37,7 +37,7 @@ #include "qemu/sockets.h" #include "sysemu/hw_accel.h" #include "sysemu/kvm.h" -#include "exec/semihost.h" +#include "hw/semihosting/semihost.h" #include "exec/exec-all.h" #ifdef CONFIG_USER_ONLY diff --git a/hw/Makefile.objs b/hw/Makefile.objs index 82aa7fab8e4..d770926ba96 100644 --- a/hw/Makefile.objs +++ b/hw/Makefile.objs @@ -36,6 +36,7 @@ devices-dirs-$(CONFIG_SOFTMMU) += watchdog/ devices-dirs-$(CONFIG_SOFTMMU) += xen/ devices-dirs-$(CONFIG_MEM_DEVICE) += mem/ devices-dirs-$(CONFIG_SOFTMMU) += smbios/ +devices-dirs-y += semihosting/ devices-dirs-y += core/ common-obj-y += $(devices-dirs-y) obj-y += $(devices-dirs-y) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 439665ab45e..3b009fda25f 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -55,7 +55,7 @@ #include "qemu/error-report.h" #include "hw/empty_slot.h" #include "sysemu/kvm.h" -#include "exec/semihost.h" +#include "hw/semihosting/semihost.h" #include "hw/mips/cps.h" #define ENVP_ADDR 0x80002000l diff --git a/hw/semihosting/Makefile.objs b/hw/semihosting/Makefile.objs new file mode 100644 index 00000000000..546954f4ff4 --- /dev/null +++ b/hw/semihosting/Makefile.objs @@ -0,0 +1 @@ +common-obj-$(CONFIG_SOFTMMU) += config.o diff --git a/hw/semihosting/config.c b/hw/semihosting/config.c new file mode 100644 index 00000000000..f1d3fe1e4c6 --- /dev/null +++ b/hw/semihosting/config.c @@ -0,0 +1,160 @@ +/* + * Semihosting configuration + * + * Copyright (c) 2015 Imagination Technologies + * Copyright (c) 2019 Linaro Ltd + * + * This controls the configuration of semihosting for all guest + * targets that support it. Architecture specific handling is handled + * in target/HW/HW-semi.c + * + * Semihosting is sightly strange in that it is also supported by some + * linux-user targets. However in that use case no configuration of + * the outputs and command lines is supported. + * + * The config module is common to all softmmu targets however as vl.c + * needs to link against the helpers. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/option.h" +#include "qemu/config-file.h" +#include "qemu/error-report.h" +#include "hw/semihosting/semihost.h" + +QemuOptsList qemu_semihosting_config_opts = { + .name = "semihosting-config", + .implied_opt_name = "enable", + .head = QTAILQ_HEAD_INITIALIZER(qemu_semihosting_config_opts.head), + .desc = { + { + .name = "enable", + .type = QEMU_OPT_BOOL, + }, { + .name = "target", + .type = QEMU_OPT_STRING, + }, { + .name = "arg", + .type = QEMU_OPT_STRING, + }, + { /* end of list */ } + }, +}; + +typedef struct SemihostingConfig { + bool enabled; + SemihostingTarget target; + const char **argv; + int argc; + const char *cmdline; /* concatenated argv */ +} SemihostingConfig; + +static SemihostingConfig semihosting; + +bool semihosting_enabled(void) +{ + return semihosting.enabled; +} + +SemihostingTarget semihosting_get_target(void) +{ + return semihosting.target; +} + +const char *semihosting_get_arg(int i) +{ + if (i >= semihosting.argc) { + return NULL; + } + return semihosting.argv[i]; +} + +int semihosting_get_argc(void) +{ + return semihosting.argc; +} + +const char *semihosting_get_cmdline(void) +{ + if (semihosting.cmdline == NULL && semihosting.argc > 0) { + semihosting.cmdline = g_strjoinv(" ", (gchar **)semihosting.argv); + } + return semihosting.cmdline; +} + +static int add_semihosting_arg(void *opaque, + const char *name, const char *val, + Error **errp) +{ + SemihostingConfig *s = opaque; + if (strcmp(name, "arg") == 0) { + s->argc++; + /* one extra element as g_strjoinv() expects NULL-terminated array */ + s->argv = g_realloc(s->argv, (s->argc + 1) * sizeof(void *)); + s->argv[s->argc - 1] = val; + s->argv[s->argc] = NULL; + } + return 0; +} + +/* Use strings passed via -kernel/-append to initialize semihosting.argv[] */ +void semihosting_arg_fallback(const char *file, const char *cmd) +{ + char *cmd_token; + + /* argv[0] */ + add_semihosting_arg(&semihosting, "arg", file, NULL); + + /* split -append and initialize argv[1..n] */ + cmd_token = strtok(g_strdup(cmd), " "); + while (cmd_token) { + add_semihosting_arg(&semihosting, "arg", cmd_token, NULL); + cmd_token = strtok(NULL, " "); + } +} + +void qemu_semihosting_enable(void) +{ + semihosting.enabled = true; + semihosting.target = SEMIHOSTING_TARGET_AUTO; +} + +int qemu_semihosting_config_options(const char *optarg) +{ + QemuOptsList *opt_list = qemu_find_opts("semihosting-config"); + QemuOpts *opts = qemu_opts_parse_noisily(opt_list, optarg, false); + + semihosting.enabled = true; + + if (opts != NULL) { + semihosting.enabled = qemu_opt_get_bool(opts, "enable", + true); + const char *target = qemu_opt_get(opts, "target"); + if (target != NULL) { + if (strcmp("native", target) == 0) { + semihosting.target = SEMIHOSTING_TARGET_NATIVE; + } else if (strcmp("gdb", target) == 0) { + semihosting.target = SEMIHOSTING_TARGET_GDB; + } else if (strcmp("auto", target) == 0) { + semihosting.target = SEMIHOSTING_TARGET_AUTO; + } else { + error_report("unsupported semihosting-config %s", + optarg); + return 1; + } + } else { + semihosting.target = SEMIHOSTING_TARGET_AUTO; + } + /* Set semihosting argument count and vector */ + qemu_opt_foreach(opts, add_semihosting_arg, + &semihosting, NULL); + } else { + error_report("unsupported semihosting-config %s", optarg); + return 1; + } + + return 0; +} + diff --git a/include/exec/semihost.h b/include/hw/semihosting/semihost.h similarity index 85% rename from include/exec/semihost.h rename to include/hw/semihosting/semihost.h index 5980939c7b8..07ea40a322f 100644 --- a/include/exec/semihost.h +++ b/include/hw/semihosting/semihost.h @@ -51,12 +51,16 @@ static inline const char *semihosting_get_cmdline(void) { return NULL; } -#else +#else /* !CONFIG_USER_ONLY */ bool semihosting_enabled(void); SemihostingTarget semihosting_get_target(void); const char *semihosting_get_arg(int i); int semihosting_get_argc(void); const char *semihosting_get_cmdline(void); -#endif +void semihosting_arg_fallback(const char *file, const char *cmd); +/* for vl.c hooks */ +void qemu_semihosting_enable(void); +int qemu_semihosting_config_options(const char *opt); +#endif /* CONFIG_USER_ONLY */ -#endif +#endif /* SEMIHOST_H */ diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 5f133cae837..61579ae71ef 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -193,5 +193,6 @@ extern QemuOptsList qemu_nic_opts; extern QemuOptsList qemu_net_opts; extern QemuOptsList qemu_global_opts; extern QemuOptsList qemu_mon_opts; +extern QemuOptsList qemu_semihosting_config_opts; #endif diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c index 8b5fd7bc6e3..3273306c8ea 100644 --- a/target/arm/arm-semi.c +++ b/target/arm/arm-semi.c @@ -21,7 +21,7 @@ #include "qemu/osdep.h" #include "cpu.h" -#include "exec/semihost.h" +#include "hw/semihosting/semihost.h" #ifdef CONFIG_USER_ONLY #include "qemu.h" diff --git a/target/arm/helper.c b/target/arm/helper.c index e2d5c8e34fe..c1f0a07efd8 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -16,7 +16,7 @@ #include "exec/cpu_ldst.h" #include "arm_ldst.h" #include /* For crc32 */ -#include "exec/semihost.h" +#include "hw/semihosting/semihost.h" #include "sysemu/cpus.h" #include "sysemu/kvm.h" #include "fpu/softfloat.h" diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index b7c5a928b4a..8844a75e53d 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -29,7 +29,7 @@ #include "qemu/host-utils.h" #include "qemu/qemu-print.h" -#include "exec/semihost.h" +#include "hw/semihosting/semihost.h" #include "exec/gen-icount.h" #include "exec/helper-proto.h" diff --git a/target/arm/translate.c b/target/arm/translate.c index dd053c80d62..f2a65c0b5b0 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -30,7 +30,7 @@ #include "qemu/bitops.h" #include "qemu/qemu-print.h" #include "arm_ldst.h" -#include "exec/semihost.h" +#include "hw/semihosting/semihost.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h" diff --git a/target/lm32/helper.c b/target/lm32/helper.c index 20ea17ba23c..8cd48400521 100644 --- a/target/lm32/helper.c +++ b/target/lm32/helper.c @@ -22,7 +22,7 @@ #include "exec/exec-all.h" #include "qemu/host-utils.h" #include "sysemu/sysemu.h" -#include "exec/semihost.h" +#include "hw/semihosting/semihost.h" #include "exec/log.h" bool lm32_cpu_tlb_fill(CPUState *cs, vaddr address, int size, diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index 1ecc772b5cb..bde2d551ff6 100644 --- a/target/m68k/op_helper.c +++ b/target/m68k/op_helper.c @@ -21,7 +21,7 @@ #include "exec/helper-proto.h" #include "exec/exec-all.h" #include "exec/cpu_ldst.h" -#include "exec/semihost.h" +#include "hw/semihosting/semihost.h" #if defined(CONFIG_USER_ONLY) diff --git a/target/mips/mips-semi.c b/target/mips/mips-semi.c index a7aefbaefc8..eac8374fb34 100644 --- a/target/mips/mips-semi.c +++ b/target/mips/mips-semi.c @@ -22,7 +22,7 @@ #include "qemu/log.h" #include "exec/helper-proto.h" #include "exec/softmmu-semi.h" -#include "exec/semihost.h" +#include "hw/semihosting/semihost.h" typedef enum UHIOp { UHI_exit = 1, diff --git a/target/mips/translate.c b/target/mips/translate.c index f96c0d01ef1..3cd5b11b16b 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -32,7 +32,7 @@ #include "exec/helper-proto.h" #include "exec/helper-gen.h" -#include "exec/semihost.h" +#include "hw/semihosting/semihost.h" #include "target/mips/trace.h" #include "trace-tcg.h" diff --git a/target/nios2/helper.c b/target/nios2/helper.c index ffb83fc1045..57c97bde3c6 100644 --- a/target/nios2/helper.c +++ b/target/nios2/helper.c @@ -26,7 +26,7 @@ #include "exec/cpu_ldst.h" #include "exec/log.h" #include "exec/helper-proto.h" -#include "exec/semihost.h" +#include "hw/semihosting/semihost.h" #if defined(CONFIG_USER_ONLY) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 53dce470c17..6f1da878752 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -38,7 +38,7 @@ #include "qemu/qemu-print.h" #include "sysemu/sysemu.h" #include "exec/cpu_ldst.h" -#include "exec/semihost.h" +#include "hw/semihosting/semihost.h" #include "exec/translator.h" #include "exec/helper-proto.h" diff --git a/target/xtensa/xtensa-semi.c b/target/xtensa/xtensa-semi.c index 5f5ce4f344c..38efa3485af 100644 --- a/target/xtensa/xtensa-semi.c +++ b/target/xtensa/xtensa-semi.c @@ -29,7 +29,7 @@ #include "cpu.h" #include "chardev/char-fe.h" #include "exec/helper-proto.h" -#include "exec/semihost.h" +#include "hw/semihosting/semihost.h" #include "qapi/error.h" #include "qemu/log.h" #include "sysemu/sysemu.h" diff --git a/vl.c b/vl.c index 201144b1628..6b19ea42bfe 100644 --- a/vl.c +++ b/vl.c @@ -116,7 +116,7 @@ int main(int argc, char **argv) #include "qapi/opts-visitor.h" #include "qapi/clone-visitor.h" #include "qom/object_interfaces.h" -#include "exec/semihost.h" +#include "hw/semihosting/semihost.h" #include "crypto/init.h" #include "sysemu/replay.h" #include "qapi/qapi-events-run-state.h" @@ -500,25 +500,6 @@ static QemuOptsList qemu_icount_opts = { }, }; -static QemuOptsList qemu_semihosting_config_opts = { - .name = "semihosting-config", - .implied_opt_name = "enable", - .head = QTAILQ_HEAD_INITIALIZER(qemu_semihosting_config_opts.head), - .desc = { - { - .name = "enable", - .type = QEMU_OPT_BOOL, - }, { - .name = "target", - .type = QEMU_OPT_STRING, - }, { - .name = "arg", - .type = QEMU_OPT_STRING, - }, - { /* end of list */ } - }, -}; - static QemuOptsList qemu_fw_cfg_opts = { .name = "fw_cfg", .implied_opt_name = "name", @@ -1350,80 +1331,6 @@ static void configure_msg(QemuOpts *opts) enable_timestamp_msg = qemu_opt_get_bool(opts, "timestamp", true); } -/***********************************************************/ -/* Semihosting */ - -typedef struct SemihostingConfig { - bool enabled; - SemihostingTarget target; - const char **argv; - int argc; - const char *cmdline; /* concatenated argv */ -} SemihostingConfig; - -static SemihostingConfig semihosting; - -bool semihosting_enabled(void) -{ - return semihosting.enabled; -} - -SemihostingTarget semihosting_get_target(void) -{ - return semihosting.target; -} - -const char *semihosting_get_arg(int i) -{ - if (i >= semihosting.argc) { - return NULL; - } - return semihosting.argv[i]; -} - -int semihosting_get_argc(void) -{ - return semihosting.argc; -} - -const char *semihosting_get_cmdline(void) -{ - if (semihosting.cmdline == NULL && semihosting.argc > 0) { - semihosting.cmdline = g_strjoinv(" ", (gchar **)semihosting.argv); - } - return semihosting.cmdline; -} - -static int add_semihosting_arg(void *opaque, - const char *name, const char *val, - Error **errp) -{ - SemihostingConfig *s = opaque; - if (strcmp(name, "arg") == 0) { - s->argc++; - /* one extra element as g_strjoinv() expects NULL-terminated array */ - s->argv = g_realloc(s->argv, (s->argc + 1) * sizeof(void *)); - s->argv[s->argc - 1] = val; - s->argv[s->argc] = NULL; - } - return 0; -} - -/* Use strings passed via -kernel/-append to initialize semihosting.argv[] */ -static inline void semihosting_arg_fallback(const char *file, const char *cmd) -{ - char *cmd_token; - - /* argv[0] */ - add_semihosting_arg(&semihosting, "arg", file, NULL); - - /* split -append and initialize argv[1..n] */ - cmd_token = strtok(g_strdup(cmd), " "); - while (cmd_token) { - add_semihosting_arg(&semihosting, "arg", cmd_token, NULL); - cmd_token = strtok(NULL, " "); - } -} /* Now we still need this for compatibility with XEN. */ bool has_igd_gfx_passthru; @@ -3739,37 +3646,10 @@ int main(int argc, char **argv, char **envp) nb_option_roms++; break; case QEMU_OPTION_semihosting: - semihosting.enabled = true; - semihosting.target = SEMIHOSTING_TARGET_AUTO; + qemu_semihosting_enable(); break; case QEMU_OPTION_semihosting_config: - semihosting.enabled = true; - opts = qemu_opts_parse_noisily(qemu_find_opts("semihosting-config"), - optarg, false); - if (opts != NULL) { - semihosting.enabled = qemu_opt_get_bool(opts, "enable", - true); - const char *target = qemu_opt_get(opts, "target"); - if (target != NULL) { - if (strcmp("native", target) == 0) { - semihosting.target = SEMIHOSTING_TARGET_NATIVE; - } else if (strcmp("gdb", target) == 0) { - semihosting.target = SEMIHOSTING_TARGET_GDB; - } else if (strcmp("auto", target) == 0) { - semihosting.target = SEMIHOSTING_TARGET_AUTO; - } else { - error_report("unsupported semihosting-config %s", - optarg); - exit(1); - } - } else { - semihosting.target = SEMIHOSTING_TARGET_AUTO; - } - /* Set semihosting argument count and vector */ - qemu_opt_foreach(opts, add_semihosting_arg, - &semihosting, NULL); - } else { - error_report("unsupported semihosting-config %s", optarg); + if (qemu_semihosting_config_options(optarg) != 0) { exit(1); } break; From patchwork Thu May 23 10:25:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164954 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1987282ili; Thu, 23 May 2019 03:28:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDhhHjvbYe+5j6fxhrHA0MjxTt/8d7v9z3p944GYQ7DWDPEVhswa23Pd/lY4FKCcHTFraD X-Received: by 2002:aa7:db50:: with SMTP id n16mr94382806edt.108.1558607323232; Thu, 23 May 2019 03:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558607323; cv=none; d=google.com; s=arc-20160816; b=uXmTF9z58Wg8B4dZkV1K/MEwijMXXqyeeJtyDE4FpPWsB4pOs1+T3PspoFeOiaINLV 2R+hKZvn6EqIdjHD+2wyXcr6s7eTs9pBovDouPOQ0BdsQvPjMnAlN5x36t1VdCAjbWvV p7qvUSPp+ajLg7pfe46bVOMp9phF2k6uKKdPK6okOFAABnpOXabpTnlcdlNdRw03au6x tcGCLM5sAczbKoOegFAcWgTONKazYhzlIJbyreHMUCiky/A9J5GJaAX7uOySudWQD2az Y281ua16wDN4NlVaCnOWp0xojp69W9CvFnqyNix40gnyFXE6BPqCaZ92MzO6D6HUco6h n8zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=VPYoDDTghYG2/LL0n9irfzSxJnK/tqgoLIbho5rYvV8=; b=Ehe1s9PqKMmAKZAZIZMKDT6M6L3HSaOQNKB6p3lPobD59KmtvoBU/f4p7a8muiePjP JEjSca+u4PSo6SH3cJVSQUYXUDahyF+yJJ2b26geyJWJk2vy83JJI1nDI91dWw3y8Jrw eN6aEoI95tmli6n28oGa9BB5xmLmHd6joCPUBYSza5yKE0Ed89LdgeeInDgymoeNBkm5 y9HZUcqqLf81qvH4UoD7vFgIu0s3vr2d2Qy3W46jBsFbEx/xh8c4By+DpsFuqH0PRXvn vOtQJFNAdduhL+M3wDVv3gEJ2pjwdav9hXj9wEfMkSyVK70Y4nj+R0txBvX1yhl2Qx3h DV+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fpmUbgTP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id hh22si394736ejb.149.2019.05.23.03.28.42 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:28:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fpmUbgTP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkxl-0007tI-WC for patch@linaro.org; Thu, 23 May 2019 06:28:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkuu-0005Qc-2i for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkuo-0000ui-1B for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:41 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:38080) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkul-0000rX-VQ for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:36 -0400 Received: by mail-wm1-x344.google.com with SMTP id t5so5200855wmh.3 for ; Thu, 23 May 2019 03:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VPYoDDTghYG2/LL0n9irfzSxJnK/tqgoLIbho5rYvV8=; b=fpmUbgTP8m0B7hMdU7nymRbgU9OHxbXqRMb0US7extFNgplo5xSF8kLWC7+I6RVogM NXnfdZbTG4+AbKlkkEJZczf2XoLeelI1EzpevITj5+wj/mpi0k0HdI9mZqtiIT4MFCAa JX75HeTOu788/y19GGRtjSkbH/NNEL3XtYzbPOWvvgfpTOcj3t/8UtJp0jAEMiypClIn 4L2Z7+pM9g7g3I2eVAP2XZqxUMMTEErji6/Pbj9hPkC2n5h3QF3mIIpqTZHomWBe6SXJ 4V/xT6S6iMum3pXmGRvIAk0Dc2g/l0O7hNn8FqJkKfqbHZ1jKxQlE9MY3XL7+prrrgHf fLNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VPYoDDTghYG2/LL0n9irfzSxJnK/tqgoLIbho5rYvV8=; b=tpWuw2k3AwVEjZNttitcdRRjChVl09pb1Nt1fHZbYqPGD3TGHivXB2iIPf+TF6qwo4 xAIhHK0ww2Xeb5P7piWNNY1enUpLFhR9t9sebDGrrn7Y3AKtRskoLRfyxy9hYAVTUMGD I+8JBkyLKqPlCA1SVKobFTBsCIadDBrYFn9/n1vvBa+6z24b84rq4cHxBDWzbA0WYL7l cC6w/lUbym6nciOAq64gVnlIdNWd4qBVxqxY3extABkYU/dyFmcm8sG9wwW8tsuhaPTY HKU8MA6e2fObeaLVJpkG5eH6tD740KHUDAfwkuhwFvp8Rz4ok+jrFMsPtVo2vtpqwMfy xeRw== X-Gm-Message-State: APjAAAXnjhEl2FlB2s4PRrmgEbR91sF6oPgvu4WBRX0Hp7zVkGQF9/th IEQ55h2R6CoyJmg1V39WTwCPsw== X-Received: by 2002:a1c:1f95:: with SMTP id f143mr11864734wmf.16.1558607134510; Thu, 23 May 2019 03:25:34 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b18sm25054186wrx.75.2019.05.23.03.25.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:33 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 96F531FF8F; Thu, 23 May 2019 11:25:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:06 +0100 Message-Id: <20190523102532.10486-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH v2 02/28] semihosting: introduce CONFIG_SEMIHOSTING X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Aleksandar Rikalo , =?utf-8?q?Alex_Benn=C3=A9e?= , Chris Wulff , Max Filippov , qemu-arm@nongnu.org, Aleksandar Markovic , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" There isn't much point building semihosting for platforms that don't support it. Introduce a new symbol and enable it only for the softmmu targets that need it. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- default-configs/arm-softmmu.mak | 1 + default-configs/lm32-softmmu.mak | 2 + default-configs/m68k-softmmu.mak | 2 + default-configs/mips-softmmu-common.mak | 1 + default-configs/nios2-softmmu.mak | 2 + default-configs/xtensa-softmmu.mak | 2 + hw/Kconfig | 1 + hw/semihosting/Kconfig | 3 ++ hw/semihosting/Makefile.objs | 2 +- stubs/Makefile.objs | 1 + stubs/semihost.c | 66 +++++++++++++++++++++++++ 11 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 hw/semihosting/Kconfig create mode 100644 stubs/semihost.c -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak index f23ecfd5c58..1f2e0e7fdeb 100644 --- a/default-configs/arm-softmmu.mak +++ b/default-configs/arm-softmmu.mak @@ -39,3 +39,4 @@ CONFIG_MICROBIT=y CONFIG_FSL_IMX25=y CONFIG_FSL_IMX7=y CONFIG_FSL_IMX6UL=y +CONFIG_SEMIHOSTING=y diff --git a/default-configs/lm32-softmmu.mak b/default-configs/lm32-softmmu.mak index 6d259665d60..115b3e34c98 100644 --- a/default-configs/lm32-softmmu.mak +++ b/default-configs/lm32-softmmu.mak @@ -4,6 +4,8 @@ # #CONFIG_MILKYMIST_TMU2=n # disabling it actually causes compile-time failures +CONFIG_SEMIHOSTING=y + # Boards: # CONFIG_LM32=y diff --git a/default-configs/m68k-softmmu.mak b/default-configs/m68k-softmmu.mak index e17495e2a0b..4049a8f2ba9 100644 --- a/default-configs/m68k-softmmu.mak +++ b/default-configs/m68k-softmmu.mak @@ -1,5 +1,7 @@ # Default configuration for m68k-softmmu +CONFIG_SEMIHOSTING=y + # Boards: # CONFIG_AN5206=y diff --git a/default-configs/mips-softmmu-common.mak b/default-configs/mips-softmmu-common.mak index 8e54a74b7a5..e10ac4b20c0 100644 --- a/default-configs/mips-softmmu-common.mak +++ b/default-configs/mips-softmmu-common.mak @@ -35,6 +35,7 @@ CONFIG_MIPS_CPS=y CONFIG_MIPS_ITU=y CONFIG_R4K=y CONFIG_MALTA=y +CONFIG_SEMIHOSTING=y CONFIG_PCNET_PCI=y CONFIG_MIPSSIM=y CONFIG_ACPI_SMBUS=y diff --git a/default-configs/nios2-softmmu.mak b/default-configs/nios2-softmmu.mak index e130d024e62..1bc4082ea99 100644 --- a/default-configs/nios2-softmmu.mak +++ b/default-configs/nios2-softmmu.mak @@ -1,5 +1,7 @@ # Default configuration for nios2-softmmu +CONFIG_SEMIHOSTING=y + # Boards: # CONFIG_NIOS2_10M50=y diff --git a/default-configs/xtensa-softmmu.mak b/default-configs/xtensa-softmmu.mak index 7e4d1cc0979..3aa20a47a7f 100644 --- a/default-configs/xtensa-softmmu.mak +++ b/default-configs/xtensa-softmmu.mak @@ -1,5 +1,7 @@ # Default configuration for Xtensa +CONFIG_SEMIHOSTING=y + # Boards: # CONFIG_XTENSA_SIM=y diff --git a/hw/Kconfig b/hw/Kconfig index 88b9f150070..195f541e50c 100644 --- a/hw/Kconfig +++ b/hw/Kconfig @@ -29,6 +29,7 @@ source pci/Kconfig source rdma/Kconfig source scsi/Kconfig source sd/Kconfig +source semihosting/Kconfig source smbios/Kconfig source ssi/Kconfig source timer/Kconfig diff --git a/hw/semihosting/Kconfig b/hw/semihosting/Kconfig new file mode 100644 index 00000000000..efe0a30734c --- /dev/null +++ b/hw/semihosting/Kconfig @@ -0,0 +1,3 @@ + +config SEMIHOSTING + bool diff --git a/hw/semihosting/Makefile.objs b/hw/semihosting/Makefile.objs index 546954f4ff4..09c19bf19ed 100644 --- a/hw/semihosting/Makefile.objs +++ b/hw/semihosting/Makefile.objs @@ -1 +1 @@ -common-obj-$(CONFIG_SOFTMMU) += config.o +obj-$(CONFIG_SEMIHOSTING) += config.o diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 269dfa58326..e0d4f11b348 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -39,3 +39,4 @@ stub-obj-y += xen-hvm.o stub-obj-y += pci-host-piix.o stub-obj-y += ram-block.o stub-obj-y += ramfb.o +stub-obj-$(CONFIG_SOFTMMU) += semihost.o diff --git a/stubs/semihost.c b/stubs/semihost.c new file mode 100644 index 00000000000..1a4e88e5326 --- /dev/null +++ b/stubs/semihost.c @@ -0,0 +1,66 @@ +/* + * Semihosting Stubs for SoftMMU + * + * Copyright (c) 2019 Linaro Ltd + * + * Stubs for SoftMMU targets that don't actually do semihosting. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/option.h" +#include "qemu/error-report.h" +#include "hw/semihosting/semihost.h" + +/* Empty config */ +QemuOptsList qemu_semihosting_config_opts = { + .name = "", + .head = QTAILQ_HEAD_INITIALIZER(qemu_semihosting_config_opts.head), + .desc = { + { /* end of list */ } + }, +}; + +/* Queries to config status default to off */ +bool semihosting_enabled(void) +{ + return false; +} + +SemihostingTarget semihosting_get_target(void) +{ + return SEMIHOSTING_TARGET_AUTO; +} + +/* + * All the rest are empty subs. We could g_assert_not_reached() but + * that adds extra weight to the final binary. Waste not want not. + */ +void qemu_semihosting_enable(void) +{ +} + +int qemu_semihosting_config_options(const char *optarg) +{ + return 1; +} + +const char *semihosting_get_arg(int i) +{ + return NULL; +} + +int semihosting_get_argc(void) +{ + return 0; +} + +const char *semihosting_get_cmdline(void) +{ + return NULL; +} + +void semihosting_arg_fallback(const char *file, const char *cmd) +{ +} From patchwork Thu May 23 10:25:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164983 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1999132ili; Thu, 23 May 2019 03:40:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwp3gFbuav7o8THvjHQHFWlwsOFDOegNl3g02RgKIY7P1JHFf3VhafxFY33Joagw+vGb6Dx X-Received: by 2002:a50:947c:: with SMTP id q57mr97155284eda.81.1558608059275; Thu, 23 May 2019 03:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558608059; cv=none; d=google.com; s=arc-20160816; b=fM3unkdHfamCOrG7iIJ99AzjZyHheqdx1Pbdk4nTNDisoXBY5Hf2GJ8KVXeiydSdyo mlpfoVFtPRyorxbQ48+dLEMUFgdHZN5bfCHuRW8bmBlFpDV7invkncSJrzhG1uwuvJxG 0bFS4X7GqHC4ikqfdtfBp+9MjleUKtdDV7TXCNnqlzkOgQfcEk6bpDkPD4df4eKlKk8M ohmMOAfY9NtfqUFdNTPtFBqWzW1cJAHYeyMNCvcikPAeohqOnuSGD3RFoPiM7ukawC7e 2W79d7nuVRNCAPFxFvBo1L/RtVxIwV34ONqOyCW9cLz96pGzzsnCPlrnqAsagDCDtGzJ 4Hxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=hbC6Uuy+rCphFJXRN5GPHrqZRqXnqfdaGhA8RUCMKxg=; b=xEWA8Ojw8AA5L+6+KV6nbkQ9AqUFUest/SMO5TAaiOjOD3TUp56hGkGDsZ3N922AFK mvXbPKesRu+0OQXZfVBIIXJ4JA/LPosjcB1U/tfqp6l2ZweqVZ7hcHzHkwKmuKc0QCiL HZz/nkPEzp5PtUn8pvlAMYO9cF12nHmmXcaeohswxlbWuaJyU+OgARg9wcN4wFoHIk+E m0ymPzJyyPJzYpjC8qAKnRcjvCTsQkfy8ZXpCijjHd1LrfzhrP0oSlg6oI6GydTBn6+H v4IYM+xU1lq/Z8qtTFvLf63+8IN9tzEgTtJME6sMz5V66q6/9ZAYwOgrSeZCkHqYWzDX qaIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hEJh9QgO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y9si3790749ejp.82.2019.05.23.03.40.58 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:40:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hEJh9QgO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl9e-0002Cl-4E for patch@linaro.org; Thu, 23 May 2019 06:40:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkvA-0005gP-Lq for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkv4-0001CR-CS for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:58 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:54678) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkv2-0000ta-8Y for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:54 -0400 Received: by mail-wm1-x344.google.com with SMTP id i3so5211842wml.4 for ; Thu, 23 May 2019 03:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hbC6Uuy+rCphFJXRN5GPHrqZRqXnqfdaGhA8RUCMKxg=; b=hEJh9QgOdMqmyLe0c0khC2QOt9zDuLNDpB6Gh9jOzlcCy2PZFa9iNLia9iFXwYxzlH BlS4456PzJwanNJmq07CK6WOM/uGZRjM20RfAjTbGYtoYcpfsvw5pA0hl8ms9ypguAHd DPopycyQjW7E142KDeXCoz4XGCJD2W9gBT4jujJb1/a7mQ7rVMHnZNm2vcd9BC53tutK JQM9IiKxnZmJqSkt5mFP1S59i72fQPAWC8XfztryW3uaUcwDtSEAwWtJxhw6xyQIcFWI Qdn5jxM+ZKcAM2q5UYXMhHsTloFsTmekHd9Pmhy3z5Fivm2rCB7GG8imVcP1E9863zuQ v6RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hbC6Uuy+rCphFJXRN5GPHrqZRqXnqfdaGhA8RUCMKxg=; b=c7UwldhGfEM/C4qjBN08YiKLRDC1/g0laiqhExi3W2TZ6/PmTdYIXmUO91Fp81+6EU ZcvVmYwlm1XQlZ/PwEOxN+zd6IswBfedhH7vYi2vMCgA3iqmdREYK501ojj0WLAZEiEr f4ICoPJrbSg4exMvdsQqjtF3I9tMTj9Kt7z+rNCZ7jIIWvw08WM4BoIIK7S1lGJ5Sgff h3wnyIS72ZTPAP268wxMUHOy64wRkKD1+jXQw8d9ReDd6TVPqMTeLQ8lIJr93SWlIx6y lGjKksY3ILD9JEbhcb07Zm4xRFPUwKh3d3PTla59GSDAF7xzUoryGIDQZeAwgGIU6bDu hE3g== X-Gm-Message-State: APjAAAVsGMSWEhECQ2yL3pUks1eZScCSMYyttlukxpcRcBHBOck+S+XN M2iLYzwnNnDjpl5SrfhR3TmQZ7aG1nQ= X-Received: by 2002:a1c:3cc2:: with SMTP id j185mr10788632wma.26.1558607135796; Thu, 23 May 2019 03:25:35 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id q68sm7037319wme.11.2019.05.23.03.25.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:33 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B25F01FF90; Thu, 23 May 2019 11:25:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:07 +0100 Message-Id: <20190523102532.10486-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH v2 03/28] semihosting: implement a semihosting console X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This provides two functions for handling console output that handle the common backend behaviour for semihosting. Signed-off-by: Alex Bennée --- gdbstub.c | 5 +++ hw/semihosting/Makefile.objs | 1 + hw/semihosting/console.c | 70 ++++++++++++++++++++++++++++++++ include/exec/gdbstub.h | 11 +++++ include/hw/semihosting/console.h | 38 +++++++++++++++++ 5 files changed, 125 insertions(+) create mode 100644 hw/semihosting/console.c create mode 100644 include/hw/semihosting/console.h -- 2.20.1 diff --git a/gdbstub.c b/gdbstub.c index 793218bb43a..b4334014373 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1987,6 +1987,11 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...) va_end(va); } +void gdb_do_console_out(target_ulong s, int len) +{ + gdb_do_syscall(NULL, "write,2,%x,1", s, len); +} + static void gdb_read_byte(GDBState *s, int ch) { uint8_t reply; diff --git a/hw/semihosting/Makefile.objs b/hw/semihosting/Makefile.objs index 09c19bf19ed..4ad47c05c06 100644 --- a/hw/semihosting/Makefile.objs +++ b/hw/semihosting/Makefile.objs @@ -1 +1,2 @@ obj-$(CONFIG_SEMIHOSTING) += config.o +obj-$(CONFIG_SEMIHOSTING) += console.o diff --git a/hw/semihosting/console.c b/hw/semihosting/console.c new file mode 100644 index 00000000000..ad6f67ecc71 --- /dev/null +++ b/hw/semihosting/console.c @@ -0,0 +1,70 @@ +/* + * Semihosting Console Support + * + * Copyright (c) 2015 Imagination Technologies + * Copyright (c) 2019 Linaro Ltd + * + * This provides support for outputting to a semihosting console. + * + * While most semihosting implementations support reading and writing + * to arbitrary file descriptors we treat the console as something + * specifically for debugging interaction. This means messages can be + * re-directed to gdb (if currently being used to debug) or even + * re-directed elsewhere. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "cpu.h" +#include "hw/semihosting/console.h" +#include "exec/gdbstub.h" +#include "qemu/log.h" + +int qemu_semihosting_log_out(const char *s, int len) +{ + return write(STDERR_FILENO, s, len); +} + +/* + * A re-implementation of lock_user_string that we can use locally + * instead of relying on softmmu-semi. Hopefully we can deprecate that + * in time. We either copy len bytes if specified or until we find a NULL. + */ +static GString *copy_user_string(CPUArchState *env, target_ulong addr, int len) +{ + CPUState *cpu = ENV_GET_CPU(env); + GString *s = g_string_sized_new(len ? len : 128); + uint8_t c; + bool done; + + do { + if (cpu_memory_rw_debug(cpu, addr++, &c, 1, 0) == 0) { + s = g_string_append_c(s, c); + done = len ? s->len == len : c == 0; + } else { + qemu_log_mask(LOG_GUEST_ERROR, + "%s: passed inaccessible address " TARGET_FMT_lx, + __func__, addr); + done = true; + } + } while (!done); + + return s; +} + + +int qemu_semihosting_console_out(CPUArchState *env, target_ulong addr, int len) +{ + GString *s = copy_user_string(env, addr, len); + int out = s->len; + + if (use_gdb_syscalls()) { + gdb_do_console_out(addr, s->len); + } else { + out = qemu_semihosting_log_out(s->str, s->len); + } + + g_string_free(s, true); + return out; +} diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index 08363969c14..b2963547c48 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -44,6 +44,17 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...); * argument list. */ void gdb_do_syscallv(gdb_syscall_complete_cb cb, const char *fmt, va_list va); +/** + * gdb_do_console_out: + * @gs: guest address of string to send + * @len: length of string + * + * Sends a string to gdb console. Unlike the system call interface + * there is no callback and we assume the system call always + * succeeds. + */ +void gdb_do_console_out(target_ulong s, int len); + int use_gdb_syscalls(void); void gdb_set_stop_cpu(CPUState *cpu); void gdb_exit(CPUArchState *, int); diff --git a/include/hw/semihosting/console.h b/include/hw/semihosting/console.h new file mode 100644 index 00000000000..30e66ae20aa --- /dev/null +++ b/include/hw/semihosting/console.h @@ -0,0 +1,38 @@ +/* + * Semihosting Console + * + * Copyright (c) 2019 Linaro Ltd + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef _SEMIHOST_CONSOLE_H_ +#define _SEMIHOST_CONSOLE_H_ + +/** + * qemu_semihosting_console_out: + * @env: CPUArchState + * @s: host address of guest string + * @len: length of string or 0 (string is null terminated) + * + * Send a guest string to the debug console. This may be the remote + * gdb session if a softmmu guest is currently being debugged. + * + * Returns: number of bytes written. + */ +int qemu_semihosting_console_out(CPUArchState *env, target_ulong s, int len); + +/** + * qemu_semihosting_log_out: + * @s: pointer to string + * @len: length of string + * + * Send a string to the debug output. Unlike console_out these strings + * can't be sent to a remote gdb instance as they don't exist in guest + * memory. + * + * Returns: number of bytes written + */ +int qemu_semihosting_log_out(const char *s, int len); + +#endif /* _SEMIHOST_CONSOLE_H_ */ From patchwork Thu May 23 10:25:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164960 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1992867ili; Thu, 23 May 2019 03:34:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqya3Ch3DNlRQRDe+HXBEp7hYhib356DzHLf0eD9kSwsZsQctj3RF8Kv4LziWsZaQ/tfPZln X-Received: by 2002:a50:a96f:: with SMTP id m44mr96146898edc.135.1558607657149; Thu, 23 May 2019 03:34:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558607657; cv=none; d=google.com; s=arc-20160816; b=IzNIZjM+Tc5zaAlITk2Zbg9SheGNXJMc+rQSTgieQ/CEjrDcg2cGal1LSJWF8yF6WJ lEMW1ZEHNp790SfmtQfcSRI1redTri6G05/tiUvH8EThBh1Y60DScJCEJLyqVfXlEQSJ IfL+JuPqsO8nuxnz0a54BFwz0gtukHchVELA8iiMo8GcZVQunb9BQM2+vQgNsTzw4DSk sdket/ZF4gaG48UNmUI/e6qcKXxM11wAi05gZeDazskRcgtBh/zTXsAKbLQOe0S4mH3t gMqRfQQ90xa2j06ww6MJn+Si8NiUiXq5cNF0jKenDKXzT5gejjaHk1H4caTotlKKpkA8 akuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=ubw9I71sjpfwvHzR2UuoEnPw3tj8WSm8sBEUKtfQT7Q=; b=e829zMYFh8UEBUBqhV9uEtlv/zu6J9UORPSwmlrflSZRF1K+lJHZzeH4fETLstDhMd fKWTAa/2KooeH9hwvcpz7YLeEQdvHocwh3Iujt/OM5Wv4iY5JBGedr0uCkoTUfmEGgS4 8JIyG4AyjqeDdTWsDZCje0sOZxQKwbCrhfp+drTlyIpVMkZPt/oJhS1W45qZUk9VlrCN iUuxem3wn6ycyyPAK2VNYFaeXiM/5jDR+gLAhQpj/0GYeYYykeOM3zoVeeJq5F+EhbJL Q6NsEpFo1AGcMVv5u2iS8iYWiHxkf75u+Iu+APhByixobRvrjHPTXIe5KZHGHu1/OIlh vr4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Xai7+mHr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id qh3si8924366ejb.193.2019.05.23.03.34.16 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:34:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Xai7+mHr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33171 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl3A-0004mv-1i for patch@linaro.org; Thu, 23 May 2019 06:34:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkvA-0005gO-Ll for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkv4-0001Bz-9H for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:58 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:51619) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkv0-0000t1-L4 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:52 -0400 Received: by mail-wm1-x342.google.com with SMTP id c77so5229933wmd.1 for ; Thu, 23 May 2019 03:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ubw9I71sjpfwvHzR2UuoEnPw3tj8WSm8sBEUKtfQT7Q=; b=Xai7+mHrsX9qzZJRm6WOBdTGNXV+M0y/MpGwt/8Nfv0H1rMbQpFkH1UC9IyWNXv7sd Ppm1eDd4Wpq5H7n7V+F9Fv4QAvi+59PRRd574AQ+VL8U6DjQ8EODOHNHcpdZzyfAFh79 VIX1A8Z1Yrsu/6vQ2UOAMiOSpePSuqh3Zws0j48ygNVlkWnrLFH7g/YbP6uwjnSYz7xS UsGzMDjHMUlK/t2n8ToB1lxKzU0aZxyM42BqJUFljadAaFTFJI38/TK28tzncki7csQ2 86J94UpldTHOu7pwd2ki0ViuuFwB1xyOLIQ/fL5yrhbk5KIAzhGOaKnAg0IDp+zX81R8 MLkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ubw9I71sjpfwvHzR2UuoEnPw3tj8WSm8sBEUKtfQT7Q=; b=cQyBM9kCyZf5UpNbh+2+UX/8fHq3ps2myufbnqfLDLMqkNZAwl/8nvyj9kHKnFfg1l ehMzwSax/PQB4GkC8HzXL5JuxdU5kUo/5f6V81npWPPqvfP74OjLM5xegYkbCb/YnzO1 5CeqwHJ1g5E9NSYbfL5h4PnYg4I1D9imG35Kbmkmt1Ay+ivEpCZxiXAJrxe6OH4t7PVE ivK32egOtHkNnhY5CwFGirePVJDMQD7Ag2yF6ZlPh2R5+usH8WHeo/R9CZaUE7MiNufA ButD1SWpaOfxv08seagLDQIEKfjWSCabgv/FT76izOrQt1SxgXjmMefhKs6+aLOQ81/y PKvg== X-Gm-Message-State: APjAAAWnpggEP5K6XL4ACPimVfxiQFhwnu8t9YLxR6q7FYuOYsmf+4CG X5/cyqC9Q6ej+GBmbsHICTD1ncHPkPI= X-Received: by 2002:a1c:cc02:: with SMTP id h2mr11027550wmb.13.1558607135043; Thu, 23 May 2019 03:25:35 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id i15sm32072270wre.30.2019.05.23.03.25.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:33 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D0C241FF91; Thu, 23 May 2019 11:25:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:08 +0100 Message-Id: <20190523102532.10486-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 Subject: [Qemu-devel] [PATCH v2 04/28] semihosting: enable chardev backed output for console X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , qemu-arm@nongnu.org, =?utf-8?q?Al?= =?utf-8?q?ex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" It will be useful for a number of use-cases to be able to re-direct output to a file like we do with serial output. This does the wiring to allow us to treat then semihosting console like just another character output device. Signed-off-by: Alex Bennée --- hw/semihosting/config.c | 26 ++++++++++++++++++++++++++ hw/semihosting/console.c | 9 ++++++++- include/hw/semihosting/semihost.h | 7 +++++++ qemu-options.hx | 6 ++++-- stubs/semihost.c | 4 ++++ vl.c | 2 ++ 6 files changed, 51 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/hw/semihosting/config.c b/hw/semihosting/config.c index f1d3fe1e4c6..2a8e7e1045a 100644 --- a/hw/semihosting/config.c +++ b/hw/semihosting/config.c @@ -23,6 +23,7 @@ #include "qemu/config-file.h" #include "qemu/error-report.h" #include "hw/semihosting/semihost.h" +#include "chardev/char.h" QemuOptsList qemu_semihosting_config_opts = { .name = "semihosting-config", @@ -35,6 +36,9 @@ QemuOptsList qemu_semihosting_config_opts = { }, { .name = "target", .type = QEMU_OPT_STRING, + }, { + .name = "chardev", + .type = QEMU_OPT_STRING, }, { .name = "arg", .type = QEMU_OPT_STRING, @@ -46,12 +50,14 @@ QemuOptsList qemu_semihosting_config_opts = { typedef struct SemihostingConfig { bool enabled; SemihostingTarget target; + Chardev *chardev; const char **argv; int argc; const char *cmdline; /* concatenated argv */ } SemihostingConfig; static SemihostingConfig semihosting; +static const char *semihost_chardev; bool semihosting_enabled(void) { @@ -115,6 +121,11 @@ void semihosting_arg_fallback(const char *file, const char *cmd) } } +Chardev *semihosting_get_chardev(void) +{ + return semihosting.chardev; +} + void qemu_semihosting_enable(void) { semihosting.enabled = true; @@ -132,6 +143,8 @@ int qemu_semihosting_config_options(const char *optarg) semihosting.enabled = qemu_opt_get_bool(opts, "enable", true); const char *target = qemu_opt_get(opts, "target"); + /* setup of chardev is deferred until they are initialised */ + semihost_chardev = qemu_opt_get(opts, "chardev"); if (target != NULL) { if (strcmp("native", target) == 0) { semihosting.target = SEMIHOSTING_TARGET_NATIVE; @@ -158,3 +171,16 @@ int qemu_semihosting_config_options(const char *optarg) return 0; } +void qemu_semihosting_connect_chardevs(void) +{ + /* We had to defer this until chardevs were created */ + if (semihost_chardev) { + Chardev *chr = qemu_chr_find(semihost_chardev); + if (chr == NULL) { + error_report("semihosting chardev '%s' not found", + semihost_chardev); + exit(1); + } + semihosting.chardev = chr; + } +} diff --git a/hw/semihosting/console.c b/hw/semihosting/console.c index ad6f67ecc71..2fa440eb32a 100644 --- a/hw/semihosting/console.c +++ b/hw/semihosting/console.c @@ -17,13 +17,20 @@ #include "qemu/osdep.h" #include "cpu.h" +#include "hw/semihosting/semihost.h" #include "hw/semihosting/console.h" #include "exec/gdbstub.h" #include "qemu/log.h" +#include "chardev/char.h" int qemu_semihosting_log_out(const char *s, int len) { - return write(STDERR_FILENO, s, len); + Chardev *chardev = semihosting_get_chardev(); + if (chardev) { + return qemu_chr_write_all(chardev, (uint8_t *) s, len); + } else { + return write(STDERR_FILENO, s, len); + } } /* diff --git a/include/hw/semihosting/semihost.h b/include/hw/semihosting/semihost.h index 07ea40a322f..60fc42d851e 100644 --- a/include/hw/semihosting/semihost.h +++ b/include/hw/semihosting/semihost.h @@ -51,6 +51,11 @@ static inline const char *semihosting_get_cmdline(void) { return NULL; } + +static inline Chardev *semihosting_get_chardev(void) +{ + return NULL; +} #else /* !CONFIG_USER_ONLY */ bool semihosting_enabled(void); SemihostingTarget semihosting_get_target(void); @@ -58,9 +63,11 @@ const char *semihosting_get_arg(int i); int semihosting_get_argc(void); const char *semihosting_get_cmdline(void); void semihosting_arg_fallback(const char *file, const char *cmd); +Chardev *semihosting_get_chardev(void); /* for vl.c hooks */ void qemu_semihosting_enable(void); int qemu_semihosting_config_options(const char *opt); +void qemu_semihosting_connect_chardevs(void); #endif /* CONFIG_USER_ONLY */ #endif /* SEMIHOST_H */ diff --git a/qemu-options.hx b/qemu-options.hx index 5daa5a8fb0a..ce36048ef31 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4015,12 +4015,12 @@ STEXI Enable semihosting mode (ARM, M68K, Xtensa, MIPS, Nios II only). ETEXI DEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config, - "-semihosting-config [enable=on|off][,target=native|gdb|auto][,arg=str[,...]]\n" \ + "-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]\n" \ " semihosting configuration\n", QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 | QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2) STEXI -@item -semihosting-config [enable=on|off][,target=native|gdb|auto][,arg=str[,...]] +@item -semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]] @findex -semihosting-config Enable and configure semihosting (ARM, M68K, Xtensa, MIPS, Nios II only). @table @option @@ -4028,6 +4028,8 @@ Enable and configure semihosting (ARM, M68K, Xtensa, MIPS, Nios II only). Defines where the semihosting calls will be addressed, to QEMU (@code{native}) or to GDB (@code{gdb}). The default is @code{auto}, which means @code{gdb} during debug sessions and @code{native} otherwise. +@item chardev=@var{str1} +Send the output to a chardev backend output for native or auto output when not in gdb @item arg=@var{str1},arg=@var{str2},... Allows the user to pass input arguments, and can be used multiple times to build up a list. The old-style @code{-kernel}/@code{-append} method of passing a diff --git a/stubs/semihost.c b/stubs/semihost.c index 1a4e88e5326..4d5b3c06530 100644 --- a/stubs/semihost.c +++ b/stubs/semihost.c @@ -64,3 +64,7 @@ const char *semihosting_get_cmdline(void) void semihosting_arg_fallback(const char *file, const char *cmd) { } + +void qemu_semihosting_connect_chardevs(void) +{ +} diff --git a/vl.c b/vl.c index 6b19ea42bfe..17f912166ce 100644 --- a/vl.c +++ b/vl.c @@ -4166,6 +4166,8 @@ int main(int argc, char **argv, char **envp) qemu_opts_foreach(qemu_find_opts("chardev"), chardev_init_func, NULL, &error_fatal); + /* now chardevs have been created we may have semihosting to connect */ + qemu_semihosting_connect_chardevs(); #ifdef CONFIG_VIRTFS qemu_opts_foreach(qemu_find_opts("fsdev"), From patchwork Thu May 23 10:25:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164984 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1999661ili; Thu, 23 May 2019 03:41:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzc1Sz7PFJFR04PT7Ri0ANQA6DgBdsO+UawnjG4xMJ/C4etwcQ0LVa5AhYxx98wJEemG7qM X-Received: by 2002:a17:906:49ca:: with SMTP id w10mr31092681ejv.156.1558608092912; Thu, 23 May 2019 03:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558608092; cv=none; d=google.com; s=arc-20160816; b=rK4KhuRyC8DesJiKSZEpi3bEGyWwnYNQwnmX+SaIrA6APRJf8CcL4xP9OF4Dqq/c/A qIaoSRwys03gZ3d18RVY//w77RrEpEKsOVryFD8ilU85tSFJ7eslsp0i0bmO3VuNlhSj 4hDw5+UuYmrZHsc5bE7GhhGPVi1y1Kr5Vf8X8RGnKGKVZgZoWIZjg85bs3+T51D61Hsx yCdh1LEgdexprTmMrhMiDaZiQeaQt0AtCNMMqZp/F4bbSKEmlc6Yv0nRreeXUaZtHySq 3pNGabtGx3ul+cOhtzOd/paIDzTltCPG++QBGUbHHZdyTeivAzfz+Ew9G38opVJ9MeSe UxVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=ClzRD6CI4ag8pii4JNWlYLGFqOxEmOFpGkxKaMBsRlY=; b=pUlM13pALHsPuNap5m/zE5RlMCGAXNXpfyBKJANlP2XsyUAxj5Oe5PdboaPTLBX7/j G0CZ068nkFtn/aacmY5AAp0ToeSQVFNfTfUhvYHJlBf2QlNiXKmJBEw3bRwaPNRHi9Sa a/GC8/PqvtHYgW0HkT03C8vPzoW3WCo9u89lISnj8YawNTyT0kQpYyTu8QnyYY04GE6+ Ip/8Dh3o0rmGMDJXyy1Xyap1GGNgGER7XX3RXOu9hcyVSXEN0fJVvFEyj6E6OtwvIX2V MRSFwXMY0IxgyTy/+Nodu14EL44rTYTps8Uon9CDVtCoVGR+/Gwl0CRYLRPFIqxmWHAg cixg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KknHiVSn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a10si6677398ejr.87.2019.05.23.03.41.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:41:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KknHiVSn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTlAB-0002Ub-Oj for patch@linaro.org; Thu, 23 May 2019 06:41:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkvK-0005ue-0Z for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkvA-0001Jr-OO for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:06 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:34351) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkv4-0000uS-DP for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:58 -0400 Received: by mail-wm1-x342.google.com with SMTP id j187so6754165wma.1 for ; Thu, 23 May 2019 03:25:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ClzRD6CI4ag8pii4JNWlYLGFqOxEmOFpGkxKaMBsRlY=; b=KknHiVSn4tKPDo6MAF76n0trlEPaus08nEOmHAyxZyjfPBavs6gGNS91/oIaT2gpIO OVDIrnkHSlhg46TQ33HUC1IyQ6Kp8c3TeqweRi6CLc0+f3JoaGKBw9i2pdQrsaTv1XgI iEiTSCXZT1IPGZA7hImPvgfMxPOqSo8u56F5wc+mjPri58EbWhwgyQ2/f17rUKlNs+vS 1C8BRS2C06SFjGItDADj4591O7ByeD17TLfaWvbA39ECvi4hr+t9Ljvf4YIAQQTbmTKN 4dhM7wNKNsciMwbkrBb3Vs+VbQ88uUfVta+gk7D7Gc8389rPq8HRYN21iQoInY9rqMOk trbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ClzRD6CI4ag8pii4JNWlYLGFqOxEmOFpGkxKaMBsRlY=; b=ZwtT4suNyAqRkjyfiqaNr1Wg6wg1vwrE3VReH5aMN+Ld1r+zoetrtJ7XI0Lgi1S0N/ 02DsUmRb6Hi5+n8psuT+bJyVpGYq5NBdposGKpXcz0G5RsRXx5rhjOED3TctKLsRN40s +ukF+QM8lkoIsdf9FwHDZJhxEwnRgqgRQLEJs36GzpKh4leePtAUMhAzi8IhLB9e6X/0 fSfmXhIHj+SUvhlzMIQ0KJe4KmCAuBKrnzM/22S1ittgOyoZD+UvhnwKgLTRFbOeG8EG NzPLMaAm0YSXk8VnnbqKOWhkynmfDamVTq1Mi/BGv3sqCm+gCtTzNtcNe1olK2fr+FRf WcpQ== X-Gm-Message-State: APjAAAWPtEvA9imu58pNNdgW1I8lGUyHgDhVHFXrLv6xRmBm51hsY0T2 Zg84uxJ57bktOM15MhHXZQ8xnHC5dnQ= X-Received: by 2002:a1c:7303:: with SMTP id d3mr10893139wmb.119.1558607137301; Thu, 23 May 2019 03:25:37 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id n5sm7077195wrj.27.2019.05.23.03.25.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:35 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E42081FF92; Thu, 23 May 2019 11:25:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:09 +0100 Message-Id: <20190523102532.10486-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 Subject: [Qemu-devel] [PATCH v2 05/28] target/arm: fixup some of the commentary for arm-semi X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This cleans up a number of the block comments to fit the proper style. While we are at it we also reference the official specification and document what the return register value can be. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- target/arm/arm-semi.c | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) -- 2.20.1 diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c index 3273306c8ea..9e5a414dd89 100644 --- a/target/arm/arm-semi.c +++ b/target/arm/arm-semi.c @@ -2,6 +2,7 @@ * Arm "Angel" semihosting syscalls * * Copyright (c) 2005, 2007 CodeSourcery. + * Copyright (c) 2019 Linaro * Written by Paul Brook. * * This program is free software; you can redistribute it and/or modify @@ -16,6 +17,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, see . + * + * ARM Semihosting is documented in: + * Semihosting for AArch32 and AArch64 Release 2.0 + * https://static.docs.arm.com/100863/0200/semihosting.pdf */ #include "qemu/osdep.h" @@ -240,6 +245,15 @@ static target_ulong arm_gdb_syscall(ARMCPU *cpu, gdb_syscall_complete_cb cb, put_user_u64(val, args + (n) * 8) : \ put_user_u32(val, args + (n) * 4)) +/* + * Do a semihosting call. + * + * The specification always says that the "return register" either + * returns a specific value or is corrupted, so we don't need to + * report to our caller whether we are returning a value or trying to + * leave the register unchanged. We use 0xdeadbeef as the return value + * when there isn't a defined return value for the call. + */ target_ulong do_arm_semihosting(CPUARMState *env) { ARMCPU *cpu = arm_env_get_cpu(env); @@ -510,14 +524,16 @@ target_ulong do_arm_semihosting(CPUARMState *env) output_size = ts->info->arg_end - ts->info->arg_start; if (!output_size) { - /* We special-case the "empty command line" case (argc==0). - Just provide the terminating 0. */ + /* + * We special-case the "empty command line" case (argc==0). + * Just provide the terminating 0. + */ output_size = 1; } #endif if (output_size > input_size) { - /* Not enough space to store command-line arguments. */ + /* Not enough space to store command-line arguments. */ return -1; } @@ -571,8 +587,10 @@ target_ulong do_arm_semihosting(CPUARMState *env) GET_ARG(0); #ifdef CONFIG_USER_ONLY - /* Some C libraries assume the heap immediately follows .bss, so - allocate it using sbrk. */ + /* + * Some C libraries assume the heap immediately follows .bss, so + * allocate it using sbrk. + */ if (!ts->heap_limit) { abi_ulong ret; @@ -620,7 +638,8 @@ target_ulong do_arm_semihosting(CPUARMState *env) } case TARGET_SYS_EXIT: if (is_a64(env)) { - /* The A64 version of this call takes a parameter block, + /* + * The A64 version of this call takes a parameter block, * so the application-exit type can return a subcode which * is the exit status code from the application. */ @@ -633,14 +652,17 @@ target_ulong do_arm_semihosting(CPUARMState *env) ret = 1; } } else { - /* ARM specifies only Stopped_ApplicationExit as normal - * exit, everything else is considered an error */ + /* + * ARM specifies only Stopped_ApplicationExit as normal + * exit, everything else is considered an error + */ ret = (args == ADP_Stopped_ApplicationExit) ? 0 : 1; } gdb_exit(env, ret); exit(ret); case TARGET_SYS_SYNCCACHE: - /* Clean the D-cache and invalidate the I-cache for the specified + /* + * Clean the D-cache and invalidate the I-cache for the specified * virtual address range. This is a nop for us since we don't * implement caches. This is only present on A64. */ From patchwork Thu May 23 10:25:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164957 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1990088ili; Thu, 23 May 2019 03:31:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPV6qChPOq/f1KIwm+Qkk2h/xhlHM29grUQuaN2o1pJS27Kt3BZ5p9+B7tRTifM19Fap3I X-Received: by 2002:a17:906:60c7:: with SMTP id f7mr49532160ejk.107.1558607505346; Thu, 23 May 2019 03:31:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558607505; cv=none; d=google.com; s=arc-20160816; b=U9nQiUkrUm56G1oga3fx4y+YcB61IzyOXR4C9BnT9NpEVeq75R6aTgjMvnHZNQKpz5 3Lmx5zcODQp5nnaw1W14DmbOJsmuXnS+DUn7N915UUxU9wH1Jbk+BRujQpy3wOiXWh0V 0xIsQ+vmVfgD4sWWSwPeThpNvNCrdOzoyEABkTSlyC2t6qEAvOvqNU5OzKWrZQpiGWHB H0wLBLbRRmPuqA/M9v0gOAx8lkWY7KOov4Z6TAvo2KNn1ZDeW0fv6Brnok5P641WXpDz qIWIK8CRmHaJL+2tfqw9GMMyFGuInzXpckRY1q6ar01c7n9QrhhmO88yPfsSqavaH/pw HJVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=3N082WaIffsJbYXIZ0a/9GfiR46w16xaqgWtZJxN1co=; b=NMJa6KzqdM8E+sUo7E/GBDQvvi6qU1p3VQCDu/AfmmvH8HEYqg7YNVb8eMm2N70xWr AJh7URcACpBcbMBZwVaCqwPfQvGYaIyk45IW5uQIYAMhjbshXefV7qjRnBcKNEtsmWe5 p2BVLTthhMT1zQ1yz9cEK4bqOhXLUeC6AD46gJBZPQvpLqsh/Rjhzav76M7T4f8iypuy Rijw/BYYPL7CfJKWdXzSR/BkiAkERw/9LV19F9Xg8AJWuadD4o88pCO2lT/v3tFXHPBM v+86onD/oINn7EpUj9nVYcgRDsUVb83stTjigq72hOyBjN11twqEcNeZ5YrNkfaXvzEa e0VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=k2BX6BdL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d34si5835504eda.58.2019.05.23.03.31.45 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:31:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=k2BX6BdL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33146 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl0i-0002sC-4w for patch@linaro.org; Thu, 23 May 2019 06:31:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkuy-0005SL-4U for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkut-0000z7-Dq for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:47 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:37894) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkuo-0000uC-5Z for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:41 -0400 Received: by mail-wr1-x441.google.com with SMTP id d18so5650892wrs.5 for ; Thu, 23 May 2019 03:25:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3N082WaIffsJbYXIZ0a/9GfiR46w16xaqgWtZJxN1co=; b=k2BX6BdL7AfVBVZGvxR6I1W5YQyw97rfN8y982CROeZA6WA5nEUyu0LNZ381uVK3mK TEtZ0H7yj/B/AYZ7U3O24ZAej2MQM+RmX6gq6keUVDmGPEobLe1afslliZWeUcudmPFO epO9GMf3Nbtq7cf9pryxXssNASaX2oR16yfEvQ3SPnI5AyrS12XSLGTDN3LuVxP+q/OL hdI+/2zIUl1DiG6/Fn9UYaxCbybEHlTVeGrUKoLVvGGAxttNVkHxcqz48YVsR/HbWvpz f3hj8UrsvPotAGg9UsxjNbAV/G5k+BesvT95b1BFgf2yS+TO4PA3UDR3YxqRl7WAyyjC 83nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3N082WaIffsJbYXIZ0a/9GfiR46w16xaqgWtZJxN1co=; b=P3PheMlv5H0QaZBHz52Zz3MCmBi8iJwGfyz1cr48OGtI1tzT+eL2/gGkef2ceu3t2c AXKUHHn+hueENVZv3pbTq8OvXkV5tsXpDKH2i3UR2UjG9Quvo+n2Ov4gqy12Rr/mBKdq 4YmoRm1OKcuFZDvuH+ylbLG61u+ByNvB+M6jitbrMeDI93LHwbXKGw1MknNF4pYW2Cek WeCGgCbhPPsDmCO71GS6ZtPpRSsbJgmqQ1+wDjb4GLmSqEFAsuOWu/5l5SGM4Brjo2Cu dwHB2mUxOmwCjqM6rLwRAxJkZljJy9xxn0Uc2gHf7KgqgiGOmGO01xkiyhws7wzEuRPl FELQ== X-Gm-Message-State: APjAAAWaHNyEl1+AzucP7LEVYfeASoL1GwRmpcYCaOrLTbC+Zgh9fcAp TI9QfhUBFPYtt2LUr2e7GqSdWQ== X-Received: by 2002:adf:ce07:: with SMTP id p7mr44958922wrn.241.1558607136866; Thu, 23 May 2019 03:25:36 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 19sm9345962wmk.3.2019.05.23.03.25.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:35 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0B3E71FF93; Thu, 23 May 2019 11:25:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:10 +0100 Message-Id: <20190523102532.10486-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [PATCH v2 06/28] target/arm: use the common interface for WRITE0/WRITEC in arm-semi X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Riku Voipio , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Now we have a common semihosting console interface use that for our string output. However ARM is currently unique in also supporting semihosting for linux-user so we need to replicate the API in linux-user. If other architectures gain this support we can move the file later. Signed-off-by: Alex Bennée --- linux-user/Makefile.objs | 2 ++ linux-user/arm/semihost.c | 24 ++++++++++++++++++++++++ target/arm/arm-semi.c | 31 ++++++------------------------- 3 files changed, 32 insertions(+), 25 deletions(-) create mode 100644 linux-user/arm/semihost.c -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/linux-user/Makefile.objs b/linux-user/Makefile.objs index 769b8d83362..285c5dfa17a 100644 --- a/linux-user/Makefile.objs +++ b/linux-user/Makefile.objs @@ -6,4 +6,6 @@ obj-y = main.o syscall.o strace.o mmap.o signal.o \ obj-$(TARGET_HAS_BFLT) += flatload.o obj-$(TARGET_I386) += vm86.o obj-$(TARGET_ARM) += arm/nwfpe/ +obj-$(TARGET_ARM) += arm/semihost.o +obj-$(TARGET_AARCH64) += arm/semihost.o obj-$(TARGET_M68K) += m68k-sim.o diff --git a/linux-user/arm/semihost.c b/linux-user/arm/semihost.c new file mode 100644 index 00000000000..9554102a855 --- /dev/null +++ b/linux-user/arm/semihost.c @@ -0,0 +1,24 @@ +/* + * ARM Semihosting Console Support + * + * Copyright (c) 2019 Linaro Ltd + * + * Currently ARM is unique in having support for semihosting support + * in linux-user. So for now we implement the common console API but + * just for arm linux-user. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "cpu.h" +#include "hw/semihosting/console.h" +#include "qemu.h" + +int qemu_semihosting_console_out(CPUArchState *env, target_ulong addr, int len) +{ + void *s = lock_user_string(addr); + len = write(STDERR_FILENO, s, len ? len : strlen(s)); + unlock_user(s, addr, 0); + return len; +} diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c index 9e5a414dd89..253c66b172a 100644 --- a/target/arm/arm-semi.c +++ b/target/arm/arm-semi.c @@ -27,6 +27,7 @@ #include "cpu.h" #include "hw/semihosting/semihost.h" +#include "hw/semihosting/console.h" #ifdef CONFIG_USER_ONLY #include "qemu.h" @@ -314,32 +315,12 @@ target_ulong do_arm_semihosting(CPUARMState *env) return set_swi_errno(ts, close(arg0)); } case TARGET_SYS_WRITEC: - { - char c; - - if (get_user_u8(c, args)) - /* FIXME - should this error code be -TARGET_EFAULT ? */ - return (uint32_t)-1; - /* Write to debug console. stderr is near enough. */ - if (use_gdb_syscalls()) { - return arm_gdb_syscall(cpu, arm_semi_cb, "write,2,%x,1", args); - } else { - return write(STDERR_FILENO, &c, 1); - } - } + { + qemu_semihosting_console_out(env, args, 1); + return 0xdeadbeef; + } case TARGET_SYS_WRITE0: - if (!(s = lock_user_string(args))) - /* FIXME - should this error code be -TARGET_EFAULT ? */ - return (uint32_t)-1; - len = strlen(s); - if (use_gdb_syscalls()) { - return arm_gdb_syscall(cpu, arm_semi_cb, "write,2,%x,%x", - args, len); - } else { - ret = write(STDERR_FILENO, s, len); - } - unlock_user(s, args, 0); - return ret; + return qemu_semihosting_console_out(env, args, 0); case TARGET_SYS_WRITE: GET_ARG(0); GET_ARG(1); From patchwork Thu May 23 10:25:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164981 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1996048ili; Thu, 23 May 2019 03:37:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1q9Uql3hVO5ZQA7BA5I4XGSMvBR9+Zx7BsrKFk8bL9TELlBih3EPXbtOHsz/UTiFoONkA X-Received: by 2002:a17:906:4599:: with SMTP id t25mr49225097ejq.197.1558607857491; Thu, 23 May 2019 03:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558607857; cv=none; d=google.com; s=arc-20160816; b=O1kP3AcCzCrYZ/6F7532qGLxhhUvqLv2gachBgS582A3PdvHS3AKAWaRTwQLY5qVOh VXR+FhfSqWrJclP+mT7iknm7Ki0BlQAwZXZ6NHpwkrZoTITaYVs7/dHGkXOP5FFHkm4n 01mLeQTwXjMLAxZYF/g/eGtfGcmT74jqq6MY7Dwr5JepJj+9j9K2scFtTVY7AhiSC5uZ sxHv0DWYEk+5AQzTyz7p78PEA2vTYvyneZx+o8iUcmRGPivbb6Fsst3Xwjih0qdGWKJk glx5J10RO2MP9xd8xuGiJolDK6BjjLbwaH/22+rj9xcIwVNakhLODL8v2AP0LLE0Wev1 eseQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=oyPkJQUuoY6kZyyqgBjqwhy0PzvVeS2HQFmL5+Adi4A=; b=xZd4gvfox06uzbpupcf44cjlCurvRVVl/nEm150SpGE0+ayNXwBbPdYt4pj227kkPw isfra+WCOtKMhneSwop8ajWGkGgMYdSLqIRsJECTRiVqa9W+EViMhmTOE1reziTsOQ+F O3tQ1aiohiMaPX8PPIcerUoP6hTuhaceo5obKYsV+mZ/IbmNiyeYCT5frxkaEgyolUGE 59is9EVZ71UajITNqilmua5OhvCOix9YXBQ+Tzw1N4s2Woz9QuTWjjHZO9yPxGkHnzSW vKgfGnMha7aj2lyiSKKd5zlAnGVO1/AlhLdowAPKyue6v9v6RBR2cAXNre/29YvAidZe QA0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nuKPLW1+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l44si1971761eda.13.2019.05.23.03.37.37 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:37:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nuKPLW1+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl6O-0007R7-6x for patch@linaro.org; Thu, 23 May 2019 06:37:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49500) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkvM-0005x3-9v for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkvK-0001U4-9C for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:12 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:35840) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkvK-0000vB-1l for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:10 -0400 Received: by mail-wm1-x342.google.com with SMTP id j187so5195269wmj.1 for ; Thu, 23 May 2019 03:25:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oyPkJQUuoY6kZyyqgBjqwhy0PzvVeS2HQFmL5+Adi4A=; b=nuKPLW1+Z37vDr7p+bdJhWm3p3mAdionkRiJNbA0/6Jv/44BIiRTMDJdObos7VqT+d x4DIe5tUSUWwGUZj8bLiQiX/XH5dNBKmSuO/ugUjSv1c/5ATrfsTMHUS/SoQs837fOei slgJHtrA/H51XCwznG3ZMO2Nd1M2xdHQufpwj+FwUaH754oM5zGhVR+QbIYANgKv7RwV mD5fYyaBaFjcGEFqkkSBfcWoLEY6Uw/DVy1yYEBP4pVmpqbmgCDUKHlirQlXQ0HSIrdx JvUvwxUD0lmsg3SWOsUbqbnTxI/kyUJDjLyU+IWAhp3LpeSdH4l4v9Psoy5CJPyhjxEX No3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oyPkJQUuoY6kZyyqgBjqwhy0PzvVeS2HQFmL5+Adi4A=; b=ExUf9Q472D0xawVF2WDOkmiWu7M7hipDw0CP9W5QuFk4lZIFgBQQS+xPIws5nZFTda wnXs6jsc8dSF/wzWSBek4aYZYscIqM0wkdLWxocyF11OVIa0nGBp3/zqapeQgzwrgx0R vtfsgakTemeJNi8Pgw4W9G9ophRXWWX60VMNLy9XP7X+XyZvYLVPQXxlV88LifPY8baa wgrF4OJpjseJxps11MvxB61GX/8K2FYKQ1t3hImWOWSZ6DZFha3vp5eogqEQCIvQJFep +Nm6t8l6pPyf7ewrvQ6yNGmXfrRiNnNL3DP/RDeMjAy6cCiDeBlr1tRa0aQJ6GuhU1oB 7/Hg== X-Gm-Message-State: APjAAAUFbXQ52ukncwW2eCXnSzcFQl0nO8vwMhbGhV0uHFjYWYjOLP8R 9JcFpzvHabdV4Nu1EFVwrorNBw== X-Received: by 2002:a1c:eb07:: with SMTP id j7mr10801336wmh.138.1558607138116; Thu, 23 May 2019 03:25:38 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 6sm35343311wrd.51.2019.05.23.03.25.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:35 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 205DC1FF96; Thu, 23 May 2019 11:25:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:11 +0100 Message-Id: <20190523102532.10486-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 Subject: [Qemu-devel] [PATCH v2 07/28] target/arm: add LOG_UNIMP messages to arm-semi X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Clean-up our unimplemented bits with a proper message. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- target/arm/arm-semi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c index 253c66b172a..a3bbef18ef7 100644 --- a/target/arm/arm-semi.c +++ b/target/arm/arm-semi.c @@ -28,6 +28,7 @@ #include "cpu.h" #include "hw/semihosting/semihost.h" #include "hw/semihosting/console.h" +#include "qemu/log.h" #ifdef CONFIG_USER_ONLY #include "qemu.h" @@ -366,7 +367,7 @@ target_ulong do_arm_semihosting(CPUARMState *env) return len - ret; } case TARGET_SYS_READC: - /* XXX: Read from debug console. Not implemented. */ + qemu_log_mask(LOG_UNIMP, "%s: SYS_READC not implemented", __func__); return 0; case TARGET_SYS_ISTTY: GET_ARG(0); @@ -400,7 +401,7 @@ target_ulong do_arm_semihosting(CPUARMState *env) return buf.st_size; } case TARGET_SYS_TMPNAM: - /* XXX: Not implemented. */ + qemu_log_mask(LOG_UNIMP, "%s: SYS_TMPNAM not implemented", __func__); return -1; case TARGET_SYS_REMOVE: GET_ARG(0); From patchwork Thu May 23 10:25:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164958 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1990814ili; Thu, 23 May 2019 03:32:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPONTcPFuDVoP+c/EzGXku3QPwVLfhiPsp6s7dqw7fadJWWFMPO7cP98ZFlLPeA3LGvFX7 X-Received: by 2002:a17:906:1514:: with SMTP id b20mr45324207ejd.174.1558607540930; Thu, 23 May 2019 03:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558607540; cv=none; d=google.com; s=arc-20160816; b=tSRS3ZBfQw9p55KhqdnNfIOagpxj/WSnuNU1VYkg7Sge07WvahQ29Lk2vlF2b5E0CX vJcXW9efcP2ZgTQZT52VYHXQK5jw/kVtPojuTYZ+XcjKR8A5S40drz/W8+198M6/q7LO jBcVJqTWM9C5PHGIC3qAsyAH9LjZUarl4ptJPLof1DeHlcIZ1CSmr31jiFP98pVci2u7 awMxjvvyUceMqz9xsQx9Nx4NMlijlN6kNSbhhbtPjP1QUCr0jknoA2GM+2J28ugCgRML aOWm2sOd5OBYcEa5Zu4yKMaUWVWNk1iRXZLMJAeY1dwcZv6MfqCbHIOaMt1GQy6frSAx UWmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=gOs6U+dajCIf3344cfmtEQwYTSo5fWlyTxBlW4SM4Qo=; b=XMYM1Cp27OZBc0Gcq38WiZlmckTg1kOwlJXX0jIr/iTY9mbwSKNWqJzUbBMmxGIK+T vH+YKPZxyJew0xnu2os1PH9N+w4HhuoTpV1PtpKtnIu+0DXRd0SdMeGsoIhRJbiGDbfF jR33/r/xOMlQoguNSiKjOtfOzzeSeXpo3TGvpfpY5/rQZEg7y2oRkN6qzA8rlnqprqYF JUOJ0uPYcZZXRKj9DeLCe3yZs5qsz6FWqhRD9iznJP2ScQ1e9wJ8U4Za41bP98n0eDx7 Bb1lRlBRt5cJymlBPBQl7qHJUK6Vkvi9uHqs5xBaxbDE8Ei9dzi4yEqXK3ja3R7Z9uBA GojQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ua91iBkf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v20si20292278edc.102.2019.05.23.03.32.19 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:32:20 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ua91iBkf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl1G-0002yI-QB for patch@linaro.org; Thu, 23 May 2019 06:32:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkv4-0005YP-7L for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkv0-00018Z-E5 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:52 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:38081) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkv0-0000vi-54 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:50 -0400 Received: by mail-wm1-x344.google.com with SMTP id t5so5201080wmh.3 for ; Thu, 23 May 2019 03:25:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gOs6U+dajCIf3344cfmtEQwYTSo5fWlyTxBlW4SM4Qo=; b=Ua91iBkfhzDSZQQT09/eD2aY088HPqcnVLS2CalLdrbg+I7Wm6cAzwk0yOoAZw/XTp ji+ZVfSeo/LwsbeAM4XF1xGY8HEA/bBUXziozpCdlhdKmIiItoW+vNH9vc1Q7Yfq1rKJ ok6Fk0m5LNwAwqlaXPb8xv8ahFi79rfgzXbsXE9DVUVgJkiGaimSPovZshbkata4oOUo 8QIPfbxrmUtU3YOe6WCbxw/4KwEeUe8w00m1oFHnnz4J7sOHypPielcFDgunnnCZsoaS FqYxoUlgsRnk/8Av6mB0hb2xbTehlxpmWZS9ObRdS4s1XnGppBTnpSHZLrlLrQupqULu GE/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gOs6U+dajCIf3344cfmtEQwYTSo5fWlyTxBlW4SM4Qo=; b=f7U80Ady3KLzVh8ARMAx0lOAcCp4TKqBe4uqevIaKS8Dl+fNv18J+/wMYWtPJXtcHJ kGCjb1xpec+2EUgmXh6CMfRBzE6TT2zJbKWNbhefAdPR9Zf0XofAzqTP9mRqDLhvJjdw H23rMD1nB8XS7xpOjaykHBXXf2EFBfTvy4L63rXfPq0xg69tf8e154GMOsh8UyS0J6Zx gdTYV6i0YG8YfoKimDIV/HPDHE2ohQEQD/Q6BN59nvBeceCpeG9Ud7YgHA2GolFHi7Ly AT8BqkE6jg8qoof2gbuu3GVqDJdkIq5XO/U/sC+XM43SSs6iufawVHtPeJ744QfRxG6a k4zA== X-Gm-Message-State: APjAAAVZ2yX0P0pWxdRyhkm0fibA5E2iEMdZpzneRGcI2f7issOhRxoO oMbFewS/C8WswQNwpSjTLoG02Q== X-Received: by 2002:a1c:c706:: with SMTP id x6mr5246214wmf.35.1558607138901; Thu, 23 May 2019 03:25:38 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 24sm7218895wmo.3.2019.05.23.03.25.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:35 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 340541FF87; Thu, 23 May 2019 11:25:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:12 +0100 Message-Id: <20190523102532.10486-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH v2 08/28] target/arm: correct return values for WRITE/READ in arm-semi X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The documentation says the write should return the number of bytes not written on an error (0 means everything was written). Read provides a buffer length and the return value should be the buffer length - bytes actually read. Remove the incorrect FIXME's and return the correct values. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- target/arm/arm-semi.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) -- 2.20.1 diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c index a3bbef18ef7..3ae8f05d51b 100644 --- a/target/arm/arm-semi.c +++ b/target/arm/arm-semi.c @@ -334,13 +334,15 @@ target_ulong do_arm_semihosting(CPUARMState *env) } else { s = lock_user(VERIFY_READ, arg1, len, 1); if (!s) { - /* FIXME - should this error code be -TARGET_EFAULT ? */ - return (uint32_t)-1; + /* Return bytes not written on error */ + return len; } ret = set_swi_errno(ts, write(arg0, s, len)); unlock_user(s, arg1, 0); - if (ret == (uint32_t)-1) - return -1; + if (ret == (uint32_t)-1) { + ret = 0; + } + /* Return bytes not written */ return len - ret; } case TARGET_SYS_READ: @@ -355,15 +357,17 @@ target_ulong do_arm_semihosting(CPUARMState *env) } else { s = lock_user(VERIFY_WRITE, arg1, len, 0); if (!s) { - /* FIXME - should this error code be -TARGET_EFAULT ? */ - return (uint32_t)-1; + /* return bytes not read */ + return len; } do { ret = set_swi_errno(ts, read(arg0, s, len)); } while (ret == -1 && errno == EINTR); unlock_user(s, arg1, len); - if (ret == (uint32_t)-1) - return -1; + if (ret == (uint32_t)-1) { + ret = 0; + } + /* Return bytes not read */ return len - ret; } case TARGET_SYS_READC: From patchwork Thu May 23 10:25:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164982 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1996270ili; Thu, 23 May 2019 03:37:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLaXyfhnE9U6U95Gc3cEgM1je/XuEHEiOe8C3il8D7fipRMFKojBELihSdfbVeE+BpwT1p X-Received: by 2002:a50:908a:: with SMTP id c10mr95313138eda.226.1558607872450; Thu, 23 May 2019 03:37:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558607872; cv=none; d=google.com; s=arc-20160816; b=hNogiqaiTijZ4sMcN5v4RXficd9q+DjqQUbWV1AxV6OQr7S9PSYUREfUO/spimbPef RGaQVH7ZZSGANbfg/Wtq2p0cVek4lW9f2nG4Jpga9RpjI9EUOvNmQiYXU6Yk6V4zBoDa Q4vqOmf7Cbfo3vEXViTKaxg2dEY3J3FLkUEuI1ia3+xVbYxR6+4IhucSy+ktz/8MxCrV 2iOBXj0U0FH13khFtVz+0U20fNI2Y/GO2smS4XMYO0Wk3y0T4XSIxQNOIsGad5t4KhNb gxngFBWT6dssj8pTEMX9POPvV1wjHmVMImQ0kKNc8voU7evF5Anrg9kRIWpkXpKZW6rL I9lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=CBMu5m7eSFgVxsne/XtTOzzcwofGf1J0u9oREYxWAFw=; b=mjp4pMrqsR++Uv+kU5LDYQTfwQjh+FKzlo6Hq270D18pbUOxiWcNtif7rYe3ihjN1a q32kDe2P4dVnWGmbXbL5LCrulklFS7qsbMKdZhCPIQK/Q3xLeww23fwP+8301KqgKJqk aljG3zsXK3UWA4ktJJhk5sRHOw/dMMNDp/2iO/96IsI+15xJ2d5gQGniBda2OEPAWnHE /Pt808yEdV7naR5yz10CDYLnGDRPiuL7q0Bkxd+Uw4pm7A9l5KI1/V8I+4L5C9eYrfzX QCG8OtzXgZ/eCStIsItydaDsG3+YypdhUglqw/dCTi+oUmhpeE0cAhBuXa8X0spgmXBl yBNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tUUnghut; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id hk25si1141927ejb.171.2019.05.23.03.37.52 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:37:52 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tUUnghut; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl6d-0007et-Eq for patch@linaro.org; Thu, 23 May 2019 06:37:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkv4-0005YS-8B for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkv0-000185-9P for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:52 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:34867) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkv0-0000xP-1o for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:50 -0400 Received: by mail-wm1-x344.google.com with SMTP id q15so5201896wmj.0 for ; Thu, 23 May 2019 03:25:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CBMu5m7eSFgVxsne/XtTOzzcwofGf1J0u9oREYxWAFw=; b=tUUnghut34aXiftRyh3GqNtRNX+FS1aOhZG4Mo5g42SKs/CO4JYGGcgYJRoxkXIDLI MJKshVJX7GJn8XhJ3DJhZuiqLICyuQHgHFnSoX2kjRKScGgnLoxanecFRfRmrftmUMf4 0AldmnfYeLmwrutxcwHPNSCkJkLe4QPq9cx8xdNDfsM8KxuzkEHg72LJVh6CGRU6EfbE GwDbxuIbb3I7tnmal1fdvPCjUn82dhtoV75dcAaw3IHFBE8mOr24FHK0KuyqImO5xcco uh9ZYCvDsknN3w1SzpPy9btYbt4LHd4x2qg+6NvZ1kdYOe5UIqvwRHpJs37rTQsUrBMz 2NuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CBMu5m7eSFgVxsne/XtTOzzcwofGf1J0u9oREYxWAFw=; b=QwZXUXpO6OGNjzhEZYGquxbgDnmCu64WvrIES6Ivd22qpsGULPeyYXnDtLLl+kWGf9 EteQYPlcJ9nByJl7S/7bPWNE3OYCbYOVC06QHeNk2mZf6hKmfa89wPYdYzFX8UqkSXdi FXnIBK0N/Yym10ATLVTd2bw/ufWvD0PmZlSxwvaw3KRPMab1/5fPxt0Zu4UZXziW+lIW 6n7QqyUAOiSz813/1hfUrXGPNUbJilSY5jjd5Yf2eHim+Us8wBnJBj+BBvtLkG+CaQ+Y jS7BoRyschaTZh79rmUVpgpdEFYAU5wIp2xbcMIgqY3772AMLtWL32Z4w2jfnq555HI8 bMiQ== X-Gm-Message-State: APjAAAU59net5/iJ5ZpkVEXI4whRXoU1QMYuwQKqOxAaDUWAj+uRrf3Y Ytg8qBK/nsRz/uBEglQaUqM6hw== X-Received: by 2002:a1c:688a:: with SMTP id d132mr2610625wmc.131.1558607140945; Thu, 23 May 2019 03:25:40 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b136sm9875486wmg.1.2019.05.23.03.25.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:35 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4A35B1FF98; Thu, 23 May 2019 11:25:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:13 +0100 Message-Id: <20190523102532.10486-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH v2 09/28] target/mips: only build mips-semi for softmmu X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, Aleksandar Markovic , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The is_uhi gates all semihosting calls and always returns false for CONFIG_USER_ONLY builds. There is no reason to build and link mips-semi for these builds so lets fix that. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Aleksandar Markovic --- target/mips/Makefile.objs | 3 ++- target/mips/helper.h | 2 ++ target/mips/translate.c | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/target/mips/Makefile.objs b/target/mips/Makefile.objs index 651f36f5176..3448ad5e193 100644 --- a/target/mips/Makefile.objs +++ b/target/mips/Makefile.objs @@ -1,4 +1,5 @@ obj-y += translate.o dsp_helper.o op_helper.o lmi_helper.o helper.o cpu.o -obj-y += gdbstub.o msa_helper.o mips-semi.o +obj-y += gdbstub.o msa_helper.o +obj-$(CONFIG_SOFTMMU) += mips-semi.o obj-$(CONFIG_SOFTMMU) += machine.o cp0_timer.o obj-$(CONFIG_KVM) += kvm.o diff --git a/target/mips/helper.h b/target/mips/helper.h index a6d687e3405..90ab03b76e3 100644 --- a/target/mips/helper.h +++ b/target/mips/helper.h @@ -2,7 +2,9 @@ DEF_HELPER_3(raise_exception_err, noreturn, env, i32, int) DEF_HELPER_2(raise_exception, noreturn, env, i32) DEF_HELPER_1(raise_exception_debug, noreturn, env) +#ifndef CONFIG_USER_ONLY DEF_HELPER_1(do_semihosting, void, env) +#endif #ifdef TARGET_MIPS64 DEF_HELPER_4(sdl, void, env, tl, tl, int) diff --git a/target/mips/translate.c b/target/mips/translate.c index 3cd5b11b16b..fb905c88b57 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -13726,6 +13726,14 @@ static inline bool is_uhi(int sdbbp_code) #endif } +#ifdef CONFIG_USER_ONLY +/* The above should dead-code away any calls to this..*/ +static inline void gen_helper_do_semihosting(void *env) +{ + g_assert_not_reached(); +} +#endif + static int decode_mips16_opc (CPUMIPSState *env, DisasContext *ctx) { int rx, ry; From patchwork Thu May 23 10:25:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164959 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1992109ili; Thu, 23 May 2019 03:33:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyk50k+TjpDy236jSHpEtSLikufGEKXBaR/OOb2tU2GlF+qrQWLr1qzqth5Zn/BHOMcbBV X-Received: by 2002:a50:e79b:: with SMTP id b27mr98092456edn.281.1558607612234; Thu, 23 May 2019 03:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558607612; cv=none; d=google.com; s=arc-20160816; b=0cVAYe6pm7gKaFPeH67ZJnK7JYcSTAHIghDlSHyxSCPP/Zt46EDeh/JNPkxWlmlHnh FFM35uWbHmU7E9UrnTBrrT/Lnsimyxn1/e13ndkSE3ZNJnw/IrbQAm16zChha/tNSFDm 5fsqxmni0ybtPdsG9YvnYaH+0kxuY1bIThobCwFmkA8ZAI5t7FRs9CIZA/cFoyGt6yQg 1x37frqtABsDBb7VjlNcMc8Sr+w+afFkwyRfrqK2vQLWTlBZ/1rBZied84ZkZk76Hpra k+A9XQiaKdqlh0AyeXBTCzmk03TmZNUMIC1lNFfiIjcfVehhCJMsvU4eFu5B6wyuRQKJ 9IEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=82m0nfi4dm1nYK1jjOZA1RHXA6lw0YusU8h2ijo5ck8=; b=AvGWJ3hGtX8sZS0HY72Mp0cyfp7KojrGR9CZxpMb0iT+HsjWTY0LSn3cNDpir3HwTT 45SHQeuwaVIaSia0OLvWqAVpazEJvyzCtSAer5o21Soo9B4IyX8rLyEBo/20/UVyYJPC Q3HsO77R8veCayhlcsFG+1eHPB5tN8kv7xIRSHY0YtU6K4xXSZVpyUiMdz3TF1xvPGsY lVTD8N4TAqnN8uVij1IiyeDW7wThGXA+4YuKJ47zEY2lI+1eyUVuAKo9Bg8la50CNq31 g03pltEKc8V614zuOn595xXd3hsvn/yvfYB9/rCh7hVypvSRgRMpN8vYD+lXpNoG6IKH SOcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iHcGHSBq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v16si3821386eju.197.2019.05.23.03.33.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:33:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iHcGHSBq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl2R-00047g-7M for patch@linaro.org; Thu, 23 May 2019 06:33:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkvK-0005ua-08 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkvA-0001K2-Ns for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:06 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:40060) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkv4-0000w9-C9 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:58 -0400 Received: by mail-wm1-x342.google.com with SMTP id 15so5186358wmg.5 for ; Thu, 23 May 2019 03:25:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=82m0nfi4dm1nYK1jjOZA1RHXA6lw0YusU8h2ijo5ck8=; b=iHcGHSBqgqA03l7DRF5mjuOailwePJ57lDnjFJ+ptwz/w3bH7QNwot5Qglu74EeDl+ 4oOAKE+StzTeBR1TS8WfuefzaxfaypReMbgoYOmZ7E7NNqXk+MM6Mjeb9LWE4DKOBuBH p9B+wD7poJczrLxz7IC9NIRjmmUAnFTIHTEjuvOjZsDp+J6dq+NvOMW2Jn7QrL51giv5 dEON2ZzgkJb2+6eoRqK92BJYoQOlgM6hjO13C9lCFOuaOLMedamiJcfG+LL7HAwC/r95 Th8ql8jwfQyGpHdAoDpiQoRIWd3cnIObbGC8tjp4mOpq+yNsB6ryHhZ6pS7dkadHyoGQ zVrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=82m0nfi4dm1nYK1jjOZA1RHXA6lw0YusU8h2ijo5ck8=; b=HZbLGWLpa81Tc+o91WiaMblpKlSd6iGzVdTzWg2Cs3MBSo2J7tOzNPZPtotzY2mkej XZz+vqy/QWXhbb9wdVDvgqHoftpDM4PpYdCnqkkV0PyyvtFL+cOoP3vwEZ+OyR5DB2qA hZ0TzgwVIxDtGTAwU3rWtNMVhjBYE8u7YzyTQIxk3yhDTpA5+qPWvXO0NLpEZ93Dd57P saMrxTFI7jGLUQuiTaIwsDdKegn0h9NIwe4nEhkLZDpW6xEF2jZIIDqG+Bbaiy7j9Ivk LnsTXvpyxus6Ku7i+mYEgozbo/03ptmHzo/6ADV1MNNX1DBuG2vLnhZGHjO39n/xHQfq SNew== X-Gm-Message-State: APjAAAUClqe5/EJNpqi9oJNvolgzplhq/YfNHNNYv8fi1pwfvUGXHNne eiv0alggLBE3VhRswqGHTzw8IA== X-Received: by 2002:a7b:c844:: with SMTP id c4mr11196258wml.108.1558607139479; Thu, 23 May 2019 03:25:39 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b206sm10396597wmd.28.2019.05.23.03.25.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:35 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5D0D51FF99; Thu, 23 May 2019 11:25:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:14 +0100 Message-Id: <20190523102532.10486-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 Subject: [Qemu-devel] [PATCH v2 10/28] target/mips: convert UHI_plog to use common semihosting code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Aurelien Jarno , Aleksandar Markovic Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Rather than printing directly to stdout lets use our common semihosting code. There is one minor difference in that the output currently defaults to stderr instead of stdout however this can be controlled by connecting semihosting to a chardev. Signed-off-by: Alex Bennée Reviewed-by: Aleksandar Markovic --- target/mips/mips-semi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.20.1 diff --git a/target/mips/mips-semi.c b/target/mips/mips-semi.c index eac8374fb34..35bdfd7c77e 100644 --- a/target/mips/mips-semi.c +++ b/target/mips/mips-semi.c @@ -23,6 +23,7 @@ #include "exec/helper-proto.h" #include "exec/softmmu-semi.h" #include "hw/semihosting/semihost.h" +#include "hw/semihosting/console.h" typedef enum UHIOp { UHI_exit = 1, @@ -329,13 +330,12 @@ void helper_do_semihosting(CPUMIPSState *env) p2 = strstr(p, "%d"); if (p2) { int char_num = p2 - p; - char *buf = g_malloc(char_num + 1); - strncpy(buf, p, char_num); - buf[char_num] = '\0'; - gpr[2] = printf("%s%d%s", buf, (int)gpr[5], p2 + 2); - g_free(buf); + GString *s = g_string_new_len(p, char_num); + g_string_append_printf(s, "%d%s", (int)gpr[5], p2 + 2); + gpr[2] = qemu_semihosting_log_out(s->str, s->len); + g_string_free(s, true); } else { - gpr[2] = printf("%s", p); + gpr[2] = qemu_semihosting_log_out(p, strlen(p)); } FREE_TARGET_STRING(p, gpr[4]); break; From patchwork Thu May 23 10:25:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164961 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1993859ili; Thu, 23 May 2019 03:35:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEMolZvoP8Ip4EICEw4bJ34lh0C6SS4qIP8477VosfWRCu2QXOTLaKc5fe4SSCmcJFkB4B X-Received: by 2002:a50:b7bc:: with SMTP id h57mr80264570ede.77.1558607721539; Thu, 23 May 2019 03:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558607721; cv=none; d=google.com; s=arc-20160816; b=WGkn6qtITUWX6SMG3hizAaDozRZkMR6lrbR3Z5YhiFHr/fjm0vidhBj6prGGfpRw1G azFCUGuy6oGwGfTHCrACSCd1z/FjSbqZ6LABCuKebtgVQYM+P6p2A3Jr75nwzN8yGYGy JvnQxMZOD3SQkfJZwYZOW5dJDJV1BhF1xDzvDLMR2j33fF2Md3ZLdrbKHY4qP5aMGdnv XQPJqbLyOkFca4ZMf/GyJgmkNT90LsgtihYbilkyGOHG+19sS7E331F/EIhY/0zBoo32 gwe8L/nxTk4AbdDpJhbi0S/oAtzv7XxgGGsSBjTVxaGz/BEiIdKbaZh9XQU4F3e57FJw U0uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=VHL/eH+WA1PJ4T5TasKMlaKBAQV31B2TXqjsSLGyJaY=; b=M/HKIC5qMTHyH5+d7eQgg3llclvFSxmTCw2J+yCs1GfBr/xPE+4n3DJo6FT9iR/Tjh fdmVJFaAKbKLrXCbKlBJsE/NvnAqWbVDYYyC2Mt2Qdi0FJpAmnT+h7f6yNlxnqhMv4Kk 6b+a+OvaBEXc02pktVQOKs89GMKMZMyIu91gtmjqXIrRnYxx4Sh/h25V3LXb4A6/0eK5 fCXc2FxKn0e4lUbCIS6DXA6PJZU8DNP3co9oMZlELY4cP5L8yGsH6iynqhY7pci6wg8Z Z4LMXTJCp3PFwcPrdZ9iy4fIjQKkyF5cX6pDa2lF8RaZ0QdBo0KF4pP7y168U93tE3XV MRxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NwkjGBT8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w27si5756270eje.284.2019.05.23.03.35.21 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:35:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NwkjGBT8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl4C-0005gP-El for patch@linaro.org; Thu, 23 May 2019 06:35:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkvA-0005gI-Ko for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkv4-0001Br-8d for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:58 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:39057) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkv0-0000wY-JH for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:52 -0400 Received: by mail-wm1-x344.google.com with SMTP id z23so1126305wma.4 for ; Thu, 23 May 2019 03:25:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VHL/eH+WA1PJ4T5TasKMlaKBAQV31B2TXqjsSLGyJaY=; b=NwkjGBT8bp+Ve9YOqOitp3MeeUi5QKJyXvejYpvbioHd7YwusaILrEorFCVAPRLQ6M pnxohw4Wtzi1I85XTA06jBOnKs2x67sPBsO0N/3EX6N1t2Iosl4ZkJxPU1axJOQpaZs4 2zrHD9QRDuOBY7Z8U1Cfs+rkEDPECPi7tWTkS3lnqls6cPK2EAzrOJXwjWeoEEtjldC6 sjew6Ces2RNkpAl60UZz/JjrIpDLiSq6qGNf5quTHiTNj2p6SgyLf9/NaB0zZeZmVyC2 rn3qP7rmzIA4EVCTYOkw63dAht4S5ATADAtxry5QuO0hPIgvKdG7Kct20x/xw5YtGe53 kyRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VHL/eH+WA1PJ4T5TasKMlaKBAQV31B2TXqjsSLGyJaY=; b=Fd2aLpGnwq3g0lmj9hR3Zxma61t/rzw7eZYTNZw0fkmhO78mcMvJaugdkQGcomO84b RImfqDaXGBFJwVMQamCygpYdSyFJBgc/52xbllr+jDDaVTcmpE7JV7ZMdNZtX/FqJbk1 61sRY1KhbmIwF8jRUrM+/0l7ShLLEPcvOmuD7KsU1V9aJZVyb+BOMRnwVgGWgU3T0iIq g3tR1sFSBbcYubx5+2OE5G4y8tIqI/EJa/2idHODr19ZuWVjDRomkdZwgeD3bsZJn/5h 5GL27boF2p3eLN701qBC9csu1D4w6i9KG5zIVrPvGcntTGm2EBG1scOYU9txH+N/59vB ZShQ== X-Gm-Message-State: APjAAAUyTUT2PUUnlzk4lzPTJo6CVveyv4Pc/QYNgXLNAHus6tLKiKzz 0jiBXfi2rLLRsR8I82+ALTt11Q== X-Received: by 2002:a1c:f910:: with SMTP id x16mr11837752wmh.132.1558607140227; Thu, 23 May 2019 03:25:40 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id z13sm23588885wrw.42.2019.05.23.03.25.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:35 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 71A1A1FF9A; Thu, 23 May 2019 11:25:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:15 +0100 Message-Id: <20190523102532.10486-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH v2 11/28] MAINTAINERS: update for semihostings new home X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Seeing as I touched it I should at least keep an eye on it. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/MAINTAINERS b/MAINTAINERS index a6948ebc63b..c4f209898a9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2560,6 +2560,13 @@ F: docs/pvrdma.txt F: contrib/rdmacm-mux/* F: qapi/rdma.json +Semihosting +M: Alex Bennée +L: qemu-devel@nongnu.org +S: Maintained +F: hw/semihosting/ +F: include/hw/semihosting/ + Build and test automation ------------------------- Build and test automation From patchwork Thu May 23 10:25:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164995 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2013750ili; Thu, 23 May 2019 03:57:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdMvlPLL9giWQe+cq8Pv1uf3n9jrIICinfEgBXjUy2UVEO+rQKbBwHepBV1DC86jEaA3nm X-Received: by 2002:aa7:da8f:: with SMTP id q15mr94770282eds.54.1558609040642; Thu, 23 May 2019 03:57:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558609040; cv=none; d=google.com; s=arc-20160816; b=lp96h74mVNQOcDP2B6DPQ21fGbCm4SAcwIOX/JXNMDuy2+4Q1O5M7Quqo6GmwPWpdE jM2y3LXH9vvV+ON5LdYs3fzuf50De2JZV2IQHJfCtin+5eXlwAAOI3RKLf/RgFYcxKk5 rM7wRjT6CzousPLySbJyBvuurXbKwDAqnfZMf/vuPUVYQEWd0hQG5kgEdOTo7tcH+76D tP+eZWcapkSea6UIX4pVElE8ZL6+OhOx4nyQQCAsG/lZ0qqvPl2kEBV6LAkhJbiCS+gT 8bGyPlxBONOBTiXaWJcaknEWKnsG68JKJwmxjJEGY74jNQdrYjs0SGn9Nj7RwfvDfOaE xhYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=xuuMnNMpb8Xfi2k7UTaye3/+aCNPdHNH8EZgGhe/xVw=; b=v6YRqqHZsPcWZSRDXBmeyR+6q99oui7sag/TNpDt/19wICUmsVPP32lPD8LYO9/cBl 8J3/U2vP/Kd/yAo2CFWR5y+7KtU8WvJgKDT3D9G2LHLyS54C1Tm/5/rRsJU5zIrqIxec XvLKQLNG4ukHF/jGymErnmOoYc9HfAp3qB6dqEORmgSmzP1uUI/I8wFHsbsSUUhIJyFl Sdr5IC1RheDQuJq294HwgSqJAH06Y1I9TSjvR+IwowhplH8VaqWJdzSVR9xj9qGX/AzI 1Qg18ac8JApyAtPo2dNnCFOmP7tT8ltvV7tkP7VW2biHkaYD9mWRvZD2Dj8aV2fb+zvs AoUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BYBFYJlx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f46si1226229edf.221.2019.05.23.03.57.20 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:57:20 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BYBFYJlx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33632 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTlPT-0007Tb-KZ for patch@linaro.org; Thu, 23 May 2019 06:57:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl2r-0004U5-FU for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTl2q-0006hG-FI for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:57 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:37054) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTl2o-0006dJ-FE for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:55 -0400 Received: by mail-wm1-x341.google.com with SMTP id 7so5224145wmo.2 for ; Thu, 23 May 2019 03:33:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xuuMnNMpb8Xfi2k7UTaye3/+aCNPdHNH8EZgGhe/xVw=; b=BYBFYJlxprKmCCsen8TmgK142cSTMkLUIQb5qqFJq0t6kSdYZ85XDCSueq4uBAhLSL piGlLpifau8XKmqwxKXPl2fm+yDhRj77OKas4CKR1YEeAFD+EomgUDACuPJ/dghCCplq /dzqPJlpFPdVc8PDuC3PFk6R7O6ZS0TCj6bensWWTN/zMvFpB6ScXwTkkAQx+JJIDhLF A3x7aiCIuiwCw4Ozk46wAl/S+pduc+BEEw6UFNu8+/yBL4+3u2mMzJprkBd/cLA8Wo4n 2Yd6h8FALkqNF+BO23vYyIJYeRJqxAojJptwwpOkGPdG++3YtprRfwJXsgqA+Uf0owwU /VtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xuuMnNMpb8Xfi2k7UTaye3/+aCNPdHNH8EZgGhe/xVw=; b=crAoodWXvFdhdTBYkI+uAtWjvtE1HtoMk4xP+ysfVBugxxLM6oElj+w204smcKt4Ty /+LjVU7IV+KEW8EPn0F3WeCejsF0Pk/1NHR+PcxDkksShTWk/ude1tDJNgJxlne0nFwG WiWleU4sRpI8qO7NVrcMh1WjjWflRW+NcvpQFWDbcGOt+Sy3iZ3aN6VkoUA5ImV71xx4 XqjxH/rgMzAedeK40PuM5i+4JJY6dQ5HL9rXhLQBQgQf/2cIw7xR/SxxhA1o/sG6GAYn 5323aopY9FcSuAfREIT9xjK8o7iYobcEb2LkJSTO4Ck4HhsVIfXoyZohr4nccYWy9zW6 pQrQ== X-Gm-Message-State: APjAAAX4qX3MJaZvci7E5A4s1jXnvqK7WohE5D92iAl3FxFRs9sWsOYk wWiUJusd/xa5M0AmFT+qcQ9AFQ== X-Received: by 2002:a7b:cd12:: with SMTP id f18mr5791043wmj.103.1558607630142; Thu, 23 May 2019 03:33:50 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 74sm10695056wma.7.2019.05.23.03.33.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:33:47 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 86F721FF9B; Thu, 23 May 2019 11:25:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:16 +0100 Message-Id: <20190523102532.10486-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 Subject: [Qemu-devel] [PATCH v2 12/28] tests/docker: add ubuntu 18.04 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Based on the ubuntu.docker file. Used to reproduce the build failure Peter was seeing. Others might find this useful too ;) Signed-off-by: Gerd Hoffmann Message-Id: <20190503070241.24786-1-kraxel@redhat.com> Signed-off-by: Alex Bennée Tested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé --- tests/docker/dockerfiles/ubuntu1804.docker | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 tests/docker/dockerfiles/ubuntu1804.docker -- 2.20.1 diff --git a/tests/docker/dockerfiles/ubuntu1804.docker b/tests/docker/dockerfiles/ubuntu1804.docker new file mode 100644 index 00000000000..2e2900150b0 --- /dev/null +++ b/tests/docker/dockerfiles/ubuntu1804.docker @@ -0,0 +1,57 @@ +FROM ubuntu:18.04 +ENV PACKAGES flex bison \ + ccache \ + clang \ + gcc \ + gettext \ + git \ + glusterfs-common \ + libaio-dev \ + libattr1-dev \ + libbluetooth-dev \ + libbrlapi-dev \ + libbz2-dev \ + libcacard-dev \ + libcap-dev \ + libcap-ng-dev \ + libcurl4-gnutls-dev \ + libdrm-dev \ + libepoxy-dev \ + libfdt-dev \ + libgbm-dev \ + libgtk-3-dev \ + libibverbs-dev \ + libiscsi-dev \ + libjemalloc-dev \ + libjpeg-turbo8-dev \ + liblzo2-dev \ + libncurses5-dev \ + libncursesw5-dev \ + libnfs-dev \ + libnss3-dev \ + libnuma-dev \ + libpixman-1-dev \ + librados-dev \ + librbd-dev \ + librdmacm-dev \ + libsasl2-dev \ + libsdl2-dev \ + libseccomp-dev \ + libsnappy-dev \ + libspice-protocol-dev \ + libspice-server-dev \ + libssh2-1-dev \ + libusb-1.0-0-dev \ + libusbredirhost-dev \ + libvdeplug-dev \ + libvte-2.91-dev \ + libxen-dev \ + make \ + python-yaml \ + sparse \ + texinfo \ + xfslibs-dev +RUN apt-get update && \ + apt-get -y install $PACKAGES +RUN dpkg -l $PACKAGES | sort > /packages.txt +ENV FEATURES clang pyyaml sdl2 From patchwork Thu May 23 10:25:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164970 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1994365ili; Thu, 23 May 2019 03:35:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMK/0/WLVgVZoytDDr+doMyiyVI3Et76ZCAe2P4zPUvAEUkSFAOyJ+x0YujKByhWDDXiz+ X-Received: by 2002:a17:906:5593:: with SMTP id y19mr47136901ejp.264.1558607751883; Thu, 23 May 2019 03:35:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558607751; cv=none; d=google.com; s=arc-20160816; b=Gm1eF+zyYv4gz5t/YoseFf+l4mG6KHaCsHh7G6YcqLycgbiCLZ7RxfzRFJxGO4QOV0 wrrcWtnPwR2gkodGoiEJ/88UeZ1tZf2rXcFB1OFsHY4kWMgf5rKAAI9EGDk5n1gfyUgK A1mVBepg3WUnEjERqifeiTnTMzhjFUCUqtrysoatOz1OWa+O9N1OS/X7G+n8m+X5XviE uXW4DG00eS0m1KT6XxiT7Z9hYhQFqmTteLIXPmUQyS6YgYBsODsC6tcDsA4Lt9MnX/0R N2ugTuWLaITSbUdFZ/ICw6wUqpAIpJZtgiV++xpJIvHa1dAerB928f+moxRphZQxFgd8 K0ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=ItvJrxkkJAYsPd3+i9yl+Ujb7HJI7J9UVBJligOhXtM=; b=vs/w1GDUeXnAcRKYyfQU1O9ppjzbSTs+UEiXqS/BcNJjIB35AgVlOhbOGN8y+Pa5ng t0P81AOjRNZmTB35PAenbl+x9mWqTw9C8WA3zlUhmPYG5GmHMgs+FjghLnQKrg0LfYQ8 LvieaE4QNG/PcjYm+jCDLhi32PtzgA1+w8PUJWPCp2d+GCCwqXZg7uKcaVf1yuE1XTYP 9EpPVmy4/Hk62YRjquPiT4KShz2ijoad/w0/XvBYOUx8vgRKjFUei3Z819ZANIU1WLz2 /Z9Skj/A/Pyjr6puaoC6QLR+1Mqa1W2P5U2FcDzpFT8lnUVspgySauUAfR/My77F5xy2 Xo2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=aXH3NpW0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u17si12751229ejx.387.2019.05.23.03.35.51 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:35:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=aXH3NpW0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33217 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl4g-0005lC-RE for patch@linaro.org; Thu, 23 May 2019 06:35:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkvK-0005uf-0s for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkvA-0001KG-PP for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:06 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:36552) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkv6-00010L-5N for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:58 -0400 Received: by mail-wr1-x444.google.com with SMTP id s17so5671413wru.3 for ; Thu, 23 May 2019 03:25:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ItvJrxkkJAYsPd3+i9yl+Ujb7HJI7J9UVBJligOhXtM=; b=aXH3NpW0wGCXuRLYjqaPr1YaSXUAaupjWTZWtBXYo02w0AKWJ3futE7RtVQeQttt4I 1xbBNCLSGYiqd/k6JwIiy8Fr9Ye7LJtAEy0JQIYnrOQXg0h9jRBZNSj2DsUwwcNXsy4D 53W7yLuz6mjtQsTDnQowlQ9LPXhge867AcXAEAsRc5k5kG0objC8wP0CzACqNgJDD40Q xNbcF0imnE/rPYctzociqlwcO8XyL93+1ODOsM6SNCA0ptcYKhaLWnYlas31YfZAfpbW fmtfdjRSOyKc3fzrCLIRIFJE9L725Hcg1emHi0xxM7MjhrBBparqM4/Hi7bJ53BDQ8jJ H1HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ItvJrxkkJAYsPd3+i9yl+Ujb7HJI7J9UVBJligOhXtM=; b=XV1YsoI7GH0bs3dRRgh1THNDwVDKp+s08OIsy8jOzDh2wLgBx14yPq8TPIDVGPbB3V 23anupBlR1ch4dxNmRGeeM+rTXzIXtFi2m012iMk8lP/I3vrX2bzmXW90tekA/De7tGM LE/zuSAQhBpbxjrBdgZLsDmcJl3NZ7HgkXNmpDofRRw/5FuT47JatvkXOUQwGJcgUeuS AU4qOYTDr0tS3MLI9MfaPFWt0T+0mA77AjAQCVrtIA5LGBdFHWVjO5srzfOuNAZzcz2d U1m/uJA71/xd4+e7sfbBD7ll4MpmysBsnhZJzZABKDLaH5rAZ4+xxQgcCJgs0WPyEjgt Wf5g== X-Gm-Message-State: APjAAAWqGcqgTkobbdNDlhgMdWpiOhpIzIJfp+VlpqfhJVIYAfGo6+dZ Sd2AT9+is7qbDsZlW2XE1DUjZA== X-Received: by 2002:a05:6000:10c4:: with SMTP id b4mr33632260wrx.145.1558607144297; Thu, 23 May 2019 03:25:44 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id p8sm21177850wro.0.2019.05.23.03.25.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:40 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9C08C1FF9C; Thu, 23 May 2019 11:25:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:17 +0100 Message-Id: <20190523102532.10486-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 Subject: [Qemu-devel] [PATCH v2 13/28] tests/docker: Test more components on the Fedora default image X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Install optional dependencies of QEMU to get better coverage. The following components are now enabled: $ ./configure ... Multipath support yes VNC SASL support yes RDMA support yes PVRDMA support yes libiscsi support yes seccomp support yes libpmem support yes libudev yes Note: The udev-devel package is provided by systemd-devel. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20190504055440.20406-1-philmd@redhat.com> Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Acked-by: Marcel Apfelbaum --- tests/docker/dockerfiles/fedora.docker | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.20.1 diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker index 69d4a7f5d75..afbba29adaa 100644 --- a/tests/docker/dockerfiles/fedora.docker +++ b/tests/docker/dockerfiles/fedora.docker @@ -8,6 +8,7 @@ ENV PACKAGES \ bzip2-devel \ ccache \ clang \ + cyrus-sasl-devel \ device-mapper-multipath-devel \ findutils \ flex \ @@ -23,13 +24,17 @@ ENV PACKAGES \ libaio-devel \ libasan \ libattr-devel \ + libblockdev-mpath-devel \ libcap-devel \ libcap-ng-devel \ libcurl-devel \ libfdt-devel \ + libiscsi-devel \ libjpeg-devel \ + libpmem-devel \ libpng-devel \ librbd-devel \ + libseccomp-devel \ libssh2-devel \ libubsan \ libusbx-devel \ @@ -74,10 +79,12 @@ ENV PACKAGES \ pixman-devel \ python3 \ PyYAML \ + rdma-core-devel \ SDL2-devel \ snappy-devel \ sparse \ spice-server-devel \ + systemd-devel \ systemtap-sdt-devel \ tar \ usbredir-devel \ From patchwork Thu May 23 10:25:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164986 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2002461ili; Thu, 23 May 2019 03:44:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7D7UAsdyEcN9d+iFqwWDqz4K060rq6e6LBbIntVc/pdzl3dXcRv6vhn9HRFqGIpyYL14d X-Received: by 2002:a50:b33d:: with SMTP id q58mr96079371edd.46.1558608277582; Thu, 23 May 2019 03:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558608277; cv=none; d=google.com; s=arc-20160816; b=D5XzK/3tFaRAb1sQWxVn+q9zHRlAFsEmI9IRxghDqL4j07s26DeaOYcrXUHm9zMXPp aSHyg+28GHeqLTbG1RIEpOlx9zD8PvmzLqtpo4NXTMgkF3vHEeW0ybNTG0cAdfr/kxhg Gav1W8o5s+cJtz9KCQgVvWCpWWK9F2rWplW2gV2EV4senQ+FGLxU/g5Fy6ZyZreoxAqL p2+zXabVqMVaVYXqP2dRg++P+HzS4CijSaUl1HdAV6TJ7QGTA1D7UMF7KFyjd6UwqCLy JbEJoUWCaT/+nLfz/zJqak3A6BBZ7++wnz9EFdeLuL0eaCGPZM7bVqO0YtQmQYXw52+o iepg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=fv7yjgipiPIa0iKuBxA7WsxKljcgZAsZBYR7nSKLcJ0=; b=RTXZLTxocc7kHRxUzbh4tr1yq4Bb2BuaNzxaOWJUeSlaUuwUcpXv2EPgXJRCBBZ3Sq X/6I/PSMu23twuMUcUMjlyzcYRSrt01Il/Ed9aEjx94k1Ju91u1PWsvKuees9qnlq0ua 0kAmJ2YU+XGvkDHMu5z/FnatyJ6cGk/DvBlSZCJRKAWaCqFZ/sz3q8VX7NJG32GEX4WX oqz0JAuZQH8j9fk+lXnVC7RXdCksXP17Xn5GtYFS+n3V0BNU1aI/clOX0eFAFXkOhVDL GI0QoqvkuqOGjTzOSj/C8KSo6p3IzlMIE2p9TQlMgC9GjJJkgTK1vQWy9hx485TGhquE Fh+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=oYP46Kqn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k29si3329865edd.435.2019.05.23.03.44.37 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:44:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=oYP46Kqn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33350 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTlDA-00059h-I7 for patch@linaro.org; Thu, 23 May 2019 06:44:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkvO-0005zp-E7 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkvM-0001WS-D4 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:13 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:39058) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkvM-0000yj-4X for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:12 -0400 Received: by mail-wm1-x344.google.com with SMTP id z23so1126426wma.4 for ; Thu, 23 May 2019 03:25:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fv7yjgipiPIa0iKuBxA7WsxKljcgZAsZBYR7nSKLcJ0=; b=oYP46KqnsGKZxyofy6qTfPkl95SddVnioUefAwX/iBSZxtWeE599gY1vwK6vEbecmp abFcOpYtLhjWrt+tI23Yh6V0p7z2GzE6ngxGpheOJFrlr8+ZaPrTxdgrs4Q8whv4hVvk 3TM+QbuJn+k28CqP96Ll9xEFKsn5TIfzu75/SP9C42GuzTDIKWzFcY1KjSk3NMgRbNrg vnLknKtDCJEbd4vorkQhU9FLn51rtTqvCNTokPaRAcJqDFbW542Rv37iCjTCctBLr2Ps onuWjwNXGkwLioSi0AQUEv9n+utxbIJvr4Oy7YfduhrWzAjy9MIlVaLyJXIXZ+6wDjg8 CxLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fv7yjgipiPIa0iKuBxA7WsxKljcgZAsZBYR7nSKLcJ0=; b=TJBLLlRvwY3/mOpw9BJOPTWO0AwrOWn1A7j0a8MAFBIEilg30az3RVHyVh18h6AuzJ mDMKE8aKKgEmn8U1I84PFDu8Uc3Yz3pg0BhdKKThQVFaRCbQ0P+GEtmU3gxMCeCtg3uC WI71/zjU2H3l08ygzfq4DBoilMpznWhKMo3Q4m1QpFFUPHlGJSo/Ua27VNTFx1w+ZMHr eskMVeeM5BxFAdPzegKjNxffAgKCll1PoXu9A4U7E9mioTK1ohqWOt0m+wVrKwsT40EK TfztvpmdsPn0SYxFOeN66KUD7qfnbyvUy2dQDfrCo93VE+luS/w8zedXx4vEBECOBi1v wo5g== X-Gm-Message-State: APjAAAVu2BEFVcspXBT+Ar9KdSzUpQs6VSiSkXHn88nQnSShaW82NVkD 8A54GKmlwnRZ1qChgibztJwVXw== X-Received: by 2002:a1c:2dd2:: with SMTP id t201mr11012074wmt.136.1558607142564; Thu, 23 May 2019 03:25:42 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id a10sm31509345wrm.94.2019.05.23.03.25.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:40 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AFD191FF9D; Thu, 23 May 2019 11:25:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:18 +0100 Message-Id: <20190523102532.10486-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH v2 14/28] tests/tcg/multiarch: add support for multiarch system tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We can certainly support some common tests for system emulation that make use of our minimal defined boot.S support. It will still be up to individual architectures to ensure they build so we provide a MULTIARCH_TESTS variable that they can tack onto TESTS themselves. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- tests/tcg/Makefile | 1 + tests/tcg/multiarch/system/Makefile.softmmu-target | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 tests/tcg/multiarch/system/Makefile.softmmu-target -- 2.20.1 diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile index 1cdd628e96f..6fa63cc8d53 100644 --- a/tests/tcg/Makefile +++ b/tests/tcg/Makefile @@ -96,6 +96,7 @@ else # build options for bare programs are usually pretty different. They # are expected to provide their own build recipes. -include $(SRC_PATH)/tests/tcg/minilib/Makefile.target +-include $(SRC_PATH)/tests/tcg/multiarch/system/Makefile.softmmu-target -include $(SRC_PATH)/tests/tcg/$(TARGET_BASE_ARCH)/Makefile.softmmu-target ifneq ($(TARGET_BASE_ARCH),$(TARGET_NAME)) -include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.softmmu-target diff --git a/tests/tcg/multiarch/system/Makefile.softmmu-target b/tests/tcg/multiarch/system/Makefile.softmmu-target new file mode 100644 index 00000000000..db4bbeda44c --- /dev/null +++ b/tests/tcg/multiarch/system/Makefile.softmmu-target @@ -0,0 +1,14 @@ +# -*- Mode: makefile -*- +# +# Multiarch system tests +# +# We just collect the tests together here and rely on the actual guest +# architecture to add to the test dependancies and deal with the +# complications of building. +# + +MULTIARCH_SYSTEM_SRC=$(SRC_PATH)/tests/tcg/multiarch/system +VPATH+=$(MULTIARCH_SYSTEM_SRC) + +MULTIARCH_TEST_SRCS=$(wildcard $(MULTIARCH_SYSTEM_SRC)/*.c) +MULTIARCH_TESTS = $(patsubst $(MULTIARCH_SYSTEM_SRC)/%.c, %, $(MULTIARCH_TEST_SRCS)) From patchwork Thu May 23 10:25:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164978 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1995097ili; Thu, 23 May 2019 03:36:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6LTMgCnSnnOAd8SfkyDA9jEeauxhfMoV49bvXbEnYKBQ5a5tzh+6IL3AjKXi5c+oq2gHh X-Received: by 2002:a50:a485:: with SMTP id w5mr50447911edb.78.1558607796571; Thu, 23 May 2019 03:36:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558607796; cv=none; d=google.com; s=arc-20160816; b=DCMUl3C4ca52gzCq7FTEPu/CY4uZcLbJj15Hj8WauWtkFZtTYsutBf9UKr2xV3y2Uv JgbuwUnJWvlvy1vdj8050RfEenaSyC12b44fcw14fzKWKwmbb9cQPzK0DG7GKaxwDmyd WsC+TKA20VhbHLzvMwMSD/pUqNLJqZ2fPvjihXeDfmPn+P+2BLPXicID5kO/VXAKt0Kn 1odJ5Ln3vMAn9VGLVCR9jQEgCQs0gS1oxCeQ0V2OTnvOGvNrhfPP5xPGm7wRlSx0a6H+ DK2+ECExwPc9OqHmri8WyxBtBwjC43cUKkSbG+3BCxfNMPZrvx100gRkCzdxnm0wLRE8 LsPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=HYpRsvHEmUYvBYy6wQQpwlcDtNoNBQtfcPxm0CQghqY=; b=mZrnfjlUo2zTk9DAaFm5OBA+QV43hNdbXz9rTLkn7qXvuMKsx/mYyZc16zbMOSOD0T 7OranVOSgJg8Mu1baBxaRouPax5e53XpBPXJzW4O0ELxjxaeVS96eEmBSGAkh6ZIJf57 LYjL5mTbMBvXfHZEJNUAw/wVcfkPVVYhwe7VZmZMVvSPqvJ2dwZ8vVDxWIty8Fng+Y5e b0k1uka7eq34PoP7RIMdMHrjvl3SihKfSC8HtiDuQl+Jpv+23HhlkoCqTiarKrbvyZ9W oF2Ro5/LawjoU5FlMKKNZO8o2OHvGwJdX8s3HI8HXQoR/W3hvHtLLpN5nzFu9XgPJJpA +Fhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="VOyjw/0T"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p56si6056779eda.176.2019.05.23.03.36.36 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:36:36 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="VOyjw/0T"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33223 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl5P-0006ee-F4 for patch@linaro.org; Thu, 23 May 2019 06:36:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkvK-0005uh-21 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkvA-0001JN-LW for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:06 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:55725) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkv4-0000zM-DN for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:58 -0400 Received: by mail-wm1-x344.google.com with SMTP id x64so5213265wmb.5 for ; Thu, 23 May 2019 03:25:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HYpRsvHEmUYvBYy6wQQpwlcDtNoNBQtfcPxm0CQghqY=; b=VOyjw/0T4oebmx77bf0SHWLiR23yNN2todyLRTnN3phauS6u4en+7PF2TB9IzPZ4GF Ja8FU3oLAKB/5PPR3Q8GZJJWQ2Lmy2KYUh8X77guFGyL9KnqyWAf7rL08rH08kOoAp1b E2rSUGwtoEoDh9fHjcczOoWHV4ZhCcDJzzhRSe9RrK2Rref0FW5ltXm4dqM90MiWA68J KjXyzvxsSjMaaJNXbYHluD6NG6auM0bPK0K++9XdbnXtoThcKPupam++99sMExuQhpN0 xh0NksEQl9CbuGu354AzfTCk21ThkkLHOI05OLPjF4ojvsBF4376Ntop8CezPCgBQech 0NBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HYpRsvHEmUYvBYy6wQQpwlcDtNoNBQtfcPxm0CQghqY=; b=KCZrbkIQCa3/E+eVBmTKqMiFS2YKvdMvAmzHPYNa07qeSGbmqUJ3VieiewIPkl3DlG 9ymBzb0iHQKW5RIQQn1sAY0rgiJCSw65ogVIvk1EKTFYnFz8i6QFLJvE6joB+WSIjt2j Wf1ziZwKCp0lCN7G+HWqVLOAebQuxGDriZUY7geWgAZTLwn9+tOC12a9+I4ob8PAgItF eaGmoD7GKxs1Cg56KDeKeGq9wKcbeojMb7XJgesk2BWFvVEZUAj+7QIiDZCdNHh3Ey60 s+ldCslfeI2MrjaRo3e+Uff484TeS6tRngMx3IAypJEJFX5+NUfo7JehBq/KbKxJL5aU ewSw== X-Gm-Message-State: APjAAAVoX8t1BxM0+MP0FYzwvm51kalPqJijeYIkyMA+5ha7/+X1hT7W SuVuk6mMqhUzSt+j2A/geIkNYQ== X-Received: by 2002:a1c:be12:: with SMTP id o18mr10888052wmf.124.1558607142996; Thu, 23 May 2019 03:25:42 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id x68sm8801239wmf.13.2019.05.23.03.25.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:40 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C21C71FF9E; Thu, 23 May 2019 11:25:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:19 +0100 Message-Id: <20190523102532.10486-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH v2 15/28] tests/tcg/multiarch: add hello world system test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Richard Henderson , qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is not really i386 only, we can have the same test for all architectures supporting system tests. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- tests/tcg/i386/Makefile.softmmu-target | 2 +- tests/tcg/{i386 => multiarch}/system/hello.c | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tests/tcg/{i386 => multiarch}/system/hello.c (100%) -- 2.20.1 diff --git a/tests/tcg/i386/Makefile.softmmu-target b/tests/tcg/i386/Makefile.softmmu-target index 53c9c5ece06..c31bbbf39a7 100644 --- a/tests/tcg/i386/Makefile.softmmu-target +++ b/tests/tcg/i386/Makefile.softmmu-target @@ -27,7 +27,7 @@ CFLAGS+=-m32 LINK_SCRIPT=$(I386_SYSTEM_SRC)/kernel.ld LDFLAGS=-Wl,-T$(LINK_SCRIPT) -Wl,-melf_i386 # FIXME: move to common once x86_64 is bootstrapped -TESTS+=$(X86_TESTS) +TESTS+=$(X86_TESTS) $(MULTIARCH_TESTS) endif CFLAGS+=-nostdlib -ggdb -O0 $(MINILIB_INC) LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc diff --git a/tests/tcg/i386/system/hello.c b/tests/tcg/multiarch/system/hello.c similarity index 100% rename from tests/tcg/i386/system/hello.c rename to tests/tcg/multiarch/system/hello.c From patchwork Thu May 23 10:25:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164980 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1995599ili; Thu, 23 May 2019 03:37:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqydkzMVCXWbXS6NuU8g6mndVi0VGjS9ICP7ytDO8yQQspmmjnvnomrntFjn+Bbq0aWDjMaM X-Received: by 2002:a17:906:d513:: with SMTP id ge19mr32302923ejb.222.1558607828363; Thu, 23 May 2019 03:37:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558607828; cv=none; d=google.com; s=arc-20160816; b=RKaI3zCaTpTW0M+EtjZKau8v9NbRZoPtFna9ebN+zfD5UpULgPy28pvHq7JvWh3HVL bQVU2bcJbIPf4uwgrxScOZZMYl9tc6OcuaU3usfEkoAVKyLAO9gqbXSCsEnbo0wi/3SH huF9+Rxd/8ImRiAa0VnxCpFj5EYYvaIDk6iZ6J1QH4f9iteQYLV2sDCa1pKiFDCVekBz /1WeblYbzGj+GXXqLDNKFHKQHWS7QUjLXcgt7fZ/EmxSCQvdA7TUSbISD2+Hzck8bQtU y+KxmynAiodsO5AVr3feQ5lvcc4mKthmSAhcw9QaW/UqUnlTyMW+/Fj6tAKlhyw6IWHV K4SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=mI6pN9UnLPqpwK2uAx0syvUxElq3Ud6lBiwzd8Of+TY=; b=JxeuXoDn+FtThnWDJNKGVaL0EkHezB+4a+6waw1c+8JTzBPxJqBjLZnoFgdyX2Zsfc GUmI5cyq6qLVQr0qQPkGDcWOB9QSGvP+tRsVjKZplAXzFAHQZFWAaY/gaAHLTPRpZdYj 99pILUvuP1LxD4fL3lVeFXfUDr50nsBIvTbJ0CsX1w12+MHvrtQ1axcEe2wiwSQ0a3D3 NigZUIw8zV+a5DbdemExOcqZkTFDc5yem2tTwlw0oXbAk1TUgiAH1MPtZHJGSxGI7IM7 h/O/VKyS87+y7AOQudp9nPHMYSfOfWDP5Ef6HB/sbwy/OysOsdX+tXLoBOQhyqLYKggr e9Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=a30k3ixb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x13si531185edd.175.2019.05.23.03.37.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:37:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=a30k3ixb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl5v-0006mq-A0 for patch@linaro.org; Thu, 23 May 2019 06:37:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkvO-0005zz-Jw for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkvM-0001Wm-Hy for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:14 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:42309) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkvM-0000zw-93 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:12 -0400 Received: by mail-wr1-x444.google.com with SMTP id l2so5641125wrb.9 for ; Thu, 23 May 2019 03:25:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mI6pN9UnLPqpwK2uAx0syvUxElq3Ud6lBiwzd8Of+TY=; b=a30k3ixbS4lqsT0IEw3rOb/FUhkSaA32MzBVHIV0lRLFCXMAiDkw3kDhgYkfJVwZ0c LF1ixYC8bXhEpfPAhX3BZ6hK6kRATnLWtcjcelnXSU+ZCZ8iJcYJ9KHDJk6ZOLBdJh9o OL+/e3uL5Yq6fEo1u02n7EhlFSh4L34kclhm5HP8SrpXjiLEElnStGpJQp47P2Oc1S3I lohMeQa91dgb+eUz1YBGRtR3cVryTaDaov7ErUiMX3QOpo3I7J1sOxhTu0R5escYXcdj y2f2lZxZ9vxCsUBJ8rEwzZ77bNLL21RWLKoeFNjV0fWhgQprPLMWzeW0yXoRnZqioevU wy7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mI6pN9UnLPqpwK2uAx0syvUxElq3Ud6lBiwzd8Of+TY=; b=hQXWX0hW/K1Yp1gmhQfqn5GPp3scXlHySOlmhhnlAtgKcgJ7MKWfAgGYto6CpNqI0k Ox2aIut5h1Ll6CjmTDoB/01fNHeHw5gnF90ksAObAiF0+rI2874qEx7Ge2D3kAdmcpKq sBiScZ3O8ozAW+dspbujAkDOdNB/u7gJzXH/+AeUhlgv3162IWmdjHwdN+heGJbibsxV tyCQp+yff7bTqy7UwmK/h4MiaZeBIzSW1ukSvaL6khqbrYqY4RNMjRHRCQ3e6t3CwlqD ZvHSTcT8xowwbtDPhTyuwjqluxfbRBzytXINU2uFegdFFowp9+qEsd9R2VuoV32Cvebb TQnQ== X-Gm-Message-State: APjAAAWK6s5QTNS+q+j7zaYt432CuToMhtkHOfUZSrbVhsCnWlrjIgxJ dfQwwjZZyXorIsqOWRpqLxbRbA== X-Received: by 2002:a5d:5743:: with SMTP id q3mr18253898wrw.92.1558607143785; Thu, 23 May 2019 03:25:43 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id g6sm36900389wro.29.2019.05.23.03.25.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:40 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D53841FF8C; Thu, 23 May 2019 11:25:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:20 +0100 Message-Id: <20190523102532.10486-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 Subject: [Qemu-devel] [PATCH v2 16/28] editorconfig: add settings for .s/.S files X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We are starting to add assembler foe tests/tcg so lets make sure we get the mode right. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- .editorconfig | 5 +++++ 1 file changed, 5 insertions(+) -- 2.20.1 diff --git a/.editorconfig b/.editorconfig index 15828833938..df6db65531d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -26,6 +26,11 @@ file_type_emacs = makefile indent_style = space indent_size = 4 +[*.{s,S}] +indent_style = tab +indent_size = 8 +file_type_emacs = asm + [*.{vert,frag}] file_type_emacs = glsl From patchwork Thu May 23 10:25:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164956 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1987711ili; Thu, 23 May 2019 03:29:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQR9SmnqzEuiBWq2D+YgE7PDaIcdLDEKFO6G2lWWETb/qSWZOZRKv/c1yYttBWAb4v8PeJ X-Received: by 2002:aa7:c4d2:: with SMTP id p18mr96047077edr.232.1558607354983; Thu, 23 May 2019 03:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558607354; cv=none; d=google.com; s=arc-20160816; b=WfLcTDlvkS9Vu/k5CsTYIYucoP/8nascJzWkdUe4ue1eS2qakRauYRI0JKfV7YDN8j NtFu67cmZkJbLgW5CjIlHYOlNXXpoq9KSqx542tRo1uq/Z0U7MWqbSh/L+HFbY/fbjfE xk5D1W52VRrF50Syd+uoPKZ2vRRYVSpM30ADATazRv8YUVlkdZiFJ51GZVOecYpv7pOp SKS6f1VkB84EFt/az0QYYX2tFV4nFTAwYcGdSfehZYxRoFFMmbRLlJrj8Yy0YlhJHGMQ jLJCCi1oAZwyZpS8b815tfBo0SpX7B1zmn260gvsgAFZ4vYKGMSctvy7hRVlerzQ/+Q3 Ifpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=r55nf64rXTYonXxnBwdRPnRpArKhgZe9MpWloO32Vxg=; b=pzY10gpiD4pW54G3ssKPBEzmqv5kCQYZd8ZzUS3gxF19APtHlC6uOKO7oRdir07t+6 cfFVLXnP0xWuV2gWLoXmB/PkC5iaRat+lq/AgtSTBAURAxIplwwdd39q1Mbjcet4f07C yEmRW5K9ZWbqUzVVuW7Vci84x+KapsqywjuhUPHly/RQX+f1Mfw5dVQxVPIkDf3AzBjo S2HlO20/mIRbBikhwTYn9gUENA6HwDJ4EKPNyTy600YcLcc4ovzoRS2urVYOqLmCLqZs s0A/Y2Ui2iAxJ97PutqRhCdX8bsWO1AMsiiXu6Ajutckwwz7DZZza8sEpu24lb/uyw3T 0FMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="IH/B4KbJ"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s18si2417728ejb.364.2019.05.23.03.29.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:29:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="IH/B4KbJ"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkyH-0008SI-Q3 for patch@linaro.org; Thu, 23 May 2019 06:29:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkv4-0005YU-9C for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkv0-00018A-B4 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:52 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:35842) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkv0-00011K-1c for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:50 -0400 Received: by mail-wm1-x344.google.com with SMTP id j187so5195669wmj.1 for ; Thu, 23 May 2019 03:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r55nf64rXTYonXxnBwdRPnRpArKhgZe9MpWloO32Vxg=; b=IH/B4KbJhaKHVR2wv1f5PDXbT9EdEFsDd1greHQ1xOGg8EYeoNbundtj9W3D4ECrG9 OlhinDfZZQHfXuUceZivphsit5vWSMn72y4iBEq/TivTO8rfXDkUU4xXFhUSKw91c7gH hd6y0nvhN7+o6kEg2TJwJUhQGa777QAIqxnfXbIH5yT0SOAhbhL6IWeGCe4yMVPdtzwd 9Kt5u7RQ1ztfeUk8f3MZNdKcatO0V6+VKNg2LOU+Zt6nvBHpER69w9kN1M/efoeaD/Wz 9Hgj2bKIcUKBZioOIl1uznPy+ejVzJzCeDdxsJfeYAV2F7km9Ys79pKClUeU4ZtVx75V R8IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r55nf64rXTYonXxnBwdRPnRpArKhgZe9MpWloO32Vxg=; b=asEP+M3ToFQty+n/ZUzmTE55zmla8LVzsJGyTT+5bTnUuKxJ9jofQapjy23NzxhB3k +QRIYRHrekx9NhfB3DoSGmKeMtNuaPAWuoV2LkmLV6yjuGecookmwaQBcuqsRAEMml9R ldNbmGo7ELVCVjAWk9ogz5ujSJJLvdmH1ZOWsaiBPQQOvk0OYJVJcaRUpxqtiQs5RxGp XDvrO1DvfjCjk9w2MmVJKvJRM6ZaDRHZEAdTewAIq+guzADDOzF7SJPbW/A+UY6cLH5E GfIkh6qsxGmvoW63BsL0ppWDBanJ4vDJZ9+YqQIE5jCX6uUHfQzsC48U4o15WVmsJYkP oBzg== X-Gm-Message-State: APjAAAV8+y4oQTJAirSyaTrzGIQpRj8SbtdK9hxrStlpfbCJtfHAHMJo MyuOisCnv2uX4craPHeoyvdNCg== X-Received: by 2002:a1c:a815:: with SMTP id r21mr10515998wme.66.1558607145428; Thu, 23 May 2019 03:25:45 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id s20sm2456989wrg.8.2019.05.23.03.25.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:44 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id ED6321FF9F; Thu, 23 May 2019 11:25:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:21 +0100 Message-Id: <20190523102532.10486-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH v2 17/28] tests/tcg/aarch64: add system boot.S X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This provides the bootstrap and low level helper functions for an aarch64 kernel. We use semihosting to handle test output and exiting the emulation. semihosting's parameter passing is a little funky so we end up using the stack and pointing to that as the parameter block. Signed-off-by: Alex Bennée --- v2 - fix tabs - 2 stage table lookup with ro and nx sections - set stack to back - moar comments --- tests/tcg/aarch64/Makefile.softmmu-target | 32 +++ tests/tcg/aarch64/system/boot.S | 239 ++++++++++++++++++++++ tests/tcg/aarch64/system/kernel.ld | 24 +++ 3 files changed, 295 insertions(+) create mode 100644 tests/tcg/aarch64/Makefile.softmmu-target create mode 100644 tests/tcg/aarch64/system/boot.S create mode 100644 tests/tcg/aarch64/system/kernel.ld -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/tests/tcg/aarch64/Makefile.softmmu-target b/tests/tcg/aarch64/Makefile.softmmu-target new file mode 100644 index 00000000000..cdb836f7e1e --- /dev/null +++ b/tests/tcg/aarch64/Makefile.softmmu-target @@ -0,0 +1,32 @@ +# +# Aarch64 system tests +# + +AARCH64_SYSTEM_SRC=$(SRC_PATH)/tests/tcg/aarch64/system +VPATH+=$(AARCH64_SYSTEM_SRC) + +# These objects provide the basic boot code and helper functions for all tests +CRT_OBJS=boot.o + +AARCH64_TEST_SRCS=$(wildcard $(AARCH64_SYSTEM_SRC)/*.c) +AARCH64_TESTS = $(patsubst $(AARCH64_SYSTEM_SRC)/%.c, %, $(AARCH64_TEST_SRCS)) + +CRT_PATH=$(AARCH64_SYSTEM_SRC) +LINK_SCRIPT=$(AARCH64_SYSTEM_SRC)/kernel.ld +LDFLAGS=-Wl,-T$(LINK_SCRIPT) +TESTS+=$(AARCH64_TESTS) $(MULTIARCH_TESTS) +CFLAGS+=-nostdlib -ggdb -O0 $(MINILIB_INC) +LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc + +# building head blobs +.PRECIOUS: $(CRT_OBJS) + +%.o: $(CRT_PATH)/%.S + $(CC) $(CFLAGS) -x assembler-with-cpp -c $< -o $@ + +# Build and link the tests +%: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS) + $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) + +# Running +QEMU_OPTS+=-M virt -cpu max -display none -semihosting-config enable=on,target=native,chardev=output -kernel diff --git a/tests/tcg/aarch64/system/boot.S b/tests/tcg/aarch64/system/boot.S new file mode 100644 index 00000000000..b14e94f332d --- /dev/null +++ b/tests/tcg/aarch64/system/boot.S @@ -0,0 +1,239 @@ +/* + * Minimal AArch64 system boot code. + * + * Copyright Linaro Ltd 2019 + * + * Loosely based on the newlib/libgloss setup stubs. Using semihosting + * for serial output and exit functions. + */ + +/* + * Semihosting interface on ARM AArch64 + * See "Semihosting for AArch32 and AArch64 Relase 2.0" by ARM + * w0 - semihosting call number + * x1 - semihosting parameter + */ +#define semihosting_call hlt 0xf000 +#define SYS_WRITEC 0x03 /* character to debug channel */ +#define SYS_WRITE0 0x04 /* string to debug channel */ +#define SYS_EXIT 0x18 + + .align 12 + + .macro ventry label + .align 7 + b \label + .endm + +vector_table: + /* Current EL with SP0. */ + ventry curr_sp0_sync /* Synchronous */ + ventry curr_sp0_irq /* Irq/vIRQ */ + ventry curr_sp0_fiq /* Fiq/vFIQ */ + ventry curr_sp0_serror /* SError/VSError */ + + /* Current EL with SPx. */ + ventry curr_spx_sync /* Synchronous */ + ventry curr_spx_irq /* IRQ/vIRQ */ + ventry curr_spx_fiq /* FIQ/vFIQ */ + ventry curr_spx_serror /* SError/VSError */ + + /* Lower EL using AArch64. */ + ventry lower_a64_sync /* Synchronous */ + ventry lower_a64_irq /* IRQ/vIRQ */ + ventry lower_a64_fiq /* FIQ/vFIQ */ + ventry lower_a64_serror /* SError/VSError */ + + /* Lower EL using AArch32. */ + ventry lower_a32_sync /* Synchronous */ + ventry lower_a32_irq /* IRQ/vIRQ */ + ventry lower_a32_fiq /* FIQ/vFIQ */ + ventry lower_a32_serror /* SError/VSError */ + + .text + .align 4 + + /* Common vector handling for now */ +curr_sp0_sync: +curr_sp0_irq: +curr_sp0_fiq: +curr_sp0_serror: +curr_spx_sync: +curr_spx_irq: +curr_spx_fiq: +curr_spx_serror: +lower_a64_sync: +lower_a64_irq: +lower_a64_fiq: +lower_a64_serror: +lower_a32_sync: +lower_a32_irq: +lower_a32_fiq: +lower_a32_serror: + mov x0, SYS_WRITE0 + adr x1, .error + semihosting_call + mov x0, SYS_EXIT + mov x1, 1 + semihosting_call + /* never returns */ + + .section .rodata +.error: + .string "Terminated by exception.\n" + + .text + .align 4 + .global __start +__start: + /* Installs a table of exception vectors to catch and handle all + exceptions by terminating the process with a diagnostic. */ + adr x0, vector_table + msr vbar_el1, x0 + + /* Page table setup (identity mapping). */ + adrp x0, ttb + add x0, x0, :lo12:ttb + msr ttbr0_el1, x0 + + /* + * Setup a flat address mapping page-tables. Stage one simply + * maps RAM to the first Gb. The stage2 tables have two 2mb + * translation block entries covering a series of adjacent + * 4k pages. + */ + + /* Stage 1 entry: indexed by IA[38:30] */ + adr x1, . /* phys address */ + bic x1, x1, #(1 << 30) - 1 /* 1GB alignment*/ + add x2, x0, x1, lsr #(30 - 3) /* offset in l1 page table */ + + /* point to stage 2 table [47:12] */ + adrp x0, ttb_stage2 + orr x1, x0, #3 /* ptr to stage 2 */ + str x1, [x2] + + /* Stage 2 entries: indexed by IA[29:21] */ + ldr x5, =(((1 << 9) - 1) << 21) + + /* First block: .text/RO/execute enabled */ + adr x1, . /* phys address */ + bic x1, x1, #(1 << 21) - 1 /* 2mb block alignment */ + and x4, x1, x5 /* IA[29:21] */ + add x2, x0, x4, lsr #(21 - 3) /* offset in l2 page table */ + ldr x3, =0x401 /* attr(AF, block) */ + orr x1, x1, x3 + str x1, [x2] /* 1st 2mb (.text & rodata) */ + + /* Second block: .data/RW/no execute */ + adrp x1, .data + add x1, x1, :lo12:.data + bic x1, x1, #(1 << 21) - 1 /* 2mb block alignment */ + and x4, x1, x5 /* IA[29:21] */ + add x2, x0, x4, lsr #(21 - 3) /* offset in l2 page table */ + ldr x3, =(3 << 53) | 0x401 /* attr(AF, NX, block) */ + orr x1, x1, x3 + str x1, [x2] /* 2nd 2mb (.data & .bss)*/ + + /* Setup/enable the MMU. */ + + /* + * TCR_EL1 - Translation Control Registers + * + * IPS[34:32] = 40-bit PA, 1TB + * TG0[14:15] = b00 => 4kb granuale + * ORGN0[11:10] = Outer: Normal, WB Read-Alloc No Write-Alloc Cacheable + * IRGN0[9:8] = Inner: Normal, WB Read-Alloc No Write-Alloc Cacheable + * T0SZ[5:0] = 2^(64 - 25) + * + * The size of T0SZ controls what the initial lookup level. It + * would be nice to start at level 2 but unfortunatly for a + * flat-mapping on the virt machine we need to handle IA's + * with at least 1gb range to see RAM. So we start with a + * level 1 lookup. + */ + ldr x0, = (2 << 32) | 25 | (3 << 10) | (3 << 8) + msr tcr_el1, x0 + + mov x0, #0xee /* Inner/outer cacheable WB */ + msr mair_el1, x0 + isb + + /* + * SCTLR_EL1 - System Control Register + * + * WXN[19] = 0 = no effect, Write does not imply XN (execute never) + * I[12] = Instruction cachability control + * SA[3] = SP alignment check + * C[2] = Data cachability control + * M[0] = 1, enable stage 1 address translation for EL0/1 + */ + mrs x0, sctlr_el1 + ldr x1, =0x100d /* bits I(12) SA(3) C(2) M(0) */ + bic x0, x0, #(1 << 1) /* clear bit A(1) */ + bic x0, x0, #(1 << 19) /* clear WXN */ + orr x0, x0, x1 /* set bits */ + + dsb sy + msr sctlr_el1, x0 + isb + + /* + * Enable FP registers. The standard C pre-amble will be + * saving these and A-profile compilers will use AdvSIMD + * registers unless we tell it not to. + */ + mrs x0, cpacr_el1 + orr x0, x0, #(3 << 20) + msr cpacr_el1, x0 + + /* Setup some stack space and enter the test code. + * Assume everthing except the return value is garbage when we + * return, we won't need it. + */ + adrp x0, stack_end + add x0, x0, :lo12:stack_end + mov sp, x0 + bl main + + /* pass return value to sys exit */ + mov x1, x0 + ldr x0, =0x20026 /* ADP_Stopped_ApplicationExit */ + stp x0, x1, [sp, #-16]! + mov x1, sp + mov x0, SYS_EXIT + semihosting_call + /* never returns */ + + /* + * Helper Functions + */ + + /* Output a single character to serial port */ + .global __sys_outc +__sys_outc: + stp x0, x1, [sp, #-16]! + /* pass address of c on stack */ + mov x1, sp + mov x0, SYS_WRITEC + semihosting_call + ldp x0, x1, [sp], #16 + ret + + .data + .align 12 + + /* Translation table + * @4k granuale: 9 bit lookup, 512 entries + */ +ttb: + .space 4096, 0 + + .align 12 +ttb_stage2: + .space 4096, 0 + + .align 12 +stack: + .space 65536, 0 +stack_end: diff --git a/tests/tcg/aarch64/system/kernel.ld b/tests/tcg/aarch64/system/kernel.ld new file mode 100644 index 00000000000..7b3a76dcbf3 --- /dev/null +++ b/tests/tcg/aarch64/system/kernel.ld @@ -0,0 +1,24 @@ +ENTRY(__start) + +SECTIONS +{ + /* virt machine, RAM starts at 1gb */ + . = (1 << 30); + .text : { + *(.text) + } + .rodata : { + *(.rodata) + } + /* align r/w section to next 2mb */ + . = ALIGN(1 << 21); + .data : { + *(.data) + } + .bss : { + *(.bss) + } + /DISCARD/ : { + *(.ARM.attributes) + } +} From patchwork Thu May 23 10:25:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164985 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2001325ili; Thu, 23 May 2019 03:43:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqymKf/X2h3kdberek4Z+hRPGANUQT+OIxxZIy62MKhEle5Kqmva3FRGe6JUqP3DJYE6BiUF X-Received: by 2002:a17:906:25c5:: with SMTP id n5mr44504917ejb.110.1558608199214; Thu, 23 May 2019 03:43:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558608199; cv=none; d=google.com; s=arc-20160816; b=OI6z21zz5dBlMsrBwipDFVhaJUO18/BzRbHdRoU8/9RG5aDFFE+jtMXPcrvgYCUyG6 hej3i//O1/eQplCvWpCpdHcTxMxogryHaLKLzsoukShiuppgZpikwz2/6a2jt7u0elvO hJEds4B+3BNLvTK1RgplKAhHt9DaeuGIcvxdrJmy4JrNUtCHsObuZdEQ62RVA2UYSsXW d784J4rWzblpziRpn0gyyEVmYYbs0DLIkxUmcmBZl6t3j9uGxuatKsbsX17fUMBoucmR rgpkOZOD31sP19tM2jDs24exAFEO0ssurpd4pWpS1C9xPYvLrhzCOlUepZXdZMbFrDua QWWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=Cq0hWZXgOdvqzfyTAW4dZk0efyH3GC8saHgcK0H4+rE=; b=adYIoboVrLuMEYNd2jQ4n8xkO4/S+Z9YcscDKprD7f2nmhuC78jWUdzNucrqt41QPF mpYo9ilS9wJAm1L7JDE148j8BB4Zw3yeYjCRIXzlAiZ3Z74MWKhLO360cdksdjVlfI5W vXXJURkpZNndw++c8nBWJtCVS6wIuZyDiuYH42oakgXbKZlK4K8Wa6+sr4T+SKYzhQj6 xK/4+u89yp4Wd9NV30IpHRmPxuwsV9L8e2z/FyYyWJue3HFOuFMH+rgJ2AM7E0K8BgKd xlHI2pTiZ3ipfKj7qvRyjvN0cBjpjoTaLQhRCHuNEYmRMcdd7y0/J82BhYqdNoskmEIh DElg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bLgUC8sv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j41si4555088ede.401.2019.05.23.03.43.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:43:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bLgUC8sv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33335 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTlBu-0003rB-4L for patch@linaro.org; Thu, 23 May 2019 06:43:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl2i-0004LT-Rs for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTl2g-0006Zj-Vn for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:48 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:35905) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTl2g-0006Y2-OJ for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:46 -0400 Received: by mail-wm1-x341.google.com with SMTP id j187so5221950wmj.1 for ; Thu, 23 May 2019 03:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Cq0hWZXgOdvqzfyTAW4dZk0efyH3GC8saHgcK0H4+rE=; b=bLgUC8svY8IwS/zqbOPvYZDuiE/6OwIvaoMD/hI9dV/k6Tp4oZNNd7HebstmTT/Qt1 dHIMH5wKVkHZXy7CYvJbBsrVeHLykfoPGwasCl6vfe8qnp/+yx16q3yptdmrSJE+ADDd 6uvfLwwXD6Ubfqb6MWa62/Sv0hnuyc2inPGfYy7Xnp2IGVfY8cvP6kKAHL1aznUc8/Ci XchtDej7u3yq/sqJiFg6+TrGej1jbLBQzXO6ssg4EjLwHMgN+edT2No9W7jIyDQuzCkg yqeQMWKIM5m/DsMyDRgIRAUm4DW7uGPPiVu6f9TDyVoOIDAHiNxS15o3+m1oaoWc9RYc Tc+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Cq0hWZXgOdvqzfyTAW4dZk0efyH3GC8saHgcK0H4+rE=; b=kFLRuAm7tVHOXSVG2nhM9Tr65ALeTk3IQjQ8nUf+xc5lPS6LsL14nXhGs3Pa+fItJ7 J4pjxtkue7BpTVFI0IGAgG+PLseNlHVlHNEEtaUzFW8P8y3cG4ZhnP2mWw9nG44y146o QXG+bfXrQXn/VTWCAEdbQdsSY2XG7P3eD2QLCzWiSecht4CLqzjr8PO9giZKwNoSXtWD PzfUArbDDqWZack/iLNjPA3xXKsLrRj9/e5ZCH4FF5htZlSIYOPb3lZLwZ23v0YQDmrO v21b3SEsI0L6LguLn2hE8fNGZI8rIcDqMzBZjgrJnyzGm8aCathOLxy8ojLZEG2biiY4 G4ng== X-Gm-Message-State: APjAAAU2fjvuwO4IU7gmFMh3lpPXifBk4ZSHwvbq0TqJk8qctdX3hbjU PsbCTEPt4WcpbByJu02Nmrv4gQ== X-Received: by 2002:a1c:ca01:: with SMTP id a1mr10591112wmg.30.1558607623046; Thu, 23 May 2019 03:33:43 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id f11sm25065583wrv.93.2019.05.23.03.33.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:33:42 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0AEDE1FFA3; Thu, 23 May 2019 11:25:34 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:22 +0100 Message-Id: <20190523102532.10486-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 Subject: [Qemu-devel] [PATCH v2 18/28] tests/tcg/multiarch: move the system memory test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" There is nothing inherently architecture specific about the memory test although we may have to manage different restrictions of unaligned access across architectures. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- tests/tcg/{i386 => multiarch}/system/memory.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/tcg/{i386 => multiarch}/system/memory.c (100%) -- 2.20.1 diff --git a/tests/tcg/i386/system/memory.c b/tests/tcg/multiarch/system/memory.c similarity index 100% rename from tests/tcg/i386/system/memory.c rename to tests/tcg/multiarch/system/memory.c From patchwork Thu May 23 10:25:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164993 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2011673ili; Thu, 23 May 2019 03:54:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGU8ztCRzBydIBiEmNkzbLMvpZHEFiRjfEI+bBgLAcRgFKgduaN6Aw0BkBL2Pw8sDbz0d6 X-Received: by 2002:a17:906:3551:: with SMTP id s17mr75284640eja.19.1558608894386; Thu, 23 May 2019 03:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558608894; cv=none; d=google.com; s=arc-20160816; b=ft8BQaLZHbIBaXwDI169cdfZZf0Oph6GiO5WfLp/JuJg6T6BwtbvkQ1D9iGY6A7rlw VMUImsOLf5D2pwIbOdSGV+WfMGf3qzq6f8W+c2Ix6vS6hxgVhiVgUInMpzpZj9HcfF5K EC/OUCfPnTX01phqEYIcbse2rADt7yjN7syi2uux5sBIOmceawi6s2vVxxZCHTVE+xTa S6aiAww64DZe5BMDme7NrZNeXw9sHBJJ3rvaFkG4i1ZOeN9qEtnk+OuPutCReJcPjnAh 8FVzV3qPTa0RYl6EuQnjb+pC7xf/kfkGeFcCtWIyIxGmYasfTzsLPyind8YDIV8Pkf5/ txTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=Tdq1lhooOg5isCiP/Tk4l5zr7fBDvEhDVLC+/j+f1ds=; b=aHqDFPRRRODnaZef4PsbPQOmwyIB1dX9+lrUdosRIXn9S7j10pO0Wedb/F0mgYCXRK DAeKmYGMLXtg2c2DmTi9Wvsqdam6yb+7gN9hr6usoBf80hXjsFKVnBJ5EeBRp9niU3Gl xUC1TdSv+xOmJCJm3IRqe4m3hNcECTKLfp2Hr78t4TFm96fbqkPjRrPyM2gzb/tkW0Xq Plwzd5XOu85a2tTQX6+I+MlsiN854voCPpDedtmxddbzz/VkJffpdl5U1ZnYuq3IB4Rm aS2AO6qv0Qjx6xuZ0vXdrkhjUixjiVEZQSpQ7MJWtFFqPnKwtZ4BobacTO8VzOickl9r vrzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bBCx6fa1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f34si7114473edf.38.2019.05.23.03.54.54 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:54:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bBCx6fa1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33559 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTlN7-00051U-E0 for patch@linaro.org; Thu, 23 May 2019 06:54:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl2q-0004TK-OV for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTl2p-0006gk-RX for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:56 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:34544) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTl2o-0006cu-Ds for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:54 -0400 Received: by mail-wr1-x444.google.com with SMTP id f8so5699705wrt.1 for ; Thu, 23 May 2019 03:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Tdq1lhooOg5isCiP/Tk4l5zr7fBDvEhDVLC+/j+f1ds=; b=bBCx6fa1QtLXyXvYOhyVry/s/1iNd1OKFirniS+oQ+EuMi0qUP/1ztmvOQiQV2Xsdk b3ek7jZE80QXAXYlZf+ZA7ZSapeUV/v65Twmv+F6bFVUm+JXocdph178JqahqcXy0Sgb QTsgppuonSs0kF9H3lTnbcGizSQnnopv/6D4jQ8mJjr0FbdPuJVDfBHch6p8SOwBkHKb B4vu6ncjiR09vPaGIkzZsKBMOmiQqENNdXul5KxbCJh+zPYvZxILmYYCLT18DiL3TeR2 hUwyMv5jubrrU0seU81YITeFHZnEesI0aVLWW+MCxJm9lAtTT8HbnaX20b8+uYSHB4Q7 /qhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Tdq1lhooOg5isCiP/Tk4l5zr7fBDvEhDVLC+/j+f1ds=; b=CxtKvQMjQsEwyDHZBd+Y06U/rSgcZKywgjpsQDMNBz7Ems4bGBQTuiP2BRrvGY6GcM 0pIKXPmp5PDm72Dm5aDiux4js4m4zC7LUL8y9xRM9wnvb0w+/edSC8di2psv8oXi7+pZ VUklvBoz+e1m+JoeMSN63IQm6Z4sA7d8I0ISTYlKr5GXWfAmWfe3hRi8alSfKv0xwGM4 5wJZwsdF/DbxHfTQwqv0UVP6dkjcGc/4cnz6n3j7FuVFBYnDNmkJ8bLDPpBrx1LCpAcl IXOQRhX/ED9LCCDOBl1czYggi+eb9NSWzMRZUYSmGRAbD2jGcTx9MZmMxrwnisVRnGLe UlUQ== X-Gm-Message-State: APjAAAW8TJufMQP/jIHlIbSfSZe4qLQxWoFbQgllxQ3XT4R0w0CbtFoy yDtfzRQWZINrbUwkKOvULQbiwg== X-Received: by 2002:adf:eec9:: with SMTP id a9mr5500140wrp.281.1558607629430; Thu, 23 May 2019 03:33:49 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o8sm49092082wra.4.2019.05.23.03.33.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:33:45 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 201BB1FFA5; Thu, 23 May 2019 11:25:34 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:23 +0100 Message-Id: <20190523102532.10486-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 Subject: [Qemu-devel] [PATCH v2 19/28] tests/tcg/minilib: support %c format char X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- tests/tcg/minilib/printf.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.20.1 diff --git a/tests/tcg/minilib/printf.c b/tests/tcg/minilib/printf.c index 121620cb162..10472b4f585 100644 --- a/tests/tcg/minilib/printf.c +++ b/tests/tcg/minilib/printf.c @@ -119,6 +119,9 @@ void ml_printf(const char *fmt, ...) str = va_arg(ap, char*); print_str(str); break; + case 'c': + __sys_outc(va_arg(ap, int)); + break; case '%': __sys_outc(*fmt); break; From patchwork Thu May 23 10:25:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164987 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2005756ili; Thu, 23 May 2019 03:48:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzo4Is9gtMQjGm1CpVO4yFhgogY1duh9DMkmpSH4RJ+vTiRA+fLdVN4MQtps8taUsr/uwhH X-Received: by 2002:a17:907:20cd:: with SMTP id qq13mr50454405ejb.170.1558608489227; Thu, 23 May 2019 03:48:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558608489; cv=none; d=google.com; s=arc-20160816; b=Bkd0B2SgPYx5zEtBKXTa3lZ3l7td5xitWZ1wEPqiVUcOwHjB2Ie7jqqx5SljSx0raG 3Df/EgZDXp9TxO/oSbFogt0MN6MyW9eSR9DC/pTMBt7rebHGE1weLrNJPVbN9QN3l9Yq zi8JaC+xkiHpH6TjJYXLyes3jd/PwCA23/hxZqpV9PaCya9JTNYzSiAfDtqvA/Nz6str BqD/HylLAwxsNTzr+308bm1GpPG1Qhg6X3GOvS/hp5aC+D4CYp8ThQQNyWlE8wy7+t4z K9fBie+p32Ii7Nm6DsDPC/9bxCOFrxRh/wSFDCzyESVvhTlAPLMfEpWP0AX7o/+I1rrL /vlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=oAoiZsybadmeQ96H+02fGdiYzseS4i8XXKVQd8p6lEE=; b=Zk8X3KYrd2Q1+eFPvP6t+1PI9oZ3M/q5CvQN7hNutZs5tsh1RVLac73ElwBkL1AMSk rOWjTVClZyG+59/naxeBSOE4v24IYT59fF9GAAEG1oL79LvlGkoEG2YjjreJwUsKaRrh DZ7ksrflKTXmBE6JMnMkug2RNPeA7vYqx3PrM9TcGdEOHZmPHcFTQ75S7jXpS16mrgzC lTlIv7SRYvuC5l8uJ708DGE6WWgLPU9JuCAxHkghuF1qG3XpPWY9ZlD8jHR1P3M2TPxZ Tjt/72WuAcORnZJpkFhRsfWRVZpzv0YU2lEVvHLmBB+21ZIzZireTDbwd6poFS4qV+g8 mJtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=S9WuOBWb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o57si5757475edc.253.2019.05.23.03.48.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:48:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=S9WuOBWb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33435 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTlGZ-0007pk-SE for patch@linaro.org; Thu, 23 May 2019 06:48:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTkvS-000636-VF for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTkvM-0001Xe-Ti for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:17 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:50228) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTkvM-00011h-JF for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:12 -0400 Received: by mail-wm1-x343.google.com with SMTP id f204so5236519wme.0 for ; Thu, 23 May 2019 03:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oAoiZsybadmeQ96H+02fGdiYzseS4i8XXKVQd8p6lEE=; b=S9WuOBWbrGdqhGF8KY3OKgzIE1TTgotnUhw+sL0NlOxMc54JzGKQxibMSWu+rkUIbo QXWLleKc3fWXKebwkFmH1iVRwgNfzkJacCNZOchH6cbq8F4as4SP1T/ygs9tDfBhME19 GhIla4MbWbaWnvUPCvuMui+UU+c0zMDLsHM6aT4sQarfosMO9XOy8oaPAKQNFY0TQam7 Cl35hkSzJ3klhebn/aCYqUHoniSeNEi+KJTgjqe47dR5jo9FLJEVSCIopJVEDuaSlu1g COEU1A8UxF/5ZJk5wJYjWP0u3TsjC5v7SPJh3bu5+sH1Ku2/jB2OnQljAlxM5PJW56HO XJLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oAoiZsybadmeQ96H+02fGdiYzseS4i8XXKVQd8p6lEE=; b=M8dtEELie1B7BKo9Ya320Zo5Dde9LYY8YL4tur9LWK7gcUoWBwFLTLFy7GXFv46X1X kZRHP1zLlV+/Ehi4wjwxNd5vAlppU31DSBBq+XfPKAaABg0HXDViKZ6HPdzCUagEPLZ0 H0dlAGfWOXG10dwDiwVUYr1trj+sVkS/VqVqEn8djcs5pxAc3ffVQ3fRUTGlOepSNCbV Y1haJuTO21tlNqo08/8gBfck2SDES+l0UNvrwJDMMFAXeUKV1U13tzFXr90/4BXq1k9I Q25DpmY1zsAq2xUETUnH65hSemLWJYnM2Aj+3sr6c/kOpVnPIqndNjNhivpz9HtXDf+Q l3rQ== X-Gm-Message-State: APjAAAUsso958Vq6D/Le1AAoIFLyojgUoJmPW92VAoY36cj+uam1EtVO zXlT5qYoxbwT3itXaL8uUQycXw== X-Received: by 2002:a1c:6206:: with SMTP id w6mr11717149wmb.56.1558607145841; Thu, 23 May 2019 03:25:45 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id y18sm11063422wmd.29.2019.05.23.03.25.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:44 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 397BD1FFA6; Thu, 23 May 2019 11:25:34 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:24 +0100 Message-Id: <20190523102532.10486-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 Subject: [Qemu-devel] [PATCH v2 20/28] tests/tcg/multiarch: expand system memory test to cover more X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , Richard Henderson , qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Expand the memory test to cover move of the softmmu code. Specifically we: - improve commentary - add some helpers (for later BE support) - reduce boiler plate into helpers - add signed reads at various sizes/offsets - required -DCHECK_UNALIGNED Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- tests/tcg/aarch64/Makefile.softmmu-target | 2 + tests/tcg/i386/Makefile.softmmu-target | 2 + tests/tcg/multiarch/system/memory.c | 350 +++++++++++++++++----- 3 files changed, 282 insertions(+), 72 deletions(-) -- 2.20.1 diff --git a/tests/tcg/aarch64/Makefile.softmmu-target b/tests/tcg/aarch64/Makefile.softmmu-target index cdb836f7e1e..2e560e4d08e 100644 --- a/tests/tcg/aarch64/Makefile.softmmu-target +++ b/tests/tcg/aarch64/Makefile.softmmu-target @@ -28,5 +28,7 @@ LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc %: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS) $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) +memory: CFLAGS+=-DCHECK_UNALIGNED=1 + # Running QEMU_OPTS+=-M virt -cpu max -display none -semihosting-config enable=on,target=native,chardev=output -kernel diff --git a/tests/tcg/i386/Makefile.softmmu-target b/tests/tcg/i386/Makefile.softmmu-target index c31bbbf39a7..e1f98177aa5 100644 --- a/tests/tcg/i386/Makefile.softmmu-target +++ b/tests/tcg/i386/Makefile.softmmu-target @@ -42,5 +42,7 @@ LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc %: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS) $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) +memory: CFLAGS+=-DCHECK_UNALIGNED=1 + # Running QEMU_OPTS+=-device isa-debugcon,chardev=output -device isa-debug-exit,iobase=0xf4,iosize=0x4 -kernel diff --git a/tests/tcg/multiarch/system/memory.c b/tests/tcg/multiarch/system/memory.c index a7a0a8e9784..dc1d8a98ff2 100644 --- a/tests/tcg/multiarch/system/memory.c +++ b/tests/tcg/multiarch/system/memory.c @@ -5,18 +5,33 @@ * behave across normal and unaligned accesses across several pages. * We are not replicating memory tests for stuck bits and other * hardware level failures but looking for issues with different size - * accesses when: - + * accesses when access is: * + * - unaligned at various sizes (if -DCHECK_UNALIGNED set) + * - spanning a (softmmu) page + * - sign extension when loading */ #include +#include #include -#define TEST_SIZE (4096 * 4) /* 4 pages */ +#ifndef CHECK_UNALIGNED +# error "Target does not specify CHECK_UNALIGNED" +#endif + +#define PAGE_SIZE 4096 /* nominal 4k "pages" */ +#define TEST_SIZE (PAGE_SIZE * 4) /* 4 pages */ +#define ARRAY_SIZE(x) ((sizeof(x) / sizeof((x)[0]))) + +__attribute__((aligned(PAGE_SIZE))) static uint8_t test_data[TEST_SIZE]; +typedef void (*init_ufn) (int offset); +typedef bool (*read_ufn) (int offset); +typedef bool (*read_sfn) (int offset, bool nf); + static void pdot(int count) { if (count % 128 == 0) { @@ -24,17 +39,26 @@ static void pdot(int count) } } +/* + * Helper macros for shift/extract so we can keep our endian handling + * in one place. + */ +#define BYTE_SHIFT(b, pos) ((uint64_t)b << (pos * 8)) +#define BYTE_EXTRACT(b, pos) ((b >> (pos * 8)) & 0xff) /* - * Fill the data with ascending value bytes. As x86 is a LE machine we - * write in ascending order and then read and high byte should either - * be zero or higher than the lower bytes. + * Fill the data with ascending value bytes. + * + * Currently we only support Little Endian machines so write in + * ascending address order. When we read higher address bytes should + * either be zero or higher than the lower bytes. */ -static void init_test_data_u8(void) +static void init_test_data_u8(int unused_offset) { uint8_t count = 0, *ptr = &test_data[0]; int i; + (void)(unused_offset); ml_printf("Filling test area with u8:"); for (i = 0; i < TEST_SIZE; i++) { @@ -44,62 +68,112 @@ static void init_test_data_u8(void) ml_printf("done\n"); } +/* + * Full the data with alternating positive and negative bytes. This + * should mean for reads larger than a byte all subsequent reads will + * stay either negative or positive. We never write 0. + */ + +static inline uint8_t get_byte(int index, bool neg) +{ + return neg ? (0xff << (index % 7)) : (0xff >> ((index % 6) + 1)); +} + +static void init_test_data_s8(bool neg_first) +{ + uint8_t top, bottom, *ptr = &test_data[0]; + int i; + + ml_printf("Filling test area with s8 pairs (%s):", + neg_first ? "neg first" : "pos first"); + for (i = 0; i < TEST_SIZE / 2; i++) { + *ptr++ = get_byte(i, neg_first); + *ptr++ = get_byte(i, !neg_first); + pdot(i); + } + ml_printf("done\n"); +} + +/* + * Zero the first few bytes of the test data in preparation for + * new offset values. + */ +static void reset_start_data(int offset) +{ + uint32_t *ptr = (uint32_t *) &test_data[0]; + int i; + for (i = 0; i < offset; i++) { + *ptr++ = 0; + } +} + static void init_test_data_u16(int offset) { uint8_t count = 0; - uint16_t word, *ptr = (uint16_t *) &test_data[0]; + uint16_t word, *ptr = (uint16_t *) &test_data[offset]; const int max = (TEST_SIZE - offset) / sizeof(word); int i; - ml_printf("Filling test area with u16 (offset %d):", offset); + ml_printf("Filling test area with u16 (offset %d, %p):", offset, ptr); - /* Leading zeros */ - for (i = 0; i < offset; i++) { - *ptr = 0; - } + reset_start_data(offset); - ptr = (uint16_t *) &test_data[offset]; for (i = 0; i < max; i++) { - uint8_t high, low; - low = count++; - high = count++; - word = (high << 8) | low; + uint8_t low = count++, high = count++; + word = BYTE_SHIFT(high, 1) | BYTE_SHIFT(low, 0); *ptr++ = word; pdot(i); } - ml_printf("done\n"); + ml_printf("done @ %p\n", ptr); } static void init_test_data_u32(int offset) { uint8_t count = 0; - uint32_t word, *ptr = (uint32_t *) &test_data[0]; + uint32_t word, *ptr = (uint32_t *) &test_data[offset]; const int max = (TEST_SIZE - offset) / sizeof(word); int i; - ml_printf("Filling test area with u32 (offset %d):", offset); + ml_printf("Filling test area with u32 (offset %d, %p):", offset, ptr); - /* Leading zeros */ - for (i = 0; i < offset; i++) { - *ptr = 0; - } + reset_start_data(offset); - ptr = (uint32_t *) &test_data[offset]; for (i = 0; i < max; i++) { - uint8_t b1, b2, b3, b4; - b4 = count++; - b3 = count++; - b2 = count++; - b1 = count++; - word = (b1 << 24) | (b2 << 16) | (b3 << 8) | b4; + uint8_t b4 = count++, b3 = count++; + uint8_t b2 = count++, b1 = count++; + word = BYTE_SHIFT(b1, 3) | BYTE_SHIFT(b2, 2) | BYTE_SHIFT(b3, 1) | b4; *ptr++ = word; pdot(i); } - ml_printf("done\n"); + ml_printf("done @ %p\n", ptr); } +static void init_test_data_u64(int offset) +{ + uint8_t count = 0; + uint64_t word, *ptr = (uint64_t *) &test_data[offset]; + const int max = (TEST_SIZE - offset) / sizeof(word); + int i; + + ml_printf("Filling test area with u64 (offset %d, %p):", offset, ptr); -static int read_test_data_u16(int offset) + reset_start_data(offset); + + for (i = 0; i < max; i++) { + uint8_t b8 = count++, b7 = count++; + uint8_t b6 = count++, b5 = count++; + uint8_t b4 = count++, b3 = count++; + uint8_t b2 = count++, b1 = count++; + word = BYTE_SHIFT(b1, 7) | BYTE_SHIFT(b2, 6) | BYTE_SHIFT(b3, 5) | + BYTE_SHIFT(b4, 4) | BYTE_SHIFT(b5, 3) | BYTE_SHIFT(b6, 2) | + BYTE_SHIFT(b7, 1) | b8; + *ptr++ = word; + pdot(i); + } + ml_printf("done @ %p\n", ptr); +} + +static bool read_test_data_u16(int offset) { uint16_t word, *ptr = (uint16_t *)&test_data[offset]; int i; @@ -114,17 +188,17 @@ static int read_test_data_u16(int offset) low = word & 0xff; if (high < low && high != 0) { ml_printf("Error %d < %d\n", high, low); - return 1; + return false; } else { pdot(i); } } - ml_printf("done\n"); - return 0; + ml_printf("done @ %p\n", ptr); + return true; } -static int read_test_data_u32(int offset) +static bool read_test_data_u32(int offset) { uint32_t word, *ptr = (uint32_t *)&test_data[offset]; int i; @@ -145,16 +219,16 @@ static int read_test_data_u32(int offset) (b2 < b3 && b2 != 0) || (b3 < b4 && b3 != 0)) { ml_printf("Error %d, %d, %d, %d", b1, b2, b3, b4); - return 2; + return false; } else { pdot(i); } } - ml_printf("done\n"); - return 0; + ml_printf("done @ %p\n", ptr); + return true; } -static int read_test_data_u64(int offset) +static bool read_test_data_u64(int offset) { uint64_t word, *ptr = (uint64_t *)&test_data[offset]; int i; @@ -184,60 +258,192 @@ static int read_test_data_u64(int offset) (b7 < b8 && b7 != 0)) { ml_printf("Error %d, %d, %d, %d, %d, %d, %d, %d", b1, b2, b3, b4, b5, b6, b7, b8); - return 2; + return false; } else { pdot(i); } } - ml_printf("done\n"); - return 0; + ml_printf("done @ %p\n", ptr); + return true; } /* Read the test data and verify at various offsets */ -int do_reads(void) +read_ufn read_ufns[] = { read_test_data_u16, + read_test_data_u32, + read_test_data_u64 }; + +bool do_unsigned_reads(void) { - int r = 0; - int off = 0; + int i; + bool ok = true; - while (r == 0 && off < 8) { - r = read_test_data_u16(off); - r |= read_test_data_u32(off); - r |= read_test_data_u64(off); - off++; + for (i = 0; i < ARRAY_SIZE(read_ufns) && ok; i++) { +#if CHECK_UNALIGNED + int off; + for (off = 0; off < 8 && ok; off++) { + ok = read_ufns[i](off); + } +#else + ok = read_ufns[i](0); +#endif } - return r; + return ok; } -int main(void) +static bool do_unsigned_test(init_ufn fn) { - int i, r = 0; +#if CHECK_UNALIGNED + bool ok = true; + int i; + for (i = 0; i < 8 && ok; i++) { + fn(i); + ok = do_unsigned_reads(); + } +#else + fn(0); + return do_unsigned_reads(); +#endif +} + +/* + * We need to ensure signed data is read into a larger data type to + * ensure that sign extension is working properly. + */ + +static bool read_test_data_s8(int offset, bool neg_first) +{ + int8_t *ptr = (int8_t *)&test_data[offset]; + int i; + const int max = (TEST_SIZE - offset) / 2; + + ml_printf("Reading s8 pairs from %#lx (offset %d):", ptr, offset); + + for (i = 0; i < max; i++) { + int16_t first, second; + bool ok; + first = *ptr++; + second = *ptr++; + + if (neg_first && first < 0 && second > 0) { + pdot(i); + } else if (!neg_first && first > 0 && second < 0) { + pdot(i); + } else { + ml_printf("Error %d %c %d\n", first, neg_first ? '<' : '>', second); + return false; + } + } + ml_printf("done @ %p\n", ptr); + return true; +} + +static bool read_test_data_s16(int offset, bool neg_first) +{ + int16_t *ptr = (int16_t *)&test_data[offset]; + int i; + const int max = (TEST_SIZE - offset) / (sizeof(*ptr)); + + ml_printf("Reading s16 from %#lx (offset %d, %s):", ptr, + offset, neg_first ? "neg" : "pos"); + for (i = 0; i < max; i++) { + int32_t data = *ptr++; - init_test_data_u8(); - r = do_reads(); - if (r) { - return r; + if (neg_first && data < 0) { + pdot(i); + } else if (data > 0) { + pdot(i); + } else { + ml_printf("Error %d %c 0\n", data, neg_first ? '<' : '>'); + return false; + } } + ml_printf("done @ %p\n", ptr); + return true; +} + +static bool read_test_data_s32(int offset, bool neg_first) +{ + int32_t *ptr = (int32_t *)&test_data[offset]; + int i; + const int max = (TEST_SIZE - offset) / (sizeof(int32_t)); - for (i = 0; i < 8; i++) { - init_test_data_u16(i); + ml_printf("Reading s32 from %#lx (offset %d, %s):", + ptr, offset, neg_first ? "neg" : "pos"); - r = do_reads(); - if (r) { - return r; + for (i = 0; i < max; i++) { + int64_t data = *ptr++; + + if (neg_first && data < 0) { + pdot(i); + } else if (data > 0) { + pdot(i); + } else { + ml_printf("Error %d %c 0\n", data, neg_first ? '<' : '>'); + return false; } } + ml_printf("done @ %p\n", ptr); + return true; +} - for (i = 0; i < 8; i++) { - init_test_data_u32(i); +/* + * Read the test data and verify at various offsets + * + * For everything except bytes all our reads should be either positive + * or negative depending on what offset we are reading from. Currently + * we only handle LE systems. + */ +read_sfn read_sfns[] = { read_test_data_s8, + read_test_data_s16, + read_test_data_s32 }; - r = do_reads(); - if (r) { - return r; +bool do_signed_reads(bool neg_first) +{ + int i; + bool ok = true; + + for (i = 0; i < ARRAY_SIZE(read_sfns) && ok; i++) { +#if CHECK_UNALIGNED + int off; + for (off = 0; off < 8 && ok; off++) { + bool nf = i == 0 ? neg_first ^ (off & 1) : !(neg_first ^ (off & 1)); + ok = read_sfns[i](off, nf); } +#else + ok = read_sfns[i](0, i == 0 ? neg_first : !neg_first); +#endif + } + + return ok; +} + +init_ufn init_ufns[] = { init_test_data_u8, + init_test_data_u16, + init_test_data_u32, + init_test_data_u64 }; + +int main(void) +{ + int i; + bool ok = true; + + /* Run through the unsigned tests first */ + for (i = 0; i < ARRAY_SIZE(init_ufns) && ok; i++) { + ok = do_unsigned_test(init_ufns[i]); + } + + if (ok) { + init_test_data_s8(false); + ok = do_signed_reads(false); + } + + if (ok) { + init_test_data_s8(true); + ok = do_signed_reads(true); } - ml_printf("Test complete: %s\n", r == 0 ? "PASSED" : "FAILED"); - return r; + ml_printf("Test complete: %s\n", ok ? "PASSED" : "FAILED"); + return ok ? 0 : -1; } From patchwork Thu May 23 10:25:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164997 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2015471ili; Thu, 23 May 2019 03:59:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPHvivIrQma+R0QmR8ZMgi8BrQjM4K4PbPtrDcL5sNGC0wP5hqGok4JXPLmNFqQbFwwcP2 X-Received: by 2002:a17:906:a843:: with SMTP id dx3mr4433000ejb.64.1558609152945; Thu, 23 May 2019 03:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558609152; cv=none; d=google.com; s=arc-20160816; b=bF3QfrGMuETWrcgW9PLrOs3A6zwN1dg+MgII4D+jmF7Y1xWgri12GCdukCdBLOhTwN Lb65F04SV/+dERsl5kQfBgNq5+yb3VSABLTZjkZv9VTc/WatbjU9K4zBhQkYFPXM+GdT AHb+V9IWGFWTYzrIs/3nYOgHmQlpzJNLdUicn9NU1g19gxb/LI/Kk6yBEk98JJYVgELg gAeJkyCkvi/AEPLsMVmTt0vokY4TLL4ZZA2525W8f0dY2X+ryCOrWz44xxDs7UW4fZPy fDsgZe83EA4014aGjPq0bhSsXLCpJODYhU0cSyvcQPSRYW3Xary8M2U+SXT8LRO5uwYC w1QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=vrwtCOpqdBqDBXlwjop6UemUPv70vtcui2uO3XkTdjU=; b=pDukBD3zK7xmxgvoH0mqFcAV4wysCLTYcAgCjL6/yiNCcfyLQa/Sj9tWgZPGniAD/q v+UPyv0vi3Na7zQXdtgQ6lLYR9lH5BDrVGB7HMVurUFN9T2YMJFe5Y26QxsKxaFEMITb kYCRA0zcS2IzS+5BvMfnMJHxDgxsMT+X632YVIwxGvLgHOGD7hf3d5/0S/UWoi0Nz/jP M28SwOtN3N3Wb/+QEd5xyLGeE/ZyOvpZCzJ9dUYxX7C6P+VBf+y8LxA9jxh8a4+u5z4G NGo0R0jF0Cso7bgPyIAIzRSzIxXGDzqY+GtA7k9n+QOL4OzKP7E9K5WCrlFj/JXtJeQ0 hhXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sii941Mu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b20si17287742ede.282.2019.05.23.03.59.12 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:59:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sii941Mu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33653 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTlRH-0000Rz-TM for patch@linaro.org; Thu, 23 May 2019 06:59:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl2o-0004QS-Fm for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTl2j-0006cM-Kl for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:53 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:41521) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTl2i-0006ZM-Pv for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:49 -0400 Received: by mail-wr1-x444.google.com with SMTP id u16so1791940wrn.8 for ; Thu, 23 May 2019 03:33:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vrwtCOpqdBqDBXlwjop6UemUPv70vtcui2uO3XkTdjU=; b=sii941Mu6QsrXrF0zyHqIw9LtmqgBYkqqaqKyETsW9Xwm66KixYRsV9RaoLb7u1L1F kGIHNwVxmN55Hs/gzeNyUXsqZ91icO5C1k4bP0mUsItOym3eTA39OjZZRt2IvuI4/47n dgadRUE9Ox7l4lRZoEqBeS/IQiFtT8qfrum7jjxZmS9V7VkzrYGYGWxGlfQsmDNKv3vu +jSJQ0J2nkG1vhrnRHVOdpl5SPAEgHkXyVEk0BqRchnjigHYYOBwdkZ/7usbYPMpCuZ+ egCPQJscgZ3QQx0wHzv6nGzNuo0g6p7F/26ZgZ+/t/RTCSTPORoO5Gr1PgNbSUQJO4PL cCCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vrwtCOpqdBqDBXlwjop6UemUPv70vtcui2uO3XkTdjU=; b=o1Pj/JCpu75TOJnYAHnHcXdIl4C6Gh0/qYB6h47EXFgzIWbcFgbjjcTABVzKXmEcdW 6iCfHAfV9GjC98A3xBZxBHvKgKNygYn/vJn/EMlEpC/cepOaYIh9a2NLhrtUqnps6GLt nbaAkWA8f9tkgK6aI3zY9E17FaD/Rk085tSg9KImuvk+IeedCGAGH4eLEcATtl23Lpoe xXCbRaLIy8q6v6Q0ci/RP4awWcavrFc6f8LFdjIX9OXIz3xOrnV9R0tGfJMMCreA1LlF qG17xERrllSudcG59JNERfLPHBTMRUTM/jcN8jPpmigXU0FwpHMkw+D+xh0KOFXf9ro6 3MmA== X-Gm-Message-State: APjAAAXQZIxRucWtvZ+MytCE75LvnLXIeKJjM98s9oB96tsqjB4K1vky GXDlSkhv4YyXZs5WrbGFhnyn4g== X-Received: by 2002:adf:e902:: with SMTP id f2mr57951095wrm.301.1558607625918; Thu, 23 May 2019 03:33:45 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id a22sm7220172wma.41.2019.05.23.03.33.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:33:44 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 530A51FFA9; Thu, 23 May 2019 11:25:34 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:25 +0100 Message-Id: <20190523102532.10486-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 Subject: [Qemu-devel] [PATCH v2 21/28] tests/tcg/alpha: add system boot.S X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, Richard Henderson , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson This provides the bootstrap and low level helper functions for an alpha kernel. We use direct access to the DP264 serial port for test output, and hard machine halt to exit the emulation. Signed-off-by: Richard Henderson Message-Id: <20190501184306.15208-1-richard.henderson@linaro.org> Signed-off-by: Alex Bennée --- MAINTAINERS | 1 + tests/tcg/alpha/Makefile.softmmu-target | 34 ++ tests/tcg/alpha/system/boot.S | 511 ++++++++++++++++++++++++ tests/tcg/alpha/system/kernel.ld | 30 ++ 4 files changed, 576 insertions(+) create mode 100644 tests/tcg/alpha/Makefile.softmmu-target create mode 100644 tests/tcg/alpha/system/boot.S create mode 100644 tests/tcg/alpha/system/kernel.ld -- 2.20.1 diff --git a/MAINTAINERS b/MAINTAINERS index c4f209898a9..546a1431ea3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -470,6 +470,7 @@ M: Richard Henderson S: Maintained F: hw/alpha/ F: hw/isa/smc37c669-superio.c +F: tests/tcg/alpha/system/ ARM Machines ------------ diff --git a/tests/tcg/alpha/Makefile.softmmu-target b/tests/tcg/alpha/Makefile.softmmu-target new file mode 100644 index 00000000000..3c0f34cc692 --- /dev/null +++ b/tests/tcg/alpha/Makefile.softmmu-target @@ -0,0 +1,34 @@ +# +# Alpha system tests +# + +ALPHA_SYSTEM_SRC=$(SRC_PATH)/tests/tcg/alpha/system +VPATH+=$(ALPHA_SYSTEM_SRC) + +# These objects provide the basic boot code and helper functions for all tests +CRT_OBJS=boot.o + +ALPHA_TEST_SRCS=$(wildcard $(ALPHA_SYSTEM_SRC)/*.c) +ALPHA_TESTS = $(patsubst $(ALPHA_SYSTEM_SRC)/%.c, %, $(ALPHA_TEST_SRCS)) + +CRT_PATH=$(ALPHA_SYSTEM_SRC) +LINK_SCRIPT=$(ALPHA_SYSTEM_SRC)/kernel.ld +LDFLAGS=-Wl,-T$(LINK_SCRIPT) +TESTS+=$(ALPHA_TESTS) $(MULTIARCH_TESTS) +CFLAGS+=-nostdlib -g -O1 -mcpu=ev6 $(MINILIB_INC) +LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc + +# building head blobs +.PRECIOUS: $(CRT_OBJS) + +%.o: $(CRT_PATH)/%.S + $(CC) $(CFLAGS) -x assembler-with-cpp -c $< -o $@ + +# Build and link the tests +%: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS) + $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) + +memory: CFLAGS+=-DCHECK_UNALIGNED=0 + +# Running +QEMU_OPTS+=-serial chardev:output -kernel diff --git a/tests/tcg/alpha/system/boot.S b/tests/tcg/alpha/system/boot.S new file mode 100644 index 00000000000..9791b1ef7c8 --- /dev/null +++ b/tests/tcg/alpha/system/boot.S @@ -0,0 +1,511 @@ +/* + * Minimal Alpha system boot code. + * + * Copyright Linaro Ltd 2019 + */ + + .set noat + .set nomacro + .arch ev6 + .text + +.macro load_pci_io reg + /* For typhoon, this is + * 0xfffffc0000000000 -- kseg identity map + * + 0x10000000000 -- typhoon pio base + * + 0x1fc000000 -- typhoon pchip0 pci base + * = 0xfffffd01fc000000 + */ + ldah \reg, -3 /* ff..fd0000 */ + lda \reg, 0x1fc(\reg) /* ff..fd01fc */ + sll \reg, 24, \reg +.endm + +#define com1Rbr 0x3f8 +#define com1Thr 0x3f8 +#define com1Ier 0x3f9 +#define com1Iir 0x3fa +#define com1Lcr 0x3fb +#define com1Mcr 0x3fc +#define com1Lsr 0x3fd +#define com1Msr 0x3fe +#define com1Scr 0x3ff +#define com1Dll 0x3f8 +#define com1Dlm 0x3f9 + +#define PAL_halt 0 +#define PAL_wrent 52 +#define PAL_wrkgp 55 + + .text + .p2align 4 + .globl _start + .ent _start +_start: + br $gp, .+4 + ldah $gp, 0($gp) !gpdisp!1 + lda $gp, 0($gp) !gpdisp!1 + + ldah $sp, $stack_end($gp) !gprelhigh + lda $sp, $stack_end($sp) !gprellow + + /* Install kernel gp for exception handlers. */ + mov $gp, $16 + call_pal PAL_wrkgp + + /* Install exception handlers. */ + ldah $16, entInt($gp) !gprelhigh + lda $16, entInt($16) !gprellow + lda $17, 0 + call_pal PAL_wrent + + ldah $16, entArith($gp) !gprelhigh + lda $16, entArith($16) !gprellow + lda $17, 1 + call_pal PAL_wrent + + ldah $16, entMM($gp) !gprelhigh + lda $16, entMM($16) !gprellow + lda $17, 2 + call_pal PAL_wrent + + ldah $16, entIF($gp) !gprelhigh + lda $16, entIF($16) !gprellow + lda $17, 3 + call_pal PAL_wrent + + ldah $16, entUna($gp) !gprelhigh + lda $16, entUna($16) !gprellow + lda $17, 4 + call_pal PAL_wrent + + ldah $16, entSys($gp) !gprelhigh + lda $16, entSys($16) !gprellow + lda $17, 5 + call_pal PAL_wrent + + /* + * Initialize COM1. + */ + load_pci_io $1 + lda $2, 0x87 /* outb(0x87, com1Lcr); */ + stb $2, com1Lcr($1) + stb $31, com1Dlm($1) /* outb(0, com1Dlm); */ + lda $2, 3 /* baudconst 3 => 56000 */ + stb $2, com1Dll($1) /* outb(baudconst, com1Dll); */ + lda $2, 0x07 + stb $2, com1Lcr($1) /* outb(0x07, com1Lcr) */ + lda $2, 0x0f + stb $2, com1Mcr($1) /* outb(0x0f, com1Mcr) */ + + bsr $26, main !samegp + + /* fall through to _exit */ + .end _start + + .globl _exit + .ent _exit +_exit: + .frame $sp, 0, $26, 0 + .prologue 0 + + /* We cannot return an error code. */ + call_pal PAL_halt + .end _exit + +/* + * We have received an exception that we don't handle. Log and exit. + */ + .ent log_exit +log_exit: +entInt: +entArith: +entMM: +entIF: +entUna: +entSys: + ldah $16, $errormsg($gp) !gprelhigh + lda $16, $errormsg($16) !gprellow + bsr $26, __sys_outs !samegp + bsr $26, _exit !samegp + .end log_exit + + .section .rodata +$errormsg: + .string "Terminated by exception.\n" + .previous + + /* + * Helper Functions + */ + + /* Output a single character to serial port */ + .global __sys_outc + .ent __sys_outc +__sys_outc: + .frame $sp, 0, $26, 0 + .prologue 0 + + load_pci_io $1 + + /* + * while ((inb(com1Lsr) & 0x20) == 0) + * continue; + */ +1: ldbu $0, com1Lsr($1) + and $0, 0x20, $0 + beq $0, 1b + + /* outb(c, com1Thr); */ + stb $16, com1Thr($1) + ret + .end __sys_outc + + /* Output a nul-terminated string to serial port */ + .global __sys_outs + .ent __sys_outs +__sys_outs: + .frame $sp, 0, $26, 0 + .prologue 0 + + load_pci_io $1 + + ldbu $2, 0($16) + beq $2, 9f + + /* + * while ((inb(com1Lsr) & 0x20) == 0) + * continue; + */ +1: ldbu $0, com1Lsr($1) + and $0, 0x20, $0 + beq $0, 1b + + /* outb(c, com1Thr); */ + stb $2, com1Thr($1) + + addq $16, 1, $16 + ldbu $2, 0($16) + bne $2, 1b + +9: ret + .end __sys_outs + +/* + * Division routines that are normally in libc. + * + * These do not follow the C calling convention. Arguments are in $24+$25, + * the result is in $27. Register $28 may be clobbered; everything else + * must be saved. + * + * We store the remainder in $28, so that we can share code. + * + * We do not signal divide by zero. + */ + +/* + * Unsigned 64-bit division. + */ + + .globl __divqu + .ent __divqu +__divqu: + .frame $sp, 48, $23 + subq $sp, 48, $sp + stq $0, 0($sp) + stq $1, 8($sp) + stq $2, 16($sp) + stq $3, 24($sp) + stq $4, 32($sp) + .prologue 0 + +#define mask $0 +#define divisor $1 +#define compare $2 +#define tmp1 $3 +#define tmp2 $4 +#define quotient $27 +#define modulus $28 + + mov $24, modulus + mov $25, divisor + mov $31, quotient + mov 1, mask + beq $25, 9f + + /* Shift left until divisor >= modulus. */ +1: cmpult divisor, modulus, compare + blt divisor, 2f + addq divisor, divisor, divisor + addq mask, mask, mask + bne compare, 1b + +2: addq quotient, mask, tmp2 + srl mask, 1, mask + cmpule divisor, modulus, compare + subq modulus, divisor, tmp1 + cmovne compare, tmp2, quotient + srl divisor, 1, divisor + cmovne compare, tmp1, modulus + bne mask, 2b + +9: ldq $0, 0($sp) + ldq $1, 8($sp) + ldq $2, 16($sp) + ldq $3, 24($sp) + ldq $4, 32($sp) + addq $sp, 48, $sp + ret $31, ($23), 1 + +#undef mask +#undef divisor +#undef compare +#undef tmp1 +#undef tmp2 +#undef quotient +#undef modulus + + .end __divqu + +/* + * Unsigned 64-bit remainder. + * Note that __divqu above leaves the result in $28. + */ + + .globl __remqu + .ent __remqu +__remqu: + .frame $sp, 16, $23 + subq $sp, 16, $sp + stq $23, 0($sp) + .prologue 0 + + bsr $23, __divqu + + ldq $23, 0($sp) + mov $28, $27 + addq $sp, 16, $sp + ret $31, ($23), 1 + .end __remqu + +/* + * Signed 64-bit division. + */ + + .globl __divqs + .ent __divqs +__divqs: + .prologue 0 + + /* Common case: both arguments are positive. */ + bis $24, $25, $28 + bge $28, __divqu + + /* At least one argument is negative. */ + subq $sp, 32, $sp + stq $23, 0($sp) + stq $24, 8($sp) + stq $25, 16($sp) + + /* Compute absolute values. */ + subq $31, $24, $28 + cmovlt $24, $28, $24 + subq $31, $25, $28 + cmovlt $25, $28, $25 + + bsr $23, __divqu + + ldq $24, 8($sp) + ldq $25, 16($sp) + + /* -a / b = a / -b = -(a / b) */ + subq $31, $27, $23 + xor $24, $25, $28 + cmovlt $28, $23, $27 + + ldq $23, 0($sp) + addq $sp, 32, $sp + ret $31, ($23), 1 + .end __divqs + +/* + * Signed 64-bit remainder. + */ + + .globl __remqs + .ent __remqs +__remqs: + .prologue 0 + + /* Common case: both arguments are positive. */ + bis $24, $25, $28 + bge $28, __remqu + + /* At least one argument is negative. */ + subq $sp, 32, $sp + stq $23, 0($sp) + stq $24, 8($sp) + stq $25, 16($sp) + + /* Compute absolute values. */ + subq $31, $24, $28 + cmovlt $24, $28, $24 + subq $31, $25, $28 + cmovlt $25, $28, $25 + + bsr $23, __divqu + + ldq $23, 0($sp) + ldq $24, 8($sp) + ldq $25, 16($sp) + + /* -a % b = -(a % b); a % -b = a % b. */ + subq $31, $28, $27 + cmovge $24, $28, $27 + + addq $sp, 32, $sp + ret $31, ($23), 1 + .end __remqs + +/* + * Unsigned 32-bit division. + */ + + .globl __divlu + .ent __divlu +__divlu: + .frame $sp, 32, $23 + subq $sp, 32, $sp + stq $23, 0($sp) + stq $24, 8($sp) + stq $25, 16($sp) + .prologue 0 + + /* Zero extend and use the 64-bit routine. */ + zap $24, 0xf0, $24 + zap $25, 0xf0, $25 + bsr $23, __divqu + + addl $27, 0, $27 + ldq $23, 0($sp) + ldq $24, 8($sp) + ldq $25, 16($sp) + addq $sp, 32, $sp + ret $31, ($23), 1 + .end __divlu + +/* + * Unsigned 32-bit remainder. + */ + + .globl __remlu + .ent __remlu +__remlu: + .frame $sp, 32, $23 + subq $sp, 32, $sp + stq $23, 0($sp) + stq $24, 8($sp) + stq $25, 16($sp) + .prologue 0 + + /* Zero extend and use the 64-bit routine. */ + zap $24, 0xf0, $24 + zap $25, 0xf0, $25 + bsr $23, __divqu + + /* Recall that the remainder is returned in $28. */ + addl $28, 0, $27 + ldq $23, 0($sp) + ldq $24, 8($sp) + ldq $25, 16($sp) + addq $sp, 32, $sp + ret $31, ($23), 1 + .end __remlu + +/* + * Signed 32-bit division. + */ + + .globl __divls + .ent __divls +__divls: + .frame $sp, 32, $23 + subq $sp, 32, $sp + stq $23, 0($sp) + stq $24, 8($sp) + stq $25, 16($sp) + .prologue 0 + + /* Sign extend. */ + addl $24, 0, $24 + addl $25, 0, $25 + + /* Compute absolute values. */ + subq $31, $24, $28 + cmovlt $24, $28, $24 + subq $31, $25, $28 + cmovlt $25, $28, $25 + + bsr $23, __divqu + + ldq $24, 8($sp) + ldq $25, 16($sp) + + /* Negate the unsigned result, if necessary. */ + xor $24, $25, $28 + subl $31, $27, $23 + addl $27, 0, $27 + addl $28, 0, $28 + cmovlt $28, $23, $27 + + ldq $23, 0($sp) + addq $sp, 32, $sp + ret $31, ($23), 1 + .end __divls + +/* + * Signed 32-bit remainder. + */ + + .globl __remls + .ent __remls +__remls: + .frame $sp, 32, $23 + subq $sp, 32, $sp + stq $23, 0($sp) + stq $24, 8($sp) + stq $25, 16($sp) + .prologue 0 + + /* Sign extend. */ + addl $24, 0, $24 + addl $25, 0, $25 + + /* Compute absolute values. */ + subq $31, $24, $28 + cmovlt $24, $28, $24 + subq $31, $25, $28 + cmovlt $25, $28, $25 + + bsr $23, __divqu + + ldq $23, 0($sp) + ldq $24, 8($sp) + ldq $25, 16($sp) + + /* Negate the unsigned result, if necessary. */ + subl $31, $28, $27 + addl $28, 0, $28 + cmovge $24, $28, $27 + + addq $sp, 32, $sp + ret $31, ($23), 1 + .end __remls + + .data + .p2align 4 +stack: + .skip 65536 +$stack_end: + .type stack,@object + .size stack, . - stack diff --git a/tests/tcg/alpha/system/kernel.ld b/tests/tcg/alpha/system/kernel.ld new file mode 100644 index 00000000000..d2ac6ecfeb8 --- /dev/null +++ b/tests/tcg/alpha/system/kernel.ld @@ -0,0 +1,30 @@ +ENTRY(_start) + +SECTIONS +{ + /* Linux kernel legacy start address. */ + . = 0xfffffc0000310000; + _text = .; + .text : { + *(.text) + } + .rodata : { + *(.rodata) + } + _etext = .; + + . = ALIGN(8192); + _data = .; + .got : { + *(.got) + } + .data : { + *(.sdata) + *(.data) + } + _edata = .; + .bss : { + *(.bss) + } + _end = .; +} From patchwork Thu May 23 10:25:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164988 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2006519ili; Thu, 23 May 2019 03:48:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIojTMB2uqzlUGIJgi8Pl70ihcazbG2jg/EInpWizg/d0a13xxj8qbS6oy1RmXQ4eCmERw X-Received: by 2002:a50:ec05:: with SMTP id g5mr95717371edr.168.1558608536984; Thu, 23 May 2019 03:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558608536; cv=none; d=google.com; s=arc-20160816; b=rPlT6Pm+3sM13COvysvTmv/jR+fPCi6atGTgMfKZ2bINXYpvVcoylQuPct32cXDOfM BAfZjkFr1BWbyZ22DFW6N+0IKrwkfKRcyHEAwUWXPSSIpxpQoVfhe847wb1rIpv+qyeV sKjqRjjK6Ee04xwne3QK0taNporbezA7JvKl5weMTrnlIiWwuOCGE0TbiY5r8GRJBFAh eLzr4j6R6U4o/xkdab0ZfiEhjdkDN24nM+UZisS0lJ0YRzHQjZCGbJFcNrUePFBuWV94 ieQkyty76r2BJxTP0Ht6wg1clnjWUdjo4yvjrDwAKcPi70pc301jD99Jv39qKMbYVWHE NiEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=U7WirZ4xKeMbMxcY96b9jNQO3HlUTGEeG/vNICAL7pQ=; b=nNYKU30srJsHMfLsXaGRGvpga74s84dghNCaCDtUT2O7TzamkpbVnICYQpa+hGetdf E77k4tMKIqKkjSIrs2sSB/z3oJ9w6HOssf8d6rc2JIXBbHDAlFzz5n85ruZtSRDoB9Fw v2zzQ7O3PLR/brBuvrQrOtD2clnbKraHhwhy06kwX8Dmxv5fdZ/mO2Q1Ddeq6IuOYM0b MNlWDHsW+s4HzJP3w8cxceUn7m2EAtHHS8axc0VQwjDsVzulzjwxKFZM8RgxcCBZ+T+v govq7IBEf/L70EdIv58BexxqhbfLMqJPz8Y3lwUuTCZESO1wD4LB3xOn9lrques7zcWI AVoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="PacjGqR/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c24si13257185edc.14.2019.05.23.03.48.56 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:48:56 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="PacjGqR/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33459 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTlHJ-0008UO-G0 for patch@linaro.org; Thu, 23 May 2019 06:48:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl2i-0004LU-SA for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTl2g-0006ZW-NS for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:48 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:34960) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTl2f-0006YD-MD for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:46 -0400 Received: by mail-wr1-x444.google.com with SMTP id m3so5679297wrv.2 for ; Thu, 23 May 2019 03:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U7WirZ4xKeMbMxcY96b9jNQO3HlUTGEeG/vNICAL7pQ=; b=PacjGqR/f2kmB3AZYCSTcJ0sUmAxsyG6kM9R5D74PRopjLSJHyDHTQwej8sguNFtS1 EoLgKSufHkNVOUG40IH1vY4NKxkiy4jt91JnvTGEiYiMT7tYFcYLinSl/YZAxLLdlNZy rUYSwFQtai2N7nhGxiIui/o9IN0q0s/Hn+vqaYlMxE3jQgg0yps6Bl6aqpwQ0XMh15dR zkFmwYbRB/Zax86HZDlpIWl2RDTgQmElK9+gyjzYCu3ofCAlfYPSEFis8ufrcqBuUBWe r7SYU4MaQS2P8lmQC4It/5C1+Ku0PnSf5mZ5GMqQYMmLOow5tMRNFiJ4JKc40tx0D8ZA Afnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U7WirZ4xKeMbMxcY96b9jNQO3HlUTGEeG/vNICAL7pQ=; b=EvDnQ0hom+Pb4Ty1ofTadxAWsa7AYXsQLH0r5X33iBTMPxcb5y99FabvuI46ruqypb EpxypcQbTSWQmI3FtahxkFaNFrSU/lZHhe02VPGjKhOQC9yxKq3OaC1EjM9FAsmF0llj w5sEi/jr/OAzr6mYLyMj+rWTyF+XPwiweH2aL3kXhtP+NewXkkHVY24ZQIGoWiWVmKdp iQcrx3Hj6ARRN7VxwijlSHaCMOpeovBs8oWIiEUjlfk6yhWAOAfnjUTOA31Q9pmXpXuR 4mBrPrA3Jj/a1jePLtYZ4U6CN/wjt4AlMK/DZ/6MtCUfDXoqFQQHHlTQig9bJO5USCSu nz3g== X-Gm-Message-State: APjAAAWjpLRov/Z8J6Ht2h8ML32jhfTB1SH4MQil7xKKH4Mhypf23R8g TaOwkK/XN6C1D2u6kuZ3XBDOWw== X-Received: by 2002:adf:e44b:: with SMTP id t11mr9644661wrm.151.1558607623561; Thu, 23 May 2019 03:33:43 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id s10sm23788922wrt.66.2019.05.23.03.33.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:33:42 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 676161FFAA; Thu, 23 May 2019 11:25:34 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:26 +0100 Message-Id: <20190523102532.10486-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 Subject: [Qemu-devel] [PATCH v2 22/28] .travis.yml: enable aarch64-softmmu and alpha-softmmu tcg tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Richard Henderson , qemu-arm@nongnu.org, =?utf-8?q?Alex_B?= =?utf-8?b?ZW5uw6ll?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/.travis.yml b/.travis.yml index 6fd89b3d915..b053a836a32 100644 --- a/.travis.yml +++ b/.travis.yml @@ -284,5 +284,5 @@ matrix: # Run check-tcg against softmmu targets - env: - - CONFIG="--target-list=xtensa-softmmu,arm-softmmu" + - CONFIG="--target-list=xtensa-softmmu,arm-softmmu,aarch64-softmmu,alpha-softmmu" - TEST_CMD="make -j3 check-tcg V=1" From patchwork Thu May 23 10:25:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164991 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2010299ili; Thu, 23 May 2019 03:53:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLRgi7Nlc9rcGF2ZbhGlFYF9HeIvFD4EEQG1IfupD1oshnXfMKBJ5UglhkzXQ8cO0smRgG X-Received: by 2002:a17:906:4599:: with SMTP id t25mr49286758ejq.197.1558608793842; Thu, 23 May 2019 03:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558608793; cv=none; d=google.com; s=arc-20160816; b=Cn8QGAtx1ArxqSThLCgRQTHsxj12LX0yDqQYzqNkgimCPjmC/niUqPtsy2HdbENwjG me70xxhiQO8SoZKIYQHNF/gN6otJu7Dc7szlpAX0gvV9jfp8M9o+/XQkCFqRcJQ2f+Ms AbLxP5gs4n2lOl8Dr7RCm9gD16yEOkTHMrnueZyRNRvYMHL8ewyD/b56lsWGdyOO6deD cE6PJ6LKr5mz+EqTcyfODeg0BGJdG1mqGxskqbIuUFQadVbdizaqM0RdKtFknxvKEHKH PP0cTNKLqo1uRWEwZxMTYssuXVY729Pm8GOqjPt9B5x0OMftK/bl2WkEo7JgGeag6/EH dBuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=o3EFe5fyp8XJbHGSqeV6fhIY+jSWXjg9YliRj0HIozw=; b=bji3PJ2BhZd4dhWFQe5kCKNlyYVdK31NfG0TdJ0n9S9FCySxjpzNbAXWi1ilDuhynm GlYcHmANsNvqwhQgloSaQuWdM5KCxWXgyGSwKyW6y+zaykSp3C+6d/dEK8KsW84sQ51H oWJw5EIYckfBi2yHAERUX1d7chcSzzoe2dh+PX1oTtmZDww82B7XUCgbLEzcPrFIVVGp veM9maMxFvox5Ovvy5SIt5P9lk454vHcXdcPO2WTZBkS/BLTwFDfqKAgfIyHvkM59xX6 QR8hj04muo0ORC1/9uG2mmty/HH8pCwStCPd0t+oR9UpzcKYjcks8tLsEuPAmlRNL+IA 73/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=u2QaYt45; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l14si1749281edv.262.2019.05.23.03.53.13 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:53:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=u2QaYt45; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33541 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTlLU-0003fd-U5 for patch@linaro.org; Thu, 23 May 2019 06:53:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl2o-0004QX-HL for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTl2k-0006dX-Pz for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:53 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:41521) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTl2j-0006ac-Jk for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:49 -0400 Received: by mail-wr1-x443.google.com with SMTP id u16so1792046wrn.8 for ; Thu, 23 May 2019 03:33:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o3EFe5fyp8XJbHGSqeV6fhIY+jSWXjg9YliRj0HIozw=; b=u2QaYt45ZLMSPbitDi9ss52YxxnHdqX08kubEnrKqnKGdqFVxrQ2TA/lTYDr7g2jCs dBOBxjDMrcfNrFq2nhrvqQhDj9o1krRAcW0VPCpqJ7vFKbKb3SwpgaFv9a3XGAzS1wgx kCSSgvPNoPPCoFCG/03dKKPcIcSzHrmuV2aQo16u0hi8pZ/puer3XcSUv3j4QXqsWTUk YyUrzIsK3tLwfUoBKr0mEytVsER128hzvPFVtebv9L951dhuYzyqd0kKOPkTfOqsfWIS jvL5fIehrEzeLV0k8dA+bTPhjhbiVEMFPtyRpnnQ9grXYHPYBVDfyL5rApG6/ZT5yA+6 t1qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o3EFe5fyp8XJbHGSqeV6fhIY+jSWXjg9YliRj0HIozw=; b=fZ54kTXBF7HMdi5wQYd4Pouk3Hb+KRszdEPweM02fsDCNjae8XyVmSyNByvVncD9It 31QWXPsmD1JAmTs+OeF1lLI0KPk3pad8qvcf52QNo6GBreAaBPVn2g4gwvirvYy74m/g RokCy/EprqhKzDL1KZzCS9xivDzZLzv2jHL3giv5bpTl7p2ShEIZxaOmW8uVA4ktysz6 kkg5U90Eg8SR0JKgk5L63li4+vI4jWJOkJzvrGOUNABLeFSRqhPrTA71gvOow6vRErX6 fCArA8pD9UInfF5zgLgMMHPeKkIr4/xnBwBZ/9/1ZTwi6YuyqGg5JiY0VcMUXs7ZWX77 zQtg== X-Gm-Message-State: APjAAAWr2y+fXvtOhgeQQPvQ3SvHS2ewsKqlLsbyUtvKZWvp7A4c56RS y7XC0rT1UUxSKnDr1z3NS3i5hA== X-Received: by 2002:adf:e301:: with SMTP id b1mr27663873wrj.304.1558607628195; Thu, 23 May 2019 03:33:48 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id s13sm9407861wmh.31.2019.05.23.03.33.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:33:45 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7BC1D1FFAB; Thu, 23 May 2019 11:25:34 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:27 +0100 Message-Id: <20190523102532.10486-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 Subject: [Qemu-devel] [PATCH v2 23/28] Makefile: fix coverage-report reference to BUILD_DIR X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Commit 337f2311f actually claimed to do this in the commit log but didn't actually. Oops. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/Makefile b/Makefile index 155f066a206..40561993c40 100644 --- a/Makefile +++ b/Makefile @@ -998,7 +998,7 @@ $(filter %.1 %.7 %.8,$(DOCS)): scripts/texi2pod.pl %/coverage-report.html: @mkdir -p $* $(call quiet-command,\ - gcovr -r $(SRC_PATH) --object-directory $(BUILD_PATH) \ + gcovr -r $(SRC_PATH) --object-directory $(BUILD_DIR) \ -p --html --html-details -o $@, \ "GEN", "coverage-report.html") From patchwork Thu May 23 10:25:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164990 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2009480ili; Thu, 23 May 2019 03:52:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgMTQLA8TnAOynQTUm6KTXuTdK06X+5Y3vqY3dD9l9xScRggsgKhrfvXrHiTMXPu3V/Svs X-Received: by 2002:a50:89b7:: with SMTP id g52mr96424664edg.291.1558608734947; Thu, 23 May 2019 03:52:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558608734; cv=none; d=google.com; s=arc-20160816; b=BJDdKXi2QwglRAT2VJp7NQzyb1A+DMgbzuKxWs+UrGjqkNBciisnORpj44LSRHkNNO ByLwmno9Mxgu01N7dVuzuVatPNAEG8qs9Eczn2Y47O55B0ofFSnxFjeWLf9/Ps3VtYpq 71/DEEywhWwCbFTwHfiRNpOOhTEUEFhnKHOmpu2hQnzI6baKLFPWgzzgfFl/vXXzdlXH YksVkkRsolKPwMG3hJm1kH4K3wd4o5ftWwKAQXWFfa3mg3Jt1VlQWprxwK03to0foyq0 3YI9LGS082a25t+kS85UzXytIJbhF8n9Riwz6PYHiBzLJmbccFOwjcRn8KVukKzEQxaR Bq5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=PsZHZmw3xAVptlffZztwV7zF9bHQW1aIOcTlgJe374I=; b=04dEU6IiGE1toS2nrbWzDEPXygFLKGf/XpBreeZMX++MPSPoC0N2KWgpvSMFcbkJgj p/cYKQUdko3DcKnsYwxtXRg0hMb+8BoFkmc5WBmVQG4VZbk2dUQSUnyms6QF88WjDvT+ u6WQ9+mDU4LfQKRRtq1Xoq6Nza5HreNRwjEXW2tIpM4wTQYr9poB895lAsCOJxq59814 CtdwaiPyrvWeoSKTlco1RG82mzsI9wU7NpNKglHgUlpU35TxOYIKoWdm+Ro56OWTuVrK 9B0YlB0G/2v5AK+sdKh8+WAIlxOdOdDB6kTFG225V6fs97EF6NMB4cqGQ7BfDG0rdflR UbrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HvojMY9C; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id pj25si11239901ejb.265.2019.05.23.03.52.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:52:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HvojMY9C; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33534 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTlKY-0002Vm-0Y for patch@linaro.org; Thu, 23 May 2019 06:52:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl2o-0004Qm-JL for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTl2n-0006el-HO for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:54 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:40333) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTl2k-0006bj-L3 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:50 -0400 Received: by mail-wr1-x444.google.com with SMTP id f10so5685835wre.7 for ; Thu, 23 May 2019 03:33:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PsZHZmw3xAVptlffZztwV7zF9bHQW1aIOcTlgJe374I=; b=HvojMY9Cf7/Y6wOfRmYPD/U95c8vR+ouLycol6OmCvb0b3baeAG+VMqbHFcMijrwYz 5W64RIp92X4UMV0ZL2VZAL8TF/u4LKQtlfGxyfHeYizS+ktu+aeN7O3ncv0SK++dgJGo lhhR8k5kQy6b/ZlLOiBKxVhdIoRmYkp3UNVN1aMYu0E+yMG736AxlbJ8alcDftYl5HTP dvQH/4hzeIqWsz4bJD9/qxb7qKbJpa0nMYMQWVfZ30yCphvT8BiFa0J7YhhIY+imOn5s 1avT49dU1V+5/QYTEnZIe1RW28AmHCcgKpJwAEgtPv2buKo+ex11ZAGu2v3U5Ya5yyGA xB4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PsZHZmw3xAVptlffZztwV7zF9bHQW1aIOcTlgJe374I=; b=IRDnZX0YT/SUL8nmPYtjK/PNgon7tXp99uLPhMSd5PgxJRGHJy6bJr3mHhWpw4XL3d A/GHW/aAo3TjTBUQ1hBCPqb1AB4GeqOjK91CDOkhW57M7DZ55s4QPnJn21asnjwBermh bqu+k2+JRaRhjalSm10qWR4dEMtn0PuhJ+BGFo2r2HQsDLHShnOAZpFrHjY2flDH3kMC OAQirRGvm8KtkvEuMkFEM16goaCaVycGiEF1wDD3z1JLa//FXqMQFeISWAzn9rc/S/Yy MsKJ3zdWmrGYW42CgsaXN0SGyM7CoMSc8Z6TLfjhaNQT49hKU8/1rCzh7pPI3eVjJbdk 8KSQ== X-Gm-Message-State: APjAAAXeGy2Sdsv3Helam/rVvDoROjob6ehUuqV6Fm85A+OAOrGeb/BY 4GtX/0gEriykhjdTNav3aKxoEw== X-Received: by 2002:adf:dc4a:: with SMTP id m10mr58839475wrj.0.1558607628719; Thu, 23 May 2019 03:33:48 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id l16sm44115770wrb.40.2019.05.23.03.33.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:33:45 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8DEF01FF8F; Thu, 23 May 2019 11:25:34 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:28 +0100 Message-Id: <20190523102532.10486-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 Subject: [Qemu-devel] [PATCH v2 24/28] Makefile: include per-target build directories in coverage report X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/Makefile b/Makefile index 40561993c40..e8a886aac79 100644 --- a/Makefile +++ b/Makefile @@ -998,7 +998,9 @@ $(filter %.1 %.7 %.8,$(DOCS)): scripts/texi2pod.pl %/coverage-report.html: @mkdir -p $* $(call quiet-command,\ - gcovr -r $(SRC_PATH) --object-directory $(BUILD_DIR) \ + gcovr -r $(SRC_PATH) \ + $(foreach t, $(TARGET_DIRS), --object-directory $(BUILD_DIR)/$(t)) \ + --object-directory $(BUILD_DIR) \ -p --html --html-details -o $@, \ "GEN", "coverage-report.html") From patchwork Thu May 23 10:25:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164992 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2010941ili; Thu, 23 May 2019 03:54:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQpz9s6+h6YCTvza9tlH9TL9DPQm2VsuKYsbcYlnT0keWXyApNrcUXr+0raJz+T6VO5w7h X-Received: by 2002:a50:893d:: with SMTP id e58mr92552384ede.244.1558608841213; Thu, 23 May 2019 03:54:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558608841; cv=none; d=google.com; s=arc-20160816; b=TSkxaRsYCQvWLg2c1ddOvKRynN/GUvZDdU0kOeSvppDHMrc3VEGtik7UCZMfM1/ey5 kERSDX+YykxnRcSkclQRYOs6S0DlgPwUvng/9d3kxJyEHwQAkrkDNkpmVTx6N+rd1fyk 2tgzEPgjtO/gXmxWNqwriYKfoZJ1j3XIkC1CNnMP7cIpUBKbfQotLl1x+8z+vjG8p2KN u9HVZnmufSKfsaskrcWUsW5qLfusU4fUC3yvqBSegEdDe+swj/+5fNT2lue8jPpbOm8k c61iq3+FMKQVb/bQZfPXTRWYw0r4vi3BdgMqK3j6vGWwjFJF1wIbgQZXHv6/dDHJn5w5 OeuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=taVCGQXYe9mSal2L1Nl6ndCabOIar1+JnkxJyTbWwQY=; b=vUSbx8J1caxTpJXf8cCh9smWavgzrhpQrj0yJIL6sqRiFAb/5xay9vtxSahXYZ+Dzc fvklAWIX6v69WUqArwqh+G11I6JxIN50rxaAebcTbZIojOW+Y5b0RGajuN3Dpy0E5PE7 hBCBlNl7M/DH7BFcT4HmXHZMXhfMOjFFp3tElS4PA2uAw6jTPclwBe1wHCyXALirYDHx gE3db6SHUlmqiwyo8SYsoQziKB0UdhuJl1znbb06UdKY79CE7IUuiPCYukukwc76Tq1D PIGRGSIUvokpNtVUzvnn6UN6Mc1DejWxI3hGODnBBLtA/oijqFyGHuosaVLX5v9cd2GM J4Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VYzBIefg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b9si5824540eda.111.2019.05.23.03.54.00 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:54:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VYzBIefg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTlMG-0004YX-7w for patch@linaro.org; Thu, 23 May 2019 06:54:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl2n-0004P6-Gm for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTl2i-0006b4-RL for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:50 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:34541) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTl2g-0006Z0-V7 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:48 -0400 Received: by mail-wr1-x441.google.com with SMTP id f8so5699494wrt.1 for ; Thu, 23 May 2019 03:33:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=taVCGQXYe9mSal2L1Nl6ndCabOIar1+JnkxJyTbWwQY=; b=VYzBIefgOt3hxUUJStj0ZuIbzWDXCdvafworTfnTNKHONkJIIi/Bl5S3pR5o3E2W2p nN95Z2MgEEaOnNDte0OFZyF8qRvZ5dLHAa26QBjpWmoWxm/7R/KW/XRodsRfSKwYh9Ay yhfnDKVhUfIJC+w/SbeRwcKe+kQ6PwQz2LQEMp6d6WOirFjknkpofkBq9zkh9PlihZ9o F1o0Jhvw6p6pxkqNjKO/r1NThlgnqus6Ts5267aulvbIkH2sVPufxt73Z9igFc7h+Y7A aPcdkfzn7PmdDH9BOYlb15EVmZ6Gw3hcAOhOqJkMjda+FIdUqBobky4FEBLDNHKvaBR0 GiqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=taVCGQXYe9mSal2L1Nl6ndCabOIar1+JnkxJyTbWwQY=; b=gfDMtNnEktVeV05W83//2+PPS7JUVG4HvjRE3wXaz3GTqrJ7X8vrt8amGOXjFhKDzX CS1d5f7SJm26kARh2vE4AlkfgT4JIch8pBYQxdVRgEAdlurvkhHclWibTtzsCZ/vwhjA fkSZmr5ri8R8yFlYE82X+IF0PMltMVXFn8rlub/QdL20hK1sHybvV1znY6DgX0jsLBSc p98LxgCdussxVWIqHIlbuW6/waMzQNm8Pb5nRVqhRo5dQ/ym58Z0LwhvC/wHbaKP2yA3 JEytF2VcdY4JYACjXpkNAdEN64Bx1rD1oFBLcQm3ihiut/7ArFvCyJPky6u7sR2jp3PS l2zQ== X-Gm-Message-State: APjAAAU5Wq9YyStYOSKjVsO6tQLimwJhW4OPrQdvOdV2PTg9jKu5aMuS ig4+lyGwVusGTZalpYJa4sNggg== X-Received: by 2002:a5d:6408:: with SMTP id z8mr134299wru.238.1558607625140; Thu, 23 May 2019 03:33:45 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d17sm23214216wrw.18.2019.05.23.03.33.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:33:43 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A48B31FFAC; Thu, 23 May 2019 11:25:34 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:29 +0100 Message-Id: <20190523102532.10486-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [PATCH v2 25/28] Makefile.target: support per-target coverage reports X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Add support for generating a single targets coverage report. Execute: make coverage-report In the target build directory. This coverage report only cares about target specific blobs so only searches the target build subdirectory. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- Makefile.target | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- 2.20.1 diff --git a/Makefile.target b/Makefile.target index fdbe7c89f4a..328c37902ea 100644 --- a/Makefile.target +++ b/Makefile.target @@ -238,3 +238,19 @@ endif generated-files-y += config-target.h Makefile: $(generated-files-y) + +# Reports/Analysis +# +# The target specific coverage report only cares about target specific +# blobs and not the shared code. +# + +%/coverage-report.html: + @mkdir -p $* + $(call quiet-command,\ + gcovr -r $(SRC_PATH) --object-directory $(CURDIR) \ + -p --html --html-details -o $@, \ + "GEN", "coverage-report.html") + +.PHONY: coverage-report +coverage-report: $(CURDIR)/reports/coverage/coverage-report.html From patchwork Thu May 23 10:25:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164996 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2014861ili; Thu, 23 May 2019 03:58:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+ZnuTuPK2x9r5l0P6wQk3teq9TAM5iDEoyeGFkwXkJXkXYKtpSMEdVNxyzYQ5J+maR9DA X-Received: by 2002:aa7:c483:: with SMTP id m3mr66429106edq.161.1558609114512; Thu, 23 May 2019 03:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558609114; cv=none; d=google.com; s=arc-20160816; b=tsTDDHGq5KSAZUaQ95Au0yDpk7UHP4ZQGYdfSUA72WjRI3zIKIZ1rN5VCrTeJ4yNk8 7/U5QQOHsFZD/MmgbnaRnFRy2HYJADrZsrUeWbntbBMlmUWWE4uYAWoF7GYn7jQECOmJ SAm+ma1v319wsWLnSGwM4fhY0HVg6zsRBaWgpBVC84odcZyLcmaUnH2FzyDoFd35vROX vv9c8SC35EFT6xVPTS75LoxS1rLz087Dx4+pQts9kNNrxBuTySpanHkny1NnHCR3i9P+ N65AoCWoH6KiGxTFvgvXNczGPXEig9ibvy0rU1yI5wxbhNq5xPOh4FDpJndq7jy2HGIu SxDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=DsAUkAOZNApYzC2aBxAHlrW99wLWKzd8gRi+aiqtIvk=; b=eGewQDMK4YK+m8L8AFbL+wzBSOOqgTbl2WayIALV64OO+PkiV92dycBdOz1SrnPZ3j WX9TUvX6LV7iRlHVhjtGv9zGxQ4RQbfOEpBJljEtnVJVlJ1ro5GtPY6Kvu/RW34EHYy9 qAAJO5uAfNtGftuIy/Fi4FgNqZnYH0tQ4qvxm3o3oy6nqw8esBEU8lbDT0r9+ZVTsYTT y1wlf+EmCeSpYU/jMlNwEgudUPEXbqi9kyj6K+YC7rENNNek4iUK7TEInkyXegmqEsGw IjqQ94CBsH5ri/NmQR4fLJ3+HFxEiKngVEOh14KCs7mj3n5sdLMD3/v+/j9mOh4QJeKs 9dMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gk4HCNZl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a45si914045eda.161.2019.05.23.03.58.34 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:58:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gk4HCNZl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33647 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTlQf-0000Bb-En for patch@linaro.org; Thu, 23 May 2019 06:58:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl2o-0004QJ-F8 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTl2j-0006cH-Kn for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:52 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:50290) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTl2i-0006aG-S2 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:49 -0400 Received: by mail-wm1-x343.google.com with SMTP id f204so5262601wme.0 for ; Thu, 23 May 2019 03:33:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DsAUkAOZNApYzC2aBxAHlrW99wLWKzd8gRi+aiqtIvk=; b=gk4HCNZlwkz3FDRgWCgdqmOalX7yU8Wzd9G3uelOtH35lEESH2Eofta7/m7HGeBEV0 /zvmRfy1cJm9Kbh1ZSFolb2bpwnVGn6UY+gpfuOQGIMwY5OpfWmBmm/21J52Frrer0Su t7T4BUcFudr1eoxpZV1g9JNbJK5UvOlFEoZbCzNsQ97/NyQGS7zX3bGotMhCs9hUb3v0 52rLzGYsMMori778zpcwPPxKcCGXb0Ob7tx9ZtPBhmm7mB7zitZI+eDSQYKK8KPCGSIp FNbJ/RWpaqMHWv1QfZ9nYFZ/ce34nrZ1nutDqCIiZoe0rLGYEa3WpHCF2Bchbxn3hhX0 9aIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DsAUkAOZNApYzC2aBxAHlrW99wLWKzd8gRi+aiqtIvk=; b=TQFsdcAq632CgVPdxd1EF55lSYOcI72y9HAYprwse63thuLTVVriBYthlXzkKDYX+/ mF6WcanTGp8io0r9eNApv2FBt7AZhars6hXP+OAXzSd1TiU6UxZKbxcBEjPizzybtIcA 23pUGvkttkgdSkgReKEiPiRUKw/fhNWKM1S1+ZKV2rjJMo4jtbr4Q6NiuAaxGb7Zik4c R+/Wz3TQ9PnMuEe5mTFNxV3C7C88Zct52kqGHl/Xh6FzGG6xqAIm5sZ+5h8smnE+AJL/ i8ClHozBTTnZKifZgx7J2PiHI/HQgDbjYyqU1FRbn5vsAtJaAVB+Agv1nXt5qqO2dv2v t8XA== X-Gm-Message-State: APjAAAVI4v21uBr1y6I1otrtWPTXLxAZCdvAeJTAV4CLh1hMhDDho7IC WYQP7LWPH5n2wpnoRhDNVOD46Q== X-Received: by 2002:a1c:2c89:: with SMTP id s131mr10816600wms.142.1558607627284; Thu, 23 May 2019 03:33:47 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id h12sm19816075wre.14.2019.05.23.03.33.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:33:44 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BBAF61FFAE; Thu, 23 May 2019 11:25:34 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:30 +0100 Message-Id: <20190523102532.10486-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 Subject: [Qemu-devel] [PATCH v2 26/28] tests/qemu-iotests/group: Re-use the "auto" group for tests that can always run X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , "open list:Block layer core" , Max Reitz , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth Currently, all tests are in the "auto" group. This is a little bit pointless. OTOH, we need a group for the tests that we can automatically run during "make check" each time, too. Tests in this new group are supposed to run with every possible QEMU configuration, for example they must run with every QEMU binary (also non-x86), without failing when an optional features is missing (but reporting "skip" is ok), and be able to run on all kind of host filesystems and users (i.e. also as "nobody" or "root"). So let's use the "auto" group for this class of tests now. The initial list has been determined by running the iotests with non-x86 QEMU targets and with our CI pipelines on Gitlab, Cirrus-CI and Travis (i.e. including macOS and FreeBSD). Signed-off-by: Thomas Huth Message-Id: <20190502084506.8009-7-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/qemu-iotests/group | 177 +++++++++++++++++++++------------------ 1 file changed, 95 insertions(+), 82 deletions(-) -- 2.20.1 diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index 52b7c16e155..2c74deec00e 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -1,8 +1,21 @@ # # QA groups control file # Defines test groups +# +# Some notes about the groups: +# # - do not start group names with a digit # +# - quick : Tests in this group should finish within some few seconds. +# +# - img : Tests in this group can be used to excercise the qemu-img tool. +# +# - auto : Tests in this group are used during "make check" and should be +# runnable in any case. That means they should run with every QEMU binary +# (also non-x86), with every QEMU configuration (i.e. must not fail if +# an optional feature is not compiled in - but reporting a "skip" is ok), +# and work all kind of host filesystems and users (e.g. "nobody" or "root"). +# # # test-group association ... one line per test @@ -32,11 +45,11 @@ 023 rw auto 024 rw backing auto quick 025 rw auto quick -026 rw blkdbg auto +026 rw blkdbg 027 rw auto quick -028 rw backing auto quick +028 rw backing quick 029 rw auto quick -030 rw auto backing +030 rw backing 031 rw auto quick 032 rw auto quick 033 rw auto quick @@ -46,35 +59,35 @@ 037 rw auto backing quick 038 rw auto backing quick 039 rw auto quick -040 rw auto -041 rw auto backing +040 rw +041 rw backing 042 rw auto quick 043 rw auto backing -044 rw auto -045 rw auto quick +044 rw +045 rw quick 046 rw auto aio quick 047 rw auto quick 048 img auto quick 049 rw auto 050 rw auto backing quick -051 rw auto +051 rw 052 rw auto backing quick 053 rw auto quick 054 rw auto quick -055 rw auto -056 rw auto backing -057 rw auto -058 rw auto quick +055 rw +056 rw backing +057 rw +058 rw quick 059 rw auto quick 060 rw auto quick 061 rw auto 062 rw auto quick 063 rw auto quick 064 rw auto quick -065 rw auto quick +065 rw quick 066 rw auto quick -067 rw auto quick -068 rw auto quick +067 rw quick +068 rw quick 069 rw auto quick 070 rw auto quick 071 rw auto quick @@ -91,18 +104,18 @@ 082 rw auto quick 083 rw auto 084 img auto quick -085 rw auto +085 rw 086 rw auto quick -087 rw auto quick +087 rw quick 088 rw auto quick 089 rw auto quick 090 rw auto quick 091 rw auto migration 092 rw auto quick -093 auto +093 throttle 094 rw auto quick -095 rw auto quick -096 rw auto quick +095 rw quick +096 rw quick 097 rw auto backing 098 rw auto backing quick 099 rw auto quick @@ -118,60 +131,60 @@ 109 rw auto 110 rw auto backing quick 111 rw auto quick -112 rw auto +112 rw 113 rw auto quick 114 rw auto quick -115 rw auto +115 rw 116 rw auto quick 117 rw auto -118 rw auto +118 rw 119 rw auto quick 120 rw auto quick -121 rw auto +121 rw 122 rw auto 123 rw auto quick -124 rw auto backing -125 rw auto +124 rw backing +125 rw 126 rw auto backing -127 rw auto backing quick +127 rw backing quick 128 rw auto quick -129 rw auto quick +129 rw quick 130 rw auto quick 131 rw auto quick -132 rw auto quick +132 rw quick 133 auto quick 134 rw auto quick 135 rw auto -136 rw auto +136 rw 137 rw auto 138 rw auto quick -139 rw auto quick +139 rw quick 140 rw auto quick 141 rw auto quick 142 auto 143 auto quick -144 rw auto quick -145 auto quick +144 rw quick +145 quick 146 auto quick -147 auto -148 rw auto quick -149 rw auto sudo +147 img +148 rw quick +149 rw sudo 150 rw auto quick -151 rw auto -152 rw auto quick -153 rw auto quick +151 rw +152 rw quick +153 rw quick 154 rw auto backing quick -155 rw auto +155 rw 156 rw auto quick -157 auto +157 quick 158 rw auto quick 159 rw auto quick 160 rw auto quick 161 rw auto quick -162 auto quick -163 rw auto -165 rw auto quick -169 rw auto quick migration +162 quick +163 rw +165 rw quick +169 rw quick migration 170 rw auto quick 171 rw auto quick 172 auto @@ -180,74 +193,74 @@ 175 auto quick 176 rw auto backing 177 rw auto quick -178 auto +178 img 179 rw auto quick 181 rw auto migration -182 rw auto quick -183 rw auto migration +182 rw quick +183 rw migration 184 rw auto quick -185 rw auto +185 rw 186 rw auto 187 rw auto -188 rw auto quick -189 rw auto +188 rw quick +189 rw 190 rw auto quick 191 rw auto 192 rw auto quick -194 rw auto migration quick +194 rw migration quick 195 rw auto quick -196 rw auto quick migration +196 rw quick migration 197 rw auto quick -198 rw auto -199 rw auto migration -200 rw auto +198 rw +199 rw migration +200 rw 201 rw auto migration -202 rw auto quick -203 rw auto migration -204 rw auto quick -205 rw auto quick -206 rw auto +202 rw quick +203 rw migration +204 rw quick +205 rw quick +206 rw 207 rw auto -208 rw auto quick -209 rw auto quick +208 rw quick +209 rw quick 210 rw auto 211 rw auto quick 212 rw auto quick 213 rw auto quick 214 rw auto 215 rw auto quick -216 rw auto quick +216 rw quick 217 rw auto quick -218 rw auto quick -219 rw auto +218 rw quick +219 rw 220 rw auto 221 rw auto quick -222 rw auto quick -223 rw auto quick -224 rw auto quick +222 rw quick +223 rw quick +224 rw quick 225 rw auto quick 226 auto quick -227 auto quick -228 rw auto quick +227 quick +228 rw quick 229 auto quick 231 auto quick -232 auto quick +232 quick 233 auto quick -234 auto quick migration -235 auto quick -236 auto quick +234 quick migration +235 quick +236 quick 237 rw auto quick -238 auto quick +238 quick 239 rw auto quick -240 auto quick +240 quick 241 rw auto quick -242 rw auto quick +242 rw quick 243 rw auto quick 244 rw auto quick -245 rw auto -246 rw auto quick -247 rw auto quick -248 rw auto quick +245 rw +246 rw quick +247 rw quick +248 rw quick 249 rw auto quick 252 rw auto backing quick 253 rw auto quick From patchwork Thu May 23 10:25:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164989 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2009203ili; Thu, 23 May 2019 03:51:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqySkg2OeY6o7r2G1q2jU9zMuj2txukpiVqBItIBNOr3FXjJThUzny+wWDc3YzZnBhmDBKOT X-Received: by 2002:a17:906:8318:: with SMTP id j24mr62760549ejx.182.1558608713969; Thu, 23 May 2019 03:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558608713; cv=none; d=google.com; s=arc-20160816; b=bIx3onlQ1KVcFnF2ie4U0zy0HN2UiL56aZkToz1iqItBnpC5i0Ir4Sa5ULY19bKp1D TaSRfpjTnfSCAlXRETd6uDbzrjHdET3SI/NQfMIxqzPD++r9RUyyZ6LUsGi6H0zlTdhF aAYDKDqfFCHh0+l87LDQwINxLzRv8TuZKZ70nE/UacDYIXCi1zF9AhYkxfGixIdyxbu7 8+UZEzOnk9nq4iMWrgbfRrKc2Xnfj0/QC2fd/mhAq64Ut8NeLD4HX3M4JVHDZUONEQt1 WjJ7baZaHJCF3rgzpkswBktGQGM/x1aH2iEl2rFvSILMryDiuq2u3wc4Mu3p0D7HuOz1 YqWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=51qhdwAV6xax9lXPuidlfodA4doIzJZloRA4iy8CUcw=; b=PnTHfsGUZ9aY3CYyVWExZJUK/vg7RSPB36hE4X8OH3n6u28XSB99tEObabfgSr9xXX jtgxxS8eNgJzUflvzmwIoxZbMVApadd7cWJCxnofPTeO/CUes2nZBv6qwqe86zbwZCbA 4EoQWKOJzb5FhvnZEzTYRDAl1OaZ2xTDJ2kMHDyb1VxKZVmLqN44OHoecPXmjxA6wPVK zbVtgJzqWvd5Grtp+AO3kHXBkpU3pCjCVAZQ+JZiaXyVrwICzD/iWmWbGxuFnEBhVRCs dPnSVFL3u+Ep56eIcmXGGoLSRXjlZp4bmqpqBiLYrGmaKCFujVNbm8n1DhkvjMhbisM+ tO0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xv9Q4JLk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e45si11826620eda.383.2019.05.23.03.51.53 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:51:53 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xv9Q4JLk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTlK1-0002RY-VI for patch@linaro.org; Thu, 23 May 2019 06:51:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl2i-0004LW-Sq for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTl2h-0006Zt-05 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:48 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:52367) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTl2g-0006YZ-Np for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:46 -0400 Received: by mail-wm1-x32d.google.com with SMTP id y3so5270645wmm.2 for ; Thu, 23 May 2019 03:33:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=51qhdwAV6xax9lXPuidlfodA4doIzJZloRA4iy8CUcw=; b=xv9Q4JLkl3F+FEBn90oSI9NE0WaX9WV6XE025Kfxl2mX6T/+pcieNKO/yw65r2i+Gv kNyd/ul3WmFUKvCOFyBPfybkhRMGOQ003KFCCq5rMqoj2kfm3OocydZ1C5cICwV3GxSk YlLc4Ecq9VpaKX0/gtvf0e3retRGwWxQIUyolUVmybUBJb+xX0gR+g2n/Bok/1e6BDzq Ch8xK8cMpXwON20lP92id1mgvNN4oVlX+3fc7w7+8/SlbqyxXllarbxttqL+9Mw2PW+M Qku2Jj7myqra+z7Tzmsld0Mf6PMt4lWjEqWuuWm0Nt1ml5x0Bj31miuiPISbb7pHC8Qp 9yDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=51qhdwAV6xax9lXPuidlfodA4doIzJZloRA4iy8CUcw=; b=TAq3Isi0KfimdJHBB/DCnxaElwYIVh5uYUcSHotjnsFc31AOkLKvHs/5e+1HaVBVda 3rkzJSHfgVsYSwEwEyk4Rlub5FqITchIrdY6Pst/hmuwPzPrPt5yQgfPV9D0mhY+b8ED R6M0RYAxmtu+IVDjM5beMPmwqNvZC4J2uHbNoNqruAff5vpCoKMuTmF3gHXYW6dS7QWy uXpDI7XwmR0YWyiQ2jVMTPd/U43rozlNDZ0WzcLQSy5YDBpmvBTALwzj8symtyvKdxOp YFnzMpRJy5ToMSJekqX+FEmUgUKix1pNS+0g5sinS7P/zVgeYgAtamWqwK9GMpBd5syP 2YGA== X-Gm-Message-State: APjAAAXnmUFxX9sPCA+SzixmPLELnBM6Fh0+vZ1oRJldemvUWxRH3nG0 +79fxo/J6wHQbTVED/8dPwrGGw== X-Received: by 2002:a1c:f916:: with SMTP id x22mr10550301wmh.81.1558607624059; Thu, 23 May 2019 03:33:44 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id g127sm8495576wme.21.2019.05.23.03.33.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:33:42 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D23FD1FFAF; Thu, 23 May 2019 11:25:34 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:31 +0100 Message-Id: <20190523102532.10486-28-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d Subject: [Qemu-devel] [PATCH v2 27/28] tests/qemu-iotests: re-format output to for make check-block X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , "open list:Block layer core" , Max Reitz , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This attempts to clean-up the output to better match the output of the rest of the QEMU check system when called with -makecheck. This includes: - formatting as " TEST iotest-FMT: nnn" - only dumping config on failure (when -makecheck enabled) The non-make check output has been cleaned up as well: - line re-displayed (\r) at the end - fancy colours for pass/fail/skip - timestamps always printed (option removed) Signed-off-by: Alex Bennée Message-Id: <20190503143904.31211-1-alex.bennee@linaro.org> Tested-by: Thomas Huth --- v3 - revert echo to printf - add _report_test_start v4 - -pretty -> -makecheck - keep all output together for makecheck v5 - merged in kwolf's pretty printing - timestamps always printed in non-makecheck mode --- tests/qemu-iotests/check | 179 +++++++++++++++++++++++++-------------- 1 file changed, 116 insertions(+), 63 deletions(-) -- 2.20.1 diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 922c5d1d3d3..f46b90dbbf4 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -27,9 +27,7 @@ bad="" notrun="" casenotrun="" interrupt=true - -# by default don't output timestamps -timestamp=${TIMESTAMP:=false} +makecheck=false _init_error() { @@ -88,6 +86,22 @@ _full_platform_details() echo "$os/$platform $host $kernel" } +_full_env_details() +{ + cat </dev/null 2>&1 && diff=xxdiff fi ;; - + -makecheck) # makecheck friendly output + makecheck=true + xpand=false + ;; -n) # show me, don't do it showme=true xpand=false @@ -416,11 +433,6 @@ testlist options cachemode=true xpand=false ;; - -T) # turn on timestamp output - timestamp=true - xpand=false - ;; - -v) verbose=true xpand=false @@ -633,12 +645,6 @@ _wallclock() date "+%H %M %S" | awk '{ print $1*3600 + $2*60 + $3 }' } -_timestamp() -{ - now=$(date "+%T") - printf %s " [$now]" -} - _wrapup() { if $showme @@ -704,23 +710,54 @@ END { if (NR > 0) { trap "_wrapup; exit \$status" 0 1 2 3 15 +# Report the test start and results. For makecheck we want to pretty +# print the whole report at the end of the execution. +# args: $seq, $starttime, $lasttime +_report_test_start() +{ + if ! $makecheck; then + if [ -n "$3" ]; then + local lasttime=" (last: $3s)" + fi + printf "%-8s %-10s [%s] %4s%-14s\r" "$1" "..." "$2" "..." "$lasttime" + fi +} +# args:$seq $status $starttime $lasttime $thistime $details +_report_test_result() +{ + local status lasttime thistime + if $makecheck; then + if [ -n "$2" ] && [ "$2" != "pass" ]; then + status=" [$2]" + fi + printf " TEST iotest-$IMGFMT: %s%s\n" "$1" "$status" + return + fi + + if [ -n "$4" ]; then + lasttime=" (last: $4s)" + fi + if [ -n "$5" ]; then + thistime=" $5s" + fi + case "$2" in + "pass") status=$(printf "\e[32m%-10s\e[0m" "$2") ;; + "fail") status=$(printf "\e[1m\e[31m%-10s\e[0m" "$2") ;; + "not run") status=$(printf "\e[33m%-10s\e[0m" "$2") ;; + *) status=$(printf "%-10s" "$2") ;; + esac + + printf "%-8s %s [%s] [%s] %4s%-14s %s\n" "$1" "$status" "$3" "$(date '+%T')" "$thistime" "$lasttime" "$6" +} + [ -f $TIMESTAMP_FILE ] || touch $TIMESTAMP_FILE FULL_IMGFMT_DETAILS=$(_full_imgfmt_details) FULL_HOST_DETAILS=$(_full_platform_details) -cat < $TESTS_REMAINING_LOG.tmp mv $TESTS_REMAINING_LOG.tmp $TESTS_REMAINING_LOG sync fi + lasttime=$(sed -n -e "/^$seq /s/.* //p" <$TIMESTAMP_FILE) + starttime=$(date "+%T") + _report_test_start $seq $starttime $lasttime + if $showme then - echo - continue + status="not run" elif [ -f expunged ] && $expunge && egrep "^$seq([ ]|\$)" expunged >/dev/null then - echo " - expunged" + status="not run" + results="expunged" rm -f $seq.out.bad echo "/^$seq\$/d" >>$tmp.expunged elif [ ! -f "$source_iotests/$seq" ] then - echo " - no such test?" + status="not run" + results="no such test?" echo "/^$seq\$/d" >>$tmp.expunged else # really going to try and run this one # rm -f $seq.out.bad - lasttime=$(sed -n -e "/^$seq /s/.* //p" <$TIMESTAMP_FILE) - if [ "X$lasttime" != X ]; then - printf %s " ${lasttime}s ..." - else - printf " " # prettier output with timestamps. - fi rm -f core $seq.notrun rm -f $seq.casenotrun start=$(_wallclock) - $timestamp && printf %s " [$(date "+%T")]" if [ "$(head -n 1 "$source_iotests/$seq")" == "#!/usr/bin/env python" ]; then run_command="$PYTHON $seq" @@ -781,26 +819,26 @@ do $run_command >$tmp.out 2>&1) fi sts=$? - $timestamp && _timestamp stop=$(_wallclock) if [ -f core ] then - printf " [dumped core]" mv core $seq.core + status="fail" + results="[dumped core] $seq.core" err=true fi if [ -f $seq.notrun ] then - $timestamp || printf " [not run] " - $timestamp && echo " [not run]" && printf %s " $seq -- " - cat $seq.notrun - notrun="$notrun $seq" + # overwrites timestamp output + status="not run" + results="$(cat $seq.notrun)" else if [ $sts -ne 0 ] then - printf %s " [failed, exit status $sts]" + status="fail" + results=$(printf %s "[failed, exit status $sts]") err=true fi @@ -821,22 +859,23 @@ do if [ ! -f "$reference" ] then - echo " - no qualified output" + status="fail" + reason="no qualified output" err=true else if diff -w "$reference" $tmp.out >/dev/null 2>&1 then - echo "" - if $err - then - : - else - echo "$seq $(expr $stop - $start)" >>$tmp.time + if ! $err; then + status="pass" + thistime=$(expr $stop - $start) + echo "$seq $thistime" >>$tmp.time fi else - echo " - output mismatch (see $seq.out.bad)" mv $tmp.out $seq.out.bad $diff -w "$reference" "$PWD"/$seq.out.bad + status="fail" + results="output mismatch (see $seq.out.bad)" + printdiff=true err=true fi fi @@ -850,13 +889,27 @@ do # come here for each test, except when $showme is true # - if $err - then - bad="$bad $seq" - n_bad=$(expr $n_bad + 1) - quick=false - fi - [ -f $seq.notrun ] || try=$(expr $try + 1) + _report_test_result $seq "$status" "$starttime" "$lasttime" "$thistime" "$results" + case "$status" in + "pass") + try=$(expr $try + 1) + ;; + "fail") + try=$(expr $try + 1) + if $makecheck; then + _full_env_details + fi + if $printdiff; then + $diff -w "$reference" "$PWD"/$seq.out.bad + fi + bad="$bad $seq" + n_bad=$(expr $n_bad + 1) + quick=false + ;; + "not run") + notrun="$notrun $seq" + ;; + esac seq="after_$seq" done From patchwork Thu May 23 10:25:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 164994 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2012905ili; Thu, 23 May 2019 03:56:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyljEvsqcUI2VxIK2BkuX2dvp/W9YH1NNY399aIlx/eBdj+kqj77VTwihcCQNHFZ231Gxam X-Received: by 2002:aa7:c391:: with SMTP id k17mr96069473edq.166.1558608981049; Thu, 23 May 2019 03:56:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558608981; cv=none; d=google.com; s=arc-20160816; b=y3i/4wpbpzlqxiQTl81u3fnFZfcAgUZCS/OTDFjDmBuTC8omVlKzzCldL6wBKp5dfs nB53t16dr8Wp9GWcrzJj60E7rdqh2Tph8OiAYhP1SFWKUiI/OfI9euZzUEEwUWBVdRg7 qbSNGoqShVxRcGwM0xjaFoEu89eGsiOs++sY7I7ThfvFNgjBvZGqFhSqe2XiSYr16WJp 3zLNu0g+vs0IF/5ynuRQreVgvGbJ55czYEwmMoK5Ir9CyW9vBUMa/l3oVcoNhNAjycVD 6sfEwu5r34lrQiSJZ7ViWvu0YgKEFlvIZgGRroUaEzRoPQeMVCn4j8tTCRQdFZJ1+5Sy 27eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=PPLFa9NHnZbGHQDGEn1CiaHDLKyObQdBVLbTqFMD65I=; b=mtEy2YR7QUuozQPEvc1tyIO8ueq7r+ANbgAeJYILUQstth6IUFFG7GECs0S6sDGNg4 UCyxL5qTJqJr6jgNi93o6MBH4mAamGAKGO+xmzEi+k6jDKdx0zW+sXyjsd82P8chStin LxNM1xQXqhP+CNDxioBObl2KcrdhcdgWIsMD9BvyzNdGL/j20LmcmG9m9g/i66SlLiCS RhxtMUPRWOKt56e7TM17XPlWzVh2QWINuIFdhFZGI/XeUrjaBqMgFkrv0MNowtsIiqsP VZAeMucTNZgw5QoP1xIL2vA4SLN3DIeDiojZBSaVa7rK5jPGwlfakS5d9qM8EAnE7TuJ lZ1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UrhfoS6y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d1si5311494eja.12.2019.05.23.03.56.20 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:56:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UrhfoS6y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33604 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTlOW-0006eb-0H for patch@linaro.org; Thu, 23 May 2019 06:56:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTl2o-0004QR-Fe for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTl2j-0006cB-K6 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:52 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:41519) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTl2i-0006Zb-Rn for qemu-devel@nongnu.org; Thu, 23 May 2019 06:33:48 -0400 Received: by mail-wr1-x441.google.com with SMTP id u16so1791958wrn.8 for ; Thu, 23 May 2019 03:33:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PPLFa9NHnZbGHQDGEn1CiaHDLKyObQdBVLbTqFMD65I=; b=UrhfoS6yD/ssfJEXN98OQOJOqBmW6pWncL9HjqyZlaetSIkoxAH02lhYDAJXSBmy37 0EPmcL5BJTkshsNDztc+ddChg6Hph1hAVjPyzlLbvMu1FqrVYD3Fwu2fbB74dKSoZqQF D6+ylCd7PlZTEpwLtGntTrCmGou81xClPvElcSMIjU82gW3eBeH1y0PCeLXtixw18tyW kJ1n9fjjonaBOogkEM61gjo8TKTJrjJOQEjOHvUXP5bf6JAbLqGWd+TfsFgv7kIkp/yy nQeLPvHW7FH9TGrfisP4OW46IOSDsBhQ5IVZVxsB82L09oRghVDTbRMfiwvI8kvj1fo1 ZWmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PPLFa9NHnZbGHQDGEn1CiaHDLKyObQdBVLbTqFMD65I=; b=o2aXxXNyGFULZFB5OyXV5RCRnsBWnK/AsR1CUTTFtX9NM83SCTL0YyiaPTo0OmYk3s 9cHEhVYQFcIJWA9HdM87XBwSmY+3wVaSA6nnzvBKboP97NW2QzC+OgkxWxCMUSOvu0Wl cZWEMjP4YNaXrhS+FBjnU+BJEVVV7/GCKhv/+KDRGPWXAOzOlRM4GWBEJBeN4oYduVDK jgxEE9AA0MUNTty8ZQ3tMiVWDanuxqveAy9jO8RnE2T09qymgBi8Eemx9/6RBtpWAgTK wvVRcon9cydtpfRqJ64/c9d18F2J+/XP9537bL1zWOsGRfDFj4ShVz+UrBhn9zv8Smcl Uxxw== X-Gm-Message-State: APjAAAWCkdxlUbbuASaoHP10VAPoXD9PfYabPA4/tyEFkGQ9lJpLvyGF Qw7GLkSiikPRRVHb/TJJMDxqZQ== X-Received: by 2002:adf:978b:: with SMTP id s11mr1197189wrb.169.1558607626407; Thu, 23 May 2019 03:33:46 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id c18sm25591581wrm.7.2019.05.23.03.33.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:33:44 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E9B0C1FFB1; Thu, 23 May 2019 11:25:34 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:32 +0100 Message-Id: <20190523102532.10486-29-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [PATCH v2 28/28] tests: Run the iotests during "make check" again X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , qemu-arm@nongnu.org, =?utf-8?q?Alex_Be?= =?utf-8?b?bm7DqWU=?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth People often forget to run the iotests before submitting patches or pull requests - this is likely due to the fact that we do not run the tests during our mandatory "make check" tests yet. Now that we've got a proper "auto" group of iotests that should be fine to run in every environment, we can enable the iotests during "make check" again by running the "auto" tests by default from the check-block.sh script. Some cases still need to be checked first, though: iotests need bash and GNU sed (otherwise they fail), and if gprof is enabled, it spoils the output of some test cases causing them to fail. So if we detect that one of the required programs is missing or that gprof is enabled, we still have to skip the iotests to avoid failures. And finally, since we are using check-block.sh now again, this patch also removes the qemu-iotests-quick.sh script since we do not need that anymore (and having two shell wrapper scripts around the block tests seem rather confusing than helpful). Signed-off-by: Thomas Huth Message-Id: <20190502084506.8009-8-thuth@redhat.com> [AJB: -makecheck to check-block.sh, move check-block to start&gate it] Signed-off-by: Alex Bennée --- tests/Makefile.include | 8 +++---- tests/check-block.sh | 44 ++++++++++++++++++++++++++++--------- tests/qemu-iotests-quick.sh | 8 ------- 3 files changed, 38 insertions(+), 22 deletions(-) delete mode 100755 tests/qemu-iotests-quick.sh -- 2.20.1 diff --git a/tests/Makefile.include b/tests/Makefile.include index 1865f6b3222..0c6d8c75941 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -140,7 +140,7 @@ check-unit-y += tests/test-uuid$(EXESUF) check-unit-y += tests/ptimer-test$(EXESUF) check-unit-y += tests/test-qapi-util$(EXESUF) -check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh +check-block-$(call land,$(CONFIG_POSIX),$(CONFIG_SOFTMMU)) += tests/check-block.sh # All QTests for now are POSIX-only, but the dependencies are # really in libqtest, not in the testcases themselves. @@ -1077,8 +1077,8 @@ clean-tcg: $(CLEAN_TCG_TARGET_RULES) QEMU_IOTESTS_HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = tests/qemu-iotests/socket_scm_helper$(EXESUF) -.PHONY: check-tests/qemu-iotests-quick.sh -check-tests/qemu-iotests-quick.sh: tests/qemu-iotests-quick.sh qemu-img$(EXESUF) qemu-io$(EXESUF) qemu-nbd$(EXESUF) $(QEMU_IOTESTS_HELPERS-y) +.PHONY: check-tests/check-block.sh +check-tests/check-block.sh: tests/check-block.sh qemu-img$(EXESUF) qemu-io$(EXESUF) qemu-nbd$(EXESUF) $(QEMU_IOTESTS_HELPERS-y) $< .PHONY: $(patsubst %, check-%, $(check-qapi-schema-y)) @@ -1152,7 +1152,7 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR) check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y)) check-tests/qapi-schema/doc-good.texi check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS)) check-block: $(patsubst %,check-%, $(check-block-y)) -check: check-qapi-schema check-unit check-softfloat check-qtest check-decodetree +check: check-block check-qapi-schema check-unit check-softfloat check-qtest check-decodetree check-clean: rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y) rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y)) $(check-qtest-generic-y)) diff --git a/tests/check-block.sh b/tests/check-block.sh index f3d12fd602d..c8b6cec3f68 100755 --- a/tests/check-block.sh +++ b/tests/check-block.sh @@ -1,24 +1,48 @@ #!/bin/sh -FORMAT_LIST="raw qcow2 qed vmdk vpc" +# Honor the SPEED environment variable, just like we do it for the qtests. +if [ "$SPEED" = "slow" ]; then + format_list="raw qcow2" + group= +elif [ "$SPEED" = "thorough" ]; then + format_list="raw qcow2 qed vmdk vpc" + group= +else + format_list=qcow2 + group="-g auto" +fi + if [ "$#" -ne 0 ]; then - FORMAT_LIST="$@" + format_list="$@" +fi + +if grep -q "TARGET_GPROF=y" *-softmmu/config-target.mak 2>/dev/null ; then + echo "GPROF is enabled ==> Not running the qemu-iotests." + exit 0 fi -export QEMU_PROG="$PWD/x86_64-softmmu/qemu-system-x86_64" -export QEMU_IMG_PROG="$PWD/qemu-img" -export QEMU_IO_PROG="$PWD/qemu-io" +if [ -z "$(find . -name 'qemu-system-*' -print)" ]; then + echo "No qemu-system binary available ==> Not running the qemu-iotests." + exit 0 +fi + +if ! command -v bash >/dev/null 2>&1 ; then + echo "bash not available ==> Not running the qemu-iotests." + exit 0 +fi -if [ ! -x $QEMU_PROG ]; then - echo "'make check-block' requires qemu-system-x86_64" - exit 1 +if ! (sed --version | grep 'GNU sed') > /dev/null 2>&1 ; then + if ! command -v gsed >/dev/null 2>&1; then + echo "GNU sed not available ==> Not running the qemu-iotests." + exit 0 + fi fi cd tests/qemu-iotests ret=0 -for FMT in $FORMAT_LIST ; do - ./check -T -nocache -$FMT || ret=1 +for fmt in $format_list ; do + ./check -makecheck -$fmt $group || ret=1 done exit $ret diff --git a/tests/qemu-iotests-quick.sh b/tests/qemu-iotests-quick.sh deleted file mode 100755 index 0e554bb9724..00000000000 --- a/tests/qemu-iotests-quick.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -cd tests/qemu-iotests - -ret=0 -TEST_DIR=${TEST_DIR:-/tmp/qemu-iotests-quick-$$} ./check -T -qcow2 -g quick || ret=1 - -exit $ret