Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2632683pxa; Mon, 17 Aug 2020 15:00:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyShA4Rl5GQHiy+qvJLp0H6otGHRzmyvl372/pvPG8NArYQUNaMYHNTqe5YcccDAAakFZhF X-Received: by 2002:a17:907:11dd:: with SMTP id va29mr17799434ejb.470.1597701618735; Mon, 17 Aug 2020 15:00:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597701618; cv=none; d=google.com; s=arc-20160816; b=d7m7o0SPQwrU14co4WYVjeq6OFUkyPILcvbZGfHLjDioj/WmwLaOrGTDSYkChG59y0 UHOzQD/EOid9VtMZav0r2XAapiUwJEQkRhCFU0VBxdBJiBZypJX6dzfsWIexcxrTqQ/a LW0ByYv7DPDua+xV1Zj800UPoY8iLlfVnVr9LTx5mpOUrtCkOpRuER3HSFU8pNif2h7l tS+IJY7/i4KKjMjs0yyuEbyJOT2q9e3/lm3pWn7pyNwUkbeHSJRaCdEKOvsfsQpNvu2t z9Bd/FYp91cJ5GRiCrKSRbniuf6bZLz5QV8jlMTVEWG/3LtG5ZPV5GNlSdbbAD9Qknxh KieQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TWZU0dVDledjFKIBGWGoNkeTXocH4n8hLk5kk/uxws8=; b=BLRt2tZS13hL10Kcd5pXQtjkR2/HVpZ+/P0g9dSYK37vgL9+y88RIBzEbolIinlu00 r74hhMU1lZNotMaGpr6GHaVnd63or7wd2DfeGL7L7yMl0lVMHIcuwNnipCkjCdaIx0k8 AHOWP3TszBVfxgd3ix30rhHkZDZGyRy1ZxgRPs9nxyAgVbIvnnt1Bi9Fl2MSlbKySWE/ N3n8jtEQjwY4AzN4jVquxU9uS34V0/3GExpba8Kw2aE8l+93ji8arRMPgf7VO9a9jXHa qRhYgCHlIRPP0Hls8zIY7vMlgBzoh2OiGypBJ192Yzx2uY6xw+QIBqLn+P7dsirsCg93 oMBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aEQKWonu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w9si11779849edq.487.2020.08.17.14.59.55; Mon, 17 Aug 2020 15:00:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aEQKWonu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730484AbgHQPgG (ORCPT + 99 others); Mon, 17 Aug 2020 11:36:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:52428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729877AbgHQPah (ORCPT ); Mon, 17 Aug 2020 11:30:37 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DC4C023132; Mon, 17 Aug 2020 15:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678236; bh=ZebZqfa4CbDT7jXcsMVa+Nj/+qCStPKrWCWUJDF7bJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aEQKWonuUEEwPt4gW+OuVVbCYdxegyy7dQURK0vmAngSp/JY7n8IyUmw62jqzFQFy 1v9PD8kd3Zs7IWQN4ShJkfLCN7GZlNyXzxLEUtHaNvDW15giufSIEhyEzIPipQIeyc 9Q7ZeJJ/fA+D32u8C1VNcj7jsYKfsx4ZIvcTNmk8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathieu Poirier , Mike Leach , Suzuki K Poulose , Sasha Levin Subject: [PATCH 5.8 265/464] coresight: etm4x: Fix save/restore during cpu idle Date: Mon, 17 Aug 2020 17:13:38 +0200 Message-Id: <20200817143846.482976503@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Suzuki K Poulose [ Upstream commit 342c8a1d1d9e418d32fa02d635cf96989f9a986e ] The ETM state save/restore incorrectly reads/writes some of the 64bit registers (e.g, address comparators, vmid/cid comparators etc.) using 32bit accesses. Ensure we use the appropriate width accessors for the registers. Fixes: f188b5e76aae ("coresight: etm4x: Save/restore state across CPU low power states") Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200716175746.3338735-18-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/hwtracing/coresight/coresight-etm4x.c | 16 ++++++++-------- drivers/hwtracing/coresight/coresight-etm4x.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 007d7c6e91f48..6089c481f8f19 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -1202,8 +1202,8 @@ static int etm4_cpu_save(struct etmv4_drvdata *drvdata) } for (i = 0; i < drvdata->nr_addr_cmp * 2; i++) { - state->trcacvr[i] = readl(drvdata->base + TRCACVRn(i)); - state->trcacatr[i] = readl(drvdata->base + TRCACATRn(i)); + state->trcacvr[i] = readq(drvdata->base + TRCACVRn(i)); + state->trcacatr[i] = readq(drvdata->base + TRCACATRn(i)); } /* @@ -1214,10 +1214,10 @@ static int etm4_cpu_save(struct etmv4_drvdata *drvdata) */ for (i = 0; i < drvdata->numcidc; i++) - state->trccidcvr[i] = readl(drvdata->base + TRCCIDCVRn(i)); + state->trccidcvr[i] = readq(drvdata->base + TRCCIDCVRn(i)); for (i = 0; i < drvdata->numvmidc; i++) - state->trcvmidcvr[i] = readl(drvdata->base + TRCVMIDCVRn(i)); + state->trcvmidcvr[i] = readq(drvdata->base + TRCVMIDCVRn(i)); state->trccidcctlr0 = readl(drvdata->base + TRCCIDCCTLR0); state->trccidcctlr1 = readl(drvdata->base + TRCCIDCCTLR1); @@ -1315,18 +1315,18 @@ static void etm4_cpu_restore(struct etmv4_drvdata *drvdata) } for (i = 0; i < drvdata->nr_addr_cmp * 2; i++) { - writel_relaxed(state->trcacvr[i], + writeq_relaxed(state->trcacvr[i], drvdata->base + TRCACVRn(i)); - writel_relaxed(state->trcacatr[i], + writeq_relaxed(state->trcacatr[i], drvdata->base + TRCACATRn(i)); } for (i = 0; i < drvdata->numcidc; i++) - writel_relaxed(state->trccidcvr[i], + writeq_relaxed(state->trccidcvr[i], drvdata->base + TRCCIDCVRn(i)); for (i = 0; i < drvdata->numvmidc; i++) - writel_relaxed(state->trcvmidcvr[i], + writeq_relaxed(state->trcvmidcvr[i], drvdata->base + TRCVMIDCVRn(i)); writel_relaxed(state->trccidcctlr0, drvdata->base + TRCCIDCCTLR0); diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h index b0d633daf7162..47729e04aac72 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.h +++ b/drivers/hwtracing/coresight/coresight-etm4x.h @@ -334,7 +334,7 @@ struct etmv4_save_state { u64 trcacvr[ETM_MAX_SINGLE_ADDR_CMP]; u64 trcacatr[ETM_MAX_SINGLE_ADDR_CMP]; u64 trccidcvr[ETMv4_MAX_CTXID_CMP]; - u32 trcvmidcvr[ETM_MAX_VMID_CMP]; + u64 trcvmidcvr[ETM_MAX_VMID_CMP]; u32 trccidcctlr0; u32 trccidcctlr1; u32 trcvmidcctlr0; -- 2.25.1