From patchwork Wed Nov 15 12:35:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 118941 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4259411qgn; Wed, 15 Nov 2017 04:39:15 -0800 (PST) X-Google-Smtp-Source: AGs4zMa4NT8kcaZlNdRrdbtG55C4u7SlZ3YN7hkqvohFrbkr9gv/UKJ+2DHSqBYHZCzPWwrAnwtL X-Received: by 10.37.0.5 with SMTP id 5mr9192857yba.491.1510749555735; Wed, 15 Nov 2017 04:39:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510749555; cv=none; d=google.com; s=arc-20160816; b=tlu1eBENDUTHhN+H4CJRqoRJgYIGWWWu8k0oPFbAYHadJ/Ki304Nr5RvC7LrVZmZY8 UiuZY3XR48g8hlQYNHC7t5eF+nqRzvUzUq71BAYnsoOPDlF3e4yH2/huqSW+DGQWAg3S KtlUzSGf2nDPxooGUqtOeH7aggXhuuf6EvCDdpi2f+uc6hvyHLWzQyq7L8Op2GZh/Nzr WfSmSFdZeFTJSv1QokxEdEPQrZwhf1EB55GrYiUOrX2uWe6lyFVhnxyZ/UT2BXn33vzl 0GA0AnKq1AmWPKBT1SG+7CHY2VkDuB8EAQVwpPT9sKLeOSljeuMdw5ey/EQl6WifsloC Mv/Q== 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=q4cHOET0RjremJACS4BvBGqPid2KGrIo6RRafDt62mw=; b=okYh/3Tz+jHFMKoMJH99qo+uE+XWSIUS+nFx6Lu+wYn0/mrQQ9cY8rykCtn9nZ+aPY IzoBN0rSdSc3gMi6QqmjpkOPF531BU25yKyJB9NtlPFHostsj9RwyB6ixyfqvtUV+Rgi INnFnXPwDQ8dsNnQp4bHGgF4FyNfkNSeC17ifGsjqMRZ9YMXYpayoRniluCalNwVuEK6 DAhrSS7CAVw+NhVYDbnshkCuUNA0/JLa5TJE8VtfJ2uwG7lQssfHfsCoRqnxWWhfmD1M FPELqFZx7taufzrxgzAltVnG0eFvJVyUqMgwEYvlX0ZVRni8tOkA5kTUUpmCnQamuq1n /qVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VYWKkn4v; 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 s4si1825298ybe.334.2017.11.15.04.39.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 15 Nov 2017 04:39: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=VYWKkn4v; 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]:35833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEwyJ-0007SD-AG for patch@linaro.org; Wed, 15 Nov 2017 07:39:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEwwc-0006rE-OS for qemu-devel@nongnu.org; Wed, 15 Nov 2017 07:37:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eEwwb-0006PW-QA for qemu-devel@nongnu.org; Wed, 15 Nov 2017 07:37:30 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:49235) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eEwwb-0006Ou-KN for qemu-devel@nongnu.org; Wed, 15 Nov 2017 07:37:29 -0500 Received: by mail-wr0-x242.google.com with SMTP id o88so20312517wrb.6 for ; Wed, 15 Nov 2017 04:37:29 -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=q4cHOET0RjremJACS4BvBGqPid2KGrIo6RRafDt62mw=; b=VYWKkn4v1yXsA+G+eXikdWPoZP2HHOH0zWlfVo9aiv6/Qy79YJTTqGk2XsYfV8FPUC WbQh6/oZj/2yCXo/lkKVB5foxEa/SONEtwinUGU9Lm5PZCrQ5EqLrSDRRCa87jkdGu4m 79i9bK9FkscW7SDVIsqjQHD/pXUe99YQ1DyzY= 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=q4cHOET0RjremJACS4BvBGqPid2KGrIo6RRafDt62mw=; b=VWDxap7weHvsG/FH2PDy2b7pP83wr9Rvs4vT9pf236vF8+xhZfX14+El4X92g9A9L5 XoCXKoFC6la4WnhiS+66wdRetpILOOpgJj/LJxKSXn+pNGb1olN2Q8uLbowvsdLeSMdp oKjalkg/ij3J1tX0BPd88JD2gYBAy/exTErMbH3+z8BniptKDr2mdmGZDubNpmOmJbLH ifTnoqRXete7ZuW+xMjlG0P4ndPVShDQV0TZ1Nr6xaaFT5Wby9BCYvS6q3J3+Pnix1t6 Kbss6bW9VhIn8ngPXuSXoNz43jBd4ZTSUW6ZXGk0bKlXW47blVnlAosQMkiU+Osw0078 9wXg== X-Gm-Message-State: AJaThX4TWBZEkNefeTxFDZlHCQi3vvTv8T8/xttoB+4s3oCVu4kXgiVd oAC5u17efFUY9i4nJ4AiPQP8czv44FU= X-Received: by 10.223.164.206 with SMTP id h14mr9495106wrb.221.1510749448338; Wed, 15 Nov 2017 04:37:28 -0800 (PST) Received: from cloudburst.twiddle.net (18.red-37-10-242.dynamicip.rima-tde.net. [37.10.242.18]) by smtp.gmail.com with ESMTPSA id 29sm21828608wrz.77.2017.11.15.04.37.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Nov 2017 04:37:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 15 Nov 2017 13:35:20 +0100 Message-Id: <20171115123520.7464-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171115123520.7464-1-richard.henderson@linaro.org> References: <20171115123520.7464-1-richard.henderson@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] [PULL for-2.11 3/3] target/arm: Fix GETPC usage in do_paired_cmpxchg64_l/be 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use of GETPC must be restricted to those functions that are directly called from TCG generated code. Reviewed-by: Alex Bennée Fixes: 2399d4e7cec22ecf1c51062d2ebfd45220dbaace Signed-off-by: Richard Henderson --- target/arm/helper-a64.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) -- 2.13.6 diff --git a/target/arm/helper-a64.c b/target/arm/helper-a64.c index 96a3ecf707..b84ebcae6e 100644 --- a/target/arm/helper-a64.c +++ b/target/arm/helper-a64.c @@ -432,9 +432,8 @@ uint64_t HELPER(crc32c_64)(uint64_t acc, uint64_t val, uint32_t bytes) /* Returns 0 on success; 1 otherwise. */ static uint64_t do_paired_cmpxchg64_le(CPUARMState *env, uint64_t addr, uint64_t new_lo, uint64_t new_hi, - bool parallel) + bool parallel, uintptr_t ra) { - uintptr_t ra = GETPC(); Int128 oldv, cmpv, newv; bool success; @@ -491,20 +490,19 @@ static uint64_t do_paired_cmpxchg64_le(CPUARMState *env, uint64_t addr, uint64_t HELPER(paired_cmpxchg64_le)(CPUARMState *env, uint64_t addr, uint64_t new_lo, uint64_t new_hi) { - return do_paired_cmpxchg64_le(env, addr, new_lo, new_hi, false); + return do_paired_cmpxchg64_le(env, addr, new_lo, new_hi, false, GETPC()); } uint64_t HELPER(paired_cmpxchg64_le_parallel)(CPUARMState *env, uint64_t addr, uint64_t new_lo, uint64_t new_hi) { - return do_paired_cmpxchg64_le(env, addr, new_lo, new_hi, true); + return do_paired_cmpxchg64_le(env, addr, new_lo, new_hi, true, GETPC()); } static uint64_t do_paired_cmpxchg64_be(CPUARMState *env, uint64_t addr, uint64_t new_lo, uint64_t new_hi, - bool parallel) + bool parallel, uintptr_t ra) { - uintptr_t ra = GETPC(); Int128 oldv, cmpv, newv; bool success; @@ -561,11 +559,11 @@ static uint64_t do_paired_cmpxchg64_be(CPUARMState *env, uint64_t addr, uint64_t HELPER(paired_cmpxchg64_be)(CPUARMState *env, uint64_t addr, uint64_t new_lo, uint64_t new_hi) { - return do_paired_cmpxchg64_be(env, addr, new_lo, new_hi, false); + return do_paired_cmpxchg64_be(env, addr, new_lo, new_hi, false, GETPC()); } uint64_t HELPER(paired_cmpxchg64_be_parallel)(CPUARMState *env, uint64_t addr, uint64_t new_lo, uint64_t new_hi) { - return do_paired_cmpxchg64_be(env, addr, new_lo, new_hi, true); + return do_paired_cmpxchg64_be(env, addr, new_lo, new_hi, true, GETPC()); }