From patchwork Tue Nov 7 15:05:49 2017 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: 118182 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp635020edm; Tue, 7 Nov 2017 07:08:59 -0800 (PST) X-Google-Smtp-Source: ABhQp+Sfip31ksQUO2P2vtAOaLwJpPbsbf26y2Ov0qIWkmr1H43ozDqyPg5JHJ47e1XOeX9USJS2 X-Received: by 10.37.203.11 with SMTP id b11mr11940720ybg.316.1510067338939; Tue, 07 Nov 2017 07:08:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510067338; cv=none; d=google.com; s=arc-20160816; b=LB9jvDNcUT3WjzRUCgraT9TKmj+VnC9K2ShM/1yrzb4d3FzoLiJCCz6tdGGr2zAmi3 FNDx59MKyVNi4Vdqcq1be1NHG3xFfhgP9YgOc0i/CKMD50ZYVs+w5HHKz9gpY4ur4jTs RqNLzvdosz4A12u1z/BNYXezgLAi5tTTqaIIJVXhbfocMP65T2df2w5nP1ZGotrrHCTB 8Y159z4VArxJnrDmXgi1FwAJNtNiI2/ukd7POZlqlfdkGUlMzrsZ18xYXRWnVQHtzU7Y LUZA/a40TrCCWxSJBSKZOIMi5e+sXHFzuqv0qRuzlfByqO2slwlJYIt8KgVPEQiSPRGF 4/VA== 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:arc-authentication-results; bh=GVlK4bo5CqCtI8hSw1d1YFgMiOhF3btodo15vpLeLP4=; b=IMO4wS77W2scuPEKP1kz+xliplWXByinsfXdEwGJetdmUojnEfKU9P90Wf8M2RGVaS MQUo3UkxY+LkQSiQQrx4xQ4u+gb4tj5tyKMyZP8wR+JIUwthLQ/hokLRbejHE8p3DUOO dR5b0zTCDQEfmtvdmYEyiOJhWO58Pv00IV/aMDiJR3XqqoZMy6jiQe72deEMlvzz9A57 w3EbVCn5DL8C5LXiTkafVuj9Zj2gKc3UH1C/WdKBDpVOP2kInhX5KGHtD6/HKwAvrJ1K h7w5wQnj4RkrSApK8hHB0RJMpbSYvmwTh4h7PbgF6cI4lTBMOXgwrfkQJUT6LYZ3ZA9a tD3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DOBJkrTU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t1si316100ywe.495.2017.11.07.07.08.58 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 Nov 2017 07:08:58 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DOBJkrTU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:53852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5Uo-0006rj-8w for patch@linaro.org; Tue, 07 Nov 2017 10:08:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5SC-0005nE-R9 for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eC5SA-0008Tb-Cn for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:16 -0500 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:56373) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eC5SA-0008Sk-60 for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:14 -0500 Received: by mail-wm0-x234.google.com with SMTP id z3so4533799wme.5 for ; Tue, 07 Nov 2017 07:06:14 -0800 (PST) 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=GVlK4bo5CqCtI8hSw1d1YFgMiOhF3btodo15vpLeLP4=; b=DOBJkrTUDauy9EaN7FN8n8KgMRJPitc57Ytj80+fgRjxYvVL0CA1sAg0bMR55JE+pq lzHxEjkHwiztNyKNu18Ndt+9K+ukvOIFDHHpeWYwBGT6liar1hxaxWqGX858mez8aiuU 5/MNOo38mhSYDBApNC2clXSdc/BFhm+RuKDtc= 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=GVlK4bo5CqCtI8hSw1d1YFgMiOhF3btodo15vpLeLP4=; b=IyyXuoNS7FQLhz0SeGhN2CSRg/Py8MFP+3ET/yeCfffbZycMFk3n5+7wOA6aWD5GLj urIORtP2kFtRIGQae2OYcx6zzWuSbPzCJxaJ/o9ukunB7/vZMdS961YuqKiITLw2tMZ+ HJ3UIPZwba8+VhOtJhOZligHtthN3VObFIzxT4utQkMHm1IRX3XEbG8WG6bILi3Hz7vL Dg8P3C4mlRZYBUamYW3eYQdWXnpmPt8zHUml7/rjUnbinIRqAiJN6Fr+lM4RVpr78aQv OPjTE9e8BfRanTSPv6BrHY+CTlgCRR/z4PX48GS+DUQDJNodglKkmX+TLFKqcDwzueIz JDWw== X-Gm-Message-State: AJaThX7/lnKcFKrpxKdDrWU4CQhGLEVR4Y3yhbRDV5dMK1ZLveUZrIpJ lSMxrt3d64+foyCfu8v0Z3WlbQ== X-Received: by 10.28.241.10 with SMTP id p10mr1527598wmh.113.1510067173031; Tue, 07 Nov 2017 07:06:13 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id n30sm652080wra.39.2017.11.07.07.06.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 07:06:10 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 921F73E03B5; Tue, 7 Nov 2017 15:06:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 7 Nov 2017 15:05:49 +0000 Message-Id: <20171107150558.22131-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171107150558.22131-1-alex.bennee@linaro.org> References: <20171107150558.22131-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:400c:c09::234 Subject: [Qemu-devel] [RISU PATCH 01/10] build-all-arches: drop -t (for tty) from docker invocation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This prevents gcc from going nuts with colorizing the compiler output which looks particularly ugly when invoked via compilation-mode. Signed-off-by: Alex Bennée --- build-all-archs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.14.2 diff --git a/build-all-archs b/build-all-archs index 63918e5..fa2ac90 100755 --- a/build-all-archs +++ b/build-all-archs @@ -61,7 +61,7 @@ done # If docker is enabled we just brute force the various images until we # can set the one that has a workable cross compiler. -DOCKER_RUN="docker run --rm -t -u $(id -u) -v $(pwd):$(pwd) -w $(pwd)" +DOCKER_RUN="docker run --rm -u $(id -u) -v $(pwd):$(pwd) -w $(pwd)" program_exists() { if [ ! -z "$docker_tags" ]; then From patchwork Tue Nov 7 15:05:50 2017 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: 118187 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp638976edm; Tue, 7 Nov 2017 07:12:15 -0800 (PST) X-Google-Smtp-Source: ABhQp+SHSE3g6DxYLpoVzy54DtONU6u+IknP+59HKH48pereTf8if4QBoG74Kl+lO5KvKd1wLM9U X-Received: by 10.37.109.4 with SMTP id i4mr11380286ybc.368.1510067535785; Tue, 07 Nov 2017 07:12:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510067535; cv=none; d=google.com; s=arc-20160816; b=tN0VKbmalyCKNG/9Bzmanc/E06NPj8td43UDk+yh/xuGohYj3jI3xs9n+CZQ8T4d54 JDt4KCp8Yvm+PaCLUAgi/LVmSPpXIuywBrQPXVZkEa8NW7qqmGFdGgCBv/DkLgFD5tlX 2fsphrVBVFKWV1OOFehO1jZczHrMCQnoIYhi/UiegGZt7GJfDBZyy8OlIZ3HkPEUyi/G A7FtWMyb8mJSrGRgNuZZ+o77tO976DaNikBjs9uZLtfEb2BiqbeyDYzH9PkF0HXa7rMB LyGA4hRF54BWFpH4Q6hOcBOkiLilTD57efDVPhUDB/BnvRUBPmhgyHJLIEOFQVOLMOnz 8R0g== 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:arc-authentication-results; bh=SzfuxM2CFCCq3NBz+c8hfiunWZDu/VF9gUjeaknaGC4=; b=E7HRA5vdLHZ8I69n2tGFMglNJNsDDeaAgrXNYs8tC8sLbN/cSfUeZCILqKLqdjk34o pJxu/2lw+UA5X+XsBPN5dDI9cdL9wRriZhGVPIy0eDV5YZh79DkmxYNTUpR49ism3pBx YD+RAaVTdtauAFVrg8FWE+/qk50WEltu3nhYCF/cSv3uqEGMTgKFngTPuWhHQWLIs1Mh F/JrtojWiMY8i5BBV5B0jgCDAyRjjihzoFtWSx2ZxdSrSMzHriGiS9G09gDfsPfGWEhj L0zrHc2LJy19qnCsuut/JqK7mqwQjgnyuu3MnknNmvVouELd0FE8l1JnMepWGdBVz2qO aK8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SMEOf9dA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i28si321148ybj.778.2017.11.07.07.12.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 Nov 2017 07:12:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SMEOf9dA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:53873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5Xz-00019F-4j for patch@linaro.org; Tue, 07 Nov 2017 10:12:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5SC-0005nD-Qs for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eC5S9-0008SY-AQ for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:16 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:49140) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eC5S9-0008Rh-4Q for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:13 -0500 Received: by mail-wm0-x241.google.com with SMTP id p75so4402192wmg.3 for ; Tue, 07 Nov 2017 07:06:13 -0800 (PST) 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=SzfuxM2CFCCq3NBz+c8hfiunWZDu/VF9gUjeaknaGC4=; b=SMEOf9dAuQQDXQ9mFe9OIZstzpmaSpGG3fQDcQ4VTbwgD4v/upWloniWz7ZixIAUyZ 5Y3hS42cr0kkiT9b2VCM8djwOADP8i0Y0SxuOlST9raS/UiOscg2pbHBPkbMvbsjWDIM YrB7OqQS8nMLUJIWPxPZdDVXSood+Snx5p6VU= 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=SzfuxM2CFCCq3NBz+c8hfiunWZDu/VF9gUjeaknaGC4=; b=WKTc9uE3kPzDzGs0/r3Y1fXdolyWCuUks33mKaCE7D+k5nIB9qOWCggSPKXwePybwW FgeqoFRI7UCF1AO9qinLj5EPmLQ1onNO5SM6+dtBSuqE+JpI4o2aAjSO2mM+mke0x9vU g+XLVOb8OCdSRluqlZ8wjbO3LJq9fhLKAgLmZ+5MDlpXwd+xM4oZ3FhPKoWZV1LFVYVg ctIOJy+YR3SPQNUKyrq4wu7x1iGUlY391bbuNP02j27pilNpX2Sc3Sq0YkgmHlE2tZw6 8SHE9SrwL9X/CF+2RC+dJ68QGjCAF+hicW15fumyVMKLy0jk1PhbUm/89xCHN2S6m8N+ EQtQ== X-Gm-Message-State: AJaThX6skQzDXNd2tFTIXLS9YZKTifdAUzkTmNZvdzLlfVp/uWQadCMq rHSa2ijZ2il7mv8Sh//dJEtfQg== X-Received: by 10.28.214.134 with SMTP id n128mr1893205wmg.59.1510067172008; Tue, 07 Nov 2017 07:06:12 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 195sm35980329wmj.3.2017.11.07.07.06.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 07:06:10 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 9CBF33E040E; Tue, 7 Nov 2017 15:06:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 7 Nov 2017 15:05:50 +0000 Message-Id: <20171107150558.22131-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171107150558.22131-1-alex.bennee@linaro.org> References: <20171107150558.22131-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:400c:c09::241 Subject: [Qemu-devel] [RISU PATCH 02/10] risu.c: split out setting up options X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is a prerequisite to properly handling architecture specific options. Signed-off-by: Alex Bennée --- risu.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) -- 2.14.2 diff --git a/risu.c b/risu.c index 47471c6..a5d155d 100644 --- a/risu.c +++ b/risu.c @@ -282,6 +282,21 @@ void usage(void) "(default 9191)\n"); } +struct option * setup_options(char **short_opts) +{ + static struct option default_longopts[] = { + {"help", no_argument, 0, '?'}, + {"master", no_argument, &ismaster, 1}, + {"host", required_argument, 0, 'h'}, + {"port", required_argument, 0, 'p'}, + {"test-fp-exc", no_argument, &test_fp_exc, 1}, + {0, 0, 0, 0} + }; + + *short_opts = "h:p:t:"; + return default_longopts; +} + int main(int argc, char **argv) { /* some handy defaults to make testing easier */ @@ -289,20 +304,14 @@ int main(int argc, char **argv) char *hostname = "localhost"; char *imgfile; char *trace_fn = NULL; + struct option *longopts; + char *shortopts; - /* TODO clean this up later */ + longopts = setup_options(&shortopts); for (;;) { - static struct option longopts[] = { - {"help", no_argument, 0, '?'}, - {"master", no_argument, &ismaster, 1}, - {"host", required_argument, 0, 'h'}, - {"port", required_argument, 0, 'p'}, - {"test-fp-exc", no_argument, &test_fp_exc, 1}, - {0, 0, 0, 0} - }; int optidx = 0; - int c = getopt_long(argc, argv, "h:p:t:", longopts, &optidx); + int c = getopt_long(argc, argv, shortopts, longopts, &optidx); if (c == -1) { break; } From patchwork Tue Nov 7 15:05:51 2017 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: 118190 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4102031qgn; Tue, 7 Nov 2017 07:17:15 -0800 (PST) X-Google-Smtp-Source: ABhQp+RLvnK0NR1xVeXFXiJw9ivcSFMeaPvK61+oAWj0j7a42yKiF5w79V3gtdF/KqJIectBtxEO X-Received: by 10.129.178.200 with SMTP id q191mr12453615ywh.290.1510067835865; Tue, 07 Nov 2017 07:17:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510067835; cv=none; d=google.com; s=arc-20160816; b=G7BFmH4RXaItdBan6crdNCyZTs6pnBHIzGoYG2U56qqJXU3si0wMd9ksE8FoAaErs3 OOtYleesJiwC6Xm7afnN2KLAkpClYF6lazKUG3UXkGRfo/ggyp3uQF7AJqdNiQw5r7u2 Om8w8zWUvuP7MzAsVLA7l4w78qMEEnhRfPCa4ljFD2WsPLmOFd1EBqD20Zu/LnPSfjZS phtP+f5H4r3iAzQlAfqXj5VzEezIn9kTuwTlNyEuk4ccm92OC568cTDQx47kGjkDEu9j zIiRzetr8I4qn0B8xGmleG8I4A1i3CoZDXXa2f3B0MgSAbPbw2QemLRj+fDtWqTIkuWs SabA== 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:arc-authentication-results; bh=ncxEDVIwQ17eRSE9Lq6AcJKQrlB9tPhh+JUKN9oZgZo=; b=jqj2d6oVrqUZpc6ZxVVEwLT7pssZu/eXCRbkvghAvkcoFISvH8MKZkNcRQd+0nEF0C KMo5Uwx8pTKec9v0H9CeJYhvr+9GGcukH3Bro+kjIChw3Xk9jDN6RVmL5tqRpSApNdbz tJYnQOZXnSKZNVqNVnQCDyVNolcfTtIRBvdnHKQo6XYhrBefbpujb0n959Bv7IQFRfBY qhKTVCINU1SY+0/1UhW9nkF0A663z+rUAtsBlBmAiRPphMaZsqszC+5xkB3Bo4e1cUxN XYlkts0xOR+D+x6YMaAjM81PGV8u3J7nbC5O+au0ALAoy4rVkisu5dk2vmOmuM7Itha0 aX3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RnhedgA9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r128si317934yba.2.2017.11.07.07.17.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 Nov 2017 07:17:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RnhedgA9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:53917 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5cp-0006Ud-EX for patch@linaro.org; Tue, 07 Nov 2017 10:17:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5SK-0005qP-JE for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eC5SC-0008VJ-NL for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:24 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:49964) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eC5SC-0008Ul-Ga for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:16 -0500 Received: by mail-wm0-x243.google.com with SMTP id b189so4338881wmd.4 for ; Tue, 07 Nov 2017 07:06:16 -0800 (PST) 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=ncxEDVIwQ17eRSE9Lq6AcJKQrlB9tPhh+JUKN9oZgZo=; b=RnhedgA90P08wBN6RZgTv6J33zORdiiNosg+j4fXap0we8Mg2hzzLRYkKkH2ZUopwC cfaMhUgXuw8/K8KAEYjghg33NWdZId12BHQ1IDkWNnKI8q+tZa1pbqXAmhlUQRwsYW8y ARNRUMDZdg6NNbZAiwCAClfaorEFpFnnBAAYg= 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=ncxEDVIwQ17eRSE9Lq6AcJKQrlB9tPhh+JUKN9oZgZo=; b=QeoH6DsX8TgfA8PyhRoxbd8sY+hbsuCHkyLk9v55DatcHg5ymmVU1n6Vugoe0bUXe3 Zn8XBB0Yaw7UoO6pKDMn/7wTUSvCWT2umRqcCAjzA8a1WSXuN6HU6BlBPMgfLnC8bxwf oLhNTOEcJoEljPTiVlYasnhjtlefbUkzTl719jP4e6nIRrNKU/bvh8FQL0ZMlsjR6O5o x7EDNpiPaDajDCA7NmFvk42BwISXWuLEvBeGabYOep6UH47tZexE52ly24HcXYVJ0PaI AMREqL+C8Ldzjw/KHTtfFKgPJ+xcNxBJTDpp5HKNO0vZnqWNHstBL2UKKuc/WtWcTNHK u3nQ== X-Gm-Message-State: AJaThX41yeVjIjEk9xobqu/IEKH3nvogSiDPNS1ayx7acowf+tWqd+f1 wUDq6rq2vNoPeLXyO6RgS/+80Q== X-Received: by 10.28.72.8 with SMTP id v8mr1531112wma.38.1510067175401; Tue, 07 Nov 2017 07:06:15 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id e71sm1097302wma.13.2017.11.07.07.06.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 07:06:10 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id A79063E0410; Tue, 7 Nov 2017 15:06:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 7 Nov 2017 15:05:51 +0000 Message-Id: <20171107150558.22131-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171107150558.22131-1-alex.bennee@linaro.org> References: <20171107150558.22131-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:400c:c09::243 Subject: [Qemu-devel] [RISU PATCH 03/10] risu.c: add missing --trace longopt X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This got missed when trace support was added. Signed-off-by: Alex Bennée --- risu.c | 1 + 1 file changed, 1 insertion(+) -- 2.14.2 diff --git a/risu.c b/risu.c index a5d155d..616fc33 100644 --- a/risu.c +++ b/risu.c @@ -289,6 +289,7 @@ struct option * setup_options(char **short_opts) {"master", no_argument, &ismaster, 1}, {"host", required_argument, 0, 'h'}, {"port", required_argument, 0, 'p'}, + {"trace", required_argument, 0, 't'}, {"test-fp-exc", no_argument, &test_fp_exc, 1}, {0, 0, 0, 0} }; From patchwork Tue Nov 7 15:05:52 2017 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: 118184 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp635606edm; Tue, 7 Nov 2017 07:09:31 -0800 (PST) X-Google-Smtp-Source: ABhQp+QJYPB6RAPjGywBpPSKjcT9EAdXhJX6aSBowe+S2PIaJcSr24lNxF63Rdfc25Ezf6t5Oa5Q X-Received: by 10.129.71.11 with SMTP id u11mr11532910ywa.86.1510067371137; Tue, 07 Nov 2017 07:09:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510067371; cv=none; d=google.com; s=arc-20160816; b=qonB60hrMf2yU5WyzQ7Filbp1s1BU268vtX8pTmtV/ANWgyryL4jQQHzTmIZzoiydm ne8N6a0Mv5miSECLmklvQ3lt2O8Skcj2c9DZfRNFBNKgJMAXBLqysB4S8KZG1Rd80LZq Yi5DaFX0G6MkAXySn59F3zrlvmiQt7nXFNfOkWNSpb3qFzLweKVy2+il3qYsM6yimSS0 3ZEmUsgwdv/JcoR91q1+k53mpp96JTRpg2dzRE13C4GKnoYl2voYoQJVDhEelcjtira7 FkP//TQsNBFfTeHCPMpQfgx8uIry4PLZPdOdPQ4PmCMMY6Bgbsd+IyPAUwfywNe776oA 218w== 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:arc-authentication-results; bh=JetAxh5yYChUz2jvr6sK3QTYSNc5deGIz46me3P2a5U=; b=C3r2fzONIwGX80muKop/hE7NfCUn070wa1fvH1EB0zTa0PI5TMpcE6Ox83bpnWgf8p m8C+Qeq8WfY2cD/2XFR2V9uoAXVyz62S3FBcIn4w8FOyzppiimSXleYXG9rQ0cKxtwTc uVi17rVFEgx+Ap4mljexLJlr4P55nO54bYg46pYZue8cbzq1ObMxeKZ2eeoI8qUIYfHQ K1OYm05+RHUK8XR/73DBXd086L8d/4Ug27i4S9z+UplLkbYc9AOLXktfkINlY1n+0/mu Vz0vFUcVr5XkdaphTNdCmoj8BWi7+ZXsvErOPCgVd/KPMxRyAWSmIW6bR6IwpPGpkaD9 wjBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=H8BBLkaZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o17si321153ybe.768.2017.11.07.07.09.30 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 Nov 2017 07:09:31 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=H8BBLkaZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:53855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5VK-0007IJ-EG for patch@linaro.org; Tue, 07 Nov 2017 10:09:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5SD-0005nG-PP for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eC5SC-0008V4-7O for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:17 -0500 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:51462) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eC5SB-0008UB-Kd for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:16 -0500 Received: by mail-wr0-x241.google.com with SMTP id j15so12123142wre.8 for ; Tue, 07 Nov 2017 07:06:15 -0800 (PST) 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=JetAxh5yYChUz2jvr6sK3QTYSNc5deGIz46me3P2a5U=; b=H8BBLkaZdGMv162LiNTqTZn/sqilVtUi2V0cM+A4mYiTAXDAcqv+pEMk75bfUBLJUc LSf1YKjdgJmOV9eUtX4aImJAcKN4yi7zCY9CzPEFkXJvw8nTk29bCtolH5nd8pwqI/cy XeLO9tsT5Wo9nZLsg1Xtm2H4u2yvNMRXj9RRo= 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=JetAxh5yYChUz2jvr6sK3QTYSNc5deGIz46me3P2a5U=; b=uQ3r61w99Ehp/Tapwpe8AdsNh0JpRZYsUMKxL4nMSKFktx1uhZ5TDYzG4GpksOkvCw 7uuLryqyN5hNFei6SVrXRmdo8XcjU4d9dtwg5+K2wnOkzgc9Bd3vM7t8BC7ZwCGelLcT IHMDaQjyX4FeGXgqRoxwwFyx3BKMX9AaSMlINALbocP48Or+P+8N7le3xqFe3IbwUmF6 TqF5JW/HMrvv9JXepkPPWcIunyiQki54eT0FCJSG7wAX1h66zuIXU5qrn12nEZaiWCrR aNViZxiU7NPIJPN29p6i0GwCRRU4ecea4SgzSgzdIjARTWRiZ6rEi1Lja4l7uMoGC4E3 XkeA== X-Gm-Message-State: AMCzsaUmUkfhmxXGgFkir5oYniUyAnj4wGm4OoJNVw51JUz8pvMpn+P4 qhXLh0N/vnMzGEhDpOx3k0DnUA== X-Received: by 10.223.152.149 with SMTP id w21mr15847255wrb.274.1510067174485; Tue, 07 Nov 2017 07:06:14 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o190sm1808400wmd.32.2017.11.07.07.06.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 07:06:10 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id B25003E0449; Tue, 7 Nov 2017 15:06:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 7 Nov 2017 15:05:52 +0000 Message-Id: <20171107150558.22131-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171107150558.22131-1-alex.bennee@linaro.org> References: <20171107150558.22131-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:400c:c0c::241 Subject: [Qemu-devel] [RISU PATCH 04/10] risu: move optional args to each architecture X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The key variables here are: *arch_long_opts and *arch_extra_help. If they are not NULL then we concatenate the extra options to appropriate structure to enable the support. Adding architecture short options is not supported. This also includes moving the ARM specific test_fp_exc/test-fp-exc into ARM specific code. Signed-off-by: Alex Bennée --- risu.c | 31 ++++++++++++++++++++++++++----- risu.h | 6 ++++-- risu_reginfo_aarch64.c | 3 +++ risu_reginfo_arm.c | 11 +++++++++++ risu_reginfo_m68k.c | 3 +++ risu_reginfo_ppc64.c | 3 +++ 6 files changed, 50 insertions(+), 7 deletions(-) -- 2.14.2 diff --git a/risu.c b/risu.c index 616fc33..f063093 100644 --- a/risu.c +++ b/risu.c @@ -43,9 +43,6 @@ gzFile gz_trace_file; sigjmp_buf jmpbuf; -/* Should we test for FP exception status bits? */ -int test_fp_exc; - /* Master functions */ int read_sock(void *ptr, size_t bytes) @@ -280,6 +277,9 @@ void usage(void) fprintf(stderr, " -p, --port=PORT Specify the port to connect to/listen on " "(default 9191)\n"); + if (arch_extra_help) { + fprintf(stderr, "%s", arch_extra_help); + } } struct option * setup_options(char **short_opts) @@ -290,12 +290,33 @@ struct option * setup_options(char **short_opts) {"host", required_argument, 0, 'h'}, {"port", required_argument, 0, 'p'}, {"trace", required_argument, 0, 't'}, - {"test-fp-exc", no_argument, &test_fp_exc, 1}, {0, 0, 0, 0} }; + struct option *lopts = &default_longopts[0]; *short_opts = "h:p:t:"; - return default_longopts; + + if (arch_long_opts) { + struct option *dptr, *sptr; + size_t osize = sizeof(default_longopts); + lopts = malloc(osize); + /* Copy default opts */ + memcpy(lopts, default_longopts, osize); + dptr = lopts; + while (dptr->name) { + dptr++; + } + /* Copy extra opts */ + sptr = arch_long_opts; + while (sptr->name) { + osize += sizeof(struct option); + lopts = realloc(lopts, osize); + *dptr++ = *sptr++; + } + memset(dptr, 0, sizeof(struct option)); + } + + return lopts; } int main(int argc, char **argv) diff --git a/risu.h b/risu.h index 1c8ecee..89811f4 100644 --- a/risu.h +++ b/risu.h @@ -17,6 +17,10 @@ #include #include +/* Extra option processing for architectures */ +extern void *arch_long_opts; +extern char *arch_extra_help; + /* GCC computed include to pull in the correct risu_reginfo_*.h for * the architecture. */ @@ -36,8 +40,6 @@ void send_response_byte(int sock, int resp); extern uintptr_t image_start_address; extern void *memblock; -extern int test_fp_exc; - /* Ops code under test can request from risu: */ #define OP_COMPARE 0 #define OP_TESTEND 1 diff --git a/risu_reginfo_aarch64.c b/risu_reginfo_aarch64.c index e3fadde..38ad338 100644 --- a/risu_reginfo_aarch64.c +++ b/risu_reginfo_aarch64.c @@ -17,6 +17,9 @@ #include "risu.h" #include "risu_reginfo_aarch64.h" +void *arch_long_opts; +char *arch_extra_help; + /* reginfo_init: initialize with a ucontext */ void reginfo_init(struct reginfo *ri, ucontext_t *uc) { diff --git a/risu_reginfo_arm.c b/risu_reginfo_arm.c index 6b9ee7b..5acad02 100644 --- a/risu_reginfo_arm.c +++ b/risu_reginfo_arm.c @@ -13,12 +13,23 @@ #include #include #include +#include #include "risu.h" #include "risu_reginfo_arm.h" extern int insnsize(ucontext_t *uc); +/* Should we test for FP exception status bits? */ +static int test_fp_exc; +static struct option extra_opts[] = { + {"test-fp-exc", no_argument, &test_fp_exc, 1}, + {0, 0, 0, 0} +}; + +void *arch_long_opts = &extra_opts[0]; +char *arch_extra_help = " --test-fp-exc Check FP exception bits when comparing\n"; + static void reginfo_init_vfp(struct reginfo *ri, ucontext_t *uc) { /* Read VFP registers. These live in uc->uc_regspace, which is diff --git a/risu_reginfo_m68k.c b/risu_reginfo_m68k.c index 4ff0aa8..d429502 100644 --- a/risu_reginfo_m68k.c +++ b/risu_reginfo_m68k.c @@ -14,6 +14,9 @@ #include "risu.h" #include "risu_reginfo_m68k.h" +void *arch_long_opts; +char *arch_extra_help; + /* reginfo_init: initialize with a ucontext */ void reginfo_init(struct reginfo *ri, ucontext_t *uc) { diff --git a/risu_reginfo_ppc64.c b/risu_reginfo_ppc64.c index eb9c12b..aa5d8c6 100644 --- a/risu_reginfo_ppc64.c +++ b/risu_reginfo_ppc64.c @@ -22,6 +22,9 @@ #define XER 37 #define CCR 38 +void *arch_long_opts; +char *arch_extra_help; + /* reginfo_init: initialize with a ucontext */ void reginfo_init(struct reginfo *ri, ucontext_t *uc) { From patchwork Tue Nov 7 15:05:53 2017 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: 118188 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp639833edm; Tue, 7 Nov 2017 07:13:03 -0800 (PST) X-Google-Smtp-Source: ABhQp+RsGmpVTua2Rue2HhqDINdgmSZrh0nM902SdqYpKS819BXjlLivJYZgnbtYHagM/MiJ+j/y X-Received: by 10.129.79.138 with SMTP id d132mr12471323ywb.236.1510067583185; Tue, 07 Nov 2017 07:13:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510067583; cv=none; d=google.com; s=arc-20160816; b=muAH3gmkwNOZ+wL16AfvlqnrW0x9FImPP8+E8Kcv32vmF7qCM7kuSdfFfzAYaLgqDw PA9FxUcGjVZMb+z12gcezsfgOSRLwcKyGpLhzCN9dCsDCGhJSElgsCccTJYzKo7AsxpA /0KzbfpkKT/wQWqhVLSvhHjEslmLfed5cnDeVYT0rzyqR/IdSw6s2ihv6qNwRDNJaf+A ga9SW6VVa6r7R5SCDrrU867CATdz62f0KHAJ2/6fnOPNo1oQG5ure63ud4lP6YZAGDoM cdkOGHGZCLNKOUCnCFq+/deg/+u1N7tYsa0W8TRvmNnBRQVvw2JjnfDmMpfQOyHhuZVo U61A== 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:arc-authentication-results; bh=/zYE1prZ1q5lHhUgPRpT3/mNwOoYSNwS4ZLxfqAqGxE=; b=MkS9IOcc525kvp2Nu3mlCOtUf8W6n6VUmek2mUKHMIprtK5JslJn4jhT/dBvjEN/8u xj0jyRL9iy19IUKkvW/KLZtNFvjI218aFCvJdl7YeV1tHHwi+zATKUDmSf79ofCv2IMo Q/WyQW2KcKHFjBB3sKTMV0X/Z6i1NPdst7AvGVVn4bgVmxOCI0+X4OW5O33V0Wv9q2ri Nztv5u9Ev7ChVYMMU4Kr+bHZhbEOiJnkDv8+YulW2SuEHtfJgEGVrj9C3VI7vhJ5WqRc JSMZQRi2PxX8oUQuJ4+84O4h8NFbZWi1ELCsbzzIk+vm43EZ9et9v5lDjQyzT3hNCqKo s/ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iiyabpAr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e203si315225ywc.543.2017.11.07.07.13.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 Nov 2017 07:13:03 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iiyabpAr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:53876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5Yk-0001sl-Gy for patch@linaro.org; Tue, 07 Nov 2017 10:13:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5SK-0005qO-4N for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eC5SF-00005o-AL for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:24 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:54009) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eC5SF-00005O-3W for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:19 -0500 Received: by mail-wm0-x244.google.com with SMTP id r196so4567073wmf.2 for ; Tue, 07 Nov 2017 07:06:19 -0800 (PST) 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=/zYE1prZ1q5lHhUgPRpT3/mNwOoYSNwS4ZLxfqAqGxE=; b=iiyabpAr9ji1CR2NjXefrWc7DU+D7jlqbKw8QO9ZaCsFu1k6i7xRpXfIK5CYdc8nxb Z8dvaHX+jO1KQfMXiyilJpVmTr56dtD0cyV3ncFtfZX9u2Rrt30+5uus+4o8B8Y4VNDJ drpmbyGmmIuB9kuSoae00Gfdj6G7BqsqD1Qtc= 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=/zYE1prZ1q5lHhUgPRpT3/mNwOoYSNwS4ZLxfqAqGxE=; b=dSF8B8kDziwBV5sjs+9KWbHvEsiNpBHkg9IMk4gfD4KaSIG+Gx33idB05ANibDGSAH lCLXJz8qErDdoUunvNSfDuZwr1jkkI9IMxuLvsBiYCbcqIK8uKlI7aVdzC7013EAmr/W wcdew5RFq+mx69BnrxMS+DEsjgCJHVPZwjQ5IDKJguGGv89hCqUCwftWCDStcKxy/tVE bAtcUrJcgJNdx9x8hTdOkhvDg+DMmj7pUOdbMvquLvVAaeIuleGI1W86PHz74lfDi2pK 5UTZejuj8P57UBlfvLArkM8EnqX5pDR63cIfhkuxxdXd8J4y0VHKa8Mm9syFVLEWYNk9 5Psw== X-Gm-Message-State: AJaThX7qW/NrN+RlZYkb0ovUUwDyUB2isifMGEdwwHeP7ZmyHViAWj3A XqjKO1gN2ZnN83tKOdLasi/b/g== X-Received: by 10.28.239.2 with SMTP id n2mr1524801wmh.140.1510067178035; Tue, 07 Nov 2017 07:06:18 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id r23sm781899wrc.93.2017.11.07.07.06.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 07:06:15 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id BDA543E044B; Tue, 7 Nov 2017 15:06:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 7 Nov 2017 15:05:53 +0000 Message-Id: <20171107150558.22131-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171107150558.22131-1-alex.bennee@linaro.org> References: <20171107150558.22131-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:400c:c09::244 Subject: [Qemu-devel] [RISU PATCH 05/10] configure: allow repeated invocation of configure in 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: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Otherwise a second configure run will totally miss out the setting of BUILD_INC. I made the link -sf as it seemed the easier way around. Signed-off-by: Alex Bennée --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.14.2 diff --git a/configure b/configure index 1dc527b..c622a5e 100755 --- a/configure +++ b/configure @@ -176,10 +176,10 @@ fi # Are we in a separate build tree? If so, link the Makefile # so that 'make' works. -if test ! -e Makefile; then +if test ! -e Makefile || test -s Makefile; then echo "linking Makefile..." BUILD_INC="-I $(pwd)" - ln -s "${SRCDIR}/Makefile" . + ln -sf "${SRCDIR}/Makefile" . fi generate_config From patchwork Tue Nov 7 15:05:54 2017 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: 118183 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp635292edm; Tue, 7 Nov 2017 07:09:15 -0800 (PST) X-Google-Smtp-Source: ABhQp+QLJkgBK3rx5nHhyoPGuU+f0WAMfTifKxsIuZgVUCAnc5Vq4gmhACmzM/34QcxJe12fr0+6 X-Received: by 10.13.229.131 with SMTP id o125mr11525604ywe.377.1510067355566; Tue, 07 Nov 2017 07:09:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510067355; cv=none; d=google.com; s=arc-20160816; b=T2KOQ/oliP2X2EJwfJIQgarpoL4iJcIOg7dxqooL5qmuIj2DxrM1UCbKbsC1WLO67Z 8rVgxIy0WBQCW2FayNq0ayOXXCLNPdFZssNVcSeCz4JVTqeMO89iNlcVYsDmUnEt9ljK Su3lEd3nWqf702hIWhY+WlV05wHMqbU6fOK4FT70qBccylWc9sYR3KL/+E2cjddqkPBW h1wRe/4nPY8hIRJluf0d98w6ypnNLyQg5qETjfBDdayWaZmsC4MB3XTlnunmv2xkBt5t EXy1TGsvgVmwguIlOZAS5kLKmZTwuj2NRXsoIjffqO2TB+VBE9F2hrwujhtkeW+wMpvm WPKw== 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:arc-authentication-results; bh=nhgQm0xuKcZEhWSD6MkFSG+FskX5P235rYKC/aqc+00=; b=ppfw1PizpeSQnjsEus602o16Bse8CMe+xfeCw67+FCkWnC6nrXrO+E18wnOIHmPAH2 lUQ0AxmQXYJqTq1kaFUIKJmPb78L19WwVtaxphzfciLr4MHzYwHuGYWizkkuw4PowqlV /9CCHcmM+5o5psgOKUyjlD6q0ZNC7CFQtFbTaHXYXVndYIVWCfSmIdTdcLK7bNTasdMR JFYAyLCWZ0eTllmZWEfjJHa6Wu3bpVJTW+C0+Z7hC3U2517YIAHpgLAIE5092h2JQ2cu OUIRUYT8pnxE6bGPNGTXC8xiBPoz74JiVismbQefbhRsSbiRpoMJj+Dk3ZqbC45K8L1W R7wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=LOzJ9uen; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t65si323336ywa.267.2017.11.07.07.09.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 Nov 2017 07:09:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=LOzJ9uen; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:53854 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5V4-00075L-Vp for patch@linaro.org; Tue, 07 Nov 2017 10:09:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5SF-0005nt-A0 for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eC5SE-000054-9v for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:19 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:50542) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eC5SE-0008WE-46 for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:18 -0500 Received: by mail-wr0-x242.google.com with SMTP id p96so12122640wrb.7 for ; Tue, 07 Nov 2017 07:06:18 -0800 (PST) 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=nhgQm0xuKcZEhWSD6MkFSG+FskX5P235rYKC/aqc+00=; b=LOzJ9uenQA7Iz8SHOjih15mz7Agnj/wobdE2hIvpxR5SsTh0t/HF7kxFvFP0u5IXRD 3ntPlcLCSzIN3cithJJFJhew3KOMwqIzcNU5UbvpsP+m6rwsZ/83AcmTPih9hk+WMEyD YJ8nnC7JWGYG3XlyipPvlEgq6cF75cfUNddmc= 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=nhgQm0xuKcZEhWSD6MkFSG+FskX5P235rYKC/aqc+00=; b=nTKNKletHLMAlCtsOeMJTlXgIr98Me+bV1LCFFldyxmewCk1vuUYyV8WE0UH9Q0Cd4 GgrBiRT7MiFnyH4qQvzvoV1EJNDIkBlZGJISankHkQFKy+de65qABPir1CJtF7/Ycp4n ZYRUJnJe0WU2aB1uPmrbV7etRbH63vfeVVjNTBe57mUy5E3698cgmLNxur4TTf/px/a8 TPyn8rIxbUNl1a9HgcwoRFlUdO30KOyt7bysx3dDEHB7QfObKA/09rkXQB/6ucGZRiQf kvQiOpk3lh+k47jfAqWwVrFx82rMeUwx1nak1HGGjFuMB8CTUusGEawHbR+SnLC9HOKK HyGg== X-Gm-Message-State: AMCzsaU/i0plxYeUPNCbNVrlre62uax8JpA8g1Fp42DHRxxFjM2w2biu lBD+Fyt3ez+Ug9dOc9BprrKkrg== X-Received: by 10.223.154.184 with SMTP id a53mr17168342wrc.48.1510067177084; Tue, 07 Nov 2017 07:06:17 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id e131sm20098565wmg.1.2017.11.07.07.06.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 07:06:15 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id C8D0E3E0464; Tue, 7 Nov 2017 15:06:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 7 Nov 2017 15:05:54 +0000 Message-Id: <20171107150558.22131-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171107150558.22131-1-alex.bennee@linaro.org> References: <20171107150558.22131-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:400c:c0c::242 Subject: [Qemu-devel] [RISU PATCH 06/10] configure: support CPPFLAGS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Useful for accessing API's that are still brewing, e.g: CROSS_PREFIX=aarch64-linux-gnu- \ CPPFLAGS=-I/home/alex/lsrc/qemu/risu.git/sve-headers/include \ ../configure Signed-off-by: Alex Bennée --- README | 6 ++++++ configure | 1 + 2 files changed, 7 insertions(+) -- 2.14.2 diff --git a/README b/README index 9946e6e..fbe408d 100644 --- a/README +++ b/README @@ -26,6 +26,12 @@ Most useful is need this if you're not building on the target system (Example: CROSS_PREFIX=arm-linux-gnueabihf- ) +Another useful flag is + CPPFLAGS= which specified pre-processor flags, usually -I statements + for specifying extra include paths. Use this is you need something + from new kernel headers not installed on your system. + (Example: CPPFLAGS=-I/path/to/sve-kernel-headers/include) + Passing --static will build a statically linked binary which is useful if you don't want to mess around with a chroot to run the binary. diff --git a/configure b/configure index c622a5e..65e1819 100755 --- a/configure +++ b/configure @@ -111,6 +111,7 @@ generate_makefilein() { echo "# Makefile.in - generated by the 'configure' script" > $m echo "ARCH:=${ARCH}" >> $m echo "CC:=${CC}" >> $m + echo "CPPFLAGS:=${CPPFLAGS}" >> $m echo "LDFLAGS:=${LDFLAGS}" >> $m echo "AS:=${AS}" >> $m echo "OBJCOPY:=${OBJCOPY}" >> $m From patchwork Tue Nov 7 15:05:55 2017 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: 118185 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp636542edm; Tue, 7 Nov 2017 07:10:15 -0800 (PST) X-Google-Smtp-Source: ABhQp+Sj4TMpb/jY/f6A9jm2bq947oRKTKrnDPp1/LdON3ez8Df2REEcOgAN4y9E4Ya15I4EbmCk X-Received: by 10.129.46.8 with SMTP id u8mr12531638ywu.511.1510067415280; Tue, 07 Nov 2017 07:10:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510067415; cv=none; d=google.com; s=arc-20160816; b=mCaNE4f+D+SqPyapXe7NnhpIsIuZqrz0Y7PpdBdsl15omd9zMvOtvP9GFNOja7xH+7 Jae7aHnTwxrb+LIYV2b7b2howbpgzPKpjc7CBR37vqcjy3/g5GLeQasWPmwgxuRNPMHk bC8JoW4TgtIVzk2fNWKIF602/H24CcXmb+xLsGaMUiGxjLzj7ckLhlCtAM6JI5DE+GUM YLaK2uCoRyg0syX+tM9NvxxHNaCeiz8yf0j3M6yllxVM7S+mMOP/WMhXXpB49ohbZ6on K6EUnUpcbEg5P0HMhggDLcO36dzA8ol07YjFBKC9eibtKZeFf8C6CmMccDg0FChGBuHg k3oA== 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:arc-authentication-results; bh=z2m0gD3rxhKF/g/UVnGrY2EDjOkD/amtIoVHJ+E7xpQ=; b=ot3SKS6n9hkxM5dlBjIdhJJGkyNpKRO5x2L6gI6ep9tVq1FatZaIFMa7pn3gxZHuDQ QFZEVVaNqmsPvwF/s59qLeCnZZq2nfSJoo3qBdMli0CxEFPg0o99qLk1HKyrFOwfIwFQ FG4yhyIsEnXhWupDYAYBb87Cl5sH5XbERanFjUoSdigWFuTXRn8CluOLd54BknoV5K1V 7zf5swpwGtEGcK/DvQId8/8IV4VKuPsiOD2VXM7tqh5HoYM1ULxU94b2rTOTYjElM50H GOs6JuyKJQ0qbzWx7iH7D4JuDX3nk20ubJArRYNtxsmS1VfsMw+180Hnwf9Ur1S8AQPr ubKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XsSZB67E; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c2si326996ywe.349.2017.11.07.07.10.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 Nov 2017 07:10:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XsSZB67E; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:53865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5W2-0000BL-IS for patch@linaro.org; Tue, 07 Nov 2017 10:10:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5SO-0005ul-Vf for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eC5SH-00007K-7h for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:28 -0500 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:45421) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eC5SG-00006a-VB for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:21 -0500 Received: by mail-wr0-x244.google.com with SMTP id y9so12133703wrb.2 for ; Tue, 07 Nov 2017 07:06:20 -0800 (PST) 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=z2m0gD3rxhKF/g/UVnGrY2EDjOkD/amtIoVHJ+E7xpQ=; b=XsSZB67Ech6Urtx4sTKGgRRWsVkB9UIBhRXxJg3qXZwMXlUQeb0ZAW7WU0DXg6p5FU ANQQT9yJqY9DAS3Yuz+tdXeLRUQ2FpAsB+v6rzZXkXlRQB8yK+zBH6GSmuox0OAgSwXU BIMuHrnIKAdUJ6A7B6P/ASoKmCdRdyeIyx+0E= 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=z2m0gD3rxhKF/g/UVnGrY2EDjOkD/amtIoVHJ+E7xpQ=; b=HoWcNKTc0WMKhFQXT8999gJRTWK8TMLhEoZk5HPsBMfFi5+QhcNuxS3CZP6iQOWgEZ 9V5iyukVCsYlo/L679jfaMGrqL6XSIFU+1NrSCJenbRqRc8SeEw2jNf8qg+E75pS0nnM 99gl8x7Eoz9LKUJLA1DkgVA1UOyiAy0eczU/anzRjEKuXf8Rug48KRvo/Jg4WVL6KR+f soudXPpKoF9xXBA7AozMP5cwGeSZUfY341oMfeTL9ZFbXoB50LTnZz5kYw12HPfocDmn e+bx56zwu5BCFFb1pyrjHmv586UmK7W4Fhdk1hMLBdCKAE2mqJVQwGSUDKOKCdwEvJoB Es9A== X-Gm-Message-State: AMCzsaX13/YYCKTw9FxzwkSzY0QbPfRJkrbeudfTdYeoyG4D2nB6OC6Q HQO2eqxgQfpl+BI82bDovjolCA== X-Received: by 10.223.181.131 with SMTP id c3mr15596783wre.198.1510067179685; Tue, 07 Nov 2017 07:06:19 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id g68sm1116653wmc.22.2017.11.07.07.06.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 07:06:16 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id D39323E0488; Tue, 7 Nov 2017 15:06:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 7 Nov 2017 15:05:55 +0000 Message-Id: <20171107150558.22131-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171107150558.22131-1-alex.bennee@linaro.org> References: <20171107150558.22131-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:400c:c0c::244 Subject: [Qemu-devel] [RISU PATCH 07/10] risugen: add --sve support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is similar to the approach used by the FP/simd data in so far as we generate a block of random data and then load into it. As there are no post-index SVE operations we need to emit an additional incp instruction to generate our offset into the array. Signed-off-by: Alex Bennée --- risugen | 3 +++ risugen_arm.pm | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 53 insertions(+), 7 deletions(-) -- 2.14.2 diff --git a/risugen b/risugen index aba4bb7..0ac8e86 100755 --- a/risugen +++ b/risugen @@ -317,6 +317,7 @@ sub main() my $condprob = 0; my $fpscr = 0; my $fp_enabled = 1; + my $sve_enabled = 1; my $big_endian = 0; my ($infile, $outfile); @@ -334,6 +335,7 @@ sub main() }, "be" => sub { $big_endian = 1; }, "no-fp" => sub { $fp_enabled = 0; }, + "sve" => sub { $sve_enabled = 1; }, ) or return 1; # allow "--pattern re,re" and "--pattern re --pattern re" @pattern_re = split(/,/,join(',',@pattern_re)); @@ -361,6 +363,7 @@ sub main() 'fpscr' => $fpscr, 'numinsns' => $numinsns, 'fp_enabled' => $fp_enabled, + 'sve_enabled' => $sve_enabled, 'outfile' => $outfile, 'details' => \%insn_details, 'keys' => \@insn_keys, diff --git a/risugen_arm.pm b/risugen_arm.pm index 2f10d58..8d1e1fd 100644 --- a/risugen_arm.pm +++ b/risugen_arm.pm @@ -472,9 +472,47 @@ sub write_random_aarch64_fpdata() } } -sub write_random_aarch64_regdata($) +sub write_random_aarch64_svedata() { - my ($fp_enabled) = @_; + # Load SVE registers + my $align = 16; + my $vl = 16; # number of vqs + my $datalen = (32 * $vl * 16) + $align; + + write_pc_adr(0, (3 * 4) + ($align - 1)); # insn 1 + write_align_reg(0, $align); # insn 2 + write_jump_fwd($datalen); # insn 3 + + # align safety + for (my $i = 0; $i < ($align / 4); $i++) { + # align with nops + insn32(0xd503201f); + }; + + for (my $rt = 0; $rt <= 31; $rt++) { + for (my $q = 0; $q < $vl; $q++) { + write_random_fpreg_var(4); # quad + } + } + + # Reset all the predicate registers to all true + for (my $p = 0; $p < 16; $p++) { + insn32(0x2518e3e0 | $p); + } + + # there is no post index load so we do this by hand + write_mov_ri(1, 0); + for (my $rt = 0; $rt <= 31; $rt++) { + # ld1d z0.d, p0/z, [x0, x1, lsl #3] + insn32(0xa5e14000 | $rt); + # incp x1, p0.d + insn32(0x25ec8801); + } +} + +sub write_random_aarch64_regdata($$) +{ + my ($fp_enabled, $sve_enabled) = @_; # clear flags insn32(0xd51b421f); # msr nzcv, xzr @@ -483,6 +521,10 @@ sub write_random_aarch64_regdata($) write_random_aarch64_fpdata(); } + if ($sve_enabled) { + write_random_aarch64_svedata(); + } + # general purpose registers for (my $i = 0; $i <= 30; $i++) { # TODO full 64 bit pattern instead of 32 @@ -490,12 +532,12 @@ sub write_random_aarch64_regdata($) } } -sub write_random_register_data($) +sub write_random_register_data($$) { - my ($fp_enabled) = @_; + my ($fp_enabled, $sve_enabled) = @_; if ($is_aarch64) { - write_random_aarch64_regdata($fp_enabled); + write_random_aarch64_regdata($fp_enabled, $sve_enabled); } else { write_random_arm_regdata($fp_enabled); } @@ -893,6 +935,7 @@ sub write_test_code($$$$$$$$) my $fpscr = $params->{ 'fpscr' }; my $numinsns = $params->{ 'numinsns' }; my $fp_enabled = $params->{ 'fp_enabled' }; + my $sve_enabled = $params->{ 'sve_enabled' }; my $outfile = $params->{ 'outfile' }; my %insn_details = %{ $params->{ 'details' } }; @@ -918,7 +961,7 @@ sub write_test_code($$$$$$$$) write_memblock_setup(); } # memblock setup doesn't clean its registers, so this must come afterwards. - write_random_register_data($fp_enabled); + write_random_register_data($fp_enabled, $sve_enabled); write_switch_to_test_mode(); for my $i (1..$numinsns) { @@ -930,7 +973,7 @@ sub write_test_code($$$$$$$$) # Rewrite the registers periodically. This avoids the tendency # for the VFP registers to decay to NaNs and zeroes. if ($periodic_reg_random && ($i % 100) == 0) { - write_random_register_data($fp_enabled); + write_random_register_data($fp_enabled, $sve_enabled); write_switch_to_test_mode(); } progress_update($i); From patchwork Tue Nov 7 15:05:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 118191 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4103509qgn; Tue, 7 Nov 2017 07:18:30 -0800 (PST) X-Google-Smtp-Source: ABhQp+RRY4xUGgbvPXDOmhdJDy0WVbBb+Yb0PQb0mE1jvUF46O+7Z37Uh3wU0+lvWm+0cRLMMYzS X-Received: by 10.13.207.130 with SMTP id r124mr11936474ywd.287.1510067910912; Tue, 07 Nov 2017 07:18:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510067910; cv=none; d=google.com; s=arc-20160816; b=UnRVos67gKqXGMZZA3tdXnY33caAPFfeg/ZO50JW0QagMgE9tRuAkyk+xl7Pr8OERU Z3TeZeCdr0n5PS3Lbn5c508FfXmFvhs3YRNVLFgEtqb5A5Q+fG55GSMEIb/0r7t4C94R VKZ/Z2m/DnZakw/jsNvqBFm7n53ypPQ7SpQHdVfTi06BgrrccLdGR/0EuU4hakBrE6Yo 4uQLc0PoASjlQmHMD19VUPHd4aD0cQnuJmqX7ux8irEFEYgF1Pqj3PNUhbVxWUbzLar/ ORoC09m0uELtDXrDRvsZDUUcdzL1aNd2aMTor2tZ0F0jD3dqMLC4KCMB8RvE4LMBoUfH eanA== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=XbE2GYAhGadQNH4f1UrfptiDmZB1NuZ25k7v6rFT6z8=; b=tOoH+dET+/JMX3nczGoT0pDtlXrzwHoUEd1x/GslEoMlt5Q/QtxYwkKrBvqoHyGuCV x/k4ucYSqdVbxi7fAHEbCARipqo1U+rH7Fkw9CXu2JR4hwefw3UEUFY1/+SNbQqHfT3w 6o+fDea1PWYrYFZI4NPEEPiolBllqsu8w/hRWCZnvJVe7kL8/WEISvBw3ZHz9zcjlwxu 9LH9S4wooljpYPMX8gdCtlyBFahMh+hpktKDFIVNK/Eeu0ncbJ9lsNJQr5SaZe2dYuDu hNZ63KAo9MjQLxzi/tVSaxpplYJJkJgGXkKHKhAzuX1S6f1X+GQY4uN0F+Ct3SHtcslF Shcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KfTy6u9p; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r127si329168ywd.139.2017.11.07.07.18.30 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 Nov 2017 07:18:30 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KfTy6u9p; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:53919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5e2-00076S-GV for patch@linaro.org; Tue, 07 Nov 2017 10:18:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5SO-0005uf-Rp for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eC5SH-00007o-Vb for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:28 -0500 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:47066) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eC5SH-000078-P8 for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:21 -0500 Received: by mail-wm0-x233.google.com with SMTP id r68so4413137wmr.1 for ; Tue, 07 Nov 2017 07:06:21 -0800 (PST) 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; bh=XbE2GYAhGadQNH4f1UrfptiDmZB1NuZ25k7v6rFT6z8=; b=KfTy6u9p3L999u3zNLqU03FOnkOmGkUNeHwJMsivAuI/V4tsuKBeTIcDMt7pRturFC CLBSJ2IgQz2drQ2RrI18zUIbiVwrneVKQfbvvsr6CTJTJOjS8fZfJ2gymSKGd5zBPeLx u6TgXZVVi5d9VhOxqgNUkOtRNI6xGzBs/Q3zY= 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; bh=XbE2GYAhGadQNH4f1UrfptiDmZB1NuZ25k7v6rFT6z8=; b=tXaVE06jlsDuwQo/5xd9+I1CNyOgR2eCEbCQ0mWBrLvusOy2bDbh2+vbqgk5d5LRKM YhAKd1b/nC3+F/B2vDZMHxMAZhjSQz8UCEod2xLd9jkqQnJ1BTojk0+6NIN4OaZU1rY+ bPo2xcqIObNK+rnfmpgnsvoO3C4Fv+5eFCZ2ypKo6E5vAlsQb2CbYjyx3Vyn1Y0atcS1 ZhWI5Po8ZMcaQ29e5LkNIig+FRDmucQCLNYKkjKt4Xa0ergSUUEaYrul5q0MCBbd+04R 6ypyHneFGfhh48g9Dlo9sBjpYNMXjtfuBYh8j6MT5yzmHHdfJe6rzYGuW/2tG7vW5n3a jajQ== X-Gm-Message-State: AJaThX4yqTEhCuyFQyfo6/qpDxOitf+5o5Bh520LnUIv62H/3gscGPG0 D2ToH+gfMvyyy0yPAtQjbFef9Q== X-Received: by 10.28.23.67 with SMTP id 64mr1579558wmx.101.1510067180557; Tue, 07 Nov 2017 07:06:20 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id x185sm1709108wmx.12.2017.11.07.07.06.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 07:06:16 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id DE2693E0521; Tue, 7 Nov 2017 15:06:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 7 Nov 2017 15:05:56 +0000 Message-Id: <20171107150558.22131-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171107150558.22131-1-alex.bennee@linaro.org> References: <20171107150558.22131-1-alex.bennee@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::233 Subject: [Qemu-devel] [RISU PATCH 08/10] aarch64.risu: initial SVE instruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" --- aarch64.risu | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) -- 2.14.2 diff --git a/aarch64.risu b/aarch64.risu index 838bded..bfa4ff8 100644 --- a/aarch64.risu +++ b/aarch64.risu @@ -2937,3 +2937,27 @@ FCVTZUsi_RES A64_V sf:1 0011110 1 type:1 1 11 001 000000 rn:5 rd:5 # End of: # Data processing - SIMD and floating point # Data processing - Scalar Floating-Point and Advanced SIMD + +# SVE Instructions +# Top-level Encodings +# +# 31 24 | 23 22 | 21 17 | 16 | 15 10 | 9 0 +# y y y y y y y m | - - | m m m m m | - | | - - - - - - - - - - +# +@SVE + +# SVE Integer Arithmetic - Binary Predicated Group +# 31 24 | 23 22 | 21 | 20 19 | 18 16 | 15 13 | 12 0 +# 0 0 0 0 0 1 0 0 | size | 0 | op | --- | 0 0 0 | ------------- | + +SVE_INTA_PRED_UNALL A64_V 00000100 ig:2 010 001 000 ignore2:13 + +# - SVE integer add/subtract vectors (predicated) +# 31 24 | 23 22 | 21 19 | 18 16 | 15 13 | 12 10 | 9 5 | 4 0 | +# 0 0 0 0 0 1 0 0 | size | 0 0 0 | opc | 0 0 0 | Pg | Zm | Zn | +# opc 010/1xx are UNALLOCATED + +SVE_INT_ADDSUB_PRED A64_V 00000100 sz:2 000 opc:3 000 pg:3 zm:5 zn:5 + +@ +# End of SVE instructions From patchwork Tue Nov 7 15:05:57 2017 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: 118186 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp636753edm; Tue, 7 Nov 2017 07:10:27 -0800 (PST) X-Google-Smtp-Source: ABhQp+RyP/3km+wJ/qTQz6DcHdxGVBSeqFQgDF0w27i/e9gUk+aOI0o0THldSc52SIStkijDIFcr X-Received: by 10.13.225.145 with SMTP id k139mr12470247ywe.483.1510067426930; Tue, 07 Nov 2017 07:10:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510067426; cv=none; d=google.com; s=arc-20160816; b=zYpAEqsyLpPtwg05b2sLvWeRNH5+OLdJv9z9TQNSiK4xTiy/Nq7aWi4xAkkfY2oErJ LWiWJVyvPY+baSfg8jdP1YuKXVIOVP7XrVQRu+x2SiT6fAYH24Lvx9lpBfxdbEiYFdfC /HVnRNQsUEhSIFe3GVT4FHcyKoVgsuC24dwN4xuj69i196/zsAc/osYTHJC2XAR65cO4 ACfA5k7ka8wTaHBzeIf4BRH7axfhOVlS52tZFY+wlS+8adU9F778uDGMmovPEmgA1OTJ FCMPJ2vENbOBLltR4mnVQjk6a+xdXNnfGQtBD1uBHuVEUycF3MjG9ljNmve6FQ4v6G3a TlBw== 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:arc-authentication-results; bh=Xj0UFbzpuaqTimkoIVxuJ9PFirQ2UgIpgeXk++kf+lg=; b=szPXRdRaf4wkLIFuuopFOHCIo0Pw2SuPuQvEZ0a9xvKfJIRO0M4ik/gwIJN0ZFPheE /+6ZiHiZismwkm6xLpPy00OXUi6/W8r8xwlaZZSGAeOgWeQVsXex/Rtf3glO/Ev2HBWy 9ivocWGsvi4FDfxrd5Vi6dS2NmkirxRJ0/2unaLGpJFtqwaF8gwgoeD73Th5qiApOPW8 GV0nig7ywyRx0y+IH0+4EdwzLyUm1UEEOtdPI4+JjdvojPPS+alUsWWrko3NQ8GwVIzR caNggV8iAi3bF14tP050vrXhzpYL3ihEGKZP3uxFAaGPHA3F78eFFjC7uayt9nXVM8XP 8FOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=a2EUCCN/; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 14si312163ywh.544.2017.11.07.07.10.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 Nov 2017 07:10:26 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=a2EUCCN/; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:53866 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5WE-0000K7-7g for patch@linaro.org; Tue, 07 Nov 2017 10:10:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5SP-0005vM-Ns for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eC5SJ-00009N-RI for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:29 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:56644) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eC5SJ-00008w-Ki for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:23 -0500 Received: by mail-wm0-x241.google.com with SMTP id z3so4534872wme.5 for ; Tue, 07 Nov 2017 07:06:23 -0800 (PST) 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=Xj0UFbzpuaqTimkoIVxuJ9PFirQ2UgIpgeXk++kf+lg=; b=a2EUCCN/jDFspWViJ/w8K+Sf1KbbNYAuMEfjLpY1zMghtDSxBqXhsEPA8pTWHbOFiV vuCsmVS28FfJKS8zuURSSKeWeHQXbiCTBM5UJfQLHjiMP97v1wXjVdisn43nOmGUhflg EpknebSrzV9fWf/jII4TWfjhdfcq5xlebEt0c= 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=Xj0UFbzpuaqTimkoIVxuJ9PFirQ2UgIpgeXk++kf+lg=; b=EBO7i7YY9Y6Dn9QKxogqZiN9R18L+EehNp1k1DDk/zpCivWvJPOhn8n5dC48+0ZVys r/33uOiTe3H4FPKNxPc2rvW/6HJPl9KlrVsFa/2VBZJ1Um6JhSRaEtBLAtj0amNATWZm FCuNzO+rYOox2icdq5Zp7VMuagASivlwIRyb7vJpE3FyhsQmFS7LzJ/5AmkaAd3x2BlO M1N0NPc/qp0yvWkYQ78Pqwf5kdfAdn0AMdE7pabKsjQ2ftnJZmxPCS21vLZIcJVIchp1 3hMWI4MZq+jwJnOFf1Xtz7bBTbzs7eiErFADy2OX+6tXcoGEi6NbS5+rUZS9oyxliFLl fV/A== X-Gm-Message-State: AJaThX5TFl1H4KyjYM5+Zu9iK0L4Ju7lK7BwOTg93ExdRalH4Zs8aTQY F3l2HQ030V5N8BClZFHoCBOjmg== X-Received: by 10.28.190.12 with SMTP id o12mr1839271wmf.4.1510067182561; Tue, 07 Nov 2017 07:06:22 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id g99sm2879373wrd.72.2017.11.07.07.06.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 07:06:16 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id E90E73E059C; Tue, 7 Nov 2017 15:06:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 7 Nov 2017 15:05:57 +0000 Message-Id: <20171107150558.22131-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171107150558.22131-1-alex.bennee@linaro.org> References: <20171107150558.22131-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:400c:c09::241 Subject: [Qemu-devel] [RISU PATCH 09/10] risu_reginfo_aarch64: add reginfo_copy_sve X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Add the ability to save SVE registers from the signal context. This is controlled with an optional flag --test-sve. The whole thing is conditionally compiled when SVE support is in the sigcontext headers. Technically SVE registers could be beyond an EXTRA_MAGIC section. I've not seen this on the model so currently we abort() if we encounter the EXTRA_MAGIC section. Signed-off-by: Alex Bennée --- risu_reginfo_aarch64.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++ risu_reginfo_aarch64.h | 8 ++++++ 2 files changed, 82 insertions(+) -- 2.14.2 diff --git a/risu_reginfo_aarch64.c b/risu_reginfo_aarch64.c index 38ad338..7c97790 100644 --- a/risu_reginfo_aarch64.c +++ b/risu_reginfo_aarch64.c @@ -13,12 +13,78 @@ #include #include #include +#include +#include +#include #include "risu.h" #include "risu_reginfo_aarch64.h" +#ifndef SVE_MAGIC void *arch_long_opts; char *arch_extra_help; +#else +/* Should we test SVE register state */ +static int test_sve; +static struct option extra_opts[] = { + {"test-sve", no_argument, &test_sve, 1}, + {0, 0, 0, 0} +}; + +void *arch_long_opts = &extra_opts[0]; +char *arch_extra_help = " --test-sve Compare SVE registers\n"; + +/* Extra SVE copy function, only called with --test-sve */ +static void reginfo_copy_sve(struct reginfo *ri, struct _aarch64_ctx *ctx) +{ + struct sve_context *sve; + int r, vq; + bool found = false; + + while (!found) { + switch (ctx->magic) + { + case SVE_MAGIC: + found = true; + break; + case EXTRA_MAGIC: + fprintf(stderr, "%s: found EXTRA_MAGIC\n", __func__); + abort(); + case 0: + /* We might not have an SVE context */ + fprintf(stderr, "%s: reached end of ctx, no joy (%d)\n", __func__, ctx->size); + return; + default: + ctx = (struct _aarch64_ctx *)((void *)ctx + ctx->size); + break; + } + + } + + sve = (struct sve_context *) ctx; + ri->vl = sve->vl; + vq = sve_vq_from_vl(sve->vl); /* number of quads for whole vl */ + + /* Copy ZREG's one at a time */ + for (r = 0; r < SVE_NUM_ZREGS; r++) { + memcpy(&ri->zregs[r], + (char *)sve + SVE_SIG_ZREG_OFFSET(vq, r), + SVE_SIG_ZREG_SIZE(vq)); + } + + /* Copy PREG's one at a time */ + for (r = 0; r < SVE_NUM_PREGS; r++) { + memcpy(&ri->pregs[r], + (char *)sve + SVE_SIG_PREG_OFFSET(vq, r), + SVE_SIG_PREG_SIZE(vq)); + } + + /* Finally the FFR */ + memcpy(&ri->ffr,(char *)sve + SVE_SIG_FFR_OFFSET(vq), + SVE_SIG_FFR_SIZE(vq)); + +} +#endif /* reginfo_init: initialize with a ucontext */ void reginfo_init(struct reginfo *ri, ucontext_t *uc) @@ -26,6 +92,7 @@ void reginfo_init(struct reginfo *ri, ucontext_t *uc) int i; struct _aarch64_ctx *ctx; struct fpsimd_context *fp; + /* necessary to be able to compare with memcmp later */ memset(ri, 0, sizeof(*ri)); @@ -59,6 +126,13 @@ void reginfo_init(struct reginfo *ri, ucontext_t *uc) for (i = 0; i < 32; i++) { ri->vregs[i] = fp->vregs[i]; } + +#ifdef SVE_MAGIC + if (test_sve) { + ctx = (struct _aarch64_ctx *) &uc->uc_mcontext.__reserved[0]; + reginfo_copy_sve(ri, ctx); + } +#endif }; /* reginfo_is_eq: compare the reginfo structs, returns nonzero if equal */ diff --git a/risu_reginfo_aarch64.h b/risu_reginfo_aarch64.h index a05fb4e..317383f 100644 --- a/risu_reginfo_aarch64.h +++ b/risu_reginfo_aarch64.h @@ -25,6 +25,14 @@ struct reginfo { uint32_t fpsr; uint32_t fpcr; __uint128_t vregs[32]; + +#ifdef SVE_MAGIC + /* SVE */ + uint16_t vl; /* current VL */ + __uint128_t zregs[SVE_NUM_ZREGS][SVE_VQ_MAX]; + uint16_t pregs[SVE_NUM_PREGS][SVE_VQ_MAX]; + uint16_t ffr[SVE_VQ_MAX]; +#endif }; #endif /* RISU_REGINFO_AARCH64_H */ From patchwork Tue Nov 7 15:05:58 2017 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: 118189 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp642784edm; Tue, 7 Nov 2017 07:15:38 -0800 (PST) X-Google-Smtp-Source: ABhQp+QUjOwZ+hHpW+Tn/zrQKxuQPG4SEwUxZUb12wMmIeYtRMQsgM64D3qjvE+r6s3TAOKFyVGh X-Received: by 10.129.145.68 with SMTP id i65mr11690125ywg.259.1510067738494; Tue, 07 Nov 2017 07:15:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510067738; cv=none; d=google.com; s=arc-20160816; b=Hluq4sE++DPgzlm0epZkuSNKIxZ5TsHFPsfohHP22WrtTBI6XQgedaYG6GCHNXTqgI Ed76t7izmFhg4PvpajFq+MvciLRdQbJOB/N2gEzz+1L4yvxRbGVefJOETJOLbYBjyZTF X5xI8g3TwVPBdr8bjprvbIFNx30EDWyVxENVef3K3mct4HDtNHMnlP/hKIoVh3tstKjd 89mgKbdFLbaJFSvOVGfP4ZiBpeYi7TciY3/YUCbFl+ac6JucaBsAysYsJdzn0imBj9jK LAj7XzbUA+bQm3I36WPNyO0nHxUOWAB3pzUezJ42BMLj02uw2PHkk9x2zGVYn3cXySpB n/eQ== 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:arc-authentication-results; bh=08zOc1t0wstXM2NGnYCovki0Coxc7wLE9BBSxT+bosI=; b=gZJY1LTNowF083fN99JcIB+b7hirM8uUF1nuVDOYh0kHMoOCICoxDrSbOOkarb8vvm HqZmxgIpx3U247JOFpCpRxAfNcQ4kFvgPjmoaVQJXvYV6Nn22akNf67LBx23khg+FSVD xmBM16b+0da9MUvJJh2XcvVcL8Fw0YiICzGDr/hJLWYYXxyQhn7aoZFV0902v+3f/Fql fVVUcAxl1P2gxk87dphu7d7UI7DAdhtZety+k8Dadj37Ds2G/uB+vRUYe0TtryKu9aZF LJotQ+gf3QNbzEZO6aSd+ALWrrjDoVCPDwuFYfi5sQgevOCxO+4NOrDHqPicNq0rNBB2 7Q0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eyaT421F; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d132si306950ybc.509.2017.11.07.07.15.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 Nov 2017 07:15:38 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eyaT421F; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:53897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5bF-0004km-TP for patch@linaro.org; Tue, 07 Nov 2017 10:15:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5SM-0005rc-2N for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eC5SI-00008g-MB for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:26 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:50997) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eC5SI-00007d-GY for qemu-devel@nongnu.org; Tue, 07 Nov 2017 10:06:22 -0500 Received: by mail-wm0-x242.google.com with SMTP id s66so4334632wmf.5 for ; Tue, 07 Nov 2017 07:06:22 -0800 (PST) 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=08zOc1t0wstXM2NGnYCovki0Coxc7wLE9BBSxT+bosI=; b=eyaT421FIXR8h0N2gCrqcuzq9sPT4EB07pfMrRC6PQbFNEwZVEZ/iPM2X4eMj5fSHX +IeIEXbW1HwWThKGAPOgrCkP8TbNgCc9F2Acawwewc9eSYI523mdboiDU5bM6JFLd1AP ySMSUYcmPr7Or76JxS1z2ePZ7Crp5QJTlJKVI= 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=08zOc1t0wstXM2NGnYCovki0Coxc7wLE9BBSxT+bosI=; b=UUhp5NA1gDYP1RSkkKo0vNiTtdM6KmgFH+6ZRDZnO6uqQybf0MhFE9upeHvCA/z9+L +2jModtbdNIusy68c2kHCK0Vtf9HOS0KtffrO7btNh572PcImzipz/bEemPyg5p6x+hw YJ5L7ekUin3+ukcX4g9G/iKBG8wZMcgRKqRYsjkybWwgYFSeaCQpI++EEHNSvxAgUeuj fZFFpa/Dgf4yJiZenLltJeWsyEA5vfsRtqAB3H3s9H7rG5S4FNEHOHZzvhNWY4Oqyyfo KBk2kxcMA4q6CE1xEf0Y5l1JXbAq8rYW7QwKHFi6yRMIsTSV+uhW1BVs9S8+tWy/ZgIL 3rSw== X-Gm-Message-State: AJaThX5dXaF2gAycf+Sjp9X5u+UfMiPbDyOqUclCTjwpm79VAgc/o0AI oV8qoZYvCyQxRH0Mb2jMQLF3I168Ecs= X-Received: by 10.28.1.199 with SMTP id 190mr1738841wmb.51.1510067181370; Tue, 07 Nov 2017 07:06:21 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o135sm2262492wmg.1.2017.11.07.07.06.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 07:06:16 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id F3AA03E061C; Tue, 7 Nov 2017 15:06:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 7 Nov 2017 15:05:58 +0000 Message-Id: <20171107150558.22131-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171107150558.22131-1-alex.bennee@linaro.org> References: <20171107150558.22131-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:400c:c09::242 Subject: [Qemu-devel] [RISU PATCH 10/10] risu_reginfo_aarch64: add SVE support to reginfo_dump_mismatch X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée --- risu_reginfo_aarch64.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) -- 2.14.2 diff --git a/risu_reginfo_aarch64.c b/risu_reginfo_aarch64.c index 7c97790..8aba192 100644 --- a/risu_reginfo_aarch64.c +++ b/risu_reginfo_aarch64.c @@ -141,6 +141,18 @@ int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2) return memcmp(r1, r2, sizeof(*r1)) == 0; } +#ifdef SVE_MAGIC +static int sve_zreg_is_eq(struct reginfo *r1, struct reginfo *r2, int z) +{ + return memcmp(r1->zregs[z], r2->zregs[z], sizeof(*r1->zregs[z])) == 0; +} + +static int sve_preg_is_eq(struct reginfo *r1, struct reginfo *r2, int p) +{ + return memcmp(r1->pregs[p], r2->pregs[p], sizeof(*r1->pregs[p])) == 0; +} +#endif + /* reginfo_dump: print state to a stream, returns nonzero on success */ int reginfo_dump(struct reginfo *ri, FILE * f) { @@ -216,5 +228,42 @@ int reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE * f) } } +#ifdef SVE_MAGIC + if (test_sve) { + if (m->vl != a->vl) { + fprintf(f, " SVE VL : %d vs %d\n", m->vl, a->vl); + } + for (i = 0; i < SVE_NUM_PREGS; i++) { + if (!sve_preg_is_eq(m, a, i)) { + int q; + fprintf(f, " P%2d : ", i); + for (q = 0; q < sve_vq_from_vl(m->vl); q++) { + fprintf(f, "%04x", m->pregs[i][q]); + } + fprintf(f, " vs "); + for (q = 0; q < sve_vq_from_vl(m->vl); q++) { + fprintf(f, "%04x", a->pregs[i][q]); + } + fprintf(f, "\n"); + } + } + for (i = 0; i < SVE_NUM_ZREGS; i++) { + if (!sve_zreg_is_eq(m, a, i)) { + int q; + char *pad=""; + fprintf(f, " Z%2d : ", i); + for (q = 0; q < sve_vq_from_vl(m->vl); q++) { + if (m->zregs[i][q] != a->zregs[i][q]) { + fprintf(f, "%sq%02d: %016" PRIx64 "%016" PRIx64 " vs %016" PRIx64 "%016" PRIx64"\n", pad, q, + (uint64_t) (m->zregs[i][q] >> 64), (uint64_t) m->zregs[i][q], + (uint64_t) (a->zregs[i][q] >> 64), (uint64_t) a->zregs[i][q]); + pad = " "; + } + } + } + } + } +#endif + return !ferror(f); }