From patchwork Thu Aug 16 02:54:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 144302 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1538324ljj; Wed, 15 Aug 2018 19:55:26 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyZevONtlzNe31rM3Ht4L/lV+7vZUxks/PtrMUnT58BDRrifPMQcPyv+79tdGFYLaWVb3r1 X-Received: by 2002:a0c:b5d8:: with SMTP id o24-v6mr24407610qvf.189.1534388125916; Wed, 15 Aug 2018 19:55:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534388125; cv=none; d=google.com; s=arc-20160816; b=O3fg5YG/TxgCobbHLkq2y55P4OQ7l5bwCPHLdDqrAMVQuCAWfIOvY6v75l91qpTwbQ LBKjFf0KakVYR9yPDUo+HdeSSv9kOUqqnUA9x+U+5bhW/RR66+nKj3YW9KQHle00+FRD sdiWJzQwNirc3l3pa8rkP8HveSeNq81qyGBGSmOymw7w32sLKWCpkSPn8AtzFGtCaJqo ldKfP0mqntLC8MZH40GYw+JJ7s9h4dNRFR2O0etGTjMYU0Ok/F7KKD8x6w3DOVDppzyY jwKpzljHCz8BlIinvnMj9R1+YahqSfQUDpV/cxE3wKvRO6eoDVc3n9UUMH9A0ExlSxaD 2I6g== 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=FHUB+xXQU00Os/kffHTkZbI/lL9W8KsObBzfiiv5QUo=; b=FRRvPHsNg3q42V1PSo/wzJGCEaWFJrFgrZ2jqbxe7P96AR+diaXK0bOJUZd5e1sSHC b7XCc5bdUhrqW4bWyVZRwf1GKThmVkbmcnG4ANU2DFxqisK+D2wTiPLhzBavGQGuV/s7 MZJjA1g01M7TIZjb4KB4S9Tz2YG1L+nuj/IsLeMWYL2r3gKZ2ItzZqWy6VOMn8aNn9Ip s1czTUmlT6c9ZGq03bt1rh/NkqQzWDBajoNQIG/eTq2TWaCeq9qPVYZVMLFWIWAorIhr 8v3FJjyc/FKdun9vRd06Ivl2iESsk4hPrjH2Rum36yPo8AvZvi2dQ7drflILVVPMStfz cSew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=c6Neu3I6; 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 d130-v6si517000qkb.313.2018.08.15.19.55.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 15 Aug 2018 19:55:25 -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=c6Neu3I6; 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]:53221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fq8RZ-0002Iy-AH for patch@linaro.org; Wed, 15 Aug 2018 22:55:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fq8RB-0002IV-3v for qemu-devel@nongnu.org; Wed, 15 Aug 2018 22:55:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fq8R7-0006hs-P0 for qemu-devel@nongnu.org; Wed, 15 Aug 2018 22:55:01 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:37998) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fq8R7-0006gM-8v for qemu-devel@nongnu.org; Wed, 15 Aug 2018 22:54:57 -0400 Received: by mail-pf1-x443.google.com with SMTP id x17-v6so1332455pfh.5 for ; Wed, 15 Aug 2018 19:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=FHUB+xXQU00Os/kffHTkZbI/lL9W8KsObBzfiiv5QUo=; b=c6Neu3I6ht19ubzjfbryJKnHR41UKzbQtXSKUv8ZCo80vc87xfi/oXT9ulmbQNsPkG UaMBXlX+gqOQykO9kjgD3FhBejWx3P7PHSvaVYpW4nU/qSxCVc7EKiirm8xIPb0W2gE7 vs+/T+6HwPT3lvzsvC1IMg4Y7oOo/ftcFxPWc= 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=FHUB+xXQU00Os/kffHTkZbI/lL9W8KsObBzfiiv5QUo=; b=rZ87sqvV4Jop3If2eCutrkiHQDUENwg7LUbKNVVKxb1XLOTKsATlR5zIxlmeus/5L6 xgdXXJfJdaQkrew56M2EDQqM5takzU09Jzgzg0pccLrQTVCnjopwxOJI97CTxEEYbj7F +cGOGyW8a779iI9+vRC1ewZH5V39CDPW3GwRyDEfGtMXpdtJCFWMOcec2MtiH9FxOkie cTdv6uNWemR63T2wiDectzqbYpVZKOqRhltzb2AYV1by7ioYf52GgWAd+ZflTlIUtwQr F4/1E+LvcpNlmtUQEtYAz/v5cLOyngOd0cyWgXzcP2k4haEVvUu3c1s0EEpnDPoz3Q4F /CuA== X-Gm-Message-State: AOUpUlHuDoC5+tgI0oYQ6TgEDXPR0Jlq8oxN5LgPh2rSQQJMQikK7yrZ JbqktR4g/TUBZpU/6marM3ikjZgz2+A= X-Received: by 2002:a62:5cc1:: with SMTP id q184-v6mr30429630pfb.241.1534388094426; Wed, 15 Aug 2018 19:54:54 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-8-179.tukw.qwest.net. [97.113.8.179]) by smtp.gmail.com with ESMTPSA id k64-v6sm45231497pfc.160.2018.08.15.19.54.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Aug 2018 19:54:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 15 Aug 2018 19:54:47 -0700 Message-Id: <20180816025452.21358-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::443 Subject: [Qemu-devel] [PATCH 0/5] tcg: Reorg 128-bit atomic operations 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: pbonzini@redhat.com, cota@braap.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The other day Emilio noticed that we weren't setting CONFIG_ATOMIC128 for x86_64, despite forcing -mcx16 on the command-line. It seems that gcc has changed behaviour with version 7. There's a rather long discussion about this: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80878 It does not appear that gcc will ever quite align with our needs here. I have added a second configure test, and have split the test to be used by the rest of QEMU into two compile-time constants. This lets us refactor the code a bit and remove some conditional compilation. In addition, no version of gcc supports __sync_compare_and_swap_16 for aarch64. Inline some asm for that case. I've also checked power8, which does support CONFIG_ATOMIC128. Comments? r~ Richard Henderson (5): tcg: Split CONFIG_ATOMIC128 target/i386: Convert to HAVE_CMPXCHG128 target/s390x: Convert to HAVE_CMPXCHG128 and HAVE_ATOMIC128 target/arm: Convert to HAVE_CMPXCHG128 target/ppc: Convert to HAVE_CMPXCHG128 and HAVE_ATOMIC128 accel/tcg/atomic_template.h | 22 ++- include/qemu/atomic128.h | 162 ++++++++++++++++++++++ target/ppc/helper.h | 2 +- tcg/tcg.h | 29 ++-- accel/tcg/cputlb.c | 3 +- accel/tcg/user-exec.c | 5 +- target/arm/helper-a64.c | 259 ++++++++++++++++++------------------ target/i386/mem_helper.c | 9 +- target/ppc/mem_helper.c | 33 ++++- target/ppc/translate.c | 115 ++++++++-------- target/s390x/mem_helper.c | 87 ++++++------ configure | 19 +++ 12 files changed, 481 insertions(+), 264 deletions(-) create mode 100644 include/qemu/atomic128.h -- 2.17.1