Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1183626ybf; Thu, 27 Feb 2020 06:28:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwzlGKOeubrjB/tvejtfFUTaAyg0OkuQ0LsL2x2hjuc9RljUtFjjeo1szgSPZSdBQmlrDlI X-Received: by 2002:a9d:7757:: with SMTP id t23mr3754332otl.315.1582813685022; Thu, 27 Feb 2020 06:28:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582813685; cv=none; d=google.com; s=arc-20160816; b=0BHTxJqpSiDid8Z1S9l28clzk06+22T7bGhopL9GFuufEckQqJgxJk8XxvN4AJcgod E1VR/aAqx4mkiXMHO2iSUgnbI9GpwFHsIYKXeS9R+10MLDHD2lGaG7S1wbxf5Tl8OHlq YvqkbAKP/TK+s6ZwK3Lo550Xx3EazJxMVczrTN6cDOhi5ksae7j56gXFX4+60WfCtRdG DNe0ZDwMjaKNn55G9Ph0u6iVqHGgIQMW2MM6Y8H5IE4k3d/+rnFmXs5PIC3F0oHq2TGb RZTzS8wxGCVSwr0EI0vLY6jB1N4kqvxbJ2ZNi6FcxDwjzoCQymV6a/VqZK7ca2zaM7IL YZiQ== 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=G5DqANoT/YmY6BPHuNOMw9DJJtf2V5rZCqD3YzX7/IY=; b=EJqjZBJFKS37vahx4UeGH7i8uUM0DYQtk13zBe0FUYjV8LdnzftNlIzJQqgUuJkxgi uwy6rCNfg17mKTlofyMLWDA9wcMOjZPSRiKfDYs7qH6FXI/4ihas6fdnzJIuRdsB4o8a 1itQhnj+28TDOtJOslw43RuMVepHGwZtgZY2dFGBQJUEbYzSUyuVJu8yExfA/kZpFTOa DVY0FvZjS2An2qjHU+0S3nDG3JxoCroDx2vms87KQubU21vyoPPIMRLX7r/83mH+jJrv 1Hdj88g3NVKsZT40IxQ9yKlQmh1LP+a6s9rPZ/HeSdVOHV/WRtsnFaRDt0cb+G70mbUR GrGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gVOpT1+6; 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 g25si1430089otj.198.2020.02.27.06.27.53; Thu, 27 Feb 2020 06:28:05 -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=gVOpT1+6; 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 S2388268AbgB0OIp (ORCPT + 99 others); Thu, 27 Feb 2020 09:08:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:46498 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387925AbgB0OIi (ORCPT ); Thu, 27 Feb 2020 09:08:38 -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 CEFDE20714; Thu, 27 Feb 2020 14:08:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582812518; bh=lqpYNNcrPhcEJCoVEm5zSXwt3P8XbK0+uztpjf3ftmk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gVOpT1+6cqofYMssT2C+t+YtR/rnxf+ZVWGm143EaeR8RSURTCqNB+N1ixQUVSa1H JYTeovN/NBAUCtWLGYj00s0uLyoa9JlITqur27EmUVtFVoNt+zVncvXSoS9fed2n7p FxDBZ5ZG7qZ4lVPRHumQsRxucn+oZ7DWamk6aW98= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy , Michael Ellerman Subject: [PATCH 5.4 048/135] powerpc/hugetlb: Fix 8M hugepages on 8xx Date: Thu, 27 Feb 2020 14:36:28 +0100 Message-Id: <20200227132236.315442234@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132228.710492098@linuxfoundation.org> References: <20200227132228.710492098@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: Christophe Leroy commit 50a175dd18de7a647e72aca7daf4744e3a5a81e3 upstream. With HW assistance all page tables must be 4k aligned, the 8xx drops the last 12 bits during the walk. Redefine HUGEPD_SHIFT_MASK to mask last 12 bits out. HUGEPD_SHIFT_MASK is used to for alignment of page table cache. Fixes: 22569b881d37 ("powerpc/8xx: Enable 8M hugepage support with HW assistance") Cc: stable@vger.kernel.org # v5.0+ Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/778b1a248c4c7ca79640eeff7740044da6a220a0.1581264115.git.christophe.leroy@c-s.fr Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/include/asm/page.h | 5 +++++ 1 file changed, 5 insertions(+) --- a/arch/powerpc/include/asm/page.h +++ b/arch/powerpc/include/asm/page.h @@ -295,8 +295,13 @@ static inline bool pfn_valid(unsigned lo /* * Some number of bits at the level of the page table that points to * a hugepte are used to encode the size. This masks those bits. + * On 8xx, HW assistance requires 4k alignment for the hugepte. */ +#ifdef CONFIG_PPC_8xx +#define HUGEPD_SHIFT_MASK 0xfff +#else #define HUGEPD_SHIFT_MASK 0x3f +#endif #ifndef __ASSEMBLY__