From patchwork Tue May 28 09:49: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: 165277 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8252204ili; Tue, 28 May 2019 02:55:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEUXk39RMmDQJnE+oSkusZDP8or1RlBLlhEfIfEJ1zpjNnrubHiXuODx+Wk5FaAHkdRoP0 X-Received: by 2002:ac8:228e:: with SMTP id f14mr65868286qta.79.1559037353419; Tue, 28 May 2019 02:55:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037353; cv=none; d=google.com; s=arc-20160816; b=qT+vHDpN0rL7OVEmHrmvqwivf1rgO+L9ZUQJtimeQBJon2N/0uKzZck0q55RFi5tNk 1iJyQPksj3VwIZlZfaZldSMqJ8lo8cNv/+KHoAqtAEV72Zyoh9kjsw04C87Pl0ff+2Ac 76FeJmLG228DRq5TaqfWLKg9OZvGfWuc0EkVw4Sk+p0qqfmoDUIq6QmCxBXr4orrN2rC TzWqKs41cK4thNbM64JiMzFtEATK6xPs+QLPKy19/QQ1orexxtRWsXNWmr/IyeOPUfwR yvD+MGzXg1y2bNIkmqalFYITBP8Gnlf9i2ZScOASaJWYyx5KedVuC0y6jPryCqH9gcw2 AnDQ== 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=TyxM8f0bgznD46UNumFr9MU2H3Me2+hTtxb1e2LSXfA=; b=wksBj6q9f/bygq75y2s6MzWZg6GGiXyX+ImXYUVWEn8xqUfmLeBOcRhDh2z3lWwWQ6 t2gDqkbTsdQ9F7e3AXFFM6SxSZQrpCLvHnKgN7vjzq2cniEGwri1OWb2WnQbGLSH/IIG Jv10HMx43Yqj/3JVaoB3SdUsPPi3IefU0n0fItQEPrdvxjm41VWw8sa59LtXfwu8RwDj wPOJvsn6JD8aMfTtnNbIFt/R3kJMfKCvMFL2iLMXrKVJJlS72v0KKY1hhyzPFpp7T2aA fEzxkmJNAbZUQDg9z7ih0wNl3wabySzACwQ8XEBtwSjPu+8Q1oR7q2CKTGp6EV7Pp9HA HzHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="xBjDGp/9"; 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 h9si4595412qkk.248.2019.05.28.02.55.53 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 02:55: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="xBjDGp/9"; 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]:60021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYpk-0002qc-Uh for patch@linaro.org; Tue, 28 May 2019 05:55:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYk2-0006Da-Vo for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYk0-0008Ql-Iz for qemu-devel@nongnu.org; Tue, 28 May 2019 05:49:58 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:36785) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYk0-0008PV-9T for qemu-devel@nongnu.org; Tue, 28 May 2019 05:49:56 -0400 Received: by mail-wr1-x443.google.com with SMTP id s17so19479419wru.3 for ; Tue, 28 May 2019 02:49:56 -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=TyxM8f0bgznD46UNumFr9MU2H3Me2+hTtxb1e2LSXfA=; b=xBjDGp/9i/SI1KNVWmmEb1tt/jVZ+iVCRey810AZh4ud15EnbCOvcyBpihjkBT1/Yv +r1IFWfAmOCBfuCL8TwRLAXwuNdq9UFfFRYkCt5JLxbCTF5+nfmLx+TfQkBVwpq2YWkt 0I2QMCiM89OexyM5aE9Nn1ZMVHwlfceGCPgfRflOwfRBtxJ7gofAptj5a+1hbPQO6Rln KYTFPoyvE56W1jHCdNmRmA++/HlzrNBRkO8XeAhMbqDGsVjz+b8TlUSwVnnDTLc1ZFhb IrF8kYj2eOOurAU0b3x+xyNqqj8P9G+y1YkSpqbviZktJ4hMaPdUiHwgymedjwqtPtxS ID8w== 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=TyxM8f0bgznD46UNumFr9MU2H3Me2+hTtxb1e2LSXfA=; b=lLfcdnNCnXkgit+g0LSBx9blfANe1q5lWTo58MlEhXyaG4yT8cCG7xskXAOfTpU+Ss kaqELLxI0wV6oBwC+eC0Xd+368ANWqPMufAkIhtAvwLZG+x4DzGBkaGr8NHU8znCqE8Q apblyFRZ+issSz+fa0kniv5r95t/kUfXcmWKFKiozUJKdLNHTQIkIwA9xpbZ69oyIyFL DIqCXfklAidajclAPkcraj+eKZ4FaWD+nmtMAEU2sG199IDKvS5VwSVwNqD2SEjfkcND yzS0CkQ5R5iLK/wiGvFXHrKhctpWBKQuX3+Tp0w4zEmGsxrA+95H+8Y5UN1b23VscQij HbQg== X-Gm-Message-State: APjAAAV7MrZ18NuXOKpOLkvUg3FUrbTUCa7eXZerKqBHbBToUp9oEdgm vxbP77yBhrANH4Utiv8L/sC94A== X-Received: by 2002:adf:ee0c:: with SMTP id y12mr53945770wrn.34.1559036994858; Tue, 28 May 2019 02:49:54 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id j206sm2496799wma.47.2019.05.28.02.49.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:49:54 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 725651FF8C; Tue, 28 May 2019 10:49:53 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:26 +0100 Message-Id: <20190528094953.14898-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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] [PULL 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 , Aleksandar Rikalo , =?utf-8?q?Alex_Benn=C3=A9e?= , Chris Wulff , Richard Henderson , qemu-devel@nongnu.org, Laurent Vivier , Max Filippov , Michael Walle , "open list:ARM" , Aleksandar Markovic , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , 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é Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/gdbstub.c b/gdbstub.c index b129df4e597..462f89edfee 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 ddb94e0aba0..a99049c7d58 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 acd23c53ca6..719fb92e600 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 42999c58011..092f0df3c4b 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 298c262825d..d240c1b7144 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 5550bd7693c..be8963b2705 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" @@ -501,25 +501,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", @@ -1351,80 +1332,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; @@ -3743,37 +3650,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 Tue May 28 09:49: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: 165271 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8247443ili; Tue, 28 May 2019 02:50:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3XSx5bF37kU+4x0atp8kVO1Nb90bAfR4QTjxRIf6bmUJJzIUltygDn9LEnNX/qYxRiRul X-Received: by 2002:a37:4804:: with SMTP id v4mr73520386qka.330.1559037027276; Tue, 28 May 2019 02:50:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037027; cv=none; d=google.com; s=arc-20160816; b=Qb+3biUhmP7mZAFGQk7w42Pz0EFUQEssJZuhFRN1CCyBTzj7h1sNV2cCfOxsdjAN5j UcNLpLye9a6/Um554k4VT15frPn3eXUoPPMgS0T/DjbHZpcLewPJOtOxYlewAidRPyH7 uDxNJdkol/XulvHP9UfdoqDiZzBJ6sYAKljt9TqRl1HZTXHb3arSMSCfNDiTTiwpYnPG 8Sx33OvA3sWi9MEInKHxW5yCX2dJ9MEZF1nBFu+xvxmbQUfXyIVxzpngSGFnkq+XaN/n klLayfI54RkyOFdR6yygsRxTxXA6jzDNTKdvERi+wcnujrO+JrP9cdmFlH5FINog0s9W MO7A== 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=y87WCNRQrFtDdoTowj1xkvcHcjB3klhft84tA7PdQ58=; b=bIcsTU37Te0e2uS4eOUSzih/PnMdbMeJbheyanbBk1U4pgKq62ZqVI7/QwsdKo9l5+ 35yBp7vzl5fT55jzakLcIZCXSLI+4cqDmNRwv8uqohIoYgBmC/tO+ttvZqh76PPrz9VB j8xJlb4l2P12p6Lcp3EI/MWb/r5LemlJrIjVPPnTRY5wUXgh0ArQnh+Onjd++AKdmhL4 D8xYMzQZriGj1nOTWssxe6lovdi+P88AY5iBNttXvuGqH0z7+XHh7q/hCCZnl/qUZQBX QiMFyaOn83son9fpT4qmKm0r9TfOfVNIpgh1M/eUSAhvuopYaQ4t1Kc4xi6Zzjw0vyGr thSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jI7iqaXq; 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 e7si905695qtg.260.2019.05.28.02.50.27 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 02:50:27 -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=jI7iqaXq; 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]:59907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYkU-0006F7-Pd for patch@linaro.org; Tue, 28 May 2019 05:50:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYk2-0006D6-53 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:49:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYk0-0008RD-Mb for qemu-devel@nongnu.org; Tue, 28 May 2019 05:49:58 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:33223) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYk0-0008Q6-GB for qemu-devel@nongnu.org; Tue, 28 May 2019 05:49:56 -0400 Received: by mail-wr1-x444.google.com with SMTP id d9so19483205wrx.0 for ; Tue, 28 May 2019 02:49:56 -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=y87WCNRQrFtDdoTowj1xkvcHcjB3klhft84tA7PdQ58=; b=jI7iqaXqL2pQSsO7KcJtDML1hcVzEYQxjk/9AdwYObBtJjv60K/85Gjkbj/LWJxOVu yf/7qQoXNcgwhw8LexIv/LHAKee5oFG33WaW2EqvkvbBim4pDqaBebLd0n7Q4zu0k/x3 5eafLeBtIhbYZjHZDozoVUZWBtm4SzwzAEBlMqCpgo4GqL0jObQuVXS9yL45AX+K819i aKtkeeeKfHlBx6jfFhkkKipxjIiJupGLawIIfPS4NXrTmffEmk+vb9ohbJuHoU7uvPb7 qOG9PuMpkur9Z8o94fueU0z0bVhMyHg9/nxZHltzpm+WwKgo90GSubk0N5MUJg+92e6S W1Ow== 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=y87WCNRQrFtDdoTowj1xkvcHcjB3klhft84tA7PdQ58=; b=q6zRUfispTZu3ociel9K69UHDckZ6ILNwiUTgFOhnOWkaFXm1QDaWS6yiI7W0Xellj Z79eucp6N/D6eu6dSnbo06llr4xENcKa6qPO9eoaFPdVqGhm4O89A9XH1RZfdyUU6WrF KWgv81yHM8szFThvTsi5Ya6fYtnKHb/u956w1PhPBuear6lji/7jwpRXej+Y1wZi3KhK g0Ydc+Px35zuxNh1NjfLAbBRV1pONEgr1iSXsu2jCMTx0xSkIqt8vLhGAojAUc15PKBW fQ5Tf3x1JPFnwBWI9F/QwKfP5c4puwq5mc6oBUVLheSpTGmUf7eK2G7GqTF7eH9xfooI YZZQ== X-Gm-Message-State: APjAAAXWalnnQrhjWivPuDWpGcPpNQDkzluFNkg/Ljv07hcxTMDxzJHJ aOospUDCpGYRfEl+t017aEVYxw== X-Received: by 2002:adf:f3cc:: with SMTP id g12mr1258454wrp.149.1559036995366; Tue, 28 May 2019 02:49:55 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id i18sm1776582wml.33.2019.05.28.02.49.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:49:54 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9646A1FF8F; Tue, 28 May 2019 10:49:53 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:27 +0100 Message-Id: <20190528094953.14898-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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] [PULL 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 , Richard Henderson , qemu-devel@nongnu.org, Max Filippov , Aleksandar Markovic , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , 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é Reviewed-by: Richard Henderson -- 2.20.1 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 73452ad2657..9c7393b08c8 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -40,3 +40,4 @@ stub-obj-y += pci-host-piix.o stub-obj-y += ram-block.o stub-obj-y += ramfb.o stub-obj-y += fw_cfg.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 Tue May 28 09:49: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: 165275 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8249984ili; Tue, 28 May 2019 02:53:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWoyWtNQxSGBjiaeCwwH5sevs5q4rtQUVwWYaRw2FDeICfFNqQ3+Z13MDqEcqEUxfeRG6t X-Received: by 2002:a37:ef18:: with SMTP id j24mr1618267qkk.293.1559037204018; Tue, 28 May 2019 02:53:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037204; cv=none; d=google.com; s=arc-20160816; b=l+nCYlLPV0inlXbFkeWeQo8Op+SJAkNtTF9PluBUifxEdctV0YDDEoCpGy+UMqo5C+ njkFBpU1UKn2fOz9Rx4mozZQIVe35UBk8J5p3vNwzAiRKvLp0s5jJIUVvZwyOx8iIY04 5p9847HqX1Ct7GvOQTqV0pwvlOL5Af5V03pACzEHtc9BI3pS7gpuoLi69fjHRWcGHXQ1 teH0nKtT4YfujmtSWsMtmdUiHHEJ14VfjT5CbToU2I5Vm8URrs43Ri9uVGotZYmTIu1d ZT1Fe9igaryF4FFyOzFQ2s1HK+rhWgGG0xXQEOZMUKzZiapdaAiraq+dIBwi9mZrEw6l V+Vw== 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=xIlsDgqq7H/zbFWeV8b+7PEZPgAhR33EEQ41qN96A+s=; b=ucBqnFPJlhgzkCfquj3/yHvhSDskKEnbcSSyC0WolU9pyy8YVmZlf38cYz/a8NBo2v BHvMepiX/8Jm50PlY2QiYwz9mYZibjHH9RpgjZ7JHmuoiwtYfY/QzUt49b51uVwrF1UH knygwaHYINuye0zMJ0IG966gHJfNgV701zdBnmUf2XliW0xci87zBqi2Tow2zvmgz7iY p0y4ZYYRjKLcTlF417Pjp/I5PH3ijIgEexnbAB7YDyvPO7dLfncA9M8XRkd1pD4yKyty XcBr9wPv4lfqPa0Y9LXRnrXP876S9qQOP9lPxTzOT4eciDtVMGPxSKfJxBIVPhBXDPfZ s+Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HFrsBuLh; 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 y9si6232347qvf.193.2019.05.28.02.53.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 02:53:24 -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=HFrsBuLh; 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]:59966 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYnL-0000Vf-JH for patch@linaro.org; Tue, 28 May 2019 05:53:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYk3-0006Dg-4q for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYk1-0008SN-MO for qemu-devel@nongnu.org; Tue, 28 May 2019 05:49:59 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:54673) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYk1-0008RL-GW for qemu-devel@nongnu.org; Tue, 28 May 2019 05:49:57 -0400 Received: by mail-wm1-x344.google.com with SMTP id i3so2135472wml.4 for ; Tue, 28 May 2019 02:49:57 -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=xIlsDgqq7H/zbFWeV8b+7PEZPgAhR33EEQ41qN96A+s=; b=HFrsBuLh5ShnqDxQN2u3c5ADuaCOPCxk9jIp0zLgPtnOAnGdimBHlFeL67TYoLOgxI MfZ61+gRYs5TGGD6BZwsX1npqGgasb/vqK4tlZqaSjNNga+QmA4Y+hA7ScbhprCt4y+u B3IQPT+Dufo+HXMiOQgo9jvhj+VjJ0mW4kVtlITkm9ME9h4+DiXbwISKCSncoFJq+KVg V2dmCLdmfjyc03DIWQvFIDgxzQZ9gpGDL3LxUfyD0L16gfP8KE4z/H2ZUvqlVBPRIE3X D/AHQnyQDMNhONhORGV6IVJWv2LRGsZoCrh99qWt+C26yrzO5nt6UPObQs9LLaNSb50y NZcw== 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=xIlsDgqq7H/zbFWeV8b+7PEZPgAhR33EEQ41qN96A+s=; b=OalPXv8VTXWACFGFf9d00OXQC0qPz7QxGxx8zmSwIvv8TFV3O76STRPUY9blffW5mO ZqYa6LcYmlT7+I/PuChTLnjRJJQbvOfksOmVDMinmmtwgUthc+PnjNlpmskXM4VZ2yrS sDukdActv1UMUwUCAp8om5f8Ba5E47JcThwWFXUn4FLX0gyqFGjcsoDKfNv0BXxfiBal OnsDB4E8FpkexkWLrpmDy8m+Mb/xhSotI2tpvYa19CrwDmfkmELNqxW1yK6h7OEeXh4u iz2v7cKjnvqN+xiFIODGXTuTyqJxJp8uDcjgmDrFvoNmqJCACk7nhw7QLi0+8SvayEtX 9fvg== X-Gm-Message-State: APjAAAWx1yKX1fUuCiTsL1CAdS/pVjCnttfyb1kXgj4sHiKCC2BiznVd D8Uk0Ts45Xk/oXuz8gGRQHB9ew== X-Received: by 2002:a1c:8017:: with SMTP id b23mr2480354wmd.117.1559036996289; Tue, 28 May 2019 02:49:56 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id p16sm27332759wrg.49.2019.05.28.02.49.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:49:54 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id ACD6B1FF90; Tue, 28 May 2019 10:49:53 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:28 +0100 Message-Id: <20190528094953.14898-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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] [PULL 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org 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 -- 2.20.1 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..01826bd6879 --- /dev/null +++ b/hw/semihosting/console.c @@ -0,0 +1,77 @@ +/* + * 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; +} + +static void semihosting_cb(CPUState *cs, target_ulong ret, target_ulong err) +{ + if (ret == (target_ulong) -1) { + qemu_log("%s: gdb console output failed ("TARGET_FMT_ld")", + __func__, err); + } +} + +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_syscall(semihosting_cb, "write,2,%x,%x", addr, s->len); + } else { + out = qemu_semihosting_log_out(s->str, s->len); + } + + g_string_free(s, true); + return out; +} 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 Tue May 28 09:49: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: 165278 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8252487ili; Tue, 28 May 2019 02:56:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZAZ565ofiadKHlHKk77wGMzAs+5jWXpQ3Y/rQ3fPTFPNnRnkQkBFo1Z6MQPbrgFLQK77U X-Received: by 2002:a0c:932f:: with SMTP id d44mr86688991qvd.187.1559037371072; Tue, 28 May 2019 02:56:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037371; cv=none; d=google.com; s=arc-20160816; b=brC4avgYEBclvGKIIUZSShvk2S3R4kUErNgedUWOG5tm+Z48tdTj58g+dAlKURqsQN Ru7gI2xkVzwGbQGKnT0e/C49MD8M8/W8LhkvfzSNdK5hfV6AM9YsF4+RVfars0xp1wZU r57XNkpg1P4ZN/bbRDTad9q7UQSMe92b/9h/VgMN6k+7tDKgos4yWb15utokJQen5Vsi 7l7NSqlo2lbteAIqg0IxSIZfUGwO1+gHcQamkLIpB8/OSavIOFj2su4/5jbqYeYjvFNz 0qTFWp+bQiRcDO4C35qwFuxsTWxCP7Xg7eQ8X9gYnW07KVMJGfkvycgAaFnP+pxsNkxY MslA== 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=t82Ise9y5EQdUowZAI8bltqiROUMDt8BIZRgYkgKnHs=; b=hWUUCsXousTGUVZYNluLlOi7z8+A7D571nyt7RsniR1tKtEyna0qfqlfWNc/VQ3lTo VmGAvoM8eehimxiCf/ApeZhG1u4cZu09rcWpXZ0a0rBwSDmD3Bvagti2su4Lh1d2v8Df LHDaPqEHeiye6BflKHPxqvd996rrlZ0tqb8j6V2d9B/Asia+Jze/P5C2kjtT5H5UgQgd bSOybq13FsXQpjzDBJVooAoVQlEHGrkrOXwKxvPwgLoYe7kgorONC6CbaZX0NC3FWDJl iGjAjVx+9tLm9v/pYUbgYhsW5Tuf1VA9kpPRg8WVyAlZuHjrNE9Vjm9+7ML+uGBifrl7 +wmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=veEzCpEU; 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 a73si441164qkb.61.2019.05.28.02.56.10 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 02:56:11 -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=veEzCpEU; 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]:60027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYq2-00037J-Js for patch@linaro.org; Tue, 28 May 2019 05:56:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYk3-0006E8-Tw for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYk2-0008TK-Ay for qemu-devel@nongnu.org; Tue, 28 May 2019 05:49:59 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:40781) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYk2-0008Rt-4n for qemu-devel@nongnu.org; Tue, 28 May 2019 05:49:58 -0400 Received: by mail-wr1-x42f.google.com with SMTP id t4so11187655wrx.7 for ; Tue, 28 May 2019 02:49:57 -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=t82Ise9y5EQdUowZAI8bltqiROUMDt8BIZRgYkgKnHs=; b=veEzCpEUBpRlAIHwS7A47/4RtGReJZ4q2kPRloAA355Nbs5xf/VdNmppHiliCm5V3V MzaT80Cx9KMnAzX56av7rdYzbvuWprceGe5mJtOONpt84U8Iwoewxv+GiHKv5IgfkmcK qTjNtXCslhmz+Cm1wrhArT86II4Ax8csO5EKmga5T8ydeWzduSfadLzWboE6OXLEv+Gx xHdw/Do4B62WRgqMRRauBKV/N/SHwqwybcc7CB+qYna0ZOnOYf3SRPm57YfGYfcYbZI0 8GbSojI5LN/JxcqlSFU65jM2H592Vhn8urJ9DkmqfvyleseER9K3hh4ljAIxroPyXWbW MZ6Q== 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=t82Ise9y5EQdUowZAI8bltqiROUMDt8BIZRgYkgKnHs=; b=iGVlHLMWGEjb/qg2BOcAsRTHtcH83yODwmQMEE+wm3XnRSF40H0C9qF0/+ztiZPANz HWvn8TryLm/SDzUomgnBMw5sZ8l0L7GjOqAkVb7GLJqBmOQ1ms3CNTrAa9ZVSRrTmCsV 11xoz/vMbsa+jeNkg3TgLFx7MxdnUdGPL133iSuWKVxdzbJGUTljM9Bavmkp5sSDDbzN 0WdRSW/1IjX8+XmrXqDmaj4vmQlnI2YM0dWbxidDvbCIzj62kjwVs7BHQdSFjYx9CTsW lRnVo98/6uQy7ae3xfYbv/1OOTODCE27ZRHMMyvAKNRTeIFjeI9wU5id8JxkUsAVn+FP 2avw== X-Gm-Message-State: APjAAAWcafRd7+FITkbyk98ZvpdrBCE8cLcJL/YawiVpo3ZGBpWPD7N+ 58+P4h0tWwqOj+Ed8RiO9Ty9bQ== X-Received: by 2002:a5d:5283:: with SMTP id c3mr38452101wrv.268.1559036996785; Tue, 28 May 2019 02:49:56 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id n10sm12997964wrr.11.2019.05.28.02.49.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:49:54 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CA33B1FF91; Tue, 28 May 2019 10:49:53 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:29 +0100 Message-Id: <20190528094953.14898-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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::42f Subject: [Qemu-devel] [PULL 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 , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org 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 -- 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 01826bd6879..466ea6dade7 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 7ae3373a009..39dc1704296 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4025,12 +4025,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 @@ -4038,6 +4038,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 be8963b2705..2e69c9fef2f 100644 --- a/vl.c +++ b/vl.c @@ -4170,6 +4170,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 Tue May 28 09:49: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: 165272 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8247488ili; Tue, 28 May 2019 02:50:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyImDRTbgyEdPuhOLUozwPfxTy8Fcjl/0v2DoUKvl9y8axWtPhITXV8heivdunuUlrAe5Cg X-Received: by 2002:a37:6086:: with SMTP id u128mr7827663qkb.270.1559037029286; Tue, 28 May 2019 02:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037029; cv=none; d=google.com; s=arc-20160816; b=PYj3FdnubN/MenFaRuPOSltjAIcwUhmF/zNRVj3JpWhCUEMKP1moMkznrEp9NSLdx+ nO1TtlvO5Y6GgyAsnoTiBefh3Nf81LcQFc+/zkCMLncFJ/wAdRaSpe+xAG6eDfHvSubu fwPA8ku/kmIAi5W/sezoPd5nIXXZIgH/2/OdPRLqf6VSt6MeAG93aWXNEGzFJRl9KmAz FiVu3gzM7ayTGa9CxpuWvJik2QWtZ9Bt/HHd49xI/+mALohdDGdlYC5h8eZJFGzlBsvQ k8InJD7zkEjYbTlGndBaQus+2uchc24R1RD/wcNk6Yb5IX0mq0J5CHRFVV8wFRu9OPCY gTsQ== 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=qqKC0aSbOxnvRt4Ak9385i5tuKqObKaJREy1yTVl17E=; b=ORix1/FN7jWoJ9MnuR+knRgiqA4SjJ1xvFNKazl7VP9GaOuFmDsMmWJpQIsPOzciOd 1yDgIKmm3lwS8gZ5edIxmyN8hE5jms08AMUeAd9SGH0xshQakz6miSuge/Yhcl/wvZ/S nalswQCBUKRcZ7at/2Aq26VBG9HchYv6Dc9CRdVv4N5PGxklv1Zmf0BzhoV0oi/dsXzj o6lcL917sUR6K1l1Jc7gZOTze9HgjcgFVhV7+cQo6NY5hvTOJZOK2oOMLMo0kynTy128 7dHpwfzE8i5eVICpihR0AtsCr8M0bAZdKNJ9WsVv7rZ7aJ2ftiDZgHDfDfvGV3LfcNed 32YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Nl6xhjdL; 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 16si6440267qta.329.2019.05.28.02.50.29 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 02:50:29 -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=Nl6xhjdL; 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]:59913 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYkW-0006GI-Lm for patch@linaro.org; Tue, 28 May 2019 05:50:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYk4-0006EN-PQ for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYk2-0008UE-W3 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:00 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:38633) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYk2-0008Sp-Pc for qemu-devel@nongnu.org; Tue, 28 May 2019 05:49:58 -0400 Received: by mail-wr1-x42c.google.com with SMTP id d18so19473046wrs.5 for ; Tue, 28 May 2019 02:49:58 -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=qqKC0aSbOxnvRt4Ak9385i5tuKqObKaJREy1yTVl17E=; b=Nl6xhjdLBBjo4hXQwpFtEexyaLdc65OHvYSdnKssLUGAYLOeJj1FapYcBQcViqvFw1 W2xCQTjL9T3faRzIwKHYXlU3kRhy8fwx/JUjr1uMuL71o+R9/iickq6npGpbz2iEW2GR tU3ipx6/MPw6f7Z0A9yjs3UBCiRW+Cxk28oRYhRP4LPY7rD5xDgU6TPrr5GqbWJPM8kv GY9ELYN8B+GCNIwHg7W8L/saE6nUY8UGWTjI9I2ZN8japezxXJrOatQ+tGEbv1rWRuDc KfZHjm9d6eksvENNaqrnRA9SMrxMQp5INwl1gDwTsnvoaUSWo7NlU61/TFrw1E5eUn8j iqoA== 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=qqKC0aSbOxnvRt4Ak9385i5tuKqObKaJREy1yTVl17E=; b=UkZkYD7w6V6mpRdNHs8jzWCjlNyx6NvnskBbhbw7kXX72Z9DqjHTgBxiGkYs02+bOL xEvpRSDgcbH+4m5H3+jbnnGl7Nm8cCMDB8KhmC2OGgbzSAJLfNPUozIZa030CumCe5Of eEUTA1qeRTrHd7v43sFRpjfbcux3AzaLfDZ3MwSYjtaLZFyEm5xaPL4kMz686KDHUrse TqWD3TyWeBXj/YproDa5FS8IgDVOfyzm0qYMLJayFN282ocyhGxfwFq/75thQEmK9tqd jYNJej7ZhpU9DdlLHw5iCg8JzzOewRlY8m6n+Rb0qMhESoAYbyz24YgJuUYiXt+eWQa4 X+aQ== X-Gm-Message-State: APjAAAUaZ90T2eLCliP0ytUixFuDVMsGkkwgCg9i8uIuwdq7eOWrb1jn wcvn74YGDdBgvlUe0T5D812VEA== X-Received: by 2002:a5d:4581:: with SMTP id p1mr5980478wrq.228.1559036997603; Tue, 28 May 2019 02:49:57 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id s13sm1917474wmh.31.2019.05.28.02.49.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:49:56 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DDB9C1FF92; Tue, 28 May 2019 10:49:53 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:30 +0100 Message-Id: <20190528094953.14898-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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::42c Subject: [Qemu-devel] [PULL 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?= , "open list:ARM" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org 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é -- 2.20.1 diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c index a99049c7d58..d812eef1519 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" @@ -239,6 +244,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); @@ -509,14 +523,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; } @@ -570,8 +586,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; @@ -619,7 +637,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. */ @@ -632,14 +651,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 Tue May 28 09:49: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: 165276 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8251851ili; Tue, 28 May 2019 02:55:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBMAhA+54uygOQBsSZgbSvWJcw7CYK/dlXwV2UvuP4kMElVSm5wcecGHVuTBKmG6zdaedF X-Received: by 2002:a0c:e90a:: with SMTP id a10mr1438322qvo.17.1559037327953; Tue, 28 May 2019 02:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037327; cv=none; d=google.com; s=arc-20160816; b=AxirMWtlPqp7SZP+A2RAQMBPN/K18Jh9j/dwnzCDrFDmFGESPmDm1KRB80w6e64Y+9 kFBud3l8fJaCcxSOYHXpAgx2bIApyVXfCrCGsYWLbmZ3waPTNgaVZQM7CH3kytZK8BBg fSzR1mWyTGENmL144TOGeTahi+W8LZF9LsXo3Pr5bGboHsMpwba24P2AhnwxFRVCWZHm 3vi0xqj9UtaqQuMDbb6NfMelUjlXeBJSt4uQZ709E+Ni5zxtFRaFKYCT4QnILzXgVZA/ yAVy36cB0UUwQPIv7JQOF0J98j2ed28JBC1Mu93H0fGYRJM3MjRfbOpiu9Rw5vylACk1 pNPw== 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=xTfU1HgK0Yu+Mt8wiwSgiAOdcAiaYW/8Jaw7M5Np27U=; b=jXSSw2zgMFagJLD/nPjp0lvwtrq1L5BIhZZTpE4QmfVuEvxofYYP+VOpdzZbs6HGii cMJ3URIc+KKvelQomU+phChgQ10opxipJ6JWEZkF+RF1XnULXmoDWf8ZIp7R9t6mse4b G8MmW0aKfU1fV91jEgr6fYaZrRU7c0cngb8v547GMLcMj6Ay5rdJyI3W9c7b9his9kMg Vi4oLHNVsBAijPN72GM+LL7OofxrfZLkF7SCy9fq5F7lad6A/N94K341PBIzMT/MuwMn u8Oi7E3mOzPyv2ZpvNzoRJ22WqJldRokHNH1NspVnAQbuygNPdRhbHu/b6P1fW1NEfGt 4Tyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xrqP2ZLF; 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 x10si5113617qth.137.2019.05.28.02.55.27 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 02:55:27 -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=xrqP2ZLF; 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]:59994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYpL-00028m-FD for patch@linaro.org; Tue, 28 May 2019 05:55:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYk7-0006EV-OJ for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYk4-0008WI-Da for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:02 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:38434) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYk4-0008VJ-6t for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:00 -0400 Received: by mail-wm1-x344.google.com with SMTP id t5so2090269wmh.3 for ; Tue, 28 May 2019 02:50:00 -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=xTfU1HgK0Yu+Mt8wiwSgiAOdcAiaYW/8Jaw7M5Np27U=; b=xrqP2ZLF1RQm05hRnkS4H3RsDflCKr4NLGZCVHQxxRCKUM9pMmnkGFLisIFYmmQyqz KdYtiTWrjvgDOAdE+sc6M88XgHNSTjyBiP+f9PZVIdcALVKCyk2hcxVw5KLJkOtBktXr NltHWTMhrl0QneFICQ9lQC7fgHaIB8qD6V85UQJhh4PV7KOGbA+yN5eAktj7p87/uMMi X2eEzsUGQvCZzUsHkB6ex5VOdW7fjlf36fNuTrV+DHBN4iLmovQ1U5yEjLHY4GSt87kE Z6TqUtvfQn6bPIUtf2VJyQYinMbv46aR0AysUTeJViIPXuWbHhoDuEocCK6T+a7H3rg8 ioeQ== 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=xTfU1HgK0Yu+Mt8wiwSgiAOdcAiaYW/8Jaw7M5Np27U=; b=sqdxkl7zd2WCq0pCL/uM+HITPipyMcZzLve8w0kMs1Bb4xj+Y1zm3FNrk40Qv8X2/Z iDEcZaBBqWunJPK9HNnNiw6LHvcREutU8xF/T3N+5tOK5XHVjiRk1ObwmGrBQZDdiPre mjIKYxIPnoW1Y2u1j+li3tQF/s/eJ3XvmYk2gUVSdqGUOzuFp5vRzOMwyxqBpQoRM2bs Zd5g+75DxUeVgdwWeyloNYckvMoO/J5NbYkJkRaj67zimHsfV0rtfPHFGjUCacaNwdBU QccdMCPOzYf9lyiNWyjXPRvopIq6HkKFeA0CSsX8AcC1OW3bduvXDgd2dnEupTDeFUpl aHvQ== X-Gm-Message-State: APjAAAX6H5gUpSPMRs42fZLWlhbPtovdT2mPx6xOKel9Na83IHAWa5tC 8Sli8YrqkKlyqrA9NWFpV1SRhA== X-Received: by 2002:a1c:eb0c:: with SMTP id j12mr2454551wmh.55.1559036999128; Tue, 28 May 2019 02:49:59 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id j123sm3589694wmb.32.2019.05.28.02.49.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:49:56 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 029EC1FF93; Tue, 28 May 2019 10:49:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:31 +0100 Message-Id: <20190528094953.14898-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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] [PULL 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: Riku Voipio , Richard Henderson , qemu-devel@nongnu.org, Laurent Vivier , "open list:ARM" , =?utf-8?q?Alex_Benn=C3=A9e?= 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 Reviewed-by: Richard Henderson -- 2.20.1 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 d812eef1519..384b01124e1 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" @@ -313,32 +314,10 @@ 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 Tue May 28 09:49: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: 165273 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8248679ili; Tue, 28 May 2019 02:51:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrq/dsj+OHlFSJJfGF7ddqtW+xMOQPGES0r6Vw/fI3eoxO+TLCE7HBkpasYOqX5C5Dl4rm X-Received: by 2002:a05:620a:1641:: with SMTP id c1mr91720680qko.103.1559037114772; Tue, 28 May 2019 02:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037114; cv=none; d=google.com; s=arc-20160816; b=J2IJ6TOFsgYZYlsZQGrZXXz+793NXzT62jpm3S2mvw5BE4r7Ab8rKM+mVU5J7gd04q 08z6iUZ4AJ9c/C2wqiLlNXuBnS3ftcM5C4yhe4zyYpL+2TSvxgbQWTJC7MQz2/sQzGrP /TwLBou5Nzp/HmYsQZeQTYedXVcZsPxRzUmBTQTgBUA5mxQmL/XjggdiEfTLComyLkap z8y5PcNq+DIoPH0COoCBM/rI6W8mqPt0BmKl89fAzV58ae2IqnJfvGl2jgCSkPtfECKx Hr6YDBnZtimVpTpm81k/Sls6latDwdMujoDd0nzBiCKVuI32fC8OQ8YkWZdeHcyQ9iWF L3zw== 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=WaPXaKJ84KPnf9Vac7fR8yciWXTzgsdE11wI7irhktI=; b=oXRExwXk6YfYWNmK0qcn8AAsvUqyKufWD1VqlVLt6o202uTqFE2shsdA+lB2Fw7++L 0LmqtvsUJYlvz1cBazNoAQ3BUy284PuEqRjZY2tRlC5g06BGSGj84xbTjr6VZPxLge5o jDdP38UO5iQZ1fCHVdQHZOjWbmIjrdc9ao0SR5/yie+eXE/3IlXIGH9xRiiLAuNR8vxS xeQTIiqRg9s5jpHsnT5lmbr6TDcVMCqaYk65vNe2iYTne2jWZT7RinPAvy0t2oxKwBCr My0dVc4z6d7yJfnDjELYbMBQb0yUiepzFbFo0sa9vA5vpR/GEzXjl8Vosiq8CkhYoimS NWXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="WZmHeP/+"; 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 q5si6413735qvf.198.2019.05.28.02.51.54 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 02:51: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="WZmHeP/+"; 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]:59953 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYlu-0007mG-5t for patch@linaro.org; Tue, 28 May 2019 05:51:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYk7-0006EX-OU for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYk5-00006e-PJ for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:02 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:39309) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYk5-0008WM-2B for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:01 -0400 Received: by mail-wr1-x42b.google.com with SMTP id x4so357116wrt.6 for ; Tue, 28 May 2019 02:50:00 -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=WaPXaKJ84KPnf9Vac7fR8yciWXTzgsdE11wI7irhktI=; b=WZmHeP/+ejRZURE+yRjhCqwLn9ZB6wcW+5BLNBCUOsGmgoa6Iii0bvzPPxtqb5ECgu 8jGw0c3TVWU/4XKxtBL3Hy1myCe/oQ59r/glro1BSivgQQNb0g9P99U3AnaDHR9YaklU xiGR33uMLQzwPioJTACmFYLaQSl9iXS+WpcmE2i7XI9XB7BdfJ88wcN72yY09AHAgAHI C76nGKksMldgGoaJqBhNZaWF+bmwQ7Gtb3sBjAA0y3bw0tsaz7w0JHd0PpQkuXgmyVYq rkjLcCn/An3jFbBDxW7n2rJIrkkiiYjbaBiE8QyCkj/yq0V/rGNtDWU19dXPBUfab4eB skdQ== 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=WaPXaKJ84KPnf9Vac7fR8yciWXTzgsdE11wI7irhktI=; b=MrIb5henlwN/6jt1pJt77NmZZYBfCcgTPFpzx0/Zhc9sASxfnbCFScrQ/1Xjs0VerK p354CP6Dyh+eKz/IqhJ9/r+bH3CdV1g0Q39WAJxGWv1d8C3pUtFWPFqpVXqyeIvLtPij 0MprEvx2D95ZT7xMT7uieWaM0wz7kAV7hk/7m3WJBtyvm8N8QSO8nSd3B+6AhCcmlUd/ UQQ7503CxrDIB1ntQPWb1lXvHBdls/HzLgKv5f5b3bZkMogN2+bhcoXJuiYhwqKOdAEe FU+Z2pYC7yjbDzb/LOsKBiQDupNV5a0RUmKzn4MHkFYUTeepBu9oOTLfg3ydJGf3j/h+ lIAQ== X-Gm-Message-State: APjAAAXo7QiMnKdY4NbBE54lOWmVOqh4IlEjBVBhuMJ7mQE5KMeR7uk8 JN3/xQAxVKts1ERn0fkWycLAeQ== X-Received: by 2002:adf:df87:: with SMTP id z7mr16559399wrl.8.1559036999970; Tue, 28 May 2019 02:49:59 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id w2sm7298995wru.16.2019.05.28.02.49.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:49:56 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 16BC41FF96; Tue, 28 May 2019 10:49:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:32 +0100 Message-Id: <20190528094953.14898-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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::42b Subject: [Qemu-devel] [PULL 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?= , Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org, "open list:ARM" 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é Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c index 384b01124e1..86e6ec48c2f 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" @@ -363,7 +364,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); @@ -397,7 +398,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 Tue May 28 09:49:33 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: 165279 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8254782ili; Tue, 28 May 2019 02:58:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqziv30f8CpGHAz4Db4a9qzPnj9lMK23NHwPKXfdTnuf6NvpEIRQHrNsfqFDgKfHXD7R8ipN X-Received: by 2002:aed:3b66:: with SMTP id q35mr12862638qte.118.1559037512814; Tue, 28 May 2019 02:58:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037512; cv=none; d=google.com; s=arc-20160816; b=qJd0hKG9nsJH5Q/vGKu22j/b2F2LYZrIuccz49MsK92qJepKf4vHt24EWN/KjRTdY8 09d6Ylew8Y0QbS/LpnARmq1YEUrIl5E/JAGr2XF/f6TSBS8gmJcw5Yt6u0jFrVtsmLXS j4zEBN/9w4bmxuN1fTOhCSUUBrbPRngdDDcyPsY3bIGqzI3SYRVzXsi40I2LJQ5tOxIQ hwPcLDxRUhy3R/2fsvpwixbfWyeXa+kzEzyHmZZpUD+xZ4kN/gskMJyDH/Kwnix4pyDp GpuGV+falJ/ihXNfZEoN/D+SCLEx50d7SXhgHAZTGAafBrrgmlA8VsPodPzs17gFv96k JDig== 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=pFgHz7Tht5qTVpx15EDKkUknXmNVbUsIScAUSfYzoag=; b=Ehn+6ziHGYmrkuKBYwVbftEIXltME8xwtcnHac9T1jQyIjmsMoUHa5/N4etyW+fp96 lkpXpLZHnAVnycqyN+jCu21PHGYc3QYLV9o1jAi0vxfzzPVYARMxDVHALggOXUl8vQAi uKxJ5p73rhzV0uBQu39gxJSqYkFIbaRflnw5gXGYRBmcGstnsZgarn9pPTJTAON5a3UH ++h+ult581OxeHbY22/2ldxl5bToCVEjfe5qExMXmvwblm44gRNzFYgykQUaYqb0oEMD PJ6sdIACb6Wr+qoAEOnzDA8NrN2Y67FuDyCJO47E/dIa7+02Fjlzefajfi+0Fcjq4vwA 3qoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=vEt3BDV4; 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 c127si1133338qkg.194.2019.05.28.02.58.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 02:58: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=vEt3BDV4; 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]:60046 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYsK-00059B-CI for patch@linaro.org; Tue, 28 May 2019 05:58:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYk4-0006EO-Qi for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYk3-0008V8-IS for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:00 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:47030) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYk3-0008Ts-C7 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:49:59 -0400 Received: by mail-wr1-x42f.google.com with SMTP id r7so19444951wrr.13 for ; Tue, 28 May 2019 02:49:59 -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=pFgHz7Tht5qTVpx15EDKkUknXmNVbUsIScAUSfYzoag=; b=vEt3BDV4pVGNjDaQXTX598ft1XJRMAqvzxi0C6qvMjpHXBDahFdDF6/NATFVedpJtx Our/AVZWQmH1H5LelhWbuqAXamaKNkaMO9b5CDbbS/UEiScSp9X4+OCLm75sNgBY+ZxN uaLmiOP4GWh26W298e1/RM5K201pZZBBqA65AEDXvspaJpgyNQ9UnWqJVN/cxLTY8RYT I1L73NgGtlJK7MYNnkjWHDIm8SjOlNlMHQzqET/q8aIbvsTD/2sWzziY227F0sXkkKIQ q/6te+MZc2VYmGKLkppx1psXOqG+/sG8L5hvG59NJkxYsbKpDszCNEy31fmBakEb3QPd 0E6w== 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=pFgHz7Tht5qTVpx15EDKkUknXmNVbUsIScAUSfYzoag=; b=F1zDQ3JwiXg1Omi4Z5MvnURUa7e4hsDMlB5EfwJaqc2ppiA07qDY0LgQbY35VkYYRF abd0BjvmyltKHJ1E1J04S8CZ8wloJIz7dAePWvguwzIL38zQLctRQL8fOxJw2e9F/bgk Vy/gXpx9AqaTbsZXqcNMPAUCHY98Xh9QoHjze9+bYeA3axjGwN4W+okIgHnTUTH8M3Rq A/I/Rmj10CdPG42/42s8D9StT3I9HICC52R2wKq0WRxCADJcswkEwRxbuP99CWfgO9cd cOSttYye51/eXGamzo8dYlDmnnMFOL8DKJfZ8HCE4jlDfZWTdMEYfuc/ssdBlxu/ERDv 5/fA== X-Gm-Message-State: APjAAAUxaD/aw8Y4a/Omij34dlFxEAFdJPvZH3BqdDr+C+sqDCEegZxi 3iVn5GnMnZw0xNk9Puw88czH6g== X-Received: by 2002:adf:e742:: with SMTP id c2mr25057764wrn.249.1559036998364; Tue, 28 May 2019 02:49:58 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 95sm7704397wrk.70.2019.05.28.02.49.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:49:56 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2C1C71FF98; Tue, 28 May 2019 10:49:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:33 +0100 Message-Id: <20190528094953.14898-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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::42f Subject: [Qemu-devel] [PULL 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?= , "open list:ARM" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org 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é -- 2.20.1 diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c index 86e6ec48c2f..53e807ab721 100644 --- a/target/arm/arm-semi.c +++ b/target/arm/arm-semi.c @@ -331,13 +331,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: @@ -352,15 +354,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 Tue May 28 09:49:34 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: 165282 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8255159ili; Tue, 28 May 2019 02:59:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHbN7nzUUZ7wBN4rKGthLrGYmtZ0n4NpdIPw30nD6hnB9IKOdPStMcmjFp9MJ2jKF4i+4h X-Received: by 2002:a05:620a:12ef:: with SMTP id f15mr4458466qkl.340.1559037544138; Tue, 28 May 2019 02:59:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037544; cv=none; d=google.com; s=arc-20160816; b=j+rWQnRpPL81f5XPc9NljoYmJWf+GGaQOOrYZY+Wx3BMYpjllw4yUYkpNb/DMgTj98 6OX0mgQql5B3HU8bKPBlEtybC/EnzxptAamR37WzTAVzV7DIQCd7ZqT7C39TBfHtiZzL IdtSgDdoh3HEqhOkkY9tkHclnQ89XmdS29ztUE5rOUObpDxws+QqvZSi86B+GSQPtc1M 051Ue0p2eS5L9jVyygGaNlGU3jX2poGrTNOKbJpENVy3TXjTALNYJ1kvyk7kIU64BAG7 tDgd3QCNsGrgV+ZKexDDD8bYZoquAIkOYGEwJFskbPIRCdSlZMGc2PCHz8+e2ySgFXXP xA1g== 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=afO8c5gpnfvt0aBAYWof1X05QoKKDVER3olU0OZ3Ft4=; b=ihOzfhXe9QulMLtoUqWKcYbhhlA+FHQNzs7UGpckcww1l0WTFJ9Rx6vs8HozFgiTjY GbZimav8fIVt1uyf8JJmdbVRFdUxXvClcewY9AKJCSXuCvDfSH/whM726j/CCpXqTePX cA1aVLvZxrV+RWuEkDusMtmW0Lg5dJz+m3vk0xDaEte51DmPVfP5wlruV74PqbLz536j x5GIU3jxNLwTfiLuK4NdYz+t5z0fr04AiMZwu9NgWEIG6j9aPvL1ubKR+0C8OpuLgxjl k8CEI5xRsECIJbQJ4z0LEbWHEQ66mHDiX3T4xgNW5QXLJZJxQmThabFZNFB5np73XvkS Bg4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RjtP3iwa; 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 y5si6122062qvr.17.2019.05.28.02.59.04 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 02:59:04 -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=RjtP3iwa; 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]:60054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYsp-0005Hg-KC for patch@linaro.org; Tue, 28 May 2019 05:59:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYkA-0006IF-V9 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYk6-00007z-TH for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:06 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:45553) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYk6-00005p-5i for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:02 -0400 Received: by mail-wr1-x444.google.com with SMTP id b18so19436332wrq.12 for ; Tue, 28 May 2019 02:50:01 -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=afO8c5gpnfvt0aBAYWof1X05QoKKDVER3olU0OZ3Ft4=; b=RjtP3iwasgcd5Zj+tL+Sq+/0Bj7lnX+8o2cRf0FrGkw+awiJ8U7REgfHqquOPA3Exr vibhzmDRffqt/Tk2+jM2i8l1wM+bHScxb4P/8a1N9VoeV13zqLYdRKAySXLDZOgb3Qs0 TjabRAWiwb7RCgJgNDpvKtnMDXU2JSSyfqqBkBawtTXZjmJ1OuhzGRfDUkFSM+neeWKe 3S057Es93aWlb1eyVe8FQ5qGjHgNMwE/mhS7aRUqbQ7+RrgCRu475+Q7jK/JO65rbVd9 aeS/5+iq73Bf52/3Sp8aJWOY5pZlhfbx2SQ9HfqtibBe/l8+zbGTdQRkKsnRnhtnGNyv I4xw== 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=afO8c5gpnfvt0aBAYWof1X05QoKKDVER3olU0OZ3Ft4=; b=oUG7sFOg855lYF/75/gpgB5+8DkN7s5k3fuKfNWrXGLGOzd0vU01zjzKO9NFKONA4S AqgVkNw2hxgveiZ5PFXWd2Hq9KyXnUT+4RjeggHtOx7htwFKxo/rm/QnspAggRq8AKgP KeXsjKNij0KSRXDQ8vzuYoJvnLuCz4xSWKgPGO4QHYAXigDPEvtkvqWs8GALKzryj+hr 6JfI/5Nji4A6qdROLl9AyGFSmEBk943WReM0xB8xZfgavKlENqwdPllDLqYbRlOhbyxj mP0pcXo9Ejz6XIxnjSpvR1XgBWdmamfbPCuEUIGmJ94ps2Hdx7LxkS7C+c5NJizyCZMm uiCg== X-Gm-Message-State: APjAAAXvvg5EkR5OyjKvhDE0UGiESbGiKL1Hnf2njZaGoIOc5+F+cLkq r8dKByWxrq1hfDRgeyoa+gaQFw== X-Received: by 2002:adf:f041:: with SMTP id t1mr4698093wro.74.1559037000879; Tue, 28 May 2019 02:50:00 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id h200sm3522991wme.11.2019.05.28.02.49.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:49:56 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 44D881FF87; Tue, 28 May 2019 10:49:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:34 +0100 Message-Id: <20190528094953.14898-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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] [PULL 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?= , Richard Henderson , qemu-devel@nongnu.org, Aleksandar Markovic , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , 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 Reviewed-by: Richard Henderson -- 2.20.1 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 Tue May 28 09:49:35 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: 165283 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8255301ili; Tue, 28 May 2019 02:59:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxZV65UGhsi8Jswp6CoYxnfYiWADGr5x2ayNrNf4s3DQEzM91KdUrykFWpcZSMo3Qlt9yt X-Received: by 2002:a05:620a:1e6:: with SMTP id x6mr64987152qkn.179.1559037553533; Tue, 28 May 2019 02:59:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037553; cv=none; d=google.com; s=arc-20160816; b=0WS06RBXK9t4ZIYgjV6oYh9K8/jumZV5aEY2L0U0fZZ5xHG8vFF+0F7hSh7kNyVzQ6 5juIR4wQloQQFP7WrOL7+V9919fZDUjb2WT1C7kah2ytFSOPUwef61eHEHm0xi899gmx tYxqIkV80anJwLC002uFYCFTWJvB/IrvhKUSZL5lJ51Ra26i+hqn8TgjTK9o07xAPDAA DlCNoFAh34YRGKKw+x5VLiwU5xLTmCqXYVm7oMOlQWWYsfql6woyHuID0cF9Y1SQP+y3 6jmM5I212m4p9ezg70wyRDgtKU1kWQW3oLfrVcRP81st99kownR8S+7Xm5z1gSURmhgp rIHw== 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=FxtIkdXbzo6iNDE4yzISIpBWlKoNafWnhJfmMbMyOVk=; b=SDQ3D+LLmsnpkA0nj5djaRKSZb3r3Nw27Rp7ZqVQTvJ2CBN+Xjqob6tMcL7dGjuwIz J4FreqmJ42zlH9aZyJjlN/NwCX3HU+iCsoZKX7MD7iZeQ+LAUlKxPCF1NYtbIJfyTYuE wRJ0WOPCFh1nEWBtRzZpWZUua8vL5kTWI8zC6PUYd1boqi4aR7H+9ELYbSh8e+ECKruU spKyEpOgKjoz8/sTp/m5o/E45IYSy7iIuYIgfK6o5M3SwX74u/JAGBvGPri2JjLGuwvu feH2Cms7ZamVhxZig6XbEGrs8wA9yqPEFLVPcmaXgtzoHyYNewPsjW/KIIXx20s/QIDx s0Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tFV4Wu3g; 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 x14si2081665qkh.42.2019.05.28.02.59.13 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 02:59: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=tFV4Wu3g; 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]:60056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYsz-0005hO-1s for patch@linaro.org; Tue, 28 May 2019 05:59:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYkA-0006IE-V1 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYk7-00008Q-1d for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:06 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:54674) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYk6-00006u-SZ for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:02 -0400 Received: by mail-wm1-x344.google.com with SMTP id i3so2135790wml.4 for ; Tue, 28 May 2019 02:50:02 -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=FxtIkdXbzo6iNDE4yzISIpBWlKoNafWnhJfmMbMyOVk=; b=tFV4Wu3gOK1SXwpfKHf9Q64GJQVZY2N4sQ0G1Y2Jmu+ZuSK6vjGnOGi0nYY0k56qLQ yo/zJJYHkh85jb+iQShglTTZMz8yzchNcwhf61pKnH16ZZJAUiWBzVQ1E0XVkC7zTbzW Ob6+T+pXAcKDvEGodicmrlm9Da7Kg+DdFK5gFc0dSWNfoNS+2IdPVKxOdfnFBkELYOXZ Q4TzfJd177gBKE8EsO9FZ2sAFSBDrhBEN+FkbsNSXa51Thc8tAIp+g9ekwSFAeWG9kKe GbjIp2MHKsu0MP/US0UvyaVOMan8kf/M4/x+Oterpd1drpgy61KywPCb/kKgASzEkiB/ eyDQ== 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=FxtIkdXbzo6iNDE4yzISIpBWlKoNafWnhJfmMbMyOVk=; b=RQUeKVEf4/cgz90tOp+dcrqvjtw+5OhJ2eJWXQcc9qd+a9C3aE7wb3pBFW1Ww6C9dq RsXILjHJ0t57JPpCqqD4SkLj+SVXOrrECf+QhWb7BJHe4qNImVuUUtASGLssHhB2Mag5 AsBHanpJB77n/lx5gf96JMGZqSQ+lP5OdfTazTyKkVOJPD1u6ol3JEpb45nrDDLQyhIY bhkVwevw5bQHtW3QFocOE9mhSp0wqfTMuSwWtlp7l68fU9KjJjJRTuNaTkRxu0KObhKU EnOXL0ILsp3WVNw5OkrwQrlrxuRB1MVGN6rZ/V0EA6FvMZrs9lPqkdDSGk/JKluY6ezW 5JvQ== X-Gm-Message-State: APjAAAUYsV9mVcWHDYR0rBK/K2dfJQcdfGmya//iK6UikIE+7dMRJOMs gpB8kYN3VKplwt0keuNm8jLDempjbD0= X-Received: by 2002:a7b:c181:: with SMTP id y1mr2633514wmi.14.1559037001479; Tue, 28 May 2019 02:50:01 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id f197sm2272921wme.39.2019.05.28.02.49.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:49:56 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5A4071FF99; Tue, 28 May 2019 10:49:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:35 +0100 Message-Id: <20190528094953.14898-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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] [PULL 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 , Aurelien Jarno , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, 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 -- 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 Tue May 28 09:49:36 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: 165284 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8255764ili; Tue, 28 May 2019 02:59:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/QANT9AA4HpqTuzNZRMKH9VKrdVxz2W+ix/9ybhL6womStX/sy/C2h/UVjYLvxLFO9wLu X-Received: by 2002:a37:ae03:: with SMTP id x3mr38307888qke.355.1559037578689; Tue, 28 May 2019 02:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037578; cv=none; d=google.com; s=arc-20160816; b=NviVneFQquWnw2vLtANrU08qIGBvyOKEyAzQszmluvL+3JjJGOEwVZ+xTn6H9SB1Zw SmseH/wTNhFrf6X0n5nkxnsWNQKWSDYmKLFz63JpNfDpr++8MEzQ6SHNPiaOOyRjulqW R8zX7gg8qt3bm/7yd/RT8GqRiS7vxti9C20RX6EECoAfkkTlKPFi9rO1XqDEQuCRCoVv CrUhE7UZRh1IOTgWKSnovY2kldGvi3/S/rKr1AiR10kiFlnfyxRJ2rqpJD30Z4KDgMkB +bMTFfTNO5jx6gA/ig6TR2XnGSgaWcgA0D5BvGAPEqwuQYq3MeVuBPjwSUyEMVPJ9q9q ToKg== 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=eOLgzCPVuK47NB48nwRoyyPbsLoU9UamcYj7EK9p+AQ=; b=LtB10u3pZgcuPCkiIONZP7G5eCpUShw+G2H9JOlcoVbd11OvHwpJYLoXIjhv477Gq6 xlsgohCNnQGIvPY0eDaqcXXkLZLvKZKRE6ZbAkgZEtjifeVFxSNnNSuK34jax7RgwFyy S447/bkNxwQ0WoAXScP51PWjzCyooeKBBo7KM0MrChBo/1v02Ux0ZTLVz7wgyzo/SgEv Hfx40WZT4tW7B5RHwkfYFZl4y7+v+mi5HYVyOSVikZXqO9o9X57ehY7Jb593uc0fBFTA KtGHiadiGHhEKgH0E6YdBhaGOmjHkiEXtFhbedQRy1QFUu/bur31PBcPSOPjSgoqugJr GHeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gPALOcul; 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 p25si2461119qvc.38.2019.05.28.02.59.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 02:59:38 -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=gPALOcul; 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]:60060 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYtO-0005ls-8V for patch@linaro.org; Tue, 28 May 2019 05:59:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYkC-0006Jo-4v for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYkB-0000Cm-8R for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:08 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:37172) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYkB-00008t-1X for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:07 -0400 Received: by mail-wr1-x42a.google.com with SMTP id h1so5331536wro.4 for ; Tue, 28 May 2019 02:50:04 -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=eOLgzCPVuK47NB48nwRoyyPbsLoU9UamcYj7EK9p+AQ=; b=gPALOculpv/YntpRqxs1XNvaDIpXen91zkXrRGNOvtdRe2TKkPY6QN0wv1AGB9nSNl 1ZfZf6fLkrIiTOuDYRWYV6+ARAIeqM7JmDjbsJKf3k0ua9srVcdpzuHg8HBa/sJz35Rm DWic4T5mETU4NmB3JhAeFEpZddLakWqIZLHjb/7+VdtJhJNipNv0emTrBroCh5xG0Zgl m9+2RErRl56BOsCOrERgb/5jJm1p2luNepJp49wl0iFhOe4RQWC+fpccQ7yV+tBThqpz xfzeFowOgz9u5rfWn1/peftot5IjeS8JGlU6NDDeIyIK6iw7yfaEQYIyE95GuJMUVBPZ hgNg== 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=eOLgzCPVuK47NB48nwRoyyPbsLoU9UamcYj7EK9p+AQ=; b=A2obSDZN3L8HYII+jgzRdKh0UJiGlQ3t+zJwxBUriVFLhEJG8TyuPy/oogwppby4ct bHYjK2VPgR9en81+igxem3pJlaBFUvuTOirGZfXZSGD9h4Vd8jEtR2OI62BNBVxpaorn QaUW5fOMHMyethM5lq18smRXjpTetRl5emFGliDGpFRpLyHhZ0Qmm7pQtky0SQ5GkPD5 MAuyWo9UYNcwm/g4llgnh2EZrNB7B0/TwE3oPaYlFWW+BaAyb3hljQpQcKWkeec4s4FR zINv3QgoqqO07a1pcR9ax/CtfkShZwKFlu5WM+1yU7wWFExo8HTkROUc6N87TxnsTf8M BJ0w== X-Gm-Message-State: APjAAAULlL7AKvtAWrDiNyFHRnuaGTNpfbXo0fl74mh6UEjrCMLblUxC bRaWg7vFL4Qko28oeOTnTUlGQA== X-Received: by 2002:adf:ec0f:: with SMTP id x15mr7658418wrn.165.1559037002960; Tue, 28 May 2019 02:50:02 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d11sm12704447wrv.72.2019.05.28.02.49.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:49:57 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6D5611FF9A; Tue, 28 May 2019 10:49:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:36 +0100 Message-Id: <20190528094953.14898-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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::42a Subject: [Qemu-devel] [PULL 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?= , Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org 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é Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/MAINTAINERS b/MAINTAINERS index 3cacd751bf3..cc1178fe692 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2562,6 +2562,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 Tue May 28 09:49:37 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: 165289 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8261963ili; Tue, 28 May 2019 03:04:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZ6B83ih8ZAH1t3Jalsj02bZgIuOYa5l9vUqbPnS0oq+WBTfxxOkIMwsrJgrCTH9t0z1r5 X-Received: by 2002:a0c:e90a:: with SMTP id a10mr1472226qvo.17.1559037883053; Tue, 28 May 2019 03:04:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037883; cv=none; d=google.com; s=arc-20160816; b=d1Q3O14T7UpZrbBEf41kXM7BEVOqv/M+bykr7uVGZic/pay0WGazfvQZMtsmbMbM7T aceICuUwjKKOrCOXqSAxUTjaNGetyta0TFMtvpNUW9ypFMJnK/rVMhefupgPc3K1qYnf Hirz6OKZ5hhULUN6Lv59uZq4MDvpqCH+Amj5UzdI1cf8IbD4b/gKorWGptkpar+2x0FC 0vnFYzvxpLt8PHfOx5kxyNyoMEYH9XQikfQsKsh7dudziP0MApOlYAYwh0cWu6NKZp6p LyI/d2h6Coh/GczfbuP0lbwILL7k6Zb2D8vl0tymq7qS5v60uz1SrrMIhUBCXgRrBnxG AfQA== 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=AVe13N12Qyr3X7QnGmWrUiMxH2ipPSHqjdNskm5lzV0=; b=xLsgn0WIVvltYqG4XvAufd0iRIVJFQ0YPCEjFyR9+2qOi/oBDr+BOF6sCJCSJbXS7E mim/Qxg9UOD1XRvvjHH6qwrruOhbQvwbcQASJ+RHZOe2J50lee51ln+clbUzW2Hf1OZH J54W/f8hyMm+Mdy5qf70jE3/IR+OZsItfcGLSRtITk1IdLaFoHz0rObBU33wbQNfGzej vf38crs4Fqop/3jqu7ko35ncStCxe7oJgQyCvt5maRSxImR8NRTzvR+Iv+pwLY5qrjxw NwMHtgEJTopeb9UA09F9gdqoK8CTAEOY2mY4vmuxdl2YGaQGbPEEMYRkoJSSNqYN/ihu +XgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=el0FdrJ7; 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 f15si6061544qkg.48.2019.05.28.03.04.42 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 03:04: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=el0FdrJ7; 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]:60140 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYyI-0001ta-Gq for patch@linaro.org; Tue, 28 May 2019 06:04:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYkC-0006KB-68 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYkB-0000Ce-72 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:08 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:51337) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYkB-00007r-16 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:07 -0400 Received: by mail-wm1-x333.google.com with SMTP id f10so2142887wmb.1 for ; Tue, 28 May 2019 02:50:03 -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=AVe13N12Qyr3X7QnGmWrUiMxH2ipPSHqjdNskm5lzV0=; b=el0FdrJ7SxwziN4+YFvmUStwfKZRmqIsc2v00/G+LpRDf7ts1sCVkVRhiIjj4m4xzW mmjIpp1jtCQMt0NrC/drHOlpIh6V+h2QxMoJPrZsOkx4TAFWZAMACn8SlnyLciBbSKQr 8lzB65VjT4/bia1WEnGKYiDYVk4lMwpYDzD5DAjqJd+6HNNZ9gfgKaJLS0OZNKXlvg2P 9PGKc/buRM5WaD4kXxgunw7Mn1hbk14e6gZuYAEG69yonkbYT9ck5P4/nAlw9WJb1sSy NGIU9+uxEqG8i09gxO+EfZTnLgBIhzOUGILxR5BqYmXGifwtCzmJhQU6mLwP3y9Mdp1Z XyTA== 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=AVe13N12Qyr3X7QnGmWrUiMxH2ipPSHqjdNskm5lzV0=; b=YQPpI3d+f8fXPNC5xpSHYR7guQ1pN1TkuujI+H8QDRAGWkztSBxKGNwY1eN0JVxhH7 tmCryFZMcEAhszvkm7PNedZCM7I/y2aPEjOzKZ8SuBDPtOeL/COvsdZ7P81+CPhJXdFQ jQBfGOSRlFtw1VIJkSkWO6+QiEEODS89eEm4IXN/oDTryaqVz+N6a0MhDcsRgTFgMD1L nMkEpq8CcEi8AmVG1ntsnSHJYxq5YGB1MMQFrf0NP+oho+h1nm5aWst82GtVrh4rYSDZ Xt9P9X38QsWhZCMzCnqJergky4aXi8Vm1pIoUv1Beghn/3IuklXA+//PWwDKDGaedQIZ ajPA== X-Gm-Message-State: APjAAAUvOsCwokN9TxJd0A0lxJzArc07LORrsCfISl21xqu4wOj2f3HH eiG24LwrBbQ3L/yaXpwmyq78kw== X-Received: by 2002:a1c:7915:: with SMTP id l21mr2476187wme.166.1559037002288; Tue, 28 May 2019 02:50:02 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d9sm12242564wro.26.2019.05.28.02.49.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:49:56 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 803961FF9B; Tue, 28 May 2019 10:49:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:37 +0100 Message-Id: <20190528094953.14898-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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::333 Subject: [Qemu-devel] [PULL 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?= , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, 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é -- 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 Tue May 28 09:49:38 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: 165280 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8254841ili; Tue, 28 May 2019 02:58:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsyoR003ryEcXXms+AuP11CNAjFsqqyJ/ag6jxFiRKDZdUF4wlxkBF0fPpsXmhwAwsjWNz X-Received: by 2002:a0c:9499:: with SMTP id j25mr84898254qvj.155.1559037517600; Tue, 28 May 2019 02:58:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037517; cv=none; d=google.com; s=arc-20160816; b=RXK+glLPY9LLg/XVmgiphZf9P29WyCWEX78EZh9lwsqD8jvD6WISOuhwgkFmRHIqT5 J5s9x9iD40X3k4k8QiTOZwe+nw+b8Jjw3lIfo2IQF1ZQ4e0VTcx9ecXOVOP/EwCFSBrD B+W6ZPOzArl9GVZv8qdwwfNeJS5AHAVi4gAxUoHTb8GLNe+nBtwlqv3TYVID5tDH+XuH 9S0gPOlBh5g49N7W5IPAoscrVb/LjgCzrGq+HISoko/9kgDGos9aMi0zs7hQ+cukAWWm U3t9QYMAGJ75SCxgWhuUCzgIg7XMPyLRGFU5xVrGHb+/JLpLBvnomR/RY0c7u86105tc v06w== 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=YDNzQhJzHpYWtPYJ/WfzD9Kmonh+P1NhdBxQx7bYzps=; b=U1PSiIJjTv3k0a/QZyY1ncW7zrJrbxuL+1gOlUhA4NzQogtjxslnbkUd+B88vUW/oI Qlp/r8oWqY/Di66yGmYe/ZS10GXsvCwepnTs0QhWINaQlTYPC/Y0vzgjtqUXoresRk4F 5u6GR2t6ThB4DRabiQWFZXyVEF2r4S3rjvwBRtT2eM555IBaWL+W1/tMZsfWjzET9f+u 5L0Ii8uGjoxDV/zboIIscOzgT1/kyOQ1cGysUA8yG7EwIrp/8lkrhwukot0BIB/7aTE8 8ozHipNILw4wPHg736WAS22DsRmy+NmqprKZmljb9UBxaSDr4F6Gp8VUPW0R5Ubjy2Df xfwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qpePDlx7; 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 c11si3215254qtq.73.2019.05.28.02.58.37 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 02:58: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=qpePDlx7; 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]:60048 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYsP-0005D5-2W for patch@linaro.org; Tue, 28 May 2019 05:58:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYkC-0006KI-8d for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYkB-0000D1-8C for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:08 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:45509) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYkB-0000Ah-23 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:07 -0400 Received: by mail-wr1-x42f.google.com with SMTP id b18so19436593wrq.12 for ; Tue, 28 May 2019 02:50:05 -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=YDNzQhJzHpYWtPYJ/WfzD9Kmonh+P1NhdBxQx7bYzps=; b=qpePDlx73KMab03AZXzKxDpXvxURte1hnolFvszFU3PC+7C+35vW1YYt8Vq3j/8ru0 l5NDBx0ZIWznm69lLQhj1y6HnuewWOY2oyBOoogdFz23uW7Cg6AeHbOEXo4z1DXVE0nW AYO42/KikUzVBJcjdVPwotwF/IgyARoAAEmD3vWiZASkolE8XMHFCClPo5i1/YG4PJMf hrT4Ir5DRbvssDLmBAqOBwjR2P99WarhBim7EBrE7dsxghn1NO1fuqNQaV2qiwD0oqQV JIhcdRQ+G/ZV8tECK6BDvjZLvnqR3pMTOMWPH5kIfPtl5Fxgb3bazWkzG6l1+qeNuChn MULw== 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=YDNzQhJzHpYWtPYJ/WfzD9Kmonh+P1NhdBxQx7bYzps=; b=Kg9uE5y0l81NpKhtlMrBb7QJc1XQSAjc5sRWJaOV7C2J4esNaio0bWwCcHGVbIgJ5R smXlyGJBDk94MdXX28PbwkUrrpGd/PMJIpEUCgLlsQyVdUXFSJAfB80HVDEAOG0KEoyA svSuGja7hTKd9H/JQZ+IXS8KNWIw7cJiTVqlON9WGDCLV2MqXyU5N3K0v/cgq42QOHwh P3gSbIY0p4P76uySbblK1rSEO7OUPMhmmL2hivxaKmNtUekpVG0mdlVX8M79BQypqE9W oPewk6wrVAqNJSV5eDwetjsXv80oDzeNbFl2pJelpdKP9K9bylTCc5kA8RzfCy74adIx BSQw== X-Gm-Message-State: APjAAAXiBd2Giz55C/FvbQaSX2G04IUn3L+jvzWwZXDa/YIstWw5nzmm BnTEyXSU/AG/s2cr/M4SjZEMqA== X-Received: by 2002:a5d:624c:: with SMTP id m12mr12625819wrv.354.1559037004886; Tue, 28 May 2019 02:50:04 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id f2sm4479998wrq.48.2019.05.28.02.49.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:50:02 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 94E6C1FF9C; Tue, 28 May 2019 10:49:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:38 +0100 Message-Id: <20190528094953.14898-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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::42f Subject: [Qemu-devel] [PULL 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-devel@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 -- 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 Tue May 28 09:49:39 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: 165290 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp7807333oca; Tue, 28 May 2019 03:05:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsN/r+p5MEhMEiiTOo8/sHmqyDUhkDyC5wUYaNS7m5QbILqK2pXCLetxvZnMjQm9yT7hkT X-Received: by 2002:a05:620a:12ef:: with SMTP id f15mr4485614qkl.340.1559037926120; Tue, 28 May 2019 03:05:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037926; cv=none; d=google.com; s=arc-20160816; b=vyc9Qjp9IgerBaQpwUoKFDfwV48pAFaJcAJrGM1VeByiTOgPFF5udQw+FwyA3S79Tq RvsdIkiMmg5VUHfD1/Pc7M1xLZc79zS09MzJTomLsoilED9q5q0b9JHFSiMhMNRcmH6V QNS1VPvmlEqxrQJV9j0LxkIDkmjb4zCuO3VZulByhm4i25hMBiVGQ+wBpuwbKUTk+pfX 23VR8Ht7R1sS/vOdhJm82ckjpYXXaqOxJdaIEpEIY+qvOIXZWx8umhk/QTkhad5rEOBJ yTynIYDFN7i7tPr4beRypJZDklShsORk6a9YJqzgwNaesg3+wHrG3LyitWE7rKhApYIa DGsg== 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=c6ckUXNY8YtrdJt2PGJuuiNEz2jhFg33XnClUpP+3OA=; b=OIOIEh/8kHBjNxwydDBKLJ4yUkrzAFp29ydPfevLHWnWkk5ZOwMWHiJgIhL0lUbu0p V6SawKyPtD6KtNG0cVIJRbppS6JDXu8hY8L3foLIe9ePZ4/ihug3POicW3yZTaoDwCwE s0/eoAvx4VA3TvZvw5c1zxFJayx3QIOI/YY3cY5Nu3cKSQjJsAE2Jw/7PC+eCODOJ8f9 avrNAIzhKasSfbb2MVVHUMlRfjwXnaHJUslYVix8zWkijUFEzyDJ7N/bzjzM5o5C2xgY 5Zra2n34aSpbrfMdclIWx6TKLBD01woXTHUlQNB78F2eN82FS4L78IMeFpy3Wy+XiPG/ a6yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BrtZMIu9; 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 h29si4964944qtc.268.2019.05.28.03.05.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 03:05: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=BrtZMIu9; 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]:60193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYyz-0002P1-OT for patch@linaro.org; Tue, 28 May 2019 06:05:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYkC-0006KE-7G for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYkB-0000Ct-7j for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:08 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:38132) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYkB-0000B5-29 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:07 -0400 Received: by mail-wr1-x441.google.com with SMTP id d18so19473519wrs.5 for ; Tue, 28 May 2019 02:50:06 -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=c6ckUXNY8YtrdJt2PGJuuiNEz2jhFg33XnClUpP+3OA=; b=BrtZMIu9sFhJAYg545BYs5wwNpO7LfqWqewPdAQNceOYrQY4SpIusyiNi9JPsxxlIR CaYvHOZc7Egmk2HXqnM+WT5G3kSEPF65tIuVPDodgg5llVCxDFS43xu6uCUWMmNVR7Ef kP0NnEQygsejb14fGnAaQTWvw0QFdByxwXPgM4Ewf2eBnF6SKzVg1GgpTO9z+7LZNe4m R/AbIe3fiYoFYsGu+48+mtNgeKZNl4UXvtjPj+IF3dJ94A0hCUyND2T6/ZWx1n6dpFfd aflgwa8ywIdo5wHv5BPDd7Jn1FTt+SnEGewhEeZ16oNntPxAgl1TGijWM0inSloKJS84 7J5A== 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=c6ckUXNY8YtrdJt2PGJuuiNEz2jhFg33XnClUpP+3OA=; b=t/itnYYWwvZqtktZNIU81YRab3LqEE9SP07u7GAEho4NjHpD4fd2fxvjMl/Bk8Plck jg0+ZM7Xf2MSgzZBH6nWudS3JkD3X8vrZU9/v/YD0VfNuYngVJuy4HJ+cPzgmCeU7o0z qXStSXiWpRGOpLqyXyvDATF9qIELE+b5ZMPN4zM7B+NUvzsFTRS34xG94dkHrXOSZ5nU crCR+5HPBb0yWnBdKiEwG25XL55E60lR+6yx8mP9qyhYx0K3N8mSzjWaQ8IpSHOxx7Wk VVPm908khnbKQ2Ul87zIIRBHz4gjSz9EvFWclRYmUIvFNLPt665wNou+pF9MIFxRWGaA pwVg== X-Gm-Message-State: APjAAAVqxnnGXx5Z061P1ckax6ykWDgIPOfO7x0bSRF4BLXNTYFlJn0S nii5QXSYpVdaSq2dCSp4qrqywA== X-Received: by 2002:adf:e80a:: with SMTP id o10mr17022177wrm.79.1559037005360; Tue, 28 May 2019 02:50:05 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id a2sm7731931wrg.69.2019.05.28.02.49.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:50:02 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AA09F1FF9D; Tue, 28 May 2019 10:49:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:39 +0100 Message-Id: <20190528094953.14898-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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] [PULL 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 , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org, =?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 -- 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 Tue May 28 09:49:40 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: 165286 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8260815ili; Tue, 28 May 2019 03:03:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqx50LzG3JPVKUdfOGCQ44Jol8PgjGz3s41L63aC8WgJpOys0N+aSjJ6tKlMDvNWsFGFGC35 X-Received: by 2002:a0c:b902:: with SMTP id u2mr39470367qvf.151.1559037828372; Tue, 28 May 2019 03:03:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037828; cv=none; d=google.com; s=arc-20160816; b=HR5iCZWWBk12UhsP+4GfU8s9rWrzIVoY4mjTaUf4tUJzHJRr9NK3HefRua4hwhtuCn miQaSN+2hMv/OmafhYDjK/QFRASwB2mIpabw5NTKz+BdFfwEaJtoX83rowxrWMbte2Cl fRG+PoKK5zOHQAyMD5zgTckAjTlGRkrKwxNlaAm+hyrsu7AgLtqiZ8hTgHr0skUGtOF+ yXTrNG7Q+THAwYhyYNqHTImJHiG97ctGVPO9EarnAWOiJp26upOzuOMrXnHvY3XhdtWI 6kaFn8tGFveMrxNHOFtBubjo/Vvei5FjJZZwpXV7B6/jwN4EDRjrfHlZl7hZMRGRaWh5 PiIw== 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=ouRT/UBjHUBeDQJ4QIlqT44+hOMvQz+edWkO1B7kdOs=; b=joWGXBTadJ1sZcdlZOZ7NLGB3QIj/Sv0C13nL0ueVZ8/PINOE5sdY2WZlPsbZ6XSo5 uxczGFX6/TYD7OsJsGfK5cxWL6BENPHVoEcNqxUqRKeX8Dg/lQTtK88DY0uCyRTsUfQ+ /pOEogotAFCrAgWDYBcLyrZLZlvY+yOriuB4o5wteo+Y+ebHXCscXqC9i1vgDuwL/ZNC 8GfQIp8JPMWn8mde3bgEcTun09y9t6lTeYNiXj+A3rzVtPN5t4WBHGaard8Nc2RL8aVg wjTyMT7yMsYTup88l0ubLyxQe7AKcY6hlw6fFjUluFtSCV9jIzjDeFASTq6p7Oonw4+H 1nXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ms7W1F5X; 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 j13si4590827qki.271.2019.05.28.03.03.48 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 03:03:48 -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=ms7W1F5X; 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]:60132 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYxP-0000rt-T9 for patch@linaro.org; Tue, 28 May 2019 06:03:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYtg-0006Mm-Ft for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYtf-0005Y3-2h for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:56 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:38499) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYtd-0005Un-Ql for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:54 -0400 Received: by mail-wm1-x341.google.com with SMTP id t5so2126710wmh.3 for ; Tue, 28 May 2019 02:59:53 -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=ouRT/UBjHUBeDQJ4QIlqT44+hOMvQz+edWkO1B7kdOs=; b=ms7W1F5XzBFG5JijFLJunNaYtYsk8F/vVqdW/xzYhD3ydGsnnEE6AN0GxkKEkCGJ/u 1gDnKMiLlSGY8oISRir891gZNePmpaHULIOcoXoYQKSrHBUz2+wNwLRKWEPFwK9G3TFa j87xKyq1x0sZX5rlTRBhhkSY4UUFo+dNZ2FTwmSAsAKdA2V1MExuyagbq7YaNHbzuQnd 81U2coUsUKmvG4TlKXKx0QTw23vReUMzEC6I91NdjhICqnE5eBlUxxEhxRClNm+tNG4d kTBbIvqG00wzrIY4AV1h4FE1YownzdAyeYHGhivEJAN89GXbPcmdnQm4ks6N/GwlsKaj c3Gw== 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=ouRT/UBjHUBeDQJ4QIlqT44+hOMvQz+edWkO1B7kdOs=; b=bMtT3aNfIDEo/z9vNcHNyJjYv49YJSoPywZhNvlQ9i+G9vjoaJkgfRAHOQGC8rNi54 WF5KKPfV0mCYVZLjCbWknhyg3dx2XndbyDimwzrcKVH2yZiPJsk62ZI7+RpRNBVz5NUR fJeqgWe9QgzQfFyv3KqNQZnZDR/3neS+XuY4xi3fps/h30DQysv91iwS7aNKzSX/IJwe fDTpq3R2RL6fHjvM1lR0vfMv7qeX+qlg1U75GRA6G9+8cwu2G8Mr9WNS77rTmYRtnAej d0Y/K/auPEl0R68C4aJCUXXZHw6Cw3VYVKUvb4GOQkdQZ1+ynCg2eVfyUkVITokJOJVV nLUA== X-Gm-Message-State: APjAAAVwr/2Fa4uy/e3RwQfz7njkCRIY+eQRtNkZRg1kBwrlv6pIjl6Y TjGgJu6iC8HtCAUZ6Rwx1N7wxw== X-Received: by 2002:a1c:35c9:: with SMTP id c192mr2568076wma.147.1559037592661; Tue, 28 May 2019 02:59:52 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id c131sm2165251wma.31.2019.05.28.02.59.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:59:51 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C059E1FF9E; Tue, 28 May 2019 10:49:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:40 +0100 Message-Id: <20190528094953.14898-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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] [PULL 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-devel@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 -- 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 Tue May 28 09:49:41 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: 165294 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp7813359oca; Tue, 28 May 2019 03:11:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsMfpZARE0/KDBt8jZLpZz1b9Jl9b41yj6mGqQHMS7qPTkMR2OrqZTNC8Y+Ty4FuzXdj+4 X-Received: by 2002:a0c:d941:: with SMTP id t1mr94921223qvj.204.1559038268652; Tue, 28 May 2019 03:11:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559038268; cv=none; d=google.com; s=arc-20160816; b=IqnKxtQi9AgtiHOY3YDdCPTLp3DPGHw5DjNS1kXSyfQF6L+W+zyYw4Snz0KC2zIMoF Li1jlKs/c+DiCbnqQy1l7ZE0Cy/qyCFh/+kUHRclRckVPHyuUxFbDBv/lizeT2mLqlYb jJSTEmJbigrD2f01ez96RZzDYRRFdbhvLJNqLHAcCsVg7KtbzlnniGFrlQHbKDB4lx/4 xvPOcAkresl9jYSJzZ9kCinBqtE2+Tg53KC0rv8fElsoX8zXz/oSeZDNMEffc6e7kJnL XauuJ6l8Vn1JuVnLP/dW+EKka9zWRlkGUDco/aBAJL/+JvfnHqMxboDGIdiTotWmbKc9 ARGQ== 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=CMA0ydslPmEPlr23YQd+yhHgYe7W2HnkMpMaOZEuquk=; b=USLkeu6fbT53axAan/KRVfo+Ab2g0Js6tQucVTWUCWbgOduzRKscSvi9t1SWtSELhz l/Z3EvHekBk6fZLRlLbhMbbOnDvEgiwiRp7CIzDZTTf02WFXh4vdsFv+yOOJ7UmVd8Jc VyO8sMOCRfkABKAnLtIcQIP0YQ4IidgoMsZbEIe4Khx4d4RgVSjYVnYpou6BzUtj3REL slEnkEti9hquJyGhUKEQR8FkEzMkdfXElif9RKFDWt8ej/M00SbTye9Y5BzXJnlNULFa ksmKXS5uTxpW82kEIxYlLoxelEgOX5C27qxXnoVXrP7IZFRdOqshtT0ycp1P7DH/2XCI f9pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OPSlgcE7; 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 o60si6350363qte.292.2019.05.28.03.11.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 03:11: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=OPSlgcE7; 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]:60265 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVZ4V-0006uf-Ut for patch@linaro.org; Tue, 28 May 2019 06:11:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYtf-0006LF-2m for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYtd-0005WD-RG for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:54 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:35552) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYtd-0005TC-2t for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:53 -0400 Received: by mail-wm1-x331.google.com with SMTP id w9so2133161wmi.0 for ; Tue, 28 May 2019 02:59:52 -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=CMA0ydslPmEPlr23YQd+yhHgYe7W2HnkMpMaOZEuquk=; b=OPSlgcE7YkshYZTHRYGcP82H/qljTkKxyQpGXoFrSprAFyozjJ8YAh4LxMZNaIWFQl BFwkl2mSYX4bqGeHhTT3nndApM6F6v2n0cnApg4eN7oO5z8NU8EfxXRGeu3tph6j+CCu bPe/ZaaQgVba0w8lPpfQvgOLEvyPuCd9vBoFzzN529Rzl8lBETJEJK73zjJtnSw96OZq rgZfqYii4TQ56gTVZbrr6VP0u9kPBzkZEw3IEw0phcGAFBpLCEkrDZVUUjoRcYWveOkF 7aLEZmngjono44O9zKQnkdaIMi5GN41ADJLDqReiyMXBKMz0Hvw/yio5do5vHJtvgMt6 i0gw== 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=CMA0ydslPmEPlr23YQd+yhHgYe7W2HnkMpMaOZEuquk=; b=AiD1Kw7cybgXgU61+gYhb9EEz0HsiaUwXO+qfpEgomRqsU6jHq4Q4gE7pSpL+s8HCw JHEDSkyUfeCl2XFoDpyty9ZjJMHIN/eJ46MdLeHW//yQIIZ5GJdgry73384TWfJYFeoa i5hWFSMiUyVAf/vAzaqNDa1WP/euG0HsI53gWL7S+8lDU6OCLQHYrSmpzacYiBCUH5TA 2xDZc3FcvgskUGty4K3g0xa3urvq2ueYuieRVNM1KanPuFQ3/LE3BZFabCb2h1Ml/gMp EhQBRaop6VaG/tUTA+LhuxMgQBc+DeVB/q7lQ7hVKRl4ig4gatb390InJxUSE0SAswyI hMIA== X-Gm-Message-State: APjAAAWmWCmiCrdpJyZNPHq3HzP8iNctQ+H0j8PTXIb/XmbX7zWn+KP4 PgJ6WtSFpKGEeUQ5Tft5J4DumQ== X-Received: by 2002:a1c:9eca:: with SMTP id h193mr2456177wme.125.1559037591079; Tue, 28 May 2019 02:59:51 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id c24sm1639625wmb.21.2019.05.28.02.59.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:59:48 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D56101FF9F; Tue, 28 May 2019 10:49:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:41 +0100 Message-Id: <20190528094953.14898-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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::331 Subject: [Qemu-devel] [PULL 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 , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org 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 -- 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 Tue May 28 09:49:42 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: 165285 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8256699ili; Tue, 28 May 2019 03:00:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYeQI4Xp+iLmhQI6FRY6mSHAexBS4We4BMBZRYOjuRwDhw0VqoGA+Vl/B+o6RDW1AZ+TYB X-Received: by 2002:a05:620a:1232:: with SMTP id v18mr93544980qkj.27.1559037631876; Tue, 28 May 2019 03:00:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037631; cv=none; d=google.com; s=arc-20160816; b=K2k8hwDBhVOsojqTtJuHBI6q2/NDFO65XbSIKXXsJjPbGgi03RYjxJlwsCNkVuiQSJ U4v2MGqGZSOu3UMhIWWTXUoLQgurHzE01c6y6OVj+Jrbt+b97qfhAh6SNZEL31DRp9EQ kHWfX1QSA6HjvwE1Pqo0A+i6r7d7jCQnjBT9LjKs/nDC4WWqNwqPGwrlGG8axGhr8cOL 9RT5nt9NCOycUr36asS8YwgsjdE+keeUd3X6ijDVhgppkFNOvuxqClai9kVPlWl5AspI Al6QC6d0IzgickiWT7/NobUiStiao0Vp+d94VModNwZlmjg2bsbPquLq/RVkiLNVqFCy BLag== 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=gs/MZPP07Uk1YwonADDRXbResLLSvRO48g8gHzEWeTY=; b=thecPEElbI2RfpA44WaKxv4y8VQUTFgzlv58GLoKByndQnEl5Nq18HEElKltmx2t49 NRNQOeFCExFcZS7fMrNaNt9w7hRFSESmNbZxOwi+hwwQj2rSzfeyZ0l2EdFQOhEPd5zW utPn0G4Mr7A0YCm1xRKelE9CKAnQzqxDKcdAJxBdX4U6JyXFtaaR832EbET8Y/4wV75/ /Okwrf/8znb/0jCtMo4dIECWh8e6i++FC3PhH5xiln6n8BSKv9pU2KLA6WAGw/L3mBd6 SVgm8ZkiBd/0t4qadjqsSTngndefhi5J2F5XQCsRmnTwXAkG3w60wvVqxiF1TYoVu2KW 3PvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KOaM2cN+; 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 n25si1142885qkg.264.2019.05.28.03.00.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 03:00:31 -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=KOaM2cN+; 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]:60097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYuF-00070M-0g for patch@linaro.org; Tue, 28 May 2019 06:00:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYkE-0006PD-GR for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYkC-0000Fe-LZ for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:10 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:39388) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYkC-0000ED-FI for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:08 -0400 Received: by mail-wm1-x344.google.com with SMTP id z23so2081281wma.4 for ; Tue, 28 May 2019 02:50:08 -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=gs/MZPP07Uk1YwonADDRXbResLLSvRO48g8gHzEWeTY=; b=KOaM2cN+EBDKcnFwXsHMFCUhnjFU+3/cC9Oxn5eEyA9UTqNdjvLEBUxLJmB7kc+R48 E5du212W96JJUi6kVA6k2k5glbGgxrFLmVG3Y9xcCHojwWa/7imILXfCPxeNDPKgLQvy 6w579QDN6fdHWp912XoL5utQTpoBMtL5uA1I1XukkK4t0CTiYsPz/m5U9AGYnH6VY1Au 3hvi6Sx+ESpmBxSJPJHkK8uXANVGVdpfioZhdt/lIh7pvGWM4EEckvWbIJTXbL9I28VC yqyOPEpKbIhCFxIAOjH427sccSqtNbFTMXQ94+VizgsXfqCpXKWFp5atFGNrYwn1BD0Y rtbQ== 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=gs/MZPP07Uk1YwonADDRXbResLLSvRO48g8gHzEWeTY=; b=cajyUEfwgkiaSn5ylDPopn7gmTYAAlGwLmQidSC1T92ssKJmMogVlDBFtJ3eRgVWUS uEffQ2p/+/roOZzla9t0BGNBTfMk6V0deqqgZ+EprMuyGsBDLIHFtyRNEXuWgbNrzodY pKNeJ5RtInkiCpGwmsu/if3x+SovvBtqUb4FI93GWf5i/XrPILLs39x5ANEer/gyxSFL wuBtOoFxKhQzF6YqEuCqf2hEFgPiTzOG8wLXkn/fTbGuJs2k46Bci9n2Vb6SIG4xwABM gJ8UFkoWlnpDUB7Jk8l/+0EJLas2hVSvIb7u8B5SFgZxUxIl9y9nA93p6gWTbgOGhjiQ scfQ== X-Gm-Message-State: APjAAAXxM5DaywRCmu2imbNEecMVqbkSFxv4u+cBTUUZGZ3HxdbXd8rF O89mAMPMbGQ++spdqTqf5/F5Pg== X-Received: by 2002:a05:600c:10d2:: with SMTP id l18mr2532304wmd.174.1559037007353; Tue, 28 May 2019 02:50:07 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id h8sm6125436wmf.5.2019.05.28.02.50.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:50:06 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id ED9491FF8C; Tue, 28 May 2019 10:49:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:42 +0100 Message-Id: <20190528094953.14898-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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] [PULL 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: Richard Henderson , "open list:ARM" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org 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 Reviewed-by: Richard Henderson -- 2.20.1 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 Tue May 28 09:49:43 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: 165287 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8260966ili; Tue, 28 May 2019 03:03:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9FoQ8IvqROhwxbHRuiW/pxMdX9F71W+nU+dNkkAvZszBDXKeE+u1RX+BNz7/Jsw6qV9TB X-Received: by 2002:a37:e506:: with SMTP id e6mr83159292qkg.229.1559037834557; Tue, 28 May 2019 03:03:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037834; cv=none; d=google.com; s=arc-20160816; b=puWT2YVGmgXNbxKcTOAOc6g0vpYdqqTRyg1MqlJq75bF0C8JQqS81ah7wft1F/QAmL aNQj935fxiwhUd0xR890kyS+8sKsk81lxKHt5ER5EM34b+lwV5KqDmqlV9gQ1EB9p0m5 A06rsL3LczTYB9VJ1fiGvIscZd48dchHTEmvGGbSQqCPCbfwJRuQt9eq+rd177dJxxuk x6wuscznPIGZtJBHd9MEZMGH+uc/0p9zSFFuse1cqAvzsdhaOd58brmuNp2GM8yA4m/3 kH0E7ca7k94HtIDDjES5xyLPmLGPFG7bhnnwrvPo1IX//9C5hoPdoPL5tD0UZwQutw9c rohA== 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=Vg1FaPoEUTj/0i8EpZDow0jYp/5GZ3VG8fBtm+U9lz4=; b=CczBh8VXaqC6bkYEGa95P0S+gvxpaMQfvmTg9eMbGxw6kicxokYhY9GjCT1v8cw3zt alwaPg09Toi4YeyQCA/lY7jkpWqVzUskoZilks0cHvzbhasicdfVZzOHOfO/XP4lsF9g wZU6VmA/0yiK9pYMbHutVG24WJaFNA9mIQycryACZI6WRTX2kONxHU/CIZlPlEIIUe3G SMyihVtlQ91meGVBZQ/R9v0ObRJhQGullRh+Agz96dCiZcZhP6WD7iGJyq3g1yH4LY1F mYZK4VrJCaV3v2d+4dA80YcpX9iQYmk6DXBi0A+EYi6tT75MfcCXQ7vE5XIL4uPLSRmP +iNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VmReKqa8; 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 32si6260006qtc.25.2019.05.28.03.03.54 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 03:03: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=VmReKqa8; 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]:60136 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYxW-0001HQ-1n for patch@linaro.org; Tue, 28 May 2019 06:03:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYtf-0006LA-1l for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYtd-0005V0-61 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:54 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:36849) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYtb-0005R3-Ie for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:52 -0400 Received: by mail-wm1-x341.google.com with SMTP id v22so2129128wml.1 for ; Tue, 28 May 2019 02:59: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=Vg1FaPoEUTj/0i8EpZDow0jYp/5GZ3VG8fBtm+U9lz4=; b=VmReKqa8dO02Z2M/344DTVUUXJj6q88jTR188S0jLGEf8LdjWcaD3seB6lQfqFqSZu 8s3Ap03C1b437hXUDKrKlNxSiQbNkExC3vLEcG/LkVtfZi4FD0jv6z0nJgsCTxsPr8ur RiDeHVPROkf9CDIprmLM5qKpZIBOtAyKIYQQ78sGX59gnGifc3VAOcoHCI/I5uBctDBL OhZoSGNKVNvi69OOvig6j6f/Mzzsn3FegVwtY/1dBNCO0oqYrSSY4LqUr1/34IOqmMwG YOX11l8NjcOVtuLNBzJhF53K4KF6ulovqOfCFrvt4oDLe8BX2CtPAKChtP9rboZuMimM Bfig== 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=Vg1FaPoEUTj/0i8EpZDow0jYp/5GZ3VG8fBtm+U9lz4=; b=umw5kRLbviABk9hExUQ4OviRs1OqPJXSBfuSg2/THRP3saEjedQiYj1QTbyhNKWmw6 1GaEzlka5azZb72Qo4s0vcrYlLnz4CpSnYnFKoS7vUL5UPmp4TN+4TFTdxhpmHZrcoED 9FFYCL7VhcXU/qmeclxOe1Ypy52ECwdjVUr5AINlWiiux6BHT2YKIPgaJNGyhgNmPkiY RggIi/9E8/HbLSKjT0rmiH1zHKNbEz7Jzl2dHxU7zdHd4WKuUKXiBFzYi5DSXy4AVOPO nGwTKWuAFmKahxaRhWl9V8FvmoR0gTmHrJ8GULdvwGfcexfAOCTPX4hHyfaq+YkkEI6M iY4A== X-Gm-Message-State: APjAAAWjahceBbG/G3d+S/Nx9E+JDydsefPeuVJMqiMHTrfmxzNsE89T KGRnG64T1g92eOqnBXyWSh7KQg== X-Received: by 2002:a1c:f413:: with SMTP id z19mr2610407wma.145.1559037589790; Tue, 28 May 2019 02:59:49 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id g5sm6257035wrp.29.2019.05.28.02.59.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:59:47 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0CF431FFA3; Tue, 28 May 2019 10:49:55 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:43 +0100 Message-Id: <20190528094953.14898-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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] [PULL 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 , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org 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 -- 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 Tue May 28 09:49:44 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: 165293 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp7812465oca; Tue, 28 May 2019 03:10:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3FqiOn2ttCqjanPIPgBvoubvhay00zFl21DduUtkXcIGghenaDpYWmEdgP7kGtaNw1UH+ X-Received: by 2002:a37:a854:: with SMTP id r81mr10147565qke.53.1559038216255; Tue, 28 May 2019 03:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559038216; cv=none; d=google.com; s=arc-20160816; b=NSHL4I/3b+fnQ6I18zSAJ4mbcySO33WuCZ9K2fqWh5v9FbmByWk+EnbdhDiiLGgacK czP3DlV4q9XAJ3yx5iRhCqdO2fWypxnLWm8qtcdQKpxEt8Rha7jYIIriTaz54uL3bhJ1 gxlLvdkickfhXiXifLlKuladh0E8aUTspEDX6/U/uBKCczm9I37jWvCKDs1LPPmrJNRE EYJRDolwSWvhrepSP7yJdFg4DiiiVcVwLQPhEQEnesiBByCBhfiE/qtoNod4zDIbay5G TifIk14al89TNWhn7vkXcT4FNEyrb5y57ayGmzqxDf1NdIyuDJEkZSjFKkoGPCerEjaA YFXg== 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=uUUpFitvie/E2cI8g/Leng5/oivvqAC4XiTmCl3vOvg=; b=VyC6qeZp+eh+GdPbGAk6GoQygmfMdZE2L+b35Xbk5+Wwe1O2/liXDydkCfl5Kur6ri /8KY4Efb+7uLqPWgfukORa/Q+FrQgl/evSbVbHdvlTJaSpTijTs0hj4wcWK7XEbcx5jM KwiYgrMJ8cAbmwaHNZJ8QNBUEOkyDXTagxDZzUs/hihw8tLY0hzixEIMqK5TllFfhIyG FNmGrftWCblWF90Cx8UkyZzGOQPTGDTlAOJtJewScujy0illG/CPfr/IWlTQ517QRP/C l5e7eaQP9RQYm4FOrp0/lRpKhYkk+Sj+Vjh6auNSH6U+3Nyq6fcyXeL2Q+7KpQ+XItth 6tbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QdE7kc1v; 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 j51si211387qtc.347.2019.05.28.03.10.16 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 03:10:16 -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=QdE7kc1v; 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]:60229 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVZ3f-0005nV-PW for patch@linaro.org; Tue, 28 May 2019 06:10:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVZ3I-0005lq-Rr for qemu-devel@nongnu.org; Tue, 28 May 2019 06:09:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVZ3G-0006oe-L4 for qemu-devel@nongnu.org; Tue, 28 May 2019 06:09:51 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:54201) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVZ3G-0006ne-Es for qemu-devel@nongnu.org; Tue, 28 May 2019 06:09:50 -0400 Received: by mail-wm1-x335.google.com with SMTP id d17so2216481wmb.3 for ; Tue, 28 May 2019 03:09: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=uUUpFitvie/E2cI8g/Leng5/oivvqAC4XiTmCl3vOvg=; b=QdE7kc1vAQqmE15LgfYCzWMGFdwJoGX2rnwHHF1A9ykGvDjhaNRa4GmEfWfnV/qflV YGrm1P9j3eCoRfDp7DcCt8c/Jm5RqE8eiuCX682sYYC2KHug2aKYr+rYvcYxfV+JQY7O LzCGlgFdtUMPEchksKWk2aFWgSfTAg4MhKQ771FIi9LEOF10qN+wK+yZ0pDyMVYzJt7Q 9s4RA8UlCggIJHbD1T9pe+Gtv2Kk74CU4w1il6G34YikleyNox+zLBLaZHt3/hDtPL0J HbL5lbjUXU05N2Zc852fxEguXzECQ1AcpynkwVWqrXvJU5JnGuPvVxP+UQCzUU2Nm6xY Q8Ew== 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=uUUpFitvie/E2cI8g/Leng5/oivvqAC4XiTmCl3vOvg=; b=lcNALn8HWGufbb8yrJwPN1KYSIIGK86h0zx5M8QVr0VlgBTLZTqp0GBlhYc5SZaftp jWZkVkq1gcB3k3G96A3woydwomKutWEibBEd/P8Mu+9QkHwiJ2JjSr0tTkNCIALHZDrN DisAcu9MY8s8JBiQ0LaMbqe24VLUQdXg0SxxmxaXC/hC1PVMhgZZPIShmMaFVtNuWBTP YSGzPenKznWW/A9SgNkt8ShTZ4kWAtraXL8HGTYf+NTGbKbAR4Ink5BDc61JwQmfmES4 Koq9hEfCBzkLZEtC2otndc4i6ldRf5vtCRJjZPcc5lGF0vn7/wQPxOdJwT9aU7M9OxOO vZKg== X-Gm-Message-State: APjAAAVvCs17Wonru/+V8EvOnx6jMgHxJiH1BVlvJek2wZy1UAmr05dU P343noLcbD5jTPhIGCtR1ePc5qloMXc= X-Received: by 2002:a1c:104:: with SMTP id 4mr2478468wmb.97.1559038188480; Tue, 28 May 2019 03:09:48 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id x12sm7512812wrm.92.2019.05.28.03.09.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 03:09:47 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 215F21FFA5; Tue, 28 May 2019 10:49:55 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:44 +0100 Message-Id: <20190528094953.14898-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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::335 Subject: [Qemu-devel] [PULL 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 , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 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 Tue May 28 09:49:45 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: 165298 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp7815480oca; Tue, 28 May 2019 03:13:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyT3gshCgwSftac3fjlTy8noptRwdQbwyy37+8RBKM90LmrfZDZvqB/odkM68ByvBNLy0fG X-Received: by 2002:aed:352c:: with SMTP id a41mr1854712qte.137.1559038402170; Tue, 28 May 2019 03:13:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559038402; cv=none; d=google.com; s=arc-20160816; b=X/WzbGu9hqjpzxXfhrVH3QLX/nAkY9Q1GfnQd7B20awGFO9V4krqlhrZo7sHBV0+uN 780GtCDpWwsLBQtLBpgCS7rFOSJcrW5XI1TC/zEcuvtn5UDcq2bjxFOXGZOcq3T92JBk fkFF7LErsythyHTb2n/ZiN8VUdSA7HhZ4yKs0we83RRclKlghtgmyn94MiPQUuawOe9K ViuxMkiPBl5rQRGA+bVFxT5BhaPfOI5QPGlrHA9Ity1vD1Aqh/SjbCwaS200e0u1Kr5C ytLuOCOUyR0eqL+T5qyQ3DJKteKu75AQhPthsFi/5QQA5LtlgvwM9kdo376vgfqGf2EB pY9A== 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=UBA4fyuukawa6NyY3EMbRa0S9sWgh2MoFLyBGNNyQyA=; b=jQK+jH0kapyUtlAktP2jcTLzL5R1Ne09rGAjtn65kakL7NriRpJwVOh3COLabxWEw2 mJ0KXR8o7E1ASvi/URxKow3M6Sk/BdEhvWTpf4+1h0LkbhI9JRvVX+1mLmEakROCrN1F zcbykiU8ple8IDz0MleRuGxS+7dqSk+Q/IwQKekzA6HaItn3O0l+XdHFicjNL2B+TBXT qa43qe8hcE4GlzGVVGoqSu1O1SfwcO388G+YPqiFsJrrLfzLvEhehSmxKqQSHQvUD0+g 1oAwpwJ6DGN7xgmhM1gsl33HrfbXdQ+1QBf2KLl9hcESPlryo77CwxVqby64RxFSZDu9 EA0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xtrf85r4; 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 c1si273735qtc.157.2019.05.28.03.13.21 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 03:13:22 -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=xtrf85r4; 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]:60302 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVZ6f-0008WQ-N3 for patch@linaro.org; Tue, 28 May 2019 06:13:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYtf-0006Ls-Ke for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYtd-0005VU-6t for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:55 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:37423) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYtb-0005PW-Ke for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:53 -0400 Received: by mail-wm1-x341.google.com with SMTP id 7so2130332wmo.2 for ; Tue, 28 May 2019 02:59: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=UBA4fyuukawa6NyY3EMbRa0S9sWgh2MoFLyBGNNyQyA=; b=xtrf85r4OW79vw7dOJQKrjKoSeq+jGnAlgTcUXIJJQ1P2Yre7PhnctD0DniKwJLLCu gbF4PsWOhvw0dhDZf8Bf1NQveNrTpYofoiGEmbRU8xqMCxoCb9DQOX/Sq/Fd/R0Y8meN 19m46I++of9x4u0xBop2/i6EHanIUyHPsm9ll2ijReA/I26gHPAiGTVbX3z0/cq8uePl yrjonziw7Dwqgv1Vi34n98JOL+Lh15JfLcXpuA1PQWWF7HqR+YZQd4fKTD7njAs9rHsy H+YSpVjBU1IHojAiFA47j8LSM5SiDY3hZuoZVnFBILI3zDp3BGeuF5xp+ROtLAx3+mQl ki2g== 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=UBA4fyuukawa6NyY3EMbRa0S9sWgh2MoFLyBGNNyQyA=; b=LwUR8neXNRVqHF/bTwPX4UFKZJQYSmsRoCojSvZgrpUXX1NMa+Of5r3trBoAlwmX0o ZZPe96xBuIgWDBw0/nn1T2uW+IPbFTysLaWYQe4+0nu6Q3pSE42AaCQsYsCKJ7UrLB/B XR4Sz6zpE9p8GE+MksB2AoSUFysNvz5qEKy/nC6JJz90KvHMMXoK6er+vuL0fa3Ooezz nILebScbKK53qRDM27sDUWnowBKFj9nf5cgW4RD6W+FNHw/VZFsxPFBDQaq6mDW+4/gK NZitaXAXw+esbivywJ9+JXTjB1wptzjP7gSIITvhCl7HuTdVZzzeZTZu5SSszpYvS2FS X4FQ== X-Gm-Message-State: APjAAAXWGIv6nR0lZLTScxCcWB3H5MQX++2BWnbMnfN7Q0MFX9qxFUut DjO15RnFo4bmxgR4gfZdpVmXceckNOM= X-Received: by 2002:a1c:e90c:: with SMTP id q12mr2544688wmc.128.1559037588435; Tue, 28 May 2019 02:59:48 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id a2sm7778741wrg.69.2019.05.28.02.59.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:59:47 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3BD1E1FFA6; Tue, 28 May 2019 10:49:55 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:45 +0100 Message-Id: <20190528094953.14898-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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] [PULL 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: Eduardo Habkost , Richard Henderson , qemu-devel@nongnu.org, "open list:ARM" , 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 -- 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 Tue May 28 09:49:46 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: 165296 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp7814170oca; Tue, 28 May 2019 03:12:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuhzh75A4SeS66cmFOpb3eAlhofumNaalyVDRr0MFsk51dhGNdfrfJtfxLKj8B8tjbXaUE X-Received: by 2002:a37:a1d0:: with SMTP id k199mr90950652qke.116.1559038320158; Tue, 28 May 2019 03:12:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559038320; cv=none; d=google.com; s=arc-20160816; b=DdicsvD5syuSMeM3dmLLeu5fu3XlmrZEIFc+ETQ4/s6tBTZYYEd6eK5AiOdsO/3yqO LPJgdba8tVDWVPxoIDErC9iA8YBOnN40MhTd8qo2/+4PemMgoFfBk56ihrz0SuNXvzaM M+3LqVza1OC+JX60rY2nj1+LW+xViSiFyWMMV/VIfsdX/JAcT50Kf4ESJaBNsKzJVsCk EPO0PDm61cxogZlEUnZKEWEIYfOgQ4DjEqOCX36Ja8pptT1X288Xk7tlsqXlEq+UCq5N G9jl5VpPBKu4jXjg+XnLgrDuGE7aG2CbpLf5bjdN6gnVZw31GDdx4Od0414btAKh7sKn qh9Q== 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=MjTvC0r2KoMB7KYuxEeHeBHyLDrxtEdnIoGRAS++vz4=; b=L+DfomiJ77aTDFCqrCdCTs8G8kTskFAwqDrrHkFQICtMfgfflchiRrO9S8PgEybdst wJ3aJzFY10EgfRD8CAO4dPlTVa6CUMrzBVSmPzTVOGNzbCsSubRIRyVYqVrLhVFuj7SE 3OtAS56po9WOzkxbo1jOnM2HY+C2WcVd8MR8NIx+vbnwWJs7Ey+S37+3jIJbfWm8gHvt 6nuKHoYpBHBVmY5GApJTurjBbieUm97h653Jzu30klvX/XVX5dm8owbEc1yW6fDKc0Vo DekgvItg1WAMV8kzkgcHuKCWI7Hk7xn/2p5Z1lbz1EdsEKVNEM6AzYdxhAfRcsY40v9o VI2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=I8cKbxKS; 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 g43si2136229qve.24.2019.05.28.03.12.00 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 03:12:00 -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=I8cKbxKS; 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]:60282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVZ5L-0007e2-IW for patch@linaro.org; Tue, 28 May 2019 06:11:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYtf-0006La-Cf for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYtd-0005VG-6v for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:55 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:36862) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYtc-0005Ro-NA for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:53 -0400 Received: by mail-wr1-x444.google.com with SMTP id s17so19513109wru.3 for ; Tue, 28 May 2019 02:59: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=MjTvC0r2KoMB7KYuxEeHeBHyLDrxtEdnIoGRAS++vz4=; b=I8cKbxKSQ4+Ro34juVFQLToobn8yKzCR9vcnwe8ucOoUx+G+JnIkt7dUDdkb+HJYdB n0/Y+4Htpn3gEVr8AkZ9dDl3dTYIUZ3sCqRVG4n/k+qL2IPw8GqxR0Y1pDk0HC0MqhbC LNmzYnOmOtDfvhBV1DRs8OubhWSJsSMe89nyDGTtfUQ6S1Nmbj9vbhXdEY9NkYxeyow4 XrfLgsi9T1Hr6qijh8w4HiokmLZOzWO/eAFXQntVzFPB+FEZgsf4VuhhZLk6/wL9pvCB 3O9N3PwZqekI54w0W0L0MtL7LhGJWY/ERV+Q2LPkxfuya1ilH+smkezRyi7i/KdpCeuZ AChA== 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=MjTvC0r2KoMB7KYuxEeHeBHyLDrxtEdnIoGRAS++vz4=; b=fZ0Dph7I4nlTG/aECLCLWGY9SJ6sUHjgxrikXfuR2TyVNlpukHlzzLfELolu5ciogj mk59uU+m+qIl9BSbKTPW6Q+AF7rWALwMOg9F2UDQhEd2XkbwU1LsGSSNgusAnRxgfoqu JNObbJjrv5WdeyRNgt4V2cOvf7f74RqEi7tPu//wu3/9DWDK2a4XgVhfV+hjawTRf5ZX tKj6MNHF1vEnSlBfabdtvbEVhlJz4C2eZ4LX0EVdC29yFfDuWmRFpJ4oQbw8aiMluAcm aGA/4xrSo9nj1tHOwCPk5Y3yp4vtqqePZpkysBWRfTgi5r+dNCYGxcJHWtLHuG6lBLau 0gEw== X-Gm-Message-State: APjAAAVDVcebRlA3U0jCkpGG6rOUvN9VAs90dBmNUXhYsIA0C+DzuyTn 5xtrxeF633lqnPEH5kE/7tHIMQ== X-Received: by 2002:adf:e301:: with SMTP id b1mr14338034wrj.304.1559037590343; Tue, 28 May 2019 02:59:50 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id t194sm3752055wmt.3.2019.05.28.02.59.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:59:47 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 57DF91FFA9; Tue, 28 May 2019 10:49:55 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:46 +0100 Message-Id: <20190528094953.14898-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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] [PULL 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?= , Richard Henderson , qemu-devel@nongnu.org, 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 -- 2.20.1 diff --git a/MAINTAINERS b/MAINTAINERS index cc1178fe692..cf1158a434f 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 Tue May 28 09:49:47 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: 165288 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8261743ili; Tue, 28 May 2019 03:04:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7idXnnJMM9ygifV1VKHNx0cq4tLFYKRmd78UEDsk3BA4tTfeV/kSWIqbhYA/3u+jZfheg X-Received: by 2002:a0c:b12e:: with SMTP id q43mr14468977qvc.235.1559037872511; Tue, 28 May 2019 03:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037872; cv=none; d=google.com; s=arc-20160816; b=jXYhI/PQ8SRyaxhAKD8iJq/D9gKb9tH/EsEhZ3kMsw8p9dSpTiKClaYpeDgzuEph+o qm2DUCpmWxAnxqs8pE8AUx+9yxQUXvEhM227YtDSBQ5RP7tMa2suCwuqhGLF5Fa8hFAc +Btjqo8FPl2R466blIaQ+k2Q6CeqWguic6B0Rl5KjHSnD9/XGk4sSEKIJmLbE8U2NsLN r8/2Ifd/sZDD4whwg9N322Z3KBGU/3sicsbiMyCty/vWbOSfBIyfms+IDk0cIELqR83g kO6SqUbE7q7zvPg1+AZFhsH1Hq9QLeo8D5oEeNBDuCMJIAKfNhSgnpC1/P9ZrMMuxKMT 8U6g== 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=kpShySiWy3l2UEoMR7e5vE7RIjHCSmX22N18+VLA+QY=; b=LLBjSbz97AAvjfGrZTvx1aePPXP8SKA9yWEXrLqb+fHLqSoX+meqJPF7b5WMm4/ejq z2thyG9iPOkn1Qz8QKij0aiaFvEtaoBLbaD8T2NVRdbpxzJUy1zqVAOzlXz6BbllhHB8 Rn03D8R/UeXcVzQ4mwmeIz1iWeSOVokM0nzn97GZ5Ao3OqsRsdTi2BuAsusEYTWN9whC 8k7ZUM8+7++WR2G0+3IbVgkeNwxs100fhY1Op8Vcjxc6/KKL+pKgZfCy6RzHvT0+QVLs B3h3jYqvfhJPV/IYV79T6Dh4+UUfAdfe6giXe5IKHzNGp3ZqsBkC05sUimtO5kPNixhq zI7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EkhSg1Z8; 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 z29si312187qtz.322.2019.05.28.03.04.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 03:04: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=EkhSg1Z8; 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]:60138 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYy8-0001M6-3N for patch@linaro.org; Tue, 28 May 2019 06:04:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYtf-0006LC-22 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYtd-0005VI-7C for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:54 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:42128) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYtb-0005Q1-Jz for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:53 -0400 Received: by mail-wr1-x42a.google.com with SMTP id l2so19504874wrb.9 for ; Tue, 28 May 2019 02:59: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=kpShySiWy3l2UEoMR7e5vE7RIjHCSmX22N18+VLA+QY=; b=EkhSg1Z8xuAx+kGiEPZcYgXOnnOtCAid2TQqolLnLOCKILjMYPwdvpYYFVo6fL5zpe FnZfqQKhslUz32ipb6c17ioJY912nupRK625grQ27XsbH+u50MtgSVHfMdhh9BFfMd7p wwX58IcpKGv8PoEa1mZ4ViJGQYGNHNYX9Z8Z/dsM7IxxJBagv+ntNL2sDKoWeSMoK/An 12V54DG9LYHaHqSNMIPh9djG6VguZgLz4EN9iBF4g0vLkbx/URDSngB+hflDGbAVqhd+ zjQxPEsClGjtd68GNI3nyYeaZ5DmYjW07gP94LbnQbfscvAAq2ZgpWwEzGKxi3dbwLno lHBQ== 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=kpShySiWy3l2UEoMR7e5vE7RIjHCSmX22N18+VLA+QY=; b=j6yLmG7LPH7xtADi42NK03ZS++XUKFclUzARZjvzh9Nu7XGJKyFyxXC6+qWiZXdNoM UWo2XhG1eKH2FsHexyaYyhcwkHWaZ1/lZkBBXToOaNFxzWqIfspHLHsGbwugQPLjuEDj x23zISc24aL0rLPNlqDeDrRe1ysxe0Dd0WuVH8mv3EaTSN8oAccFH/7CoMpsVbjl67t5 I5nocx/FwLA8EpQUnU/zwg+IKqbIc/tacAwS3oMb9cOazDV16zyWo/sDxj4iib6jwaEb a8jgT1MR8d2NAkrF+Am4KvUzvFZTwhd9Bh/Uxp11T8SObrDDWBl9nioCEhbviZiNBPwG VcbA== X-Gm-Message-State: APjAAAXF1/kwDwipBWx9WnkHk/2SYWBYRTaXbxElx/wBW4lxx64mZn9M NQrWiRPvrUtc7QTB3Q+i+iLIfg== X-Received: by 2002:a5d:6a8c:: with SMTP id s12mr12674092wru.326.1559037588940; Tue, 28 May 2019 02:59:48 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id f7sm1527452wmc.26.2019.05.28.02.59.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:59:47 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6AB661FF8F; Tue, 28 May 2019 10:49:55 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:47 +0100 Message-Id: <20190528094953.14898-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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::42a Subject: [Qemu-devel] [PULL 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 , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, =?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 -- 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 Tue May 28 09:49:48 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: 165297 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp7815297oca; Tue, 28 May 2019 03:13:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZYZAREcS+opWVaG3C+7IayJ8JId0t+nMlf79SlZhg0+SHiaovkIOhMKn8RBWZ5K1R095b X-Received: by 2002:ac8:2ea1:: with SMTP id h30mr55513211qta.333.1559038390555; Tue, 28 May 2019 03:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559038390; cv=none; d=google.com; s=arc-20160816; b=tcJ4pdv9JZVIVshX9SYrAexlIxuiVSPWz3hIErJt3oXX4vIw7RCeqwrQzoGOj/fvT9 9u6GSJ26+1OkADYbrQMtRA9eeW+Omkxy7Fd0FTr+mZs3022dZaSkIevu3kyjYHA4Cs7q 7kIWKzbD4IAAO0zIt4c8S322WdDr/cFSw2XVqs4wIC31Q2yjozeksCj484LsmzVK+wy4 Born1hUBQjfbTukPqj/IxlY0V1thg3GQC4x34kjK5wPCFvW0UKLHz8+DDEuE9I8OZSPE V2RkQkOiLO76M5MT6aoH6W860bogzBTBx15Pm5/4X3r9fjGcsu+6lFCs2rZfxKSEYft2 sq+w== 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=s7/le6C6BEubNb8PXV+L9VQYmxXcdbVuj4/GnWwcUzo=; b=IIxk+8brzkzZD+PweRqTOeJv2z/LhIO6cFjL8C9kcmiwA6rp5KbWTV/10MxV6LXqVw OH5shK6bwpACOJrMQK1PvapaoQK83YHEJIyYdCcLN8Cauj1qN28FtO6bopv/av/WuPCr 75zE1gYh8lBRZbguioBNNiXnWCWjihi/RCVckL1K8pWAfazt348QmmZpc0qqmUvBRiEN bVGiK+ZHApqxSNwry+mO9QHG2ogD4iauLIgtg4RW6c49zxKGpOA8Uq1/uIiACpgk55gK +23qlkFP14fQ+kTJ06JaqJ291Wg5zGFKV5HjkiMELkjoYCWKTS0vN2T/GLdMwGUVRoVM ShbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eXpsMMhr; 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 k44si6406286qvf.205.2019.05.28.03.13.10 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 03:13:10 -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=eXpsMMhr; 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]:60300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVZ6U-0008Rj-6I for patch@linaro.org; Tue, 28 May 2019 06:13:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYth-0006Np-AC for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYtg-0005Zl-25 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:57 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:36851) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYtf-0005YJ-RN for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:55 -0400 Received: by mail-wm1-x342.google.com with SMTP id v22so2129422wml.1 for ; Tue, 28 May 2019 02:59:55 -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=s7/le6C6BEubNb8PXV+L9VQYmxXcdbVuj4/GnWwcUzo=; b=eXpsMMhrdMmnrAl2h3MvZubp1LnZCOuFyfGZVlNCGQdbSFi2OLh3yXSgJDg8FuvM67 mVUgTJykkf2vEJnuKyGz+mBnFAhu4XIPgGPunwGC3Y7QnmXhc4Fr4jxpNrLVTXDMon4l Ty91gzK2Be8K9EL3KZAjsI1w4mHBTY+liS3bdxuqqM+5ViHsBht3KqCyeQ/6zHj8mcri R1f/rJ6HowYpp2E/m1voOR0NRPoQz2V++OQZwcoWtlz2SXF1gN/WOKIgA/62/REqpOgq x9McWv4VgFZ1n+fGM1GnqqY8HzfIoLzE+hvwODYm2w9FnzpqpMBegLdMOjkMA+aQpxlf zPrw== 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=s7/le6C6BEubNb8PXV+L9VQYmxXcdbVuj4/GnWwcUzo=; b=r0/OLB5Y0fgDk7QnHTj8ZLyKOCgywPMlhi86WEpbr6mJ6U1DXlCNtIMiBY1AYJVC2H 8IUfU5uiJIgCMuXKOt5INhdvEq5AUj8x5FDJaXLnXGXtfaxg4ECfrJfViFAGq7ng9Cuo udigoI34136A3npooIodiCL+VvsKnVDr65Abe8gdU0VbPMfqgGHDHL4ARV6b5cd2wqb/ ppC8LJiwlNhsrHiNl/54uXmg5AQ01QLSGgZhjdsYCZ9KHGlAlZRDirt88ashEJ6AiAqH d49SOLCidrK6DIIqXi/QiqRDjFSV3tquE/wG+xBVXZ4/4o7Rwt8IHxaJ+sMDIFxPTFkP SrXg== X-Gm-Message-State: APjAAAW8iiHayvnbGiJ4oA0VrNlfPClp8NR4R/FddRzEgSUoqqDkEIwE 8GFC9rvjgfdjAKQVrrvc3w/PnQ== X-Received: by 2002:a7b:c151:: with SMTP id z17mr2276027wmi.61.1559037594695; Tue, 28 May 2019 02:59:54 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 65sm24238165wro.85.2019.05.28.02.59.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:59:51 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7D4AE1FFAA; Tue, 28 May 2019 10:49:55 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:48 +0100 Message-Id: <20190528094953.14898-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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] [PULL 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 , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org 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 -- 2.20.1 diff --git a/Makefile b/Makefile index e02b88bcb11..73370874841 100644 --- a/Makefile +++ b/Makefile @@ -1009,7 +1009,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 Tue May 28 09:49:49 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: 165281 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8255155ili; Tue, 28 May 2019 02:59:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMEKud1N3bs0qH69QQBwcIjmJnDy80jaQEO3UkLl4MfIlr7+DSMSRK6vjrC16C2jqaG4RV X-Received: by 2002:a37:a006:: with SMTP id j6mr27677021qke.251.1559037543780; Tue, 28 May 2019 02:59:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559037543; cv=none; d=google.com; s=arc-20160816; b=iEM4D+X5mtZE1Bx95wkNbYpHyM8HErv/VpTllJLEkHnX0xtf9AU4UliCSG4zSfKD4m e5XWwymOdk954KlhNvIwNxy+EL66zESIk8/s2UsxAGe1JdgwmrYPtff2xgD0Ty2Hwv8o 7/Brx6ATtoEFOA+FgInAF7R4z2Sv2/RWzgTwHA3KcSBvyEYwrzDl2cblbJON/5FKr452 0KLwU0xHndOUQ717KNARbuntO58WG3RI4R8s/Ki/+0+gpCD1AiE015URBJnUwVxoe58l Qs13qC4hpUatIPT5GoVI2Q6yiRpUPyQiw0fj9Uv2nKK7Knsvn2j++yH4ns9eM1y4SCCD Gmiw== 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=79nJW5T4D7aoXIu5nhSS0urKMSp7LqAnS25nzREggJc=; b=dhtMOnZmAsywOV2lFbsIE7hu7TSsqbKcH+WyLgGJN2tcOnBnyA5FFBKG+UwjW8h9GO ZTEPEYCPek58OZWDRNUI7hXzR73gHeE0sS1Lp7yG55NNk5L4m+z0OsBVcX4AW+OwmnTG 3sqwaK8LzXZob1in5UyDXZETZVnyDxIQbkP7Jox7mAZC+rtxKz9/kCr9CWFgrZ0REiC2 jjSFryYksFpQ7eXIeuuaI9J6QNdSd8k3pjk+9WHC+uYkd6QC/1lPNZ8BH030sqSEcQmY oGeIWzgSCOD4WUM+dLkuq38hHxxoQT8cdJPMtYusT4gCGmNCeT62c95XakQkSJcpOosx aVcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wxLFo8AB; 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 c4si1588695qkd.65.2019.05.28.02.59.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 02:59:03 -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=wxLFo8AB; 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]:60052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYsp-0005HU-BP for patch@linaro.org; Tue, 28 May 2019 05:59:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYkC-0006KW-HZ for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYkB-0000Dd-Lc for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:08 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:40781) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYkB-0000Bx-G3 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:50:07 -0400 Received: by mail-wr1-x42d.google.com with SMTP id t4so11188201wrx.7 for ; Tue, 28 May 2019 02:50:07 -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=79nJW5T4D7aoXIu5nhSS0urKMSp7LqAnS25nzREggJc=; b=wxLFo8ABdV6ZMu4Dr0uWkA0GSGOW7cpBVxanG6c10JuP6YRYI/2DBey02q1XL+1ko4 EjYQYkRIiK+WE1wdkM75a2F08Lw26874wkslCpWAnVif2t2zYPz6ijgENNqyqLMWEXWs EziJyM1V1tK0/Ug6dcc+EpVfq/f1+Uiu9ZwUXiSNkPgV9SQrJ4cQSHzpmDswfFwkJ2Nt 4Y4M6bNP2RuEcARtFuow5vZjvy9LS3Vh5KxQTDgnVF+D5/1aEr3ZIRHdien71TLBcbjF Mnzz7kTT0zc/ZsRk+8WL9dM0eIh7yzQ3kPoqI8WjLyFsq+2ERN3s5ZDYjcy/NBjewKpF 3Xeg== 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=79nJW5T4D7aoXIu5nhSS0urKMSp7LqAnS25nzREggJc=; b=LxvN5jIa3Op6/JiktaEjUS2ihV3evpVqX3TeB1ylhPD7ND+IVQHEvCxdxKZKSSTdYh Fpxp3ZjWHiXBv7mxrWto0XngPdOjyiURL/LyqfXR0KkVm1xtgNIHGbhThErGY4GsbgHJ zgXxDiPgF2Stpa9hZSmQeQlNRh6bOZrXaQdaONcRl0wdzd9CpoIKzNqW9qBJOwH2JPiL 1/WbA6pJTnC723jMwdFshA8OrFsOi0jlsT9JX5SJA+/XaVumciDezFLWbH7OSLIfv9C7 zDV8qXTfL+0wKWoTUGRL5xeFVazdGkAQ9hVZFezfBSY05ZbwhIAGnZveQVN70Ox+eO+W bZfw== X-Gm-Message-State: APjAAAVEsZNrx9tmRyVvU9aYZdRC6Umtnu7KtdtGSeqYkCmMLDnmj7wo aJjXrttu4myko5/lXn724OZcKw== X-Received: by 2002:adf:dc04:: with SMTP id t4mr232230wri.126.1559037006369; Tue, 28 May 2019 02:50:06 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 8sm2376798wmf.18.2019.05.28.02.49.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:50:03 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 909E01FFAB; Tue, 28 May 2019 10:49:55 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:49 +0100 Message-Id: <20190528094953.14898-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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::42d Subject: [Qemu-devel] [PULL 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 , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/Makefile b/Makefile index 73370874841..f0be624f471 100644 --- a/Makefile +++ b/Makefile @@ -1009,7 +1009,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 Tue May 28 09:49:50 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: 165292 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp7811402oca; Tue, 28 May 2019 03:09:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfX369y/D/SZqIBNYPycNDGbcbMZYM6xpL7H/aLyhz2klnDNxT+zUfR2BYkkm/u3mxhUvh X-Received: by 2002:ac8:3128:: with SMTP id g37mr100801053qtb.65.1559038152772; Tue, 28 May 2019 03:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559038152; cv=none; d=google.com; s=arc-20160816; b=Xh1DU+INIL++T7H47T4y7CWUS/238cGKX+uWvX0d+G09Xhl0shIJGlXZgMgIVuT0U7 kQY0okM1WbJW8E9T1zTLDk6wpyMQJl8jtNWvv5wAV4wrf3XwwzzER3wdn5ja07YL3Mj/ jRfXEMfIXsehqxNADsPOu33BtidMyOmJ7GdBsBsOqdWD37CaHX17Dr8M635JMciGbA8d lMXiEjIuLdMu8mlxp//V8bY/oDTtyBbMv8KMinxbvjJkTjB1O/8hHdEgAZPPOtZTyY+q ju9Q4nURA3Zr+GSzG3mJGc0qzpHLIPjQ7ptN0guiLxL2h5INY8TnHd9+OLDQJ4bKEnPE OgGQ== 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=tMdbq3E1Luz0DkEOlhvxxv+uguLcXoXXlXySeiBWlSg=; b=rYzQF+SvY0WbLrCJXD0oltywpJ5+y/En+F//8UFmmK8ZegVfTrfM4cU+6Gn4FGb+/A mmMnc58+dRkGk6TuCgHpdklUEX7+M+HSE6ISqAALzRhZX0wyV43Scc7H7n8hLZIiYwyh 3csqKFxMO+Wz3w3WESO3bHd41in+VfbJDZP5wvG89BBygM/7exmnnb49WdhovR9fMzHl e/LsgRHgYIX4nkIHfF02xIPsXXTnGP2Wfsh89Y3N9mb+E2StvkTaQqWi+PU8KuGa5Cvf jL6bKgtVOVJSBR21RtTw321tHatABFqL6mi3NMlD5i7awzRpxGZhenN3Nw1I4aAuZuuj J+3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VqYi1C0t; 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 y128si1518396qke.91.2019.05.28.03.09.12 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 03:09: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=VqYi1C0t; 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]:60223 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVZ2e-0005Eu-AM for patch@linaro.org; Tue, 28 May 2019 06:09:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYtg-0006MZ-B1 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYtf-0005Xu-2A for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:56 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:38501) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYtd-0005UJ-Q8 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:54 -0400 Received: by mail-wm1-x344.google.com with SMTP id t5so2126684wmh.3 for ; Tue, 28 May 2019 02:59:53 -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=tMdbq3E1Luz0DkEOlhvxxv+uguLcXoXXlXySeiBWlSg=; b=VqYi1C0t0lGUV1dL44XxrhpFy4squdvxmCQkFTPVNc9tJcqHxKTd0V2EyDl05SLNt2 gOqu948dCbPeV/ZcH9KrDGxgPYC1PMmunxa4XFdw9mcVyH03n3ACYJpbMLA5AZ96+8oT ZmQWHRLZc7Y66rzY2g/SDsV8ffAb0Hg8yYe+7EPHc95pbe9bvsgzzukM+WfyT3cP/+M5 jwler63M/zVm+JIsPIpg1oWM41qaeakFKb3qdFb81A8FzMdZOpnMPotZtKXS5PWglnJX ywMwRxQoDDDsjvaTg7L7VtEa/1gBuKUlLpz7D8ApArWbKvrqCL4PkUkmxZ9EvKLCcg0o +P9g== 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=tMdbq3E1Luz0DkEOlhvxxv+uguLcXoXXlXySeiBWlSg=; b=m7pUINqXcaSQKjSBmdM0wQf+rqmgj7Gpm8qXJRjuKYoykNxazj/4ffS7R0z8O4VYIv ob1CWP4b+bbnmEzXImLu+IgecHFgMiSIqzY04cFTAEFK1UH/doVZeWONXqaIp9bRYsNU nTtRi9DyeFoYKvksC0HzMlGARXN8l6M7xePMmENsJmZiP5+R0UTKDzGlIabSPUvBqX1R LZTYGZkun3+k1zjZJcl5lUFtEJCnPHAVbGdP5k/PQgnXAmOAYlGFNf5fu+vRZAkucPpp ge4yFVc1txmGHcqLWXAOI72u069TxWqb9FJIbJPSRpxSxBTml/ankXXaWFQlXskP0Nzt nFkw== X-Gm-Message-State: APjAAAUPMcT1AWx7Nbug+lKj7Z7mzaEP+BEtDJGP8FasK1EMzO1wx9U5 AOhfRtbDhIg0nkNh8RoJuCea7A== X-Received: by 2002:a1c:9951:: with SMTP id b78mr2586995wme.96.1559037592148; Tue, 28 May 2019 02:59:52 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o6sm517496wmc.15.2019.05.28.02.59.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:59:51 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A31D91FFAC; Tue, 28 May 2019 10:49:55 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:50 +0100 Message-Id: <20190528094953.14898-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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] [PULL 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 , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org 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 -- 2.20.1 diff --git a/Makefile.target b/Makefile.target index 4ef4ce59969..ecd856e3a3f 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 Tue May 28 09:49:51 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: 165299 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp7816617oca; Tue, 28 May 2019 03:14:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwx5GzcVCTa9EbqR7mM/qTeewDpuIivXQsfs6rUFgEOTlQDa1F5Gw2J/b4T2LkLy56/U66Z X-Received: by 2002:a05:620a:1424:: with SMTP id k4mr39026928qkj.356.1559038476926; Tue, 28 May 2019 03:14:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559038476; cv=none; d=google.com; s=arc-20160816; b=oaipZ8ikrlcDHRGkiIryqB+e87dcLbUFEqYBO2AZFJ7c7q9syrptU0BeBVmRioEnUg HtUj1X5ApkHu0krTUa4QudFK6wkvAKpbGgDLqOBypO0qI/9if6ff9vdinwRlXCeXNCAN szOU96jtdsou6vBiQO0aMtMno8X5cVuegP8rCkFNJVClMR7RYKn5hs32Js3TE7wD3KG2 2NEhmN0Xyu84txxOBfAlhiN1/N2DzqnLDkw7rvxdPANqaKeKjGPSRpk0cy+ZQdeJlcvQ +9N/wkghhSKBFmz4LqndV8Vc4jNea6QZUORYsXgTG4xu2gzByTpLSbjkhk64Dx6Av5Uh Ewlg== 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=0Lud7yYlVVyhHS+OI1YCD1+JH7L0tGMnLzLym0KFWVY=; b=wYFFAkUXGTmVOneRXAqfgl9Ah46EsedoDaRR01n20PXkNFpCjZmVNv1kldyLatroYv YVlcBkD5gnPy/E71JG10ZCQhpwg0XpPfHH1lA7CNPF1IiQGEvqjMD6ghfk3ojsl2kZWh ECDxPx8JDNf+IAW+UU5JRSksjWboZ940Sd2ZdZ18i0DLTXps7IwZJJfd1TUAKwzLdjQx DgVSrDePnjOrRAIvDbMGJr2cpxdfyp2Z2WNQeecutcSgDe7KVcxRp70KVjy6Ld8lEgRM nVezz8uLAAfkK4ioXyGHoXtBeLvEuRrBVu+PtKRYG9OD9rSPLAicVKVx4VjTrr3rv/Pf IeSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DJ2HBVOr; 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 k43si1249446qvh.138.2019.05.28.03.14.36 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 03:14: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=DJ2HBVOr; 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]:60310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVZ7s-0000vw-If for patch@linaro.org; Tue, 28 May 2019 06:14:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYth-0006OR-SJ for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYtf-0005ZM-Rg for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:57 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:54712) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYtf-0005XP-J8 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:55 -0400 Received: by mail-wm1-x32f.google.com with SMTP id i3so2173102wml.4 for ; Tue, 28 May 2019 02:59:55 -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=0Lud7yYlVVyhHS+OI1YCD1+JH7L0tGMnLzLym0KFWVY=; b=DJ2HBVOrJRYByjAo3RE2LDneaP55/KUMkBt5jffp7x76y3jsVgVg0m1cFg5sapYtZg gA1MZfM7c9oMYL7/GhIPFkfo60xjjhhG6vAasc8uhvOKuoZ8b4E6N7mCq8e/IIQwnD0S rlgUvauWIemETtmpN8TlehB14SXW5omSirIJsXgTtpgrr9en4NuBWBKypOz7G4YRqCde /VEhkjCfuT8PU+SBFHiAVp+COPUbNdC2fofYqQqJmljSYbOcvgQm5+WBch5NtYZM1asQ Do4LcpfTIxsayRySV0iTxCeonYG9ozcLqMVn8YlGtkxLg00xH/LrOB3LwLAmT4yrO9oI y6hA== 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=0Lud7yYlVVyhHS+OI1YCD1+JH7L0tGMnLzLym0KFWVY=; b=dGY4oIA3FsgsraYfymEM1HXejx2/TzdK239SNBzpAi9FTnrJuaRU40MNl1hLswoaXW d8dG2Wpf4kqDy/XxF4cuK3sqmScer5gDAZJR6MXe/dAK0u/nbyOTa1BudbHHU7ynpYzH 1dV6f82gsckx4LDhYruVNHAZbB/YhCXEi3dYW5U9DTUMwcCFTUyF/T1fj4KmFVHtB9dx KBY+7yp5MEhdRc7BHTslX9/tI5OPPJri1Mx4s/BtpRU3I1043sPehkykoucUSVYSdHRv 9JsScUySs0NGO55/irj/aHh2rR/uF0pzOFXY0QlhcXtO835mAEjMkdkyjpLYYNiV8j+3 ZnNw== X-Gm-Message-State: APjAAAWaY5cfC6gs5gZA5WFaIanrjUAwxRsxSRZVLLiIfMjIi6mJ8Bhv Mx2uRBd+6Aod3Pfqi1VrcWRLcA== X-Received: by 2002:a05:600c:40f:: with SMTP id q15mr2426034wmb.157.1559037594234; Tue, 28 May 2019 02:59:54 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id v5sm27524693wra.83.2019.05.28.02.59.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:59:51 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B6ACF1FFAE; Tue, 28 May 2019 10:49:55 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:51 +0100 Message-Id: <20190528094953.14898-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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::32f Subject: [Qemu-devel] [PULL 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" , qemu-devel@nongnu.org, Max Reitz , =?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 -- 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 Tue May 28 09:49:52 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: 165295 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp7813652oca; Tue, 28 May 2019 03:11:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqddGEx9iMco+yoh/y2YdGj1HIXAAJRsKCPzrE1wCUUNxGwMT9ZDfH6fJcJ+WuG3lLooKn X-Received: by 2002:ac8:66c5:: with SMTP id m5mr7188617qtp.71.1559038286036; Tue, 28 May 2019 03:11:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559038286; cv=none; d=google.com; s=arc-20160816; b=hdRR5ETyFClQyhJ2GFx0uxA3rNOOa4HsRRy/ip27pO1Q6wA/13gVrgPFktPfKK8CMA /qYalXfCM5G/++iTJMw4+HMQ3R0nIy6UbbmbmCqf2Ry/n5DHqIL24hBfDBQkNGvmkEjj agRGR4cGhbV5eCo9WHyY9o7iRbdqLkgJNpfzcCkTwL9bLXxUDOOOaIJ3am8jrD6DwqbB bWdOWkuE4qv71Y1CPOc+DKaebw4uDG27rb8C/S6jKclTSTXqt+xPT0WAeO/HnqXcE8GS XqtqqXmCI9QHFN4bsO1GD5xGKsajGD8MXYcljI0MOi80yLYnHznmI1xNhmR8/yLET0by faVw== 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=eb6zz8m1Vq8Xaie72PuttKF28XMFLflc0Uo0TIuBwqI=; b=AnnAsgEpcv68lYQedxV3uDlxKiMn/2g+Inf89I6A6XhFFwNz/d6Vm27P5tM+0R4uvt ZCU4ZzQ6NYkvHTbiZ6wpM1r0+gRAl96wUGT9NxiTH2wZhSsJAnuJz3PJeWRwUlq434rz 2bpQvso7aEGm1KemXrEkxdsxwVO/61kZS8VxR9GnjWrQoEbfNCTlRS+cgXvZ/vLAnsp9 t3yx5ZEhWTk+WOG9oijwO1CJP7L0eabIwzktLxiLcN9hKmwIbg7nJjQV2AfE0HBHdBmr VLcE2gLlLa8apkZL8VSf6CZV4U723g3oO+BicAU67PMKvGvFJN3SKfxjgctCNut3xgSQ GSkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HFKoVJS6; 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 p5si5047676qvq.115.2019.05.28.03.11.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 03:11: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=HFKoVJS6; 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]:60271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVZ4n-00079z-Ec for patch@linaro.org; Tue, 28 May 2019 06:11:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYti-0006Q3-V8 for qemu-devel@nongnu.org; Tue, 28 May 2019 06:00:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYth-0005bP-8g for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:58 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:39186) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYth-0005a1-06 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:57 -0400 Received: by mail-wr1-x442.google.com with SMTP id x4so392753wrt.6 for ; Tue, 28 May 2019 02:59:56 -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=eb6zz8m1Vq8Xaie72PuttKF28XMFLflc0Uo0TIuBwqI=; b=HFKoVJS6GFjQEAEXgWRN51wQnYFw8ZWVmae9tWd6UBakn8VB5snQZju6BBMWERK6+X GPk/1JPkbLfH9sZ3n5YiGkRW2og1t4uZiBu6ceYiD7iJvWdmARQ/QxataGC+MxHhx8mG NtQbAhWBirurdelMXA2/zhZeNIq91NyjFh+knXN/CVIBkG0YeAo9bHiQdRVq2/yHFrPk eZae5tta8mR5b8AfkHloZhDrHLM3iN06jXTDvNDXcKOtiMOAT91PePHJvvAg72GeAeEq ZoUV+5YnIgl5SKFLHSBad9zQftDGtHS1BZqMsTNMtyFd3R9HBd4JHtJerQnxOb/VfdMt hsTQ== 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=eb6zz8m1Vq8Xaie72PuttKF28XMFLflc0Uo0TIuBwqI=; b=RNr+xBBmOUQUiJ02g+YqLzQInpM5H87hNAHK+H8w43PEezXbRYpipnAEKwGVWAKUC9 LpXdnldwjoLmqzTEG0gXbknCo2VeqNFkhEEdrv4gKTfAUb88aI3s8mJ+Je5N9k0LO2Nm RZq6mJmm/hYvvwp1k391HCufsf6jkHQ2wWOsWH0JqCzS276hmIaDpElO2hXABIMospVc 3Xtk0c6eKU3pOVJPe3rpTruHflGfVTf0AJBGEzRK6LgQ0H6uPqic0FBp8ziUm4TvWjPe u2JW9iDPqqM7OE97m5VGZ3ELL6Sh/4PmRJ14he5rTLUJA+EnvIVRDn8JdoAM1Vg1saSe eZ/Q== X-Gm-Message-State: APjAAAWYSykojylmIRL2F9YesJyFng5KMjDWdXHBwyfTEEZgT8Pk6uNp mX60Q6KSjDvkSPIOgBu4mxJVKw== X-Received: by 2002:a5d:4310:: with SMTP id h16mr35198624wrq.331.1559037595697; Tue, 28 May 2019 02:59:55 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 205sm2424015wmd.43.2019.05.28.02.59.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:59:51 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CDE881FFAF; Tue, 28 May 2019 10:49:55 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:52 +0100 Message-Id: <20190528094953.14898-28-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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] [PULL 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" , qemu-devel@nongnu.org, Max Reitz , =?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 -- 2.20.1 diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 922c5d1d3d3..95162c6cf90 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,8 +433,7 @@ testlist options cachemode=true xpand=false ;; - -T) # turn on timestamp output - timestamp=true + -T) # deprecated timestamp option xpand=false ;; @@ -633,12 +649,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 +714,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 +823,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 +863,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 +893,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 Tue May 28 09:49:53 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: 165291 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp7810922oca; Tue, 28 May 2019 03:08:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMu387zBTGiv0jpd07WiMXiGStYx0NO7NJT0deluELj18MjiyoCXJpVkUvrEuf1aS1jbJv X-Received: by 2002:ac8:32e9:: with SMTP id a38mr4820395qtb.245.1559038125527; Tue, 28 May 2019 03:08:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559038125; cv=none; d=google.com; s=arc-20160816; b=haKFNq6cEK7uQmWNz+Ka6hznF4k2Jczq0+dqnDB5ytwV50jstA5p0MJEm7int0xsEI 4AZKpkQgLHOjSZGQFKIoRwgPYr476BzOBTwjuryJ356q8hP7NFu4UKFQsSr2AOByT9Rf SqWMfj4S2JtLb3QznPksqgMzHlyTfxSKJHwMbDYQ/X5ux921aMgJceQXA6EJH/lBgpdz fAOds4Tm7JIoeNdyWpyFfapZFOvvjFIG+en9h7SuEQGV2eQYbMaFRhk0q8aALZpwHosF ft3Ij92TmNJzinLcg+CiQziYCYdCyk564KVaJPsdgxIqK/lygOS/C7ywRSigGkcWxr7s /Y3Q== 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=JwuWb01uGinb5zd5Xhv8VSI/Lid9VvCyBHhhMXoCHSE=; b=eSDQiOWpO3xxDJ3UEsni4CfqhZcWvrdioRg9bwZ+o78UaNSynZvIKZ6r3I1emOnXEi g5BNxf7aEuyQvYsmV5CixElaksgjbBCdI/8rgNJuViTcZB8ZmmYmUaaGwGFPWDMqGi6Q LQL0SaNQWXyMJbuAoWmWEe14zNlkJ2l+gmxE+SI44AAM2rJcQGfpupv+MxRtq90xW6/1 yMOapxutMc4OhYWgTfDSPjQUYCykwfjPM6eU3O6lsFVOcUbTSX9/z2U/zgA7BCk9i07E 5W4Dww5WDZ9ajKss0d3EJHzh6MhYVg1GAoGmN6EvJrqkBnRLaVFiN6b7CRKed6TwGDU2 fvEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Oz/NMYnV"; 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 s49si1317285qth.14.2019.05.28.03.08.45 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 03:08: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="Oz/NMYnV"; 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]:60219 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVZ2D-0004s9-1p for patch@linaro.org; Tue, 28 May 2019 06:08:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVYtj-0006Q8-0L for qemu-devel@nongnu.org; Tue, 28 May 2019 06:00:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVYth-0005bm-E7 for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:58 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:52276) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVYth-0005aZ-8C for qemu-devel@nongnu.org; Tue, 28 May 2019 05:59:57 -0400 Received: by mail-wm1-x341.google.com with SMTP id y3so2175723wmm.2 for ; Tue, 28 May 2019 02:59:57 -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=JwuWb01uGinb5zd5Xhv8VSI/Lid9VvCyBHhhMXoCHSE=; b=Oz/NMYnVy0VTC1Lo/BrVoHKWAILtjUPZJi2RBxCSWtaS8kNmA/TEeKfobWTw6kFYYo yqbG2AAgnK622jmnfhiUwgNNROaczaVRln/JWq66mh/mqWiw7RymhPXxz7DN9hFAB/m7 PQD+CsUe0rHeQRKRp/nb/gc4FpZjb2VDch75EO4w4FHGT58VUPlA8vZ/Hv4jYUajPueU YhIrtdaZnUtdrYf+5mtUF1fwZxB4wn/TjhS/G/WE1/FrgyLrwpB14YISIxgDCjVEiUNK PkarGQIx4gJe5ZshReIoLNkZrr0K/zHQ7W5L/6p/u3raIz5SeDkA1mo6N9QgYugdjW+J V/Vg== 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=JwuWb01uGinb5zd5Xhv8VSI/Lid9VvCyBHhhMXoCHSE=; b=t+bDyAkLODJwXwUsMsEJ00mBTaxHIcWhXhYzs8I8aRoIGmz4f5xwFMV4f9J90/jjvi jwagK0hkAns9K1dLIEubLQA4AkDQ8sPdHMngQUA7HozwidXpEd5XdeXOy0IB6LBR7K3a tpLxZfHGrEPEsb94OaGw9ekej5QaQtM4/GjkQk6yTY2x6KgAOJTwQ9q23G3LVSaCuH3M 9BX4Qhl/UaW7+25pb6FXd2qcKlMqKSUAmWVMR+gpxZyJv9++rILGI6U8Ufu44P2LSllm k+0UzV7HGWjYH5/l7MlbpeQyTz67Meo4e42HMhUuauv3MA4FlTxUs3WmLJqXuhyJKfDM h7Rw== X-Gm-Message-State: APjAAAWvNb/9EX2d8pahlW/dvfDcAm5BPlUiHRMdFwX03NU4I3qzH8bv gJFBo99+Yz3x5nzHE6g3iaLUew== X-Received: by 2002:a1c:c909:: with SMTP id f9mr2496045wmb.115.1559037596166; Tue, 28 May 2019 02:59:56 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id g11sm11395367wrx.62.2019.05.28.02.59.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 02:59:51 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E4A661FFB1; Tue, 28 May 2019 10:49:55 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 28 May 2019 10:49:53 +0100 Message-Id: <20190528094953.14898-29-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528094953.14898-1-alex.bennee@linaro.org> References: <20190528094953.14898-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] [PULL 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 , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org 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 -- 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