From patchwork Fri May 4 18:30:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135020 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp380664lji; Fri, 4 May 2018 11:33:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqtUL3DcwYSViqSYS1jkmfHyXpy9B1PVhgIbRofqZKWUU7UTMZR88t7PPR3RNA/h8EBrfmh X-Received: by 2002:ac8:3e7:: with SMTP id z39-v6mr24963722qtg.291.1525458826611; Fri, 04 May 2018 11:33:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525458826; cv=none; d=google.com; s=arc-20160816; b=u6v+0vcgZObqFomKek88FpYsZET4SV8szFZckWuYFT5dD4PhBgslxGKMBuOqUkmu4k HUy43+WA5DnvFBFud1Noy5AabkYzL44cQnQqKKIgEFTJXopZTA/vDLdtO770M2aEbzmH bdvCvTo+tcK3ZKB9wJqC7fenTHDaMz6v00Wf0wqKZAeSLRlEREndTklQBFWIZaCuRys5 njwOgQ4Yy2fgXpL/sVwgw4sqKVOqS0TFc6bpVZj4OZIXWgcRnJxznVJh1WdEXy5Pn8i/ E+la2mIOg57K7jp6ggmAno+++QvcSOdHOsABRb44KhX59AnP6oLZ/HZ6FsXpz29LL1Zr 73Sg== 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:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=NnLHwPEUHd78QMOSxXEfR74eTOdxsx0ytS3dgUv9VU0=; b=Ep3Pb4w+3Ip6D6wS0D3TauSVmtLemK8QC1V0klyP6aku7QqH2BjQQCpIxkBy/h7vmb GG21ym76GEzML1uSA0nynGa8D/fSun/4Cwn9GJzZNvrDpm0E9jpWs+at8xgDQpnDgcWO IIr23EZcs1PmJ4UX/J19pLfTIgQigO64iCbnPSbkJbLx4d0xMVjh7pWlOz0+6bjHshfX X40cTqOp0ZYRtVDq5bqtsGkJHNSppJj8UEwrZhHTxBVaArwfBuZ34D+/R7hNceaLJoTr CyqyTQBr9FgXlTBSd6FUwAA6X3LoCp6UAb5pFXvhWNscvmkY44AqfRCSrNVzS5tdZQEg DZmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fwwgu2jx; 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 j16-v6si6227458qvj.75.2018.05.04.11.33.46 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 04 May 2018 11:33:46 -0700 (PDT) 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=fwwgu2jx; 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]:35986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEfWc-0001cp-2z for patch@linaro.org; Fri, 04 May 2018 14:33:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEfTQ-0007Si-Lc for qemu-devel@nongnu.org; Fri, 04 May 2018 14:30:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fEfTN-00011T-G9 for qemu-devel@nongnu.org; Fri, 04 May 2018 14:30:28 -0400 Received: from mail-pf0-x22f.google.com ([2607:f8b0:400e:c00::22f]:46336) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fEfTN-0000zn-8M for qemu-devel@nongnu.org; Fri, 04 May 2018 14:30:25 -0400 Received: by mail-pf0-x22f.google.com with SMTP id p12so18055026pff.13 for ; Fri, 04 May 2018 11:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=NnLHwPEUHd78QMOSxXEfR74eTOdxsx0ytS3dgUv9VU0=; b=fwwgu2jx2Lylima6B6vnY1QB7q4+83ORXYVq/KAZt0jncDjtxn+M3Do1YCXwelxdyN mlxt/HaE1xIHss4AzFaZy28SZKXuu4K0n1lDSD1KbqLipYiTab+d4L8spVc+iSHKzaU4 0Cq/feOOinUKLolSw69wfhUPUsdYCj5R5uIjo= 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; bh=NnLHwPEUHd78QMOSxXEfR74eTOdxsx0ytS3dgUv9VU0=; b=XTAAtJ8JovdqRmuo05ubftunMD5Uj8bfFgOm4hxXm1pRPfg+mwPZkb3dZDWMWMRXcN uaY+wB1tf3Xmxcr84JGrSM4dDPnAa6rnMIEbauYExw3sFTZR2iNsYO4fuQuMd3PtaQOv v2aw6w28YkOClcSJHn3BymPNYtHguZcSrpIiHcY1+3qxKu/+HcFxaDk8ze6x06sKnxh+ AJYGGMcd7KZOHF1dR/nt/evYqG1M1B4+Fa+BiAvonu57KAFQnB5ymT86eYhGEnrYJ8yR B4W+xQsE1z+mfkzDkNq7G8VMj+al1BNt7WffTP/a23BvOBDOJtAid04VY+PY67GzilRF 09tA== X-Gm-Message-State: ALQs6tDKlEokh1C7dtBmMANmvd69OVgS0Y40jP62GfcCmZduTQker0xK Xn1gJEf/mUmP3rrruXQfZ7fJiVB2BNc= X-Received: by 2002:a65:50cc:: with SMTP id s12-v6mr23606926pgp.313.1525458623734; Fri, 04 May 2018 11:30:23 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-2-170.tukw.qwest.net. [97.113.2.170]) by smtp.gmail.com with ESMTPSA id r8-v6sm16987413pgn.2.2018.05.04.11.30.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 May 2018 11:30:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 4 May 2018 11:30:11 -0700 Message-Id: <20180504183021.19318-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::22f Subject: [Qemu-devel] [PATCH v2 00/10] target/arm: Implement v8.1-Atomics X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This implements the Atomics extension, which is mandatory for v8.1. While testing the v8.2-SVE extension, I've run into issues with the GCC testsuite expecting this to exist. Missing is the wiring up of the system registers to indicate that the extension exists, but we have no system CPU model that would exercise such a setting. Changes since v2: * New patch to use a helper macro for opposite-endian atomic_fetch_add and atomic_add_fetch, as suggested by pm215. * Introduce ARM_FEATURE_V8_1 and define ARM_FEATURE_V8_ATOMICS in terms of that, reinforcing the mandatory nature of the extension. * Typo fix in patch 8. Peter, do you want to take the whole thing into target-arm.next, or have it split? We have a review and an ack for the riscv and xtensa patches. r~ Richard Henderson (10): tcg: Introduce helpers for integer min/max target/arm: Use new min/max expanders target/xtensa: Use new min/max expanders tcg: Introduce atomic helpers for integer min/max tcg: Use GEN_ATOMIC_HELPER_FN for opposite endian atomic add target/riscv: Use new atomic min/max expanders target/arm: Introduce ARM_FEATURE_V8_ATOMICS and initial decode target/arm: Fill in disas_ldst_atomic target/arm: Implement CAS and CASP target/arm: Enable ARM_FEATURE_V8_ATOMICS for user-only accel/tcg/atomic_template.h | 112 ++++++++----- accel/tcg/tcg-runtime.h | 8 + target/arm/cpu.h | 2 + target/arm/helper-a64.h | 2 + tcg/tcg-op.h | 50 ++++++ tcg/tcg.h | 8 + linux-user/elfload.c | 1 + target/arm/cpu64.c | 1 + target/arm/helper-a64.c | 43 +++++ target/arm/translate-a64.c | 375 +++++++++++++++++++++++++++++++++++--------- target/riscv/translate.c | 72 +++------ target/xtensa/translate.c | 50 ++++-- tcg/tcg-op.c | 48 ++++++ 13 files changed, 587 insertions(+), 185 deletions(-) -- 2.14.3