mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Burton <paul.burton@imgtec.com>
To: <linux-mips@linux-mips.org>, Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <james.hogan@imgtec.com>,
	"Steven J . Hill" <Steven.Hill@imgtec.com>,
	Paul Burton <paul.burton@imgtec.com>,
	"Paul Gortmaker" <paul.gortmaker@windriver.com>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH v2 02/13] MIPS: Fix HTW config on XPA kernel without LPA enabled
Date: Mon, 18 Apr 2016 10:35:22 +0100	[thread overview]
Message-ID: <1460972133-16973-3-git-send-email-paul.burton@imgtec.com> (raw)
In-Reply-To: <1460972133-16973-1-git-send-email-paul.burton@imgtec.com>

From: James Hogan <james.hogan@imgtec.com>

The hardware page table walker (HTW) configuration is broken on XPA
kernels where XPA couldn't be enabled (either nohtw or the hardware
doesn't support it). This is because the PWSize.PTEW field (PTE width)
was only set to 8 bytes (an extra shift of 1) in config_htw_params() if
PageGrain.ELPA (enable large physical addressing) is set. On an XPA
kernel though the size of PTEs is fixed at 8 bytes regardless of whether
XPA could actually be enabled.

Fix the initialisation of this field based on sizeof(pte_t) instead.

Fixes: c5b367835cfc ("MIPS: Add support for XPA.")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: linux-mips@linux-mips.org
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---

Changes in v2: None

 arch/mips/mm/tlbex.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 84c6e3f..86aa7c2 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -2311,9 +2311,7 @@ static void config_htw_params(void)
 	if (CONFIG_PGTABLE_LEVELS >= 3)
 		pwsize |= ilog2(PTRS_PER_PMD) << MIPS_PWSIZE_MDW_SHIFT;
 
-	/* If XPA has been enabled, PTEs are 64-bit in size. */
-	if (config_enabled(CONFIG_64BITS) || (read_c0_pagegrain() & PG_ELPA))
-		pwsize |= 1;
+	pwsize |= ilog2(sizeof(pte_t)/4) << MIPS_PWSIZE_PTEW_SHIFT;
 
 	write_c0_pwsize(pwsize);
 
-- 
2.8.0

  parent reply	other threads:[~2016-04-18  9:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1460972133-16973-1-git-send-email-paul.burton@imgtec.com>
2016-04-18  9:35 ` [PATCH v2 01/13] MIPS: Separate XPA CPU feature into LPA and MVH Paul Burton
2016-04-18  9:35 ` Paul Burton [this message]
2016-04-18  9:35 ` [PATCH v2 03/13] MIPS: Remove redundant asm/pgtable-bits.h inclusions Paul Burton
2016-04-18 12:36   ` Sergei Shtylyov
2016-04-18  9:35 ` [PATCH v2 04/13] MIPS: Use enums to make asm/pgtable-bits.h readable Paul Burton
2016-04-18  9:35 ` [PATCH v2 06/13] MIPS: mm: Unify pte_page definition Paul Burton
2016-04-18  9:35 ` [PATCH v2 08/13] MIPS: mm: Don't clobber $1 on XPA TLB refill Paul Burton
2016-04-18  9:35 ` [PATCH v2 09/13] MIPS: mm: Pass scratch register through to iPTE_SW Paul Burton
2016-04-18  9:35 ` [PATCH v2 10/13] MIPS: mm: Be more explicit about PTE mode bit handling Paul Burton
2016-04-18  9:35 ` [PATCH v2 11/13] MIPS: mm: Simplify build_update_entries Paul Burton
2016-04-18  9:35 ` [PATCH v2 12/13] MIPS: mm: Don't do MTHC0 if XPA not present Paul Burton
2016-04-18  9:35 ` [PATCH v2 13/13] MIPS: mm: Panic if an XPA kernel is run without RIXI Paul Burton
2016-04-18 10:04   ` James Hogan
     [not found] ` <1460972133-16973-8-git-send-email-paul.burton@imgtec.com>
2016-04-18 14:34   ` [PATCH v2 07/13] MIPS: mm: Fix MIPS32 36b physical addressing (alchemy, netlogic) Manuel Lauss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460972133-16973-3-git-send-email-paul.burton@imgtec.com \
    --to=paul.burton@imgtec.com \
    --cc=Steven.Hill@imgtec.com \
    --cc=james.hogan@imgtec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®