Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2639206pxa; Mon, 17 Aug 2020 15:10:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTMyeLunB0qPDo2k3Gm8nLVNSZnPI73j10i8ydXJBfH6Ji9iGYb8jufLII4Zqf6MSjkc3O X-Received: by 2002:a50:a6d2:: with SMTP id f18mr16512910edc.374.1597702236379; Mon, 17 Aug 2020 15:10:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597702236; cv=none; d=google.com; s=arc-20160816; b=whsgd0z/GSnixB0fvzMawEzh0ZjbRFfSmjlJkmiJ6ygBhihmSaCdbJBeecRPGjZ9FZ 4w/gLBQBS97+DpvCq4C3gPK+aG4lYSuSZqkb6CGVyn/PO79dJr2zfKlb165/Aj7QapGL 6y0F76Y+TtaSwJyLBfJwO+3Oa2a29FfRj+UkMNoaw0rE894AP82sW3sKpi6cuxqSTf2u D97WOg0r6usgd+nL7BkJUHTUYRfmBo4ZNBLC4jXrejVb0gO1j1TTxtcuSrx/m+sxQFmp 1FYZvJ4jWtA+rBroXuxPkUIN/pCyPKlBQyxtjJf4IcTxx1rnRC4cGRSAZc68GMHCWxDY YxYg== 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=osd3Gjc6ftVSnoz4u0vWmeiCQHfj48BI1hmj9nH+Gm8=; b=cyxiFM1pi0GuuU8aUjdkjaTL8aX1eR6JWihkncqatf4QO0gB/xcchD4dJ/rtcbcySC F6uyZjjfIoAlzoPvx99TtssQe6+RitvoEVv0k8wJ7tWz2Mk3LHH3O98+7ToqFdgK//e8 XH1JCEewZObrV0Ggc9PLyNx76koRfDmAJU15yjwBFuuksbWpwBM9HMD8hghK/j2I3G2g 88CFM1bKQnSVq3ygdkdkexmbUHBhhkx1ImLv6dLmrRKZy7ZYiaPMkXMKn0row91bEaW4 u1BTKxloMQ9rjNfssdCSWg648RzRsueH0q3dJOu7HW4K3UFZEvJyRJGLPfWAftBflRER gbsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ZzHs/NAQ"; 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 qc24si12299484ejb.398.2020.08.17.15.10.12; Mon, 17 Aug 2020 15:10:36 -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="ZzHs/NAQ"; 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 S2388634AbgHQQ0U (ORCPT + 99 others); Mon, 17 Aug 2020 12:26:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:36902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387420AbgHQPvd (ORCPT ); Mon, 17 Aug 2020 11:51:33 -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 7CDEB2072E; Mon, 17 Aug 2020 15:51:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679492; bh=aA5Kts/EOMrSJOwXS+IBSah7je7tbYhhRPRHVnVJbmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZzHs/NAQoOAAtjxm//IyX1BOF92gWDAoVxRJ9t9pfc5Bly73T1Jsotq9v2MlMh289 CWWZn4Qku66nei64khRcpMSIVQt5UWIyVajvzQ5N4FdUMUngOetXwoNIwKrZr7Ixsv DFAMrtfyhDWtXnSQuZ8Wz6lpECvN+MtmE0rVv0ZA= 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.7 231/393] coresight: etm4x: Fix save/restore during cpu idle Date: Mon, 17 Aug 2020 17:14:41 +0200 Message-Id: <20200817143830.831016065@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@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 942b362a1f220..13c362cddd6a6 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -1213,8 +1213,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)); } /* @@ -1225,10 +1225,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); @@ -1326,18 +1326,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