Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3080732pxj; Mon, 17 May 2021 17:16:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxle+sJuM72IxqBv8HRMcPvIqecXB/EwfPXkKLnp4JXeSiye9plekHblPbbKcM8D1OTzs7d X-Received: by 2002:a50:fd11:: with SMTP id i17mr3374815eds.23.1621296999699; Mon, 17 May 2021 17:16:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621296999; cv=none; d=google.com; s=arc-20160816; b=NUEWdBCC3kvOh0hQDohDfn9OETAynb3c9peJM3Q3bBg4IFt3Z/q4kwAKTzf5E1DqGv 7YWZ/ahTaORzzPL7Ijbio3enLmzC8nCxiYk5wyJeSk4BSSwD0UqQ4wlXyw57OR0swYUr ffG5bJ0sOUVenBLqEx5eKsTcn+vQvaq/FppV5y3h0k77Iw2qj8Jt6DfYakPc9z1TfQh3 MOXUxh8GBh16Pn95/VGJwvrilwhl5UXof3d6AnpbTj4oBHBt1YlGQ38VauB0weSPe/jX jwXLQds5dXK6wGJydWcSmJNI1PZcMOtl4UAhEEHRA0S9KS1xXn+TDQC5x9ihp3YWhMnw /5QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=c/J2bD1L/8+gf0wlZt45+PF8R+WBzmrMRo/53saSGfE=; b=fSJNcZ3MIoH+lkaAXzdVb7d5m52EOXzN0RVK4GbnfvgoEEZ8dnIS+Tk0VXfn9pQjAm 6xeuk+QkWdUpg8q9a81o5eFzXtnreZRAmGFD37wbygDaEuIX2WeFXiaAwrciHJH+rMmZ WpTPmE+AHTMqP7N4k7uENNhkghncHBJz0UD5yHs7r2Q1mkZgIXmJ7qU7Nos+PZu9u+H5 bYIhBRqH80srlDVnZpYhEPFwEk/3IWSeqbitBY+GyByz+Nqe0v7tNLMo0e2cobtF52j0 um5dUCw6DvlsG6CKLrEm6IIeEp+omD9CAvHc5/VsMQmi6+CdRoigXgmnAiYMvoE3+Bta OPaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="a/11dgDf"; 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=pass (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 z27si15057540ejl.41.2021.05.17.17.16.00; Mon, 17 May 2021 17:16:39 -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=@linuxfoundation.org header.s=korg header.b="a/11dgDf"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237898AbhEQO0U (ORCPT + 99 others); Mon, 17 May 2021 10:26:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:35964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239271AbhEQOWe (ORCPT ); Mon, 17 May 2021 10:22:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 700FF61242; Mon, 17 May 2021 14:12:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260725; bh=ggzgiK2KK9osGXto5Yoydw2qtqMmS2X5cvTtKI0/8Y0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a/11dgDfnk9H9W1RBYL1bRTkVFJnZkXCK1EjCNJffhiP3Ai887falhsg538Bmc3y4 KHLVQAkLmWqyzLXf3d4K02hccR131PcQlkGqvgtMU+Qk8bVZp9nG7EdBSSV82AzPHj Aem7RUNwbKClezABPMOK7g6eP/T7HKKUOVigbGHo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sandipan Das , "Aneesh Kumar K.V" , Michael Ellerman , Sasha Levin Subject: [PATCH 5.12 211/363] powerpc/powernv/memtrace: Fix dcache flushing Date: Mon, 17 May 2021 16:01:17 +0200 Message-Id: <20210517140309.711008455@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sandipan Das [ Upstream commit b910fcbada9721c21f1d59ab59e07e8e354c23cc ] Trace memory is cleared and the corresponding dcache lines are flushed after allocation. However, this should not be done using the PFN. This adds the missing conversion to virtual address. Fixes: 2ac02e5ecec0 ("powerpc/mm: Remove dcache flush from memory remove.") Signed-off-by: Sandipan Das Reviewed-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210501160254.1179831-1-sandipan@linux.ibm.com Signed-off-by: Sasha Levin --- arch/powerpc/platforms/powernv/memtrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/powernv/memtrace.c b/arch/powerpc/platforms/powernv/memtrace.c index 019669eb21d2..4ab7c3ef5826 100644 --- a/arch/powerpc/platforms/powernv/memtrace.c +++ b/arch/powerpc/platforms/powernv/memtrace.c @@ -88,8 +88,8 @@ static void memtrace_clear_range(unsigned long start_pfn, * Before we go ahead and use this range as cache inhibited range * flush the cache. */ - flush_dcache_range_chunked(PFN_PHYS(start_pfn), - PFN_PHYS(start_pfn + nr_pages), + flush_dcache_range_chunked((unsigned long)pfn_to_kaddr(start_pfn), + (unsigned long)pfn_to_kaddr(start_pfn + nr_pages), FLUSH_CHUNK_SIZE); } -- 2.30.2