Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp44885pja; Fri, 22 Nov 2019 03:14:40 -0800 (PST) X-Google-Smtp-Source: APXvYqz6tMpa4HfyY50wLBKDSStE2G2RGQw/p0tBJNozV4YSbe0SZWgv7pmtAaEd9FJJmj8xsw6H X-Received: by 2002:a17:906:6043:: with SMTP id p3mr21679755ejj.103.1574421280041; Fri, 22 Nov 2019 03:14:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574421280; cv=none; d=google.com; s=arc-20160816; b=VhL+cca+iTU0tTcb3eZbq8YBw5veFelHzeTz+6us2xr2Fftyd/55tjMKKHVkWPCmtO gTzAPufzKo615JM3JAm8Ol/1TfdbH90INuBz2mYpwWyWELHcfE2RRSp3iTlBVKNC+kbn hrasURRG/e8jcXKPPpElEcU4tszqd1PZyvvDhjG8VP9wqTtc0YWIlEEw9inaaGhU484O LpY1+I9CYiE+VpKefqOJyLG/i5Cgx8+fnlakofSL6XQhP96ICDcqnnhsRSNRIuk/zFx0 9ykfZYPDbhP1Ld/MhKDHxbbp9frVNqQoKnEQ6IeKWFNPVHEbnPOVYAmkjndXd3FmpGpN C+ZQ== 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=8pW1sZdQjTAvrYw+hmxZRFCu2HEG71DYYczHpiLBVCc=; b=co2omc3NpWPsZlz/RWtRGlmPZfN4A8FBcLSgrDe3xs1HC43DQGoi1iE3hwrihtPmzo ZTyoLO5N1XvkwOO77ewDF/B1yG3Lf8f+GjinjnHpMHVkYANXBr5k+bOS0JBvBGb7bDlb NkXqvrG+MdBa+Kvi7SQWC3YT2VLp03c+XlVDoCLh3e0e3wi9jr0uAjdoR0W3Zy4/VNNc ChrhbZXxXy/cb3NYnMhzvLGiKzsh0fhGJ1fDmuQRaOYqyPBuH9+Uc85hg4Ud1qhtwyMy CHB+sAC+zERIV/+LP7hQgcpWOKkaXZJzxckHDXLULC046pkwyZRygiBPeOfvyC6lcuiz o7IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MaREX8G7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t6si4316606edr.52.2019.11.22.03.14.15; Fri, 22 Nov 2019 03:14:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MaREX8G7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730839AbfKVK6x (ORCPT + 99 others); Fri, 22 Nov 2019 05:58:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:49306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730468AbfKVK6v (ORCPT ); Fri, 22 Nov 2019 05:58:51 -0500 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 09CB720721; Fri, 22 Nov 2019 10:58:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574420330; bh=UVaB9uRriPUJ3gCh//YHEKoxCmJWEb6T3hdy2VJoApU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MaREX8G7/NDrKY7oqQDFYYDlzvBMMs7erh2V9e2tFrgjNnI7hqzNAJtD0ZUKHnGyM 2Ip9H8PRWa2k/xPh0YRTLeWsEGi+BLVxmgd9d5vCgxaVJdkGMv4rnhkRjg9tfGLK25 d29lfOXEljRwLi/iDP89DbHq+PadBVYg8+nf+4iQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Naveen N. Rao" , Michael Ellerman , Sasha Levin Subject: [PATCH 4.19 068/220] powerpc/pseries: Fix how we iterate over the DTL entries Date: Fri, 22 Nov 2019 11:27:13 +0100 Message-Id: <20191122100917.052524496@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122100912.732983531@linuxfoundation.org> References: <20191122100912.732983531@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: Naveen N. Rao [ Upstream commit 9258227e9dd1da8feddb07ad9702845546a581c9 ] When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set, we look up dtl_idx in the lppaca to determine the number of entries in the buffer. Since lppaca is in big endian, we need to do an endian conversion before using this in our calculation to determine the number of entries in the buffer. Without this, we do not iterate over the existing entries in the DTL buffer properly. Fixes: 7c105b63bd98 ("powerpc: Add CONFIG_CPU_LITTLE_ENDIAN kernel config option.") Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/platforms/pseries/dtl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/dtl.c b/arch/powerpc/platforms/pseries/dtl.c index c762689e0eb33..ef6595153642e 100644 --- a/arch/powerpc/platforms/pseries/dtl.c +++ b/arch/powerpc/platforms/pseries/dtl.c @@ -184,7 +184,7 @@ static void dtl_stop(struct dtl *dtl) static u64 dtl_current_index(struct dtl *dtl) { - return lppaca_of(dtl->cpu).dtl_idx; + return be64_to_cpu(lppaca_of(dtl->cpu).dtl_idx); } #endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ -- 2.20.1