From: Bill Mills <wmills@ti.com>
To: <rmk+kernel@armlinux.org.uk>, <mark.rutland@arm.com>,
<t-kristo@ti.com>, <ssantosh@kernel.org>,
<catalin.marinas@arm.com>
Cc: <linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <r-woodruff2@ti.com>,
Bill Mills <wmills@ti.com>
Subject: [RFC v2 3/4] ARM: mm: add inner/outer sharing value command line
Date: Sun, 5 Jun 2016 23:20:28 -0400 [thread overview]
Message-ID: <1465183229-24147-4-git-send-email-wmills@ti.com> (raw)
In-Reply-To: <1465183229-24147-1-git-send-email-wmills@ti.com>
Adds defsharing=inner|outer as an early command line option.
Any such command line option will override a platform's choice.
Signed-off-by: Bill Mills <wmills@ti.com>
---
arch/arm/include/asm/pgtable-hwdef.h | 1 +
arch/arm/mm/mmu.c | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+)
diff --git a/arch/arm/include/asm/pgtable-hwdef.h b/arch/arm/include/asm/pgtable-hwdef.h
index 27654a9..2a9e24b 100644
--- a/arch/arm/include/asm/pgtable-hwdef.h
+++ b/arch/arm/include/asm/pgtable-hwdef.h
@@ -31,6 +31,7 @@ struct attr_mod_entry {
bool attr_mod_add(struct attr_mod_entry *pmod);
bool use_outer_shared(void);
+bool use_inner_shared(void);
extern int num_attr_mods;
extern struct attr_mod_entry attr_mod_table[MAX_ATTR_MOD_ENTRIES];
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 8aaccf2..cc4a803 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -1524,6 +1524,7 @@ typedef void pgtables_remap(long long offset, unsigned long pgd, void *bdata);
pgtables_remap lpae_pgtables_remap_asm;
int num_attr_mods;
+static const char *defshared_seen;
/* add an entry to the early page table attribute modification list */
bool __init attr_mod_add(struct attr_mod_entry *pmod)
@@ -1547,15 +1548,50 @@ bool __init use_outer_shared(void)
.set_mask = PTE_EXT_OSHARED
};
+ if (defshared_seen) {
+ pr_err("Default Sharing already set to %s\n", defshared_seen);
+ return false;
+ }
+
if (attr_mod_add(&mod) >= 0) {
l_pte_shared = PTE_EXT_OSHARED;
pmd_sect_s = PMD_SECT_OSHARED;
+ defshared_seen = "outer";
return true;
}
return false;
}
+/* explicitly use inner shared */
+bool __init use_inner_shared(void)
+{
+ if (defshared_seen) {
+ pr_err("Default Sharing already set to %s\n", defshared_seen);
+ return false;
+ }
+
+ defshared_seen = "inner";
+ return true;
+}
+
+/*
+ * Allow sharing type to be set
+ */
+static int __init early_defshared(char *p)
+{
+ if (strcmp(p, "outer") == 0)
+ use_outer_shared();
+ else if (strcmp(p, "inner") == 0)
+ use_inner_shared();
+ else
+ pr_err("Unknown defshared mode %s\n", p);
+
+ return 0;
+}
+
+early_param("defshared", early_defshared);
+
/*
* early_paging_init() recreates boot time page table setup, allowing machines
* to switch over to a high (>4G) address space on LPAE systems
--
1.9.1
next prev parent reply other threads:[~2016-06-06 3:22 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 3:20 [RFC v2 0/4] ARM LPAE Outer Shared v2 Bill Mills
2016-06-06 3:20 ` [RFC v2 1/4] ARM: mm: add early page table attribute modification ability Bill Mills
2016-06-06 12:18 ` Russell King - ARM Linux
2016-06-06 12:31 ` William Mills
2016-06-06 3:20 ` [RFC v2 2/4] ARM: mm: Add LPAE support for outer shared Bill Mills
2016-06-06 3:20 ` Bill Mills [this message]
2016-06-06 3:20 ` [RFC v2 4/4] ARM: keystone: dma-coherent with safe fallback Bill Mills
2016-06-06 8:56 ` Mark Rutland
2016-06-06 9:09 ` Arnd Bergmann
2016-06-06 11:42 ` Mark Rutland
2016-06-06 12:37 ` Arnd Bergmann
2016-06-06 12:50 ` William Mills
2016-06-06 16:18 ` Santosh Shilimkar
2016-06-06 11:43 ` Russell King - ARM Linux
2016-06-06 11:59 ` Mark Rutland
2016-06-06 12:19 ` William Mills
2016-06-06 12:32 ` Russell King - ARM Linux
2016-06-06 16:28 ` Santosh Shilimkar
2016-06-07 10:01 ` Mark Rutland
2016-06-07 12:32 ` Russell King - ARM Linux
2016-06-07 12:55 ` Mark Rutland
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=1465183229-24147-4-git-send-email-wmills@ti.com \
--to=wmills@ti.com \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=r-woodruff2@ti.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=ssantosh@kernel.org \
--cc=t-kristo@ti.com \
/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®