From nobody Sun May 5 19:45:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510067309206880.660334966688; Tue, 7 Nov 2017 07:08:29 -0800 (PST) Received: from localhost ([::1]:53852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5U4-0006rj-0j for importer@patchew.org; Tue, 07 Nov 2017 10:08:12 -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) 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) 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-Google-Smtp-Source: ABhQp+Qx+eK9cGs6/RFKrp1GTgqtbMhOMUwJKn9uJsic6ptiWH7Un50wlst04Awpci4OzotggueWOw== X-Received: by 10.28.241.10 with SMTP id p10mr1527598wmh.113.1510067173031; Tue, 07 Nov 2017 07:06:13 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=20Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 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=C3=A9e --- build-all-archs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. =20 -DOCKER_RUN=3D"docker run --rm -t -u $(id -u) -v $(pwd):$(pwd) -w $(pwd)" +DOCKER_RUN=3D"docker run --rm -u $(id -u) -v $(pwd):$(pwd) -w $(pwd)" =20 program_exists() { if [ ! -z "$docker_tags" ]; then --=20 2.14.2 From nobody Sun May 5 19:45:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510067492567496.62219852411033; Tue, 7 Nov 2017 07:11:32 -0800 (PST) Received: from localhost ([::1]:53873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5XC-00019F-Ok for importer@patchew.org; Tue, 07 Nov 2017 10:11:26 -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) 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) 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-Google-Smtp-Source: ABhQp+TRNynyackS3rUxO/ev7qpQQ3M9q4dy0TkROgbuCbmsItiUU9mw4OuaxdZl9z8gPxoevgyztA== X-Received: by 10.28.214.134 with SMTP id n128mr1893205wmg.59.1510067172008; Tue, 07 Nov 2017 07:06:12 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=20Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 This is a prerequisite to properly handling architecture specific options. Signed-off-by: Alex Benn=C3=A9e --- risu.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) 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"); } =20 +struct option * setup_options(char **short_opts) +{ + static struct option default_longopts[] =3D { + {"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 =3D "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 =3D "localhost"; char *imgfile; char *trace_fn =3D NULL; + struct option *longopts; + char *shortopts; =20 - /* TODO clean this up later */ + longopts =3D setup_options(&shortopts); =20 for (;;) { - static struct option longopts[] =3D { - {"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 =3D 0; - int c =3D getopt_long(argc, argv, "h:p:t:", longopts, &optidx); + int c =3D getopt_long(argc, argv, shortopts, longopts, &optidx); if (c =3D=3D -1) { break; } --=20 2.14.2 From nobody Sun May 5 19:45:01 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510067840067938.516689485407; Tue, 7 Nov 2017 07:17:20 -0800 (PST) Received: from localhost ([::1]:53917 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5cU-0006Ud-0b for importer@patchew.org; Tue, 07 Nov 2017 10:16:54 -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) 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) 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-Google-Smtp-Source: ABhQp+T8HLFy5WWfL3Oz2W6HsP+t9RC8ayXtfx5hq9PdSkcLSUf3nVTEgDw+uWdLD1IqqhnWPngGeg== X-Received: by 10.28.72.8 with SMTP id v8mr1531112wma.38.1510067175401; Tue, 07 Nov 2017 07:06:15 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=20Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 This got missed when trace support was added. Signed-off-by: Alex Benn=C3=A9e --- risu.c | 1 + 1 file changed, 1 insertion(+) 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} }; --=20 2.14.2 From nobody Sun May 5 19:45:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510067329905873.4840523431793; Tue, 7 Nov 2017 07:08:49 -0800 (PST) Received: from localhost ([::1]:53855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5UZ-0007IJ-SQ for importer@patchew.org; Tue, 07 Nov 2017 10:08:43 -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) 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) 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-Google-Smtp-Source: ABhQp+RqONY4sCGStUGIjSCUPcx7aR/EoM4mpqxVImVgtT9AwhwLYbTfIkQ2LNrjGqtrdqe7fQwK2g== X-Received: by 10.223.152.149 with SMTP id w21mr15847255wrb.274.1510067174485; Tue, 07 Nov 2017 07:06:14 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=20Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 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=C3=A9e --- 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(-) 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; =20 sigjmp_buf jmpbuf; =20 -/* Should we test for FP exception status bits? */ -int test_fp_exc; - /* Master functions */ =20 int read_sock(void *ptr, size_t bytes) @@ -280,6 +277,9 @@ void usage(void) fprintf(stderr, " -p, --port=3DPORT Specify the port to connect to/listen o= n " "(default 9191)\n"); + if (arch_extra_help) { + fprintf(stderr, "%s", arch_extra_help); + } } =20 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 =3D &default_longopts[0]; =20 *short_opts =3D "h:p:t:"; - return default_longopts; + + if (arch_long_opts) { + struct option *dptr, *sptr; + size_t osize =3D sizeof(default_longopts); + lopts =3D malloc(osize); + /* Copy default opts */ + memcpy(lopts, default_longopts, osize); + dptr =3D lopts; + while (dptr->name) { + dptr++; + } + /* Copy extra opts */ + sptr =3D arch_long_opts; + while (sptr->name) { + osize +=3D sizeof(struct option); + lopts =3D realloc(lopts, osize); + *dptr++ =3D *sptr++; + } + memset(dptr, 0, sizeof(struct option)); + } + + return lopts; } =20 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 =20 +/* 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; =20 -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" =20 +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 =20 #include "risu.h" #include "risu_reginfo_arm.h" =20 extern int insnsize(ucontext_t *uc); =20 +/* Should we test for FP exception status bits? */ +static int test_fp_exc; +static struct option extra_opts[] =3D { + {"test-fp-exc", no_argument, &test_fp_exc, 1}, + {0, 0, 0, 0} +}; + +void *arch_long_opts =3D &extra_opts[0]; +char *arch_extra_help =3D " --test-fp-exc Check FP exception bits whe= n 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" =20 +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 =20 +void *arch_long_opts; +char *arch_extra_help; + /* reginfo_init: initialize with a ucontext */ void reginfo_init(struct reginfo *ri, ucontext_t *uc) { --=20 2.14.2 From nobody Sun May 5 19:45:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510067540969533.3772571065153; Tue, 7 Nov 2017 07:12:20 -0800 (PST) Received: from localhost ([::1]:53876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5Y2-0001sl-3G for importer@patchew.org; Tue, 07 Nov 2017 10:12:18 -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) 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) 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-Google-Smtp-Source: ABhQp+SS9mLCht14B9NDFwRNh9YceDjfYwxcgh4qJhidqHlOeI/X4k3+b7llhdos9Z1SqUlQ+sVDzA== X-Received: by 10.28.239.2 with SMTP id n2mr1524801wmh.140.1510067178035; Tue, 07 Nov 2017 07:06:18 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=20Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 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=C3=A9e --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 1dc527b..c622a5e 100755 --- a/configure +++ b/configure @@ -176,10 +176,10 @@ fi =20 # 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=3D"-I $(pwd)" - ln -s "${SRCDIR}/Makefile" . + ln -sf "${SRCDIR}/Makefile" . fi =20 generate_config --=20 2.14.2 From nobody Sun May 5 19:45:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510067309263215.27549022370056; Tue, 7 Nov 2017 07:08:29 -0800 (PST) Received: from localhost ([::1]:53854 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5UG-00075L-WA for importer@patchew.org; Tue, 07 Nov 2017 10:08:25 -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) 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) 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-Google-Smtp-Source: ABhQp+SrGMzOdPgPunH/hYKMH89ed1U+RenBtJsf6hOviCk00vEDEN9a25G1ih8GDHqx3Gkpx+sCtQ== X-Received: by 10.223.154.184 with SMTP id a53mr17168342wrc.48.1510067177084; Tue, 07 Nov 2017 07:06:17 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=20Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Useful for accessing API's that are still brewing, e.g: CROSS_PREFIX=3Daarch64-linux-gnu- \ CPPFLAGS=3D-I/home/alex/lsrc/qemu/risu.git/sve-headers/include \ ../configure Signed-off-by: Alex Benn=C3=A9e --- README | 6 ++++++ configure | 1 + 2 files changed, 7 insertions(+) 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=3Darm-linux-gnueabihf- ) =20 +Another useful flag is + CPPFLAGS=3D 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=3D-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. =20 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:=3D${ARCH}" >> $m echo "CC:=3D${CC}" >> $m + echo "CPPFLAGS:=3D${CPPFLAGS}" >> $m echo "LDFLAGS:=3D${LDFLAGS}" >> $m echo "AS:=3D${AS}" >> $m echo "OBJCOPY:=3D${OBJCOPY}" >> $m --=20 2.14.2 From nobody Sun May 5 19:45:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510067512597862.2414314929257; Tue, 7 Nov 2017 07:11:52 -0800 (PST) Received: from localhost ([::1]:53874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5XV-0001Os-L0 for importer@patchew.org; Tue, 07 Nov 2017 10:11:45 -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) 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) 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-Google-Smtp-Source: ABhQp+QgKgb7clPIIkHVGFEAU0AW1x/x16c+bFylkzjcdepI4GY1vscpcNwLQbHDq0ctbuQKFjUORA== X-Received: by 10.223.181.131 with SMTP id c3mr15596783wre.198.1510067179685; Tue, 07 Nov 2017 07:06:19 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=20Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 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=C3=A9e --- risugen | 3 +++ risugen_arm.pm | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++----= --- 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/risugen b/risugen index aba4bb7..0ac8e86 100755 --- a/risugen +++ b/risugen @@ -317,6 +317,7 @@ sub main() my $condprob =3D 0; my $fpscr =3D 0; my $fp_enabled =3D 1; + my $sve_enabled =3D 1; my $big_endian =3D 0; my ($infile, $outfile); =20 @@ -334,6 +335,7 @@ sub main() }, "be" =3D> sub { $big_endian =3D 1; }, "no-fp" =3D> sub { $fp_enabled =3D 0; }, + "sve" =3D> sub { $sve_enabled =3D 1; }, ) or return 1; # allow "--pattern re,re" and "--pattern re --pattern re" @pattern_re =3D split(/,/,join(',',@pattern_re)); @@ -361,6 +363,7 @@ sub main() 'fpscr' =3D> $fpscr, 'numinsns' =3D> $numinsns, 'fp_enabled' =3D> $fp_enabled, + 'sve_enabled' =3D> $sve_enabled, 'outfile' =3D> $outfile, 'details' =3D> \%insn_details, 'keys' =3D> \@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() } } =20 -sub write_random_aarch64_regdata($) +sub write_random_aarch64_svedata() { - my ($fp_enabled) =3D @_; + # Load SVE registers + my $align =3D 16; + my $vl =3D 16; # number of vqs + my $datalen =3D (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 =3D 0; $i < ($align / 4); $i++) { + # align with nops + insn32(0xd503201f); + }; + + for (my $rt =3D 0; $rt <=3D 31; $rt++) { + for (my $q =3D 0; $q < $vl; $q++) { + write_random_fpreg_var(4); # quad + } + } + + # Reset all the predicate registers to all true + for (my $p =3D 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 =3D 0; $rt <=3D 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) =3D @_; # clear flags insn32(0xd51b421f); # msr nzcv, xzr =20 @@ -483,6 +521,10 @@ sub write_random_aarch64_regdata($) write_random_aarch64_fpdata(); } =20 + if ($sve_enabled) { + write_random_aarch64_svedata(); + } + # general purpose registers for (my $i =3D 0; $i <=3D 30; $i++) { # TODO full 64 bit pattern instead of 32 @@ -490,12 +532,12 @@ sub write_random_aarch64_regdata($) } } =20 -sub write_random_register_data($) +sub write_random_register_data($$) { - my ($fp_enabled) =3D @_; + my ($fp_enabled, $sve_enabled) =3D @_; =20 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 =3D $params->{ 'fpscr' }; my $numinsns =3D $params->{ 'numinsns' }; my $fp_enabled =3D $params->{ 'fp_enabled' }; + my $sve_enabled =3D $params->{ 'sve_enabled' }; my $outfile =3D $params->{ 'outfile' }; =20 my %insn_details =3D %{ $params->{ 'details' } }; @@ -918,7 +961,7 @@ sub write_test_code($$$$$$$$) write_memblock_setup(); } # memblock setup doesn't clean its registers, so this must come afterw= ards. - write_random_register_data($fp_enabled); + write_random_register_data($fp_enabled, $sve_enabled); write_switch_to_test_mode(); =20 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) =3D=3D 0) { - write_random_register_data($fp_enabled); + write_random_register_data($fp_enabled, $sve_enabled); write_switch_to_test_mode(); } progress_update($i); --=20 2.14.2 From nobody Sun May 5 19:45:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 151006789934087.28722113298556; Tue, 7 Nov 2017 07:18:19 -0800 (PST) Received: from localhost ([::1]:53919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5di-00076S-K0 for importer@patchew.org; Tue, 07 Nov 2017 10:18:10 -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) 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) 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-Google-Smtp-Source: ABhQp+RDcH+wMf4WgnK1MpYFFZ/UiU0JIQoILOU23B3D1BH8srM7DULkThYU13wQfh41teYzsiB42g== X-Received: by 10.28.23.67 with SMTP id 64mr1579558wmx.101.1510067180557; Tue, 07 Nov 2017 07:06:20 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=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=20Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" --- aarch64.risu | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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 00= 0000 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 --=20 2.14.2 From nobody Sun May 5 19:45:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510067516853269.07315898596937; Tue, 7 Nov 2017 07:11:56 -0800 (PST) Received: from localhost ([::1]:53875 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5Xe-0001Wj-0y for importer@patchew.org; Tue, 07 Nov 2017 10:11:54 -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) 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) 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-Google-Smtp-Source: ABhQp+RJfLnZn3KTu6b6Z6jKuAoZK6FH+nJIkEsdQ5IoKdyIgwKXWYt3b0ZV0wh8in3pKZQ9msKrjA== X-Received: by 10.28.190.12 with SMTP id o12mr1839271wmf.4.1510067182561; Tue, 07 Nov 2017 07:06:22 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=20Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 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=C3=A9e --- risu_reginfo_aarch64.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++= ++++ risu_reginfo_aarch64.h | 8 ++++++ 2 files changed, 82 insertions(+) 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 =20 #include "risu.h" #include "risu_reginfo_aarch64.h" =20 +#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[] =3D { + {"test-sve", no_argument, &test_sve, 1}, + {0, 0, 0, 0} +}; + +void *arch_long_opts =3D &extra_opts[0]; +char *arch_extra_help =3D " --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 =3D false; + + while (!found) { + switch (ctx->magic) + { + case SVE_MAGIC: + found =3D 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", __fu= nc__, ctx->size); + return; + default: + ctx =3D (struct _aarch64_ctx *)((void *)ctx + ctx->size); + break; + } + + } + + sve =3D (struct sve_context *) ctx; + ri->vl =3D sve->vl; + vq =3D sve_vq_from_vl(sve->vl); /* number of quads for whole vl */ + + /* Copy ZREG's one at a time */ + for (r =3D 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 =3D 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 =20 /* 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)); =20 @@ -59,6 +126,13 @@ void reginfo_init(struct reginfo *ri, ucontext_t *uc) for (i =3D 0; i < 32; i++) { ri->vregs[i] =3D fp->vregs[i]; } + +#ifdef SVE_MAGIC + if (test_sve) { + ctx =3D (struct _aarch64_ctx *) &uc->uc_mcontext.__reserved[0]; + reginfo_copy_sve(ri, ctx); + } +#endif }; =20 /* 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 }; =20 #endif /* RISU_REGINFO_AARCH64_H */ --=20 2.14.2 From nobody Sun May 5 19:45:01 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510067713119773.1510448959332; Tue, 7 Nov 2017 07:15:13 -0800 (PST) Received: from localhost ([::1]:53897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC5aZ-0004km-7K for importer@patchew.org; Tue, 07 Nov 2017 10:14:55 -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) 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) 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-Google-Smtp-Source: ABhQp+TqaNPpv8eaxHm0Q8jUiy0Ac6pOz9kO6resI1EL25FiJHav5FtHC/nr2lntq5fPg1o4Qn2mSw== X-Received: by 10.28.1.199 with SMTP id 190mr1738841wmb.51.1510067181370; Tue, 07 Nov 2017 07:06:21 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=20Benn=C3=A9e?= , Dave.Martin@arm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 Signed-off-by: Alex Benn=C3=A9e --- risu_reginfo_aarch64.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++= +++ 1 file changed, 49 insertions(+) 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)) =3D=3D 0; } =20 +#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])) =3D= =3D 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])) =3D= =3D 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 re= ginfo *a, FILE * f) } } =20 +#ifdef SVE_MAGIC + if (test_sve) { + if (m->vl !=3D a->vl) { + fprintf(f, " SVE VL : %d vs %d\n", m->vl, a->vl); + } + for (i =3D 0; i < SVE_NUM_PREGS; i++) { + if (!sve_preg_is_eq(m, a, i)) { + int q; + fprintf(f, " P%2d : ", i); + for (q =3D 0; q < sve_vq_from_vl(m->vl); q++) { + fprintf(f, "%04x", m->pregs[i][q]); + } + fprintf(f, " vs "); + for (q =3D 0; q < sve_vq_from_vl(m->vl); q++) { + fprintf(f, "%04x", a->pregs[i][q]); + } + fprintf(f, "\n"); + } + } + for (i =3D 0; i < SVE_NUM_ZREGS; i++) { + if (!sve_zreg_is_eq(m, a, i)) { + int q; + char *pad=3D""; + fprintf(f, " Z%2d : ", i); + for (q =3D 0; q < sve_vq_from_vl(m->vl); q++) { + if (m->zregs[i][q] !=3D 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 =3D " "; + } + } + } + } + } +#endif + return !ferror(f); } --=20 2.14.2