* Re: [PATCH] x86, powerpc : pkey-mprotect must allow pkey-0
From: Dave Hansen @ 2018-03-10 6:50 UTC (permalink / raw)
To: Ram Pai
Cc: mpe, mingo, akpm, linuxppc-dev, linux-mm, x86, linux-arch,
linux-kernel, benh, paulus, khandual, aneesh.kumar, bsingharora,
hbabu, mhocko, bauerman, ebiederm, corbet, arnd, fweimer,
msuchanek, Ulrich.Weigand
In-Reply-To: <20180310055544.GU1060@ram.oc3035372033.ibm.com>
On 03/09/2018 09:55 PM, Ram Pai wrote:
> On Fri, Mar 09, 2018 at 02:40:32PM -0800, Dave Hansen wrote:
>> On 03/09/2018 12:12 AM, Ram Pai wrote:
>>> Once an address range is associated with an allocated pkey, it cannot be
>>> reverted back to key-0. There is no valid reason for the above behavior. On
>>> the contrary applications need the ability to do so.
>> Why don't we just set pkey 0 to be allocated in the allocation bitmap by
>> default?
> ok. that will make it allocatable. But it will not be associatable,
> given the bug in the current code. And what will be the
> default key associated with a pte? zero? or something else?
I'm just saying that I think we should try to keep from making it
special as much as possible.
Let's fix the bug that keeps it from being associatable.
^ permalink raw reply
* Re: [PATCH] x86, powerpc : pkey-mprotect must allow pkey-0
From: Ram Pai @ 2018-03-10 5:55 UTC (permalink / raw)
To: Dave Hansen
Cc: mpe, mingo, akpm, linuxppc-dev, linux-mm, x86, linux-arch,
linux-kernel, benh, paulus, khandual, aneesh.kumar, bsingharora,
hbabu, mhocko, bauerman, ebiederm, corbet, arnd, fweimer,
msuchanek, Ulrich.Weigand
In-Reply-To: <60886e4a-59d4-541a-a6af-d4504e6719ad@intel.com>
On Fri, Mar 09, 2018 at 02:40:32PM -0800, Dave Hansen wrote:
> On 03/09/2018 12:12 AM, Ram Pai wrote:
> > Once an address range is associated with an allocated pkey, it cannot be
> > reverted back to key-0. There is no valid reason for the above behavior. On
> > the contrary applications need the ability to do so.
>
> Why don't we just set pkey 0 to be allocated in the allocation bitmap by
> default?
ok. that will make it allocatable. But it will not be associatable,
given the bug in the current code. And what will be the
default key associated with a pte? zero? or something else?
>
> We *could* also just not let it be special and let it be freed. An app
> could theoretically be careful and make sure nothing is using it.
unable to see how this solves the problem. Need some more explaination.
RP
^ permalink raw reply
* Re: [PATCH 4.14 1/4] powerpc/mm/slice: Remove intermediate bitmap copy
From: Greg Kroah-Hartman @ 2018-03-10 0:10 UTC (permalink / raw)
To: Christophe Leroy; +Cc: stable, linux-kernel, linuxppc-dev
In-Reply-To: <69684e92a32d00c491540e8adfa34fcb50c36244.1520468013.git.christophe.leroy@c-s.fr>
On Fri, Mar 09, 2018 at 04:48:59PM +0100, Christophe Leroy wrote:
> Upstream 326691ad4f179e6edc7eb1271e618dd673e4736d
There is no such git commit id in Linus's tree :(
Please fix up and resend the series.
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH] x86, powerpc : pkey-mprotect must allow pkey-0
From: Dave Hansen @ 2018-03-09 22:40 UTC (permalink / raw)
To: Ram Pai, mpe, mingo, akpm
Cc: linuxppc-dev, linux-mm, x86, linux-arch, linux-kernel, benh,
paulus, khandual, aneesh.kumar, bsingharora, hbabu, mhocko,
bauerman, ebiederm, corbet, arnd, fweimer, msuchanek,
Ulrich.Weigand
In-Reply-To: <1520583161-11741-1-git-send-email-linuxram@us.ibm.com>
On 03/09/2018 12:12 AM, Ram Pai wrote:
> Once an address range is associated with an allocated pkey, it cannot be
> reverted back to key-0. There is no valid reason for the above behavior. On
> the contrary applications need the ability to do so.
Why don't we just set pkey 0 to be allocated in the allocation bitmap by
default?
We *could* also just not let it be special and let it be freed. An app
could theoretically be careful and make sure nothing is using it.
^ permalink raw reply
* [PATCH v2] powerpc/64: Fix section mismatch warnings for early boot symbols
From: Mauricio Faria de Oliveira @ 2018-03-09 21:34 UTC (permalink / raw)
To: linux-kernel, mpe, jeyu; +Cc: npiggin, linuxppc-dev
In-Reply-To: <1520628111-1361-1-git-send-email-mauricfo@linux.vnet.ibm.com>
Some of the boot code located at the start of kernel text is "init"
class, in that it only runs at boot time, however marking it as normal
init code is problematic because that puts it into a different section
located at the very end of kernel text.
e.g., in case the TOC is not set up, we may not be able to tolerate a
branch trampoline to reach the init function.
Credits: code and message are based on 2016 patch by Nicholas Piggin,
and slightly modified so not to rename the powerpc code/symbol names.
Subject: [PATCH] powerpc/64: quieten section mismatch warnings
From: Nicholas Piggin <npiggin at gmail.com>
Date: Fri Dec 23 00:14:19 AEDT 2016
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
---
v2: fix missing close parenthesis in conditional (wrong patch file, sorry)
scripts/mod/modpost.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 9917f92..c65d5e2 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1174,8 +1174,15 @@ static const struct sectioncheck *section_mismatch(
* fromsec = text section
* refsymname = *.constprop.*
*
+ * Pattern 6:
+ * powerpc64 has boot functions that reference init, but must remain in text.
+ * This pattern is identified by
+ * tosec = init section
+ * fromsym = <function list>
+ *
**/
-static int secref_whitelist(const struct sectioncheck *mismatch,
+static int secref_whitelist(const struct elf_info *elf,
+ const struct sectioncheck *mismatch,
const char *fromsec, const char *fromsym,
const char *tosec, const char *tosym)
{
@@ -1212,6 +1219,17 @@ static int secref_whitelist(const struct sectioncheck *mismatch,
match(fromsym, optim_symbols))
return 0;
+ /* Check for pattern 6 */
+ if (elf->hdr->e_machine == EM_PPC64)
+ if (match(tosec, init_sections) &&
+ (!strncmp(fromsym, "__boot_from_prom",
+ strlen("__boot_from_prom")) ||
+ !strncmp(fromsym, "start_here_multiplatform",
+ strlen("start_here_multiplatform")) ||
+ !strncmp(fromsym, "start_here_common",
+ strlen("start_here_common"))))
+ return 0;
+
return 1;
}
@@ -1552,7 +1570,7 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf,
tosym = sym_name(elf, to);
/* check whitelist - we may ignore it */
- if (secref_whitelist(mismatch,
+ if (secref_whitelist(elf, mismatch,
fromsec, fromsym, tosec, tosym)) {
report_sec_mismatch(modname, mismatch,
fromsec, r->r_offset, fromsym,
--
1.8.3.1
^ permalink raw reply related
* [PATCH] powerpc/mm: Fix section mismatch warning in stop_machine_change_mapping()
From: Mauricio Faria de Oliveira @ 2018-03-09 20:45 UTC (permalink / raw)
To: linuxppc-dev, mpe; +Cc: bsingharora, aneesh.kumar, npiggin
Fix the warning messages for stop_machine_change_mapping(), and a number
of other affected functions in its call chain.
All modified functions are under CONFIG_MEMORY_HOTPLUG, so __meminit
is okay (keeps them / does not discard them).
Boot-tested on powernv/power9/radix-mmu and pseries/power8/hash-mmu.
$ make -j$(nproc) CONFIG_DEBUG_SECTION_MISMATCH=y vmlinux
...
MODPOST vmlinux.o
WARNING: vmlinux.o(.text+0x6b130): Section mismatch in reference from the function stop_machine_change_mapping() to the function .meminit.text:create_physical_mapping()
The function stop_machine_change_mapping() references
the function __meminit create_physical_mapping().
This is often because stop_machine_change_mapping lacks a __meminit
annotation or the annotation of create_physical_mapping is wrong.
WARNING: vmlinux.o(.text+0x6b13c): Section mismatch in reference from the function stop_machine_change_mapping() to the function .meminit.text:create_physical_mapping()
The function stop_machine_change_mapping() references
the function __meminit create_physical_mapping().
This is often because stop_machine_change_mapping lacks a __meminit
annotation or the annotation of create_physical_mapping is wrong.
...
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
---
arch/powerpc/mm/mem.c | 4 ++--
arch/powerpc/mm/pgtable-book3s64.c | 4 ++--
arch/powerpc/mm/pgtable-radix.c | 12 ++++++------
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index fe8c611..85245ef 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -127,7 +127,7 @@ int __weak remove_section_mapping(unsigned long start, unsigned long end)
return -ENODEV;
}
-int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
+int __meminit arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
bool want_memblock)
{
unsigned long start_pfn = start >> PAGE_SHIFT;
@@ -148,7 +148,7 @@ int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
}
#ifdef CONFIG_MEMORY_HOTREMOVE
-int arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
+int __meminit arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
{
unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long nr_pages = size >> PAGE_SHIFT;
diff --git a/arch/powerpc/mm/pgtable-book3s64.c b/arch/powerpc/mm/pgtable-book3s64.c
index 422e802..bd6ca74 100644
--- a/arch/powerpc/mm/pgtable-book3s64.c
+++ b/arch/powerpc/mm/pgtable-book3s64.c
@@ -155,7 +155,7 @@ void mmu_cleanup_all(void)
}
#ifdef CONFIG_MEMORY_HOTPLUG
-int create_section_mapping(unsigned long start, unsigned long end)
+int __meminit create_section_mapping(unsigned long start, unsigned long end)
{
if (radix_enabled())
return radix__create_section_mapping(start, end);
@@ -163,7 +163,7 @@ int create_section_mapping(unsigned long start, unsigned long end)
return hash__create_section_mapping(start, end);
}
-int remove_section_mapping(unsigned long start, unsigned long end)
+int __meminit remove_section_mapping(unsigned long start, unsigned long end)
{
if (radix_enabled())
return radix__remove_section_mapping(start, end);
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index 2e10a96..ab9db0a 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -695,7 +695,7 @@ struct change_mapping_params {
unsigned long aligned_end;
};
-static int stop_machine_change_mapping(void *data)
+static int __meminit stop_machine_change_mapping(void *data)
{
struct change_mapping_params *params =
(struct change_mapping_params *)data;
@@ -742,7 +742,7 @@ static void remove_pte_table(pte_t *pte_start, unsigned long addr,
/*
* clear the pte and potentially split the mapping helper
*/
-static void split_kernel_mapping(unsigned long addr, unsigned long end,
+static void __meminit split_kernel_mapping(unsigned long addr, unsigned long end,
unsigned long size, pte_t *pte)
{
unsigned long mask = ~(size - 1);
@@ -835,7 +835,7 @@ static void remove_pud_table(pud_t *pud_start, unsigned long addr,
}
}
-static void remove_pagetable(unsigned long start, unsigned long end)
+static void __meminit remove_pagetable(unsigned long start, unsigned long end)
{
unsigned long addr, next;
pud_t *pud_base;
@@ -863,12 +863,12 @@ static void remove_pagetable(unsigned long start, unsigned long end)
radix__flush_tlb_kernel_range(start, end);
}
-int __ref radix__create_section_mapping(unsigned long start, unsigned long end)
+int __meminit radix__create_section_mapping(unsigned long start, unsigned long end)
{
return create_physical_mapping(start, end);
}
-int radix__remove_section_mapping(unsigned long start, unsigned long end)
+int __meminit radix__remove_section_mapping(unsigned long start, unsigned long end)
{
remove_pagetable(start, end);
return 0;
@@ -888,7 +888,7 @@ int __meminit radix__vmemmap_create_mapping(unsigned long start,
}
#ifdef CONFIG_MEMORY_HOTPLUG
-void radix__vmemmap_remove_mapping(unsigned long start, unsigned long page_size)
+void __meminit radix__vmemmap_remove_mapping(unsigned long start, unsigned long page_size)
{
remove_pagetable(start, start + page_size);
}
--
1.8.3.1
^ permalink raw reply related
* [PATCH] powerpc/64: Fix section mismatch warnings for early boot symbols
From: Mauricio Faria de Oliveira @ 2018-03-09 20:41 UTC (permalink / raw)
To: linux-kernel, mpe, jeyu; +Cc: npiggin, linuxppc-dev
Some of the boot code located at the start of kernel text is "init"
class, in that it only runs at boot time, however marking it as normal
init code is problematic because that puts it into a different section
located at the very end of kernel text.
e.g., in case the TOC is not set up, we may not be able to tolerate a
branch trampoline to reach the init function.
Credits: code and message are based on 2016 patch by Nicholas Piggin,
and slightly modified so not to rename the powerpc code/symbol names.
Subject: [PATCH] powerpc/64: quieten section mismatch warnings
From: Nicholas Piggin <npiggin at gmail.com>
Date: Fri Dec 23 00:14:19 AEDT 2016
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
---
scripts/mod/modpost.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 9917f92..c65d5e2 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1174,8 +1174,15 @@ static const struct sectioncheck *section_mismatch(
* fromsec = text section
* refsymname = *.constprop.*
*
+ * Pattern 6:
+ * powerpc64 has boot functions that reference init, but must remain in text.
+ * This pattern is identified by
+ * tosec = init section
+ * fromsym = <function list>
+ *
**/
-static int secref_whitelist(const struct sectioncheck *mismatch,
+static int secref_whitelist(const struct elf_info *elf,
+ const struct sectioncheck *mismatch,
const char *fromsec, const char *fromsym,
const char *tosec, const char *tosym)
{
@@ -1212,6 +1219,17 @@ static int secref_whitelist(const struct sectioncheck *mismatch,
match(fromsym, optim_symbols))
return 0;
+ /* Check for pattern 6 */
+ if (elf->hdr->e_machine == EM_PPC64)
+ if (match(tosec, init_sections) &&
+ (!strncmp(fromsym, "__boot_from_prom",
+ strlen("__boot_from_prom")) ||
+ !strncmp(fromsym, "start_here_multiplatform",
+ strlen("start_here_multiplatform")) ||
+ !strncmp(fromsym, "start_here_common",
+ strlen("start_here_common")))
+ return 0;
+
return 1;
}
@@ -1552,7 +1570,7 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf,
tosym = sym_name(elf, to);
/* check whitelist - we may ignore it */
- if (secref_whitelist(mismatch,
+ if (secref_whitelist(elf, mismatch,
fromsec, fromsym, tosec, tosym)) {
report_sec_mismatch(modname, mismatch,
fromsec, r->r_offset, fromsym,
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH] x86, powerpc : pkey-mprotect must allow pkey-0
From: Ram Pai @ 2018-03-09 20:09 UTC (permalink / raw)
To: Ingo Molnar
Cc: mpe, mingo, akpm, linuxppc-dev, linux-mm, x86, linux-arch,
linux-kernel, dave.hansen, benh, paulus, khandual, aneesh.kumar,
bsingharora, hbabu, mhocko, bauerman, ebiederm, corbet, arnd,
fweimer, msuchanek, Ulrich.Weigand
In-Reply-To: <20180309084332.hk6xt6obghoqokbc@gmail.com>
On Fri, Mar 09, 2018 at 09:43:32AM +0100, Ingo Molnar wrote:
>
> * Ram Pai <linuxram@us.ibm.com> wrote:
>
> > Once an address range is associated with an allocated pkey, it cannot be
> > reverted back to key-0. There is no valid reason for the above behavior. On
> > the contrary applications need the ability to do so.
> >
> > The patch relaxes the restriction.
> >
> > Tested on powerpc and x86_64.
> >
> > cc: Dave Hansen <dave.hansen@intel.com>
> > cc: Michael Ellermen <mpe@ellerman.id.au>
> > cc: Ingo Molnar <mingo@kernel.org>
> > Signed-off-by: Ram Pai <linuxram@us.ibm.com>
> > ---
> > arch/powerpc/include/asm/pkeys.h | 19 ++++++++++++++-----
> > arch/x86/include/asm/pkeys.h | 5 +++--
> > 2 files changed, 17 insertions(+), 7 deletions(-)
> >
> > diff --git a/arch/powerpc/include/asm/pkeys.h b/arch/powerpc/include/asm/pkeys.h
> > index 0409c80..3e8abe4 100644
> > --- a/arch/powerpc/include/asm/pkeys.h
> > +++ b/arch/powerpc/include/asm/pkeys.h
> > @@ -101,10 +101,18 @@ static inline u16 pte_to_pkey_bits(u64 pteflags)
> >
> > static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey)
> > {
> > - /* A reserved key is never considered as 'explicitly allocated' */
> > - return ((pkey < arch_max_pkey()) &&
> > - !__mm_pkey_is_reserved(pkey) &&
> > - __mm_pkey_is_allocated(mm, pkey));
> > + /* pkey 0 is allocated by default. */
> > + if (!pkey)
> > + return true;
> > +
> > + if (pkey < 0 || pkey >= arch_max_pkey())
> > + return false;
> > +
> > + /* reserved keys are never allocated. */
> > + if (__mm_pkey_is_reserved(pkey))
> > + return false;
>
> Please capitalize in comments consistently, i.e.:
ok.
>
> /* Reserved keys are never allocated: */
>
> > +
> > + return(__mm_pkey_is_allocated(mm, pkey));
>
> 'return' is not a function.
right. will fix.
Thanks,
RP
^ permalink raw reply
* Re: [PATCH] x86, powerpc : pkey-mprotect must allow pkey-0
From: Ram Pai @ 2018-03-09 20:06 UTC (permalink / raw)
To: Michael Ellerman
Cc: mingo, akpm, linuxppc-dev, linux-mm, x86, linux-arch,
linux-kernel, dave.hansen, benh, paulus, khandual, aneesh.kumar,
bsingharora, hbabu, mhocko, bauerman, ebiederm, corbet, arnd,
fweimer, msuchanek, Ulrich.Weigand
In-Reply-To: <87lgf1v9di.fsf@concordia.ellerman.id.au>
On Fri, Mar 09, 2018 at 09:19:53PM +1100, Michael Ellerman wrote:
> Ram Pai <linuxram@us.ibm.com> writes:
>=20
> > Once an address range is associated with an allocated pkey, it cannot be
> > reverted back to key-0. There is no valid reason for the above behavior=
=2E On
> > the contrary applications need the ability to do so.
>=20
> Please explain this in much more detail. Is it an ABI change?
Not necessarily an ABI change. older binary applications will continue
to work. It can be considered as a bug-fix.
>=20
> And why did we just notice this?
Yes. this was noticed by an application vendor.
>=20
> > The patch relaxes the restriction.
> >
> > Tested on powerpc and x86_64.
>=20
> Thanks, but please split the patch, one for each arch.
Will do.
RP
^ permalink raw reply
* Re: [PATCH] x86, powerpc : pkey-mprotect must allow pkey-0
From: Ram Pai @ 2018-03-09 20:00 UTC (permalink / raw)
To: Florian Weimer
Cc: mpe, mingo, akpm, linuxppc-dev, linux-mm, x86, linux-arch,
linux-kernel, dave.hansen, benh, paulus, khandual, aneesh.kumar,
bsingharora, hbabu, mhocko, bauerman, ebiederm, corbet, arnd,
msuchanek, Ulrich.Weigand
In-Reply-To: <ec90ed75-2810-bcc3-8439-8dc85a6b46ac@redhat.com>
On Fri, Mar 09, 2018 at 12:04:49PM +0100, Florian Weimer wrote:
> On 03/09/2018 09:12 AM, Ram Pai wrote:
> >Once an address range is associated with an allocated pkey, it cannot be
> >reverted back to key-0. There is no valid reason for the above behavior.
>
> mprotect without a key does not necessarily use key 0, e.g. if
> protection keys are used to emulate page protection flag combination
> which is not directly supported by the hardware.
>
> Therefore, it seems to me that filtering out non-allocated keys is
> the right thing to do.
I am not sure, what you mean. Do you agree with the patch or otherwise?
RP
^ permalink raw reply
* Re: [PATCH] x86, powerpc : pkey-mprotect must allow pkey-0
From: Ram Pai @ 2018-03-09 19:54 UTC (permalink / raw)
To: Balbir Singh
Cc: Michael Ellerman, Ingo Molnar, akpm@linux-foundation.org,
open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), linux-mm,
maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), linux-arch,
linux-kernel@vger.kernel.org, Dave Hansen, Benjamin Herrenschmidt,
Paul Mackerras, Anshuman Khandual, Aneesh Kumar KV,
Haren Myneni/Beaverton/IBM, Michal Hocko, Thiago Jung Bauermann,
Eric W. Biederman, Jonathan Corbet, Arnd Bergmann, fweimer,
msuchanek, Ulrich.Weigand
In-Reply-To: <CAKTCnz=QrNoG0wdTZRJqmYfFOZmq2czZ4x8v1e=ouNx2Y8D6wg@mail.gmail.com>
On Fri, Mar 09, 2018 at 07:37:04PM +1100, Balbir Singh wrote:
> On Fri, Mar 9, 2018 at 7:12 PM, Ram Pai <linuxram@us.ibm.com> wrote:
> > Once an address range is associated with an allocated pkey, it cannot be
> > reverted back to key-0. There is no valid reason for the above behavior. On
> > the contrary applications need the ability to do so.
> >
> > The patch relaxes the restriction.
>
> I looked at the code and my observation was going to be that we need
> to change mm_pkey_is_allocated. I still fail to understand what
> happens if pkey 0 is reserved? What is the default key is it the first
> available key? Assuming 0 is the default key may work and seems to
> work, but I am sure its mostly by accident. It would be nice, if we
> could have a notion of the default key. I don't like the special
> meaning given to key 0 here. Remember on powerpc if 0 is reserved and
> UAMOR/AMOR does not allow modification because it's reserved, setting
> 0 will still fail
The linux pkey API, assumes pkey-0 is the default key. If no key is
explicitly associated with a page, the default key gets associated.
When a default key gets associated with a page, the permissions on the
page are not dictated by the permissions of the default key, but by the
permission of other bits in the pte; i.e _PAGE_RWX.
On powerpc, and AFAICT on x86, neither the hardware nor the hypervisor
reserves key-0. Hence the OS is free to use the key value, the
way it chooses. On Linux we choose to associate key-0 the special status
called default-key.
However I see your point. If some cpu architecture takes away key-0 from
Linux, than implementing the special status for key-0 on that
architecture can become challenging, though not impossible. That
architecture implementation can internally map key-0 value to some other
available key, and associate that key to the page. And offcourse make
sure that the hardware/MMU uses the pte's RWX bits to enforce
permissions, for that key.
--
Ram Pai
^ permalink raw reply
* Re: [PATCH 5/6] dma-mapping: support fsl-mc bus
From: Robin Murphy @ 2018-03-09 18:50 UTC (permalink / raw)
To: Nipun Gupta, Christoph Hellwig
Cc: will.deacon@arm.com, mark.rutland@arm.com,
catalin.marinas@arm.com, iommu@lists.linux-foundation.org,
robh+dt@kernel.org, m.szyprowski@samsung.com,
gregkh@linuxfoundation.org, joro@8bytes.org, Leo Li,
shawnguo@kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linuxppc-dev@lists.ozlabs.org, Bharat Bhushan, stuyoder@gmail.com,
Laurentiu Tudor
In-Reply-To: <HE1PR0401MB2425871215B13AD0EFDCA5C3E6DE0@HE1PR0401MB2425.eurprd04.prod.outlook.com>
On 09/03/18 18:29, Nipun Gupta wrote:
>
>
>> -----Original Message-----
>> From: Christoph Hellwig [mailto:hch@lst.de]
>> Sent: Thursday, March 08, 2018 13:11
>>
>> On Tue, Mar 06, 2018 at 04:41:56AM +0000, Nipun Gupta wrote:
>>> Sorry for asking a trivial question - looking into dma_configure() I see that
>>> PCI is used in the start and the end of the API.
>>> In the end part pci_put_host_bridge_device() is called.
>>> So are two bus callbacks something like 'dma_config_start' &
>> 'dma_config_end'
>>> will be required where the former one will return "dma_dev"?
>>
>> I'd just use dma_configure as the callback.
>
> This would be a decent stuff.
Yes, the PCI version should end up looking a lot like the old
pci_dma_configure() used to, before everything got pulled together.
>> Currently the of_dma_configure and acpi_dma_configure are only used
>> for PCI anyway, as no one else sets a non-NULL dma dev.
>
> My understanding is that even the platform bus uses the of_dma_configure
> and probably acpi_dma_configure too. So platform bus may also need the
> callback implemented. Please correct me if my understanding is wrong.
Indeed, platform and AMBA will want an implementation to dispatch
between {of,acpi}_dma_configre() per the current logic. Host1x doesn't
seem to care about ACPI so probably wants its own just calling
of_dma_configure().
> I will submit the patch with 'dma_configure' callback implemented for
> the busses shortly.
Cheers - I've been trying to find some time to take a look myself, but
having something to review instead would certainly be easier :)
Robin.
^ permalink raw reply
* RE: [PATCH 5/6] dma-mapping: support fsl-mc bus
From: Nipun Gupta @ 2018-03-09 18:29 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Robin Murphy, will.deacon@arm.com, mark.rutland@arm.com,
catalin.marinas@arm.com, iommu@lists.linux-foundation.org,
robh+dt@kernel.org, m.szyprowski@samsung.com,
gregkh@linuxfoundation.org, joro@8bytes.org, Leo Li,
shawnguo@kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linuxppc-dev@lists.ozlabs.org, Bharat Bhushan, stuyoder@gmail.com,
Laurentiu Tudor
In-Reply-To: <20180308074115.GB15748@lst.de>
> -----Original Message-----
> From: Christoph Hellwig [mailto:hch@lst.de]
> Sent: Thursday, March 08, 2018 13:11
>=20
> On Tue, Mar 06, 2018 at 04:41:56AM +0000, Nipun Gupta wrote:
> > Sorry for asking a trivial question - looking into dma_configure() I se=
e that
> > PCI is used in the start and the end of the API.
> > In the end part pci_put_host_bridge_device() is called.
> > So are two bus callbacks something like 'dma_config_start' &
> 'dma_config_end'
> > will be required where the former one will return "dma_dev"?
>=20
> I'd just use dma_configure as the callback.
This would be a decent stuff.
>=20
> Currently the of_dma_configure and acpi_dma_configure are only used
> for PCI anyway, as no one else sets a non-NULL dma dev.
My understanding is that even the platform bus uses the of_dma_configure
and probably acpi_dma_configure too. So platform bus may also need the
callback implemented. Please correct me if my understanding is wrong.
I will submit the patch with 'dma_configure' callback implemented for
the busses shortly.
> For fsl-mc I suspect only of_dma_configure is relevanet, so just call tha=
t directly.
> If at some point we get enough busses with either OF or ACPI we could
> create a helper called from ->dma_configure for that.
Totally agree with this.
Thanks,
Nipun
^ permalink raw reply
* Re: [RFC PATCH 0/6] arm64: untag user pointers passed to the kernel
From: Andrey Konovalov @ 2018-03-09 17:58 UTC (permalink / raw)
To: Robin Murphy
Cc: Catalin Marinas, Will Deacon, Mark Rutland, Al Viro,
Philippe Ombredanne, Greg Kroah-Hartman, Thomas Gleixner,
Kate Stewart, Andrew Morton, Kirill A . Shutemov, Ingo Molnar,
Aneesh Kumar K . V, Minchan Kim, Michal Hocko, Shaohua Li,
Andrea Arcangeli, Anshuman Khandual, Mike Rapoport,
Vlastimil Babka, Naoya Horiguchi, Shakeel Butt, Joonsoo Kim,
Hugh Dickins, Mel Gorman, Jérôme Glisse, Mike Kravetz,
Zi Yan, Linux ARM, LKML, Linux Memory Management List,
Richard Henderson, Ivan Kokshaysky, Matt Turner, Vineet Gupta,
Russell King, Mark Salter, Aurelien Jacquiot, Mikael Starvik,
Jesper Nilsson, Tony Luck, Fenghua Yu, Geert Uytterhoeven,
James Hogan, Michal Simek, Ralf Baechle, David Howells,
Ley Foon Tan, Jonas Bonn, Stefan Kristiansson, Stafford Horne,
James E . J . Bottomley, Helge Deller, Benjamin Herrenschmidt,
Paul Mackerras, Michael Ellerman, Palmer Dabbelt, Albert Ou,
Chen Liqin, Lennox Wu, Yoshinori Sato, Rich Felker,
David S . Miller, Ingo Molnar, the arch/x86 maintainers,
Chris Zankel, Max Filippov, Arnd Bergmann, linux-alpha,
linux-snps-arc, adi-buildroot-devel, linux-c6x-dev,
linux-cris-kernel, linux-ia64, linux-m68k, linux-metag,
linux-mips, linux-am33-list, nios2-dev, openrisc, linux-parisc,
linuxppc-dev, linux-riscv, linux-sh, sparclinux, linux-xtensa,
linux-arch, Dmitry Vyukov, Kostya Serebryany, Evgeniy Stepanov,
Lee Smith, Ramana Radhakrishnan, Jacob Bramley, Ruben Ayrapetyan
In-Reply-To: <963e112a-88a0-94bc-e6eb-0e9f9a6ee14a@arm.com>
On Fri, Mar 9, 2018 at 3:15 PM, Robin Murphy <robin.murphy@arm.com> wrote:
> Hi Andrey,
>
> On 09/03/18 14:01, Andrey Konovalov wrote:
>>
>> arm64 has a feature called Top Byte Ignore, which allows to embed pointer
>> tags into the top byte of each pointer. Userspace programs (such as
>> HWASan, a memory debugging tool [1]) might use this feature and pass
>> tagged user pointers to the kernel through syscalls or other interfaces.
>
>
> If you propose changing the ABI, then
> Documentation/arm64/tagged-pointers.txt needs to reflect the new one, since
> passing nonzero tags via syscalls is currently explicitly forbidden.
>
> Robin.
Hi Robin!
I will include changes to Documentation/arm64/tagged-pointers.txt in
the next version.
Thanks!
^ permalink raw reply
* Re: [PATCH v2] On ppc64le we HAVE_RELIABLE_STACKTRACE
From: Torsten Duwe @ 2018-03-09 16:47 UTC (permalink / raw)
To: Josh Poimboeuf
Cc: Michael Ellerman, Jiri Kosina, linuxppc-dev, linux-kernel,
Nicholas Piggin, live-patching
In-Reply-To: <20180308162616.yhbymodggnfzpskx@treble>
On Thu, 8 Mar 2018 10:26:16 -0600
Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> This doesn't seem to address some of my previous concerns:
You're right. That discussion quickly headed towards objtool
and I forgot about this one paragraph with the remarks.
> - Bailing on interrupt/exception frames
That is a good question. My current code keeps unwinding as long
as the trace looks sane. If the exception frame has a valid code
pointer in the LR slot it will continue. Couldn't there be cases
where this is desirable? Should this be configurable? Not that
I have an idea how this situation could occur for a thread
that is current or sleeping...
Michael, Balbir: is that possible? Any Idea how to reliably detect
an exception frame? My approach would be to look at the next return
address and compare it to the usual suspects (i.e. collect all
"b ret" addresses in the EXCEPTION_COMMON macro, for BookS).
> - Function graph tracing return address conversion
>
> - kretprobes return address conversion
You mean like in arch/x86/kernel/unwind_frame.c the call to
ftrace_graph_ret_addr ?
Forgive me my directness but I don't see why these should be handled in
arch-dependent code, other than maybe a hook, if inevitable, that calls
back into the graph tracer / kretprobes in order to get the proper
address, or simply call the trace unreliable in case it finds such a
return address.
I understand that x86 has a hard time with its multiple unwinders, but
there should be a simpler, generic solution for all other architectures.
Torsten
^ permalink raw reply
* Re: [PATCH 2/2] ppc64le save_stack_trace_tsk_reliable (Was: HAVE_RELIABLE_STACKTRACE)
From: Torsten Duwe @ 2018-03-09 15:54 UTC (permalink / raw)
To: Balbir Singh
Cc: Miroslav Benes, Michael Ellerman, Jiri Kosina, linux-kernel,
linuxppc-dev, live-patching
In-Reply-To: <20180309084333.23287074@gmail.com>
On Fri, 9 Mar 2018 08:43:33 +1100
Balbir Singh <bsingharora@gmail.com> wrote:
> On Tue, 27 Feb 2018 17:09:24 +0100
> Torsten Duwe <duwe@lst.de> wrote:
> > +save_stack_trace_tsk_reliable(struct task_struct *tsk,
> > + struct stack_trace *trace)
>
> Just double checking this is called under the task_rq_lock, so its
> safe to call task_stack_page() as opposed to try_get_task_stack()
Yes. IIRC a comment at the call site mentioned it.
[...]
> > + if (sp < stack_page + sizeof(struct thread_struct)
> > + || sp > stack_page + THREAD_SIZE -
> > STACK_FRAME_OVERHEAD)
> > + return 1;
>
> Some of this is already present in validate_sp(), it also validates
> irq stacks, should we just reuse that?
This goes a bit along one of Josh's points; I'll answer there, OK?
[...]
> Looks good to me otherwise.
>
> Acked-by: Balbir Singh <bsingharora@gmail.com>
Thanks.
Torsten
^ permalink raw reply
* [PATCH 4.14 4/4] powerpc/mm/slice: Fix hugepage allocation at hint address on 8xx
From: Christophe Leroy @ 2018-03-09 15:49 UTC (permalink / raw)
To: stable, Greg Kroah-Hartman; +Cc: linux-kernel, linuxppc-dev
In-Reply-To: <69684e92a32d00c491540e8adfa34fcb50c36244.1520468013.git.christophe.leroy@c-s.fr>
Upstream aa0ab02ba992eb956934b21373e0138211486ddd
On the 8xx, the page size is set in the PMD entry and applies to
all pages of the page table pointed by the said PMD entry.
When an app has some regular pages allocated (e.g. see below) and tries
to mmap() a huge page at a hint address covered by the same PMD entry,
the kernel accepts the hint allthough the 8xx cannot handle different
page sizes in the same PMD entry.
10000000-10001000 r-xp 00000000 00:0f 2597 /root/malloc
10010000-10011000 rwxp 00000000 00:0f 2597 /root/malloc
mmap(0x10080000, 524288, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|0x40000, -1, 0) = 0x10080000
This results the app remaining forever in do_page_fault()/hugetlb_fault()
and when interrupting that app, we get the following warning:
[162980.035629] WARNING: CPU: 0 PID: 2777 at arch/powerpc/mm/hugetlbpage.c:354 hugetlb_free_pgd_range+0xc8/0x1e4
[162980.035699] CPU: 0 PID: 2777 Comm: malloc Tainted: G W 4.14.6 #85
[162980.035744] task: c67e2c00 task.stack: c668e000
[162980.035783] NIP: c000fe18 LR: c00e1eec CTR: c00f90c0
[162980.035830] REGS: c668fc20 TRAP: 0700 Tainted: G W (4.14.6)
[162980.035854] MSR: 00029032 <EE,ME,IR,DR,RI> CR: 24044224 XER: 20000000
[162980.036003]
[162980.036003] GPR00: c00e1eec c668fcd0 c67e2c00 00000010 c6869410 10080000 00000000 77fb4000
[162980.036003] GPR08: ffff0001 0683c001 00000000 ffffff80 44028228 10018a34 00004008 418004fc
[162980.036003] GPR16: c668e000 00040100 c668e000 c06c0000 c668fe78 c668e000 c6835ba0 c668fd48
[162980.036003] GPR24: 00000000 73ffffff 74000000 00000001 77fb4000 100fffff 10100000 10100000
[162980.036743] NIP [c000fe18] hugetlb_free_pgd_range+0xc8/0x1e4
[162980.036839] LR [c00e1eec] free_pgtables+0x12c/0x150
[162980.036861] Call Trace:
[162980.036939] [c668fcd0] [c00f0774] unlink_anon_vmas+0x1c4/0x214 (unreliable)
[162980.037040] [c668fd10] [c00e1eec] free_pgtables+0x12c/0x150
[162980.037118] [c668fd40] [c00eabac] exit_mmap+0xe8/0x1b4
[162980.037210] [c668fda0] [c0019710] mmput.part.9+0x20/0xd8
[162980.037301] [c668fdb0] [c001ecb0] do_exit+0x1f0/0x93c
[162980.037386] [c668fe00] [c001f478] do_group_exit+0x40/0xcc
[162980.037479] [c668fe10] [c002a76c] get_signal+0x47c/0x614
[162980.037570] [c668fe70] [c0007840] do_signal+0x54/0x244
[162980.037654] [c668ff30] [c0007ae8] do_notify_resume+0x34/0x88
[162980.037744] [c668ff40] [c000dae8] do_user_signal+0x74/0xc4
[162980.037781] Instruction dump:
[162980.037821] 7fdff378 81370000 54a3463a 80890020 7d24182e 7c841a14 712a0004 4082ff94
[162980.038014] 2f890000 419e0010 712a0ff0 408200e0 <0fe00000> 54a9000a 7f984840 419d0094
[162980.038216] ---[ end trace c0ceeca8e7a5800a ]---
[162980.038754] BUG: non-zero nr_ptes on freeing mm: 1
[162985.363322] BUG: non-zero nr_ptes on freeing mm: -1
In order to fix this, this patch uses the address space "slices"
implemented for BOOK3S/64 and enhanced to support PPC32 by the
preceding patch.
This patch modifies the context.id on the 8xx to be in the range
[1:16] instead of [0:15] in order to identify context.id == 0 as
not initialised contexts as done on BOOK3S
This patch activates CONFIG_PPC_MM_SLICES when CONFIG_HUGETLB_PAGE is
selected for the 8xx
Alltough we could in theory have as many slices as PMD entries, the
current slices implementation limits the number of low slices to 16.
This limitation is not preventing us to fix the initial issue allthough
it is suboptimal. It will be cured in a subsequent patch.
Fixes: 4b91428699477 ("powerpc/8xx: Implement support of hugepages")
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/include/asm/mmu-8xx.h | 6 ++++++
arch/powerpc/kernel/setup-common.c | 2 ++
arch/powerpc/mm/8xx_mmu.c | 2 +-
arch/powerpc/mm/hugetlbpage.c | 2 ++
arch/powerpc/mm/mmu_context_nohash.c | 18 ++++++++++++++++--
arch/powerpc/platforms/Kconfig.cputype | 1 +
6 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/include/asm/mmu-8xx.h b/arch/powerpc/include/asm/mmu-8xx.h
index 5bb3dbede41a..1325e5b5f680 100644
--- a/arch/powerpc/include/asm/mmu-8xx.h
+++ b/arch/powerpc/include/asm/mmu-8xx.h
@@ -169,6 +169,12 @@ typedef struct {
unsigned int id;
unsigned int active;
unsigned long vdso_base;
+#ifdef CONFIG_PPC_MM_SLICES
+ u16 user_psize; /* page size index */
+ u64 low_slices_psize; /* page size encodings */
+ unsigned char high_slices_psize[0];
+ unsigned long addr_limit;
+#endif
} mm_context_t;
#define PHYS_IMMR_BASE (mfspr(SPRN_IMMR) & 0xfff80000)
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 2e3bc16d02b2..ddf62a690c23 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -899,6 +899,8 @@ void __init setup_arch(char **cmdline_p)
#ifdef CONFIG_PPC_MM_SLICES
#ifdef CONFIG_PPC64
init_mm.context.addr_limit = DEFAULT_MAP_WINDOW_USER64;
+#elif defined(CONFIG_PPC_8xx)
+ init_mm.context.addr_limit = DEFAULT_MAP_WINDOW;
#else
#error "context.addr_limit not initialized."
#endif
diff --git a/arch/powerpc/mm/8xx_mmu.c b/arch/powerpc/mm/8xx_mmu.c
index f29212e40f40..0be77709446c 100644
--- a/arch/powerpc/mm/8xx_mmu.c
+++ b/arch/powerpc/mm/8xx_mmu.c
@@ -192,7 +192,7 @@ void set_context(unsigned long id, pgd_t *pgd)
mtspr(SPRN_M_TW, __pa(pgd) - offset);
/* Update context */
- mtspr(SPRN_M_CASID, id);
+ mtspr(SPRN_M_CASID, id - 1);
/* sync */
mb();
}
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 1571a498a33f..4c9e5f9c7a44 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -552,9 +552,11 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
struct hstate *hstate = hstate_file(file);
int mmu_psize = shift_to_mmu_psize(huge_page_shift(hstate));
+#ifdef CONFIG_PPC_RADIX_MMU
if (radix_enabled())
return radix__hugetlb_get_unmapped_area(file, addr, len,
pgoff, flags);
+#endif
return slice_get_unmapped_area(addr, len, flags, mmu_psize, 1);
}
#endif
diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c
index 4554d6527682..e2b28b3a512e 100644
--- a/arch/powerpc/mm/mmu_context_nohash.c
+++ b/arch/powerpc/mm/mmu_context_nohash.c
@@ -331,6 +331,20 @@ int init_new_context(struct task_struct *t, struct mm_struct *mm)
{
pr_hard("initing context for mm @%p\n", mm);
+#ifdef CONFIG_PPC_MM_SLICES
+ if (!mm->context.addr_limit)
+ mm->context.addr_limit = DEFAULT_MAP_WINDOW;
+
+ /*
+ * We have MMU_NO_CONTEXT set to be ~0. Hence check
+ * explicitly against context.id == 0. This ensures that we properly
+ * initialize context slice details for newly allocated mm's (which will
+ * have id == 0) and don't alter context slice inherited via fork (which
+ * will have id != 0).
+ */
+ if (mm->context.id == 0)
+ slice_set_user_psize(mm, mmu_virtual_psize);
+#endif
mm->context.id = MMU_NO_CONTEXT;
mm->context.active = 0;
return 0;
@@ -428,8 +442,8 @@ void __init mmu_context_init(void)
* -- BenH
*/
if (mmu_has_feature(MMU_FTR_TYPE_8xx)) {
- first_context = 0;
- last_context = 15;
+ first_context = 1;
+ last_context = 16;
no_selective_tlbil = true;
} else if (mmu_has_feature(MMU_FTR_TYPE_47x)) {
first_context = 1;
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index a78f255111f2..3ce376b42330 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -325,6 +325,7 @@ config PPC_BOOK3E_MMU
config PPC_MM_SLICES
bool
default y if PPC_STD_MMU_64
+ default y if PPC_8xx && HUGETLB_PAGE
default n
config PPC_HAVE_PMU_SUPPORT
--
2.13.3
^ permalink raw reply related
* [PATCH 4.14 3/4] powerpc/mm/slice: Enhance for supporting PPC32
From: Christophe Leroy @ 2018-03-09 15:49 UTC (permalink / raw)
To: stable, Greg Kroah-Hartman; +Cc: linux-kernel, linuxppc-dev
In-Reply-To: <69684e92a32d00c491540e8adfa34fcb50c36244.1520468013.git.christophe.leroy@c-s.fr>
Upstream db3a528db41caaa6dfd4c64e9f5efb1c81a80467
In preparation for the following patch which will fix an issue on
the 8xx by re-using the 'slices', this patch enhances the
'slices' implementation to support 32 bits CPUs.
On PPC32, the address space is limited to 4Gbytes, hence only the low
slices will be used.
The high slices use bitmaps. As bitmap functions are not prepared to
handle bitmaps of size 0, this patch ensures that bitmap functions
are called only when SLICE_NUM_HIGH is not nul.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/include/asm/nohash/32/slice.h | 18 +++++++++++++++
arch/powerpc/include/asm/slice.h | 4 +++-
arch/powerpc/mm/slice.c | 37 +++++++++++++++++++++++-------
3 files changed, 50 insertions(+), 9 deletions(-)
create mode 100644 arch/powerpc/include/asm/nohash/32/slice.h
diff --git a/arch/powerpc/include/asm/nohash/32/slice.h b/arch/powerpc/include/asm/nohash/32/slice.h
new file mode 100644
index 000000000000..95d532e18092
--- /dev/null
+++ b/arch/powerpc/include/asm/nohash/32/slice.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_POWERPC_NOHASH_32_SLICE_H
+#define _ASM_POWERPC_NOHASH_32_SLICE_H
+
+#ifdef CONFIG_PPC_MM_SLICES
+
+#define SLICE_LOW_SHIFT 28
+#define SLICE_LOW_TOP (0x100000000ull)
+#define SLICE_NUM_LOW (SLICE_LOW_TOP >> SLICE_LOW_SHIFT)
+#define GET_LOW_SLICE_INDEX(addr) ((addr) >> SLICE_LOW_SHIFT)
+
+#define SLICE_HIGH_SHIFT 0
+#define SLICE_NUM_HIGH 0ul
+#define GET_HIGH_SLICE_INDEX(addr) (addr & 0)
+
+#endif /* CONFIG_PPC_MM_SLICES */
+
+#endif /* _ASM_POWERPC_NOHASH_32_SLICE_H */
diff --git a/arch/powerpc/include/asm/slice.h b/arch/powerpc/include/asm/slice.h
index 17c5a5d8c418..172711fadb1c 100644
--- a/arch/powerpc/include/asm/slice.h
+++ b/arch/powerpc/include/asm/slice.h
@@ -4,8 +4,10 @@
#ifdef CONFIG_PPC_BOOK3S_64
#include <asm/book3s/64/slice.h>
-#else
+#elif defined(CONFIG_PPC64)
#include <asm/nohash/64/slice.h>
+#elif defined(CONFIG_PPC_MMU_NOHASH)
+#include <asm/nohash/32/slice.h>
#endif
#ifdef CONFIG_PPC_MM_SLICES
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index a7ac600f71c6..5b2d392a1a5e 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -73,10 +73,12 @@ static void slice_range_to_mask(unsigned long start, unsigned long len,
unsigned long end = start + len - 1;
ret->low_slices = 0;
- bitmap_zero(ret->high_slices, SLICE_NUM_HIGH);
+ if (SLICE_NUM_HIGH)
+ bitmap_zero(ret->high_slices, SLICE_NUM_HIGH);
if (start < SLICE_LOW_TOP) {
- unsigned long mend = min(end, (SLICE_LOW_TOP - 1));
+ unsigned long mend = min(end,
+ (unsigned long)(SLICE_LOW_TOP - 1));
ret->low_slices = (1u << (GET_LOW_SLICE_INDEX(mend) + 1))
- (1u << GET_LOW_SLICE_INDEX(start));
@@ -113,11 +115,13 @@ static int slice_high_has_vma(struct mm_struct *mm, unsigned long slice)
unsigned long start = slice << SLICE_HIGH_SHIFT;
unsigned long end = start + (1ul << SLICE_HIGH_SHIFT);
+#ifdef CONFIG_PPC64
/* Hack, so that each addresses is controlled by exactly one
* of the high or low area bitmaps, the first high area starts
* at 4GB, not 0 */
if (start == 0)
start = SLICE_LOW_TOP;
+#endif
return !slice_area_is_free(mm, start, end - start);
}
@@ -127,7 +131,8 @@ static void slice_mask_for_free(struct mm_struct *mm, struct slice_mask *ret)
unsigned long i;
ret->low_slices = 0;
- bitmap_zero(ret->high_slices, SLICE_NUM_HIGH);
+ if (SLICE_NUM_HIGH)
+ bitmap_zero(ret->high_slices, SLICE_NUM_HIGH);
for (i = 0; i < SLICE_NUM_LOW; i++)
if (!slice_low_has_vma(mm, i))
@@ -149,7 +154,8 @@ static void slice_mask_for_size(struct mm_struct *mm, int psize, struct slice_ma
u64 lpsizes;
ret->low_slices = 0;
- bitmap_zero(ret->high_slices, SLICE_NUM_HIGH);
+ if (SLICE_NUM_HIGH)
+ bitmap_zero(ret->high_slices, SLICE_NUM_HIGH);
lpsizes = mm->context.low_slices_psize;
for (i = 0; i < SLICE_NUM_LOW; i++)
@@ -171,6 +177,10 @@ static int slice_check_fit(struct mm_struct *mm,
DECLARE_BITMAP(result, SLICE_NUM_HIGH);
unsigned long slice_count = GET_HIGH_SLICE_INDEX(mm->context.addr_limit);
+ if (!SLICE_NUM_HIGH)
+ return (mask.low_slices & available.low_slices) ==
+ mask.low_slices;
+
bitmap_and(result, mask.high_slices,
available.high_slices, slice_count);
@@ -180,6 +190,7 @@ static int slice_check_fit(struct mm_struct *mm,
static void slice_flush_segments(void *parm)
{
+#ifdef CONFIG_PPC64
struct mm_struct *mm = parm;
unsigned long flags;
@@ -191,6 +202,7 @@ static void slice_flush_segments(void *parm)
local_irq_save(flags);
slb_flush_and_rebolt();
local_irq_restore(flags);
+#endif
}
static void slice_convert(struct mm_struct *mm, struct slice_mask mask, int psize)
@@ -380,6 +392,8 @@ static unsigned long slice_find_area(struct mm_struct *mm, unsigned long len,
static inline void slice_or_mask(struct slice_mask *dst, struct slice_mask *src)
{
dst->low_slices |= src->low_slices;
+ if (!SLICE_NUM_HIGH)
+ return;
bitmap_or(dst->high_slices, dst->high_slices, src->high_slices,
SLICE_NUM_HIGH);
}
@@ -388,6 +402,8 @@ static inline void slice_andnot_mask(struct slice_mask *dst, struct slice_mask *
{
dst->low_slices &= ~src->low_slices;
+ if (!SLICE_NUM_HIGH)
+ return;
bitmap_andnot(dst->high_slices, dst->high_slices, src->high_slices,
SLICE_NUM_HIGH);
}
@@ -431,14 +447,17 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
* init different masks
*/
mask.low_slices = 0;
- bitmap_zero(mask.high_slices, SLICE_NUM_HIGH);
/* silence stupid warning */;
potential_mask.low_slices = 0;
- bitmap_zero(potential_mask.high_slices, SLICE_NUM_HIGH);
compat_mask.low_slices = 0;
- bitmap_zero(compat_mask.high_slices, SLICE_NUM_HIGH);
+
+ if (SLICE_NUM_HIGH) {
+ bitmap_zero(mask.high_slices, SLICE_NUM_HIGH);
+ bitmap_zero(potential_mask.high_slices, SLICE_NUM_HIGH);
+ bitmap_zero(compat_mask.high_slices, SLICE_NUM_HIGH);
+ }
/* Sanity checks */
BUG_ON(mm->task_size == 0);
@@ -584,7 +603,9 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
convert:
slice_andnot_mask(&mask, &good_mask);
slice_andnot_mask(&mask, &compat_mask);
- if (mask.low_slices || !bitmap_empty(mask.high_slices, SLICE_NUM_HIGH)) {
+ if (mask.low_slices ||
+ (SLICE_NUM_HIGH &&
+ !bitmap_empty(mask.high_slices, SLICE_NUM_HIGH))) {
slice_convert(mm, mask, psize);
if (psize > MMU_PAGE_BASE)
on_each_cpu(slice_flush_segments, mm, 1);
--
2.13.3
^ permalink raw reply related
* [PATCH 4.14 2/4] powerpc/mm/slice: create header files dedicated to slices
From: Christophe Leroy @ 2018-03-09 15:49 UTC (permalink / raw)
To: stable, Greg Kroah-Hartman; +Cc: linux-kernel, linuxppc-dev
In-Reply-To: <69684e92a32d00c491540e8adfa34fcb50c36244.1520468013.git.christophe.leroy@c-s.fr>
Upstream a3286f05bc5a5bc7fc73a9783ec89de78fcd07f8
In preparation for the following patch which will enhance 'slices'
for supporting PPC32 in order to fix an issue on hugepages on 8xx,
this patch takes out of page*.h all bits related to 'slices' and put
them into newly created slice.h header files.
While common parts go into asm/slice.h, subarch specific
parts go into respective books3s/64/slice.c and nohash/64/slice.c
'slices'
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/include/asm/book3s/64/slice.h | 27 ++++++++++++++
arch/powerpc/include/asm/nohash/64/slice.h | 12 ++++++
arch/powerpc/include/asm/page.h | 1 +
arch/powerpc/include/asm/page_64.h | 59 ------------------------------
arch/powerpc/include/asm/slice.h | 40 ++++++++++++++++++++
5 files changed, 80 insertions(+), 59 deletions(-)
create mode 100644 arch/powerpc/include/asm/book3s/64/slice.h
create mode 100644 arch/powerpc/include/asm/nohash/64/slice.h
create mode 100644 arch/powerpc/include/asm/slice.h
diff --git a/arch/powerpc/include/asm/book3s/64/slice.h b/arch/powerpc/include/asm/book3s/64/slice.h
new file mode 100644
index 000000000000..db0dedab65ee
--- /dev/null
+++ b/arch/powerpc/include/asm/book3s/64/slice.h
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_POWERPC_BOOK3S_64_SLICE_H
+#define _ASM_POWERPC_BOOK3S_64_SLICE_H
+
+#ifdef CONFIG_PPC_MM_SLICES
+
+#define SLICE_LOW_SHIFT 28
+#define SLICE_LOW_TOP (0x100000000ul)
+#define SLICE_NUM_LOW (SLICE_LOW_TOP >> SLICE_LOW_SHIFT)
+#define GET_LOW_SLICE_INDEX(addr) ((addr) >> SLICE_LOW_SHIFT)
+
+#define SLICE_HIGH_SHIFT 40
+#define SLICE_NUM_HIGH (H_PGTABLE_RANGE >> SLICE_HIGH_SHIFT)
+#define GET_HIGH_SLICE_INDEX(addr) ((addr) >> SLICE_HIGH_SHIFT)
+
+#else /* CONFIG_PPC_MM_SLICES */
+
+#define get_slice_psize(mm, addr) ((mm)->context.user_psize)
+#define slice_set_user_psize(mm, psize) \
+do { \
+ (mm)->context.user_psize = (psize); \
+ (mm)->context.sllp = SLB_VSID_USER | mmu_psize_defs[(psize)].sllp; \
+} while (0)
+
+#endif /* CONFIG_PPC_MM_SLICES */
+
+#endif /* _ASM_POWERPC_BOOK3S_64_SLICE_H */
diff --git a/arch/powerpc/include/asm/nohash/64/slice.h b/arch/powerpc/include/asm/nohash/64/slice.h
new file mode 100644
index 000000000000..ad0d6e3cc1c5
--- /dev/null
+++ b/arch/powerpc/include/asm/nohash/64/slice.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_POWERPC_NOHASH_64_SLICE_H
+#define _ASM_POWERPC_NOHASH_64_SLICE_H
+
+#ifdef CONFIG_PPC_64K_PAGES
+#define get_slice_psize(mm, addr) MMU_PAGE_64K
+#else /* CONFIG_PPC_64K_PAGES */
+#define get_slice_psize(mm, addr) MMU_PAGE_4K
+#endif /* !CONFIG_PPC_64K_PAGES */
+#define slice_set_user_psize(mm, psize) do { BUG(); } while (0)
+
+#endif /* _ASM_POWERPC_NOHASH_64_SLICE_H */
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 8da5d4c1cab2..d5f1c41b7dba 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -344,5 +344,6 @@ typedef struct page *pgtable_t;
#include <asm-generic/memory_model.h>
#endif /* __ASSEMBLY__ */
+#include <asm/slice.h>
#endif /* _ASM_POWERPC_PAGE_H */
diff --git a/arch/powerpc/include/asm/page_64.h b/arch/powerpc/include/asm/page_64.h
index c4d9654bd637..af04acdb873f 100644
--- a/arch/powerpc/include/asm/page_64.h
+++ b/arch/powerpc/include/asm/page_64.h
@@ -86,65 +86,6 @@ extern u64 ppc64_pft_size;
#endif /* __ASSEMBLY__ */
-#ifdef CONFIG_PPC_MM_SLICES
-
-#define SLICE_LOW_SHIFT 28
-#define SLICE_HIGH_SHIFT 40
-
-#define SLICE_LOW_TOP (0x100000000ul)
-#define SLICE_NUM_LOW (SLICE_LOW_TOP >> SLICE_LOW_SHIFT)
-#define SLICE_NUM_HIGH (H_PGTABLE_RANGE >> SLICE_HIGH_SHIFT)
-
-#define GET_LOW_SLICE_INDEX(addr) ((addr) >> SLICE_LOW_SHIFT)
-#define GET_HIGH_SLICE_INDEX(addr) ((addr) >> SLICE_HIGH_SHIFT)
-
-#ifndef __ASSEMBLY__
-struct mm_struct;
-
-extern unsigned long slice_get_unmapped_area(unsigned long addr,
- unsigned long len,
- unsigned long flags,
- unsigned int psize,
- int topdown);
-
-extern unsigned int get_slice_psize(struct mm_struct *mm,
- unsigned long addr);
-
-extern void slice_set_user_psize(struct mm_struct *mm, unsigned int psize);
-extern void slice_set_range_psize(struct mm_struct *mm, unsigned long start,
- unsigned long len, unsigned int psize);
-
-#endif /* __ASSEMBLY__ */
-#else
-#define slice_init()
-#ifdef CONFIG_PPC_STD_MMU_64
-#define get_slice_psize(mm, addr) ((mm)->context.user_psize)
-#define slice_set_user_psize(mm, psize) \
-do { \
- (mm)->context.user_psize = (psize); \
- (mm)->context.sllp = SLB_VSID_USER | mmu_psize_defs[(psize)].sllp; \
-} while (0)
-#else /* CONFIG_PPC_STD_MMU_64 */
-#ifdef CONFIG_PPC_64K_PAGES
-#define get_slice_psize(mm, addr) MMU_PAGE_64K
-#else /* CONFIG_PPC_64K_PAGES */
-#define get_slice_psize(mm, addr) MMU_PAGE_4K
-#endif /* !CONFIG_PPC_64K_PAGES */
-#define slice_set_user_psize(mm, psize) do { BUG(); } while(0)
-#endif /* !CONFIG_PPC_STD_MMU_64 */
-
-#define slice_set_range_psize(mm, start, len, psize) \
- slice_set_user_psize((mm), (psize))
-#endif /* CONFIG_PPC_MM_SLICES */
-
-#ifdef CONFIG_HUGETLB_PAGE
-
-#ifdef CONFIG_PPC_MM_SLICES
-#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
-#endif
-
-#endif /* !CONFIG_HUGETLB_PAGE */
-
#define VM_DATA_DEFAULT_FLAGS \
(is_32bit_task() ? \
VM_DATA_DEFAULT_FLAGS32 : VM_DATA_DEFAULT_FLAGS64)
diff --git a/arch/powerpc/include/asm/slice.h b/arch/powerpc/include/asm/slice.h
new file mode 100644
index 000000000000..17c5a5d8c418
--- /dev/null
+++ b/arch/powerpc/include/asm/slice.h
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_POWERPC_SLICE_H
+#define _ASM_POWERPC_SLICE_H
+
+#ifdef CONFIG_PPC_BOOK3S_64
+#include <asm/book3s/64/slice.h>
+#else
+#include <asm/nohash/64/slice.h>
+#endif
+
+#ifdef CONFIG_PPC_MM_SLICES
+
+#ifdef CONFIG_HUGETLB_PAGE
+#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
+#endif
+#define HAVE_ARCH_UNMAPPED_AREA
+#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
+
+#ifndef __ASSEMBLY__
+
+struct mm_struct;
+
+unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
+ unsigned long flags, unsigned int psize,
+ int topdown);
+
+unsigned int get_slice_psize(struct mm_struct *mm, unsigned long addr);
+
+void slice_set_user_psize(struct mm_struct *mm, unsigned int psize);
+void slice_set_range_psize(struct mm_struct *mm, unsigned long start,
+ unsigned long len, unsigned int psize);
+#endif /* __ASSEMBLY__ */
+
+#else /* CONFIG_PPC_MM_SLICES */
+
+#define slice_set_range_psize(mm, start, len, psize) \
+ slice_set_user_psize((mm), (psize))
+#endif /* CONFIG_PPC_MM_SLICES */
+
+#endif /* _ASM_POWERPC_SLICE_H */
--
2.13.3
^ permalink raw reply related
* [PATCH 4.14 1/4] powerpc/mm/slice: Remove intermediate bitmap copy
From: Christophe Leroy @ 2018-03-09 15:48 UTC (permalink / raw)
To: stable, Greg Kroah-Hartman; +Cc: linux-kernel, linuxppc-dev
Upstream 326691ad4f179e6edc7eb1271e618dd673e4736d
bitmap_or() and bitmap_andnot() can work properly with dst identical
to src1 or src2. There is no need of an intermediate result bitmap
that is copied back to dst in a second step.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/mm/slice.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index 45f6740dd407..a7ac600f71c6 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -379,21 +379,17 @@ static unsigned long slice_find_area(struct mm_struct *mm, unsigned long len,
static inline void slice_or_mask(struct slice_mask *dst, struct slice_mask *src)
{
- DECLARE_BITMAP(result, SLICE_NUM_HIGH);
-
dst->low_slices |= src->low_slices;
- bitmap_or(result, dst->high_slices, src->high_slices, SLICE_NUM_HIGH);
- bitmap_copy(dst->high_slices, result, SLICE_NUM_HIGH);
+ bitmap_or(dst->high_slices, dst->high_slices, src->high_slices,
+ SLICE_NUM_HIGH);
}
static inline void slice_andnot_mask(struct slice_mask *dst, struct slice_mask *src)
{
- DECLARE_BITMAP(result, SLICE_NUM_HIGH);
-
dst->low_slices &= ~src->low_slices;
- bitmap_andnot(result, dst->high_slices, src->high_slices, SLICE_NUM_HIGH);
- bitmap_copy(dst->high_slices, result, SLICE_NUM_HIGH);
+ bitmap_andnot(dst->high_slices, dst->high_slices, src->high_slices,
+ SLICE_NUM_HIGH);
}
#ifdef CONFIG_PPC_64K_PAGES
--
2.13.3
^ permalink raw reply related
* Re: [RFC PATCH 6/6] arch: add untagged_addr definition for other arches
From: Andrey Konovalov @ 2018-03-09 15:47 UTC (permalink / raw)
To: Robin Murphy
Cc: Catalin Marinas, Will Deacon, Mark Rutland, Al Viro,
Philippe Ombredanne, Greg Kroah-Hartman, Thomas Gleixner,
Kate Stewart, Andrew Morton, Kirill A . Shutemov, Ingo Molnar,
Aneesh Kumar K . V, Minchan Kim, Michal Hocko, Shaohua Li,
Andrea Arcangeli, Anshuman Khandual, Mike Rapoport,
Vlastimil Babka, Naoya Horiguchi, Shakeel Butt, Joonsoo Kim,
Hugh Dickins, Mel Gorman, Jérôme Glisse, Mike Kravetz,
Zi Yan, Linux ARM, LKML, Linux Memory Management List,
Richard Henderson, Ivan Kokshaysky, Matt Turner, Vineet Gupta,
Russell King, Mark Salter, Aurelien Jacquiot, Mikael Starvik,
Jesper Nilsson, Tony Luck, Fenghua Yu, Geert Uytterhoeven,
James Hogan, Michal Simek, Ralf Baechle, David Howells,
Ley Foon Tan, Jonas Bonn, Stefan Kristiansson, Stafford Horne,
James E . J . Bottomley, Helge Deller, Benjamin Herrenschmidt,
Paul Mackerras, Michael Ellerman, Palmer Dabbelt, Albert Ou,
Chen Liqin, Lennox Wu, Yoshinori Sato, Rich Felker,
David S . Miller, Ingo Molnar, the arch/x86 maintainers,
Chris Zankel, Max Filippov, Arnd Bergmann, linux-alpha,
linux-snps-arc, adi-buildroot-devel, linux-c6x-dev,
linux-cris-kernel, linux-ia64, linux-m68k, linux-metag,
linux-mips, linux-am33-list, nios2-dev, openrisc, linux-parisc,
linuxppc-dev, linux-riscv, linux-sh, sparclinux, linux-xtensa,
linux-arch, Dmitry Vyukov, Kostya Serebryany, Evgeniy Stepanov,
Lee Smith, Ramana Radhakrishnan, Jacob Bramley, Ruben Ayrapetyan
In-Reply-To: <b320ff92-43ae-a479-35aa-4257b9c5430e@arm.com>
On Fri, Mar 9, 2018 at 3:16 PM, Robin Murphy <robin.murphy@arm.com> wrote:
> On 09/03/18 14:02, Andrey Konovalov wrote:
>>
>> To allow arm64 syscalls accept tagged pointers from userspace, we must
>> untag them when they are passed to the kernel. Since untagging is done in
>> generic parts of the kernel (like the mm subsystem), the untagged_addr
>> macro should be defined for all architectures.
>
>
> Would it not suffice to have an "#ifndef untagged_addr..." fallback in
> linux/uaccess.h?
>
Hi Robin!
This approach is much better, I'll try it. This will also solve the
merge issues that Arnd mentioned.
Thanks!
^ permalink raw reply
* Re: [PATCH 1/2] crypto: talitos - don't persistently map req_ctx->hw_context and req_ctx->buf
From: Herbert Xu @ 2018-03-09 15:17 UTC (permalink / raw)
To: Christophe Leroy
Cc: David S. Miller, Horia Geanta, linux-crypto, linux-kernel,
linuxppc-dev
In-Reply-To: <7c934f0788d60bd82fb1cb51d712c9ab1ea7fcb4.1519660621.git.christophe.leroy@c-s.fr>
On Mon, Feb 26, 2018 at 05:40:04PM +0100, Christophe Leroy wrote:
> Commit 49f9783b0cea ("crypto: talitos - do hw_context DMA mapping
> outside the requests") introduced a persistent dma mapping of
> req_ctx->hw_context
> Commit 37b5e8897eb5 ("crypto: talitos - chain in buffered data for ahash
> on SEC1") introduced a persistent dma mapping of req_ctx->buf
>
> As there is no destructor for req_ctx (the request context), the
> associated dma handlers where set in ctx (the tfm context). This is
> wrong as several hash operations can run with the same ctx.
>
> This patch removes this persistent mapping.
>
> Reported-by: Horia Geanta <horia.geanta@nxp.com>
> Fixes: 49f9783b0cea ("crypto: talitos - do hw_context DMA mapping outside the requests")
> Fixes: 37b5e8897eb5 ("crypto: talitos - chain in buffered data for ahash on SEC1")
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH 2/2] crypto: talitos - do not perform unnecessary dma synchronisation
From: Herbert Xu @ 2018-03-09 15:17 UTC (permalink / raw)
To: Christophe Leroy
Cc: David S. Miller, Horia Geanta, linux-crypto, linux-kernel,
linuxppc-dev
In-Reply-To: <e57399f4eb1de4b6330a47bdf8c82c9982999a8e.1519660621.git.christophe.leroy@c-s.fr>
On Mon, Feb 26, 2018 at 05:40:06PM +0100, Christophe Leroy wrote:
> req_ctx->hw_context is mainly used only by the HW. So it is not needed
> to sync the HW and the CPU each time hw_context in DMA mapped.
> This patch modifies the DMA mapping in order to limit synchronisation
> to necessary situations.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [RFC PATCH 6/6] arch: add untagged_addr definition for other arches
From: Robin Murphy @ 2018-03-09 14:16 UTC (permalink / raw)
To: Andrey Konovalov, Catalin Marinas, Will Deacon, Mark Rutland,
Al Viro, Philippe Ombredanne, Greg Kroah-Hartman, Thomas Gleixner,
Kate Stewart, Andrew Morton, Kirill A . Shutemov, Ingo Molnar,
Aneesh Kumar K . V, Minchan Kim, Michal Hocko, Shaohua Li,
Andrea Arcangeli, Anshuman Khandual, Mike Rapoport,
Vlastimil Babka, Naoya Horiguchi, Shakeel Butt, Joonsoo Kim,
Hugh Dickins, Mel Gorman, Jérôme Glisse, Mike Kravetz,
Zi Yan, linux-arm-kernel, linux-kernel, linux-mm,
Richard Henderson, Ivan Kokshaysky, Matt Turner, Vineet Gupta,
Russell King, Mark Salter, Aurelien Jacquiot, Mikael Starvik,
Jesper Nilsson, Tony Luck, Fenghua Yu, Geert Uytterhoeven,
James Hogan, Michal Simek, Ralf Baechle, David Howells,
Ley Foon Tan, Jonas Bonn, Stefan Kristiansson, Stafford Horne,
James E . J . Bottomley, Helge Deller, Benjamin Herrenschmidt,
Paul Mackerras, Michael Ellerman, Palmer Dabbelt, Albert Ou,
Chen Liqin, Lennox Wu, Yoshinori Sato, Rich Felker,
David S . Miller, Ingo Molnar, x86, Chris Zankel, Max Filippov,
Arnd Bergmann, linux-alpha, linux-snps-arc, adi-buildroot-devel,
linux-c6x-dev, linux-cris-kernel, linux-ia64, linux-m68k,
linux-metag, linux-mips, linux-am33-list, nios2-dev, openrisc,
linux-parisc, linuxppc-dev, linux-riscv, linux-sh, sparclinux,
linux-xtensa, linux-arch
Cc: Dmitry Vyukov, Kostya Serebryany, Evgeniy Stepanov, Lee Smith,
Ramana Radhakrishnan, Jacob Bramley, Ruben Ayrapetyan
In-Reply-To: <89b4bb181a0622d2c581699bb3814fc041078d04.1520600533.git.andreyknvl@google.com>
On 09/03/18 14:02, Andrey Konovalov wrote:
> To allow arm64 syscalls accept tagged pointers from userspace, we must
> untag them when they are passed to the kernel. Since untagging is done in
> generic parts of the kernel (like the mm subsystem), the untagged_addr
> macro should be defined for all architectures.
Would it not suffice to have an "#ifndef untagged_addr..." fallback in
linux/uaccess.h?
Robin.
> Define it as a noop for all other architectures besides arm64.
>
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> ---
> arch/alpha/include/asm/uaccess.h | 2 ++
> arch/arc/include/asm/uaccess.h | 1 +
> arch/arm/include/asm/uaccess.h | 2 ++
> arch/blackfin/include/asm/uaccess.h | 2 ++
> arch/c6x/include/asm/uaccess.h | 2 ++
> arch/cris/include/asm/uaccess.h | 2 ++
> arch/frv/include/asm/uaccess.h | 2 ++
> arch/ia64/include/asm/uaccess.h | 2 ++
> arch/m32r/include/asm/uaccess.h | 2 ++
> arch/m68k/include/asm/uaccess.h | 2 ++
> arch/metag/include/asm/uaccess.h | 2 ++
> arch/microblaze/include/asm/uaccess.h | 2 ++
> arch/mips/include/asm/uaccess.h | 2 ++
> arch/mn10300/include/asm/uaccess.h | 2 ++
> arch/nios2/include/asm/uaccess.h | 2 ++
> arch/openrisc/include/asm/uaccess.h | 2 ++
> arch/parisc/include/asm/uaccess.h | 2 ++
> arch/powerpc/include/asm/uaccess.h | 2 ++
> arch/riscv/include/asm/uaccess.h | 2 ++
> arch/score/include/asm/uaccess.h | 2 ++
> arch/sh/include/asm/uaccess.h | 2 ++
> arch/sparc/include/asm/uaccess.h | 2 ++
> arch/tile/include/asm/uaccess.h | 2 ++
> arch/x86/include/asm/uaccess.h | 2 ++
> arch/xtensa/include/asm/uaccess.h | 2 ++
> include/asm-generic/uaccess.h | 2 ++
> 26 files changed, 51 insertions(+)
>
> diff --git a/arch/alpha/include/asm/uaccess.h b/arch/alpha/include/asm/uaccess.h
> index 87d8c4f0307d..09d136bb4ff5 100644
> --- a/arch/alpha/include/asm/uaccess.h
> +++ b/arch/alpha/include/asm/uaccess.h
> @@ -2,6 +2,8 @@
> #ifndef __ALPHA_UACCESS_H
> #define __ALPHA_UACCESS_H
>
> +#define untagged_addr(addr) addr
> +
> /*
> * The fs value determines whether argument validity checking should be
> * performed or not. If get_fs() == USER_DS, checking is performed, with
> diff --git a/arch/arc/include/asm/uaccess.h b/arch/arc/include/asm/uaccess.h
> index c9173c02081c..2a04b7a4aada 100644
> --- a/arch/arc/include/asm/uaccess.h
> +++ b/arch/arc/include/asm/uaccess.h
> @@ -26,6 +26,7 @@
>
> #include <linux/string.h> /* for generic string functions */
>
> +#define untagged_addr(addr) addr
>
> #define __kernel_ok (uaccess_kernel())
>
> diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
> index 0bf2347495f1..7d4f4e4021f2 100644
> --- a/arch/arm/include/asm/uaccess.h
> +++ b/arch/arm/include/asm/uaccess.h
> @@ -19,6 +19,8 @@
>
> #include <asm/extable.h>
>
> +#define untagged_addr(addr) addr
> +
> /*
> * These two functions allow hooking accesses to userspace to increase
> * system integrity by ensuring that the kernel can not inadvertantly
> diff --git a/arch/blackfin/include/asm/uaccess.h b/arch/blackfin/include/asm/uaccess.h
> index 45da4bcb050e..fb6bdc54e7bd 100644
> --- a/arch/blackfin/include/asm/uaccess.h
> +++ b/arch/blackfin/include/asm/uaccess.h
> @@ -18,6 +18,8 @@
> #include <asm/segment.h>
> #include <asm/sections.h>
>
> +#define untagged_addr(addr) addr
> +
> #define get_ds() (KERNEL_DS)
> #define get_fs() (current_thread_info()->addr_limit)
>
> diff --git a/arch/c6x/include/asm/uaccess.h b/arch/c6x/include/asm/uaccess.h
> index ba6756879f00..f187696cf440 100644
> --- a/arch/c6x/include/asm/uaccess.h
> +++ b/arch/c6x/include/asm/uaccess.h
> @@ -9,6 +9,8 @@
> #ifndef _ASM_C6X_UACCESS_H
> #define _ASM_C6X_UACCESS_H
>
> +#define untagged_addr(addr) addr
> +
> #include <linux/types.h>
> #include <linux/compiler.h>
> #include <linux/string.h>
> diff --git a/arch/cris/include/asm/uaccess.h b/arch/cris/include/asm/uaccess.h
> index 3b42ab0cae93..86d8fbd200c4 100644
> --- a/arch/cris/include/asm/uaccess.h
> +++ b/arch/cris/include/asm/uaccess.h
> @@ -19,6 +19,8 @@
> #include <asm/processor.h>
> #include <asm/page.h>
>
> +#define untagged_addr(addr) addr
> +
> /*
> * The fs value determines whether argument validity checking should be
> * performed or not. If get_fs() == USER_DS, checking is performed, with
> diff --git a/arch/frv/include/asm/uaccess.h b/arch/frv/include/asm/uaccess.h
> index ff9562dc6825..be21b42bde09 100644
> --- a/arch/frv/include/asm/uaccess.h
> +++ b/arch/frv/include/asm/uaccess.h
> @@ -12,6 +12,8 @@
> #ifndef _ASM_UACCESS_H
> #define _ASM_UACCESS_H
>
> +#define untagged_addr(addr) addr
> +
> /*
> * User space memory access functions
> */
> diff --git a/arch/ia64/include/asm/uaccess.h b/arch/ia64/include/asm/uaccess.h
> index a74524f2d625..1c46bf1c4f73 100644
> --- a/arch/ia64/include/asm/uaccess.h
> +++ b/arch/ia64/include/asm/uaccess.h
> @@ -42,6 +42,8 @@
> #include <asm/io.h>
> #include <asm/extable.h>
>
> +#define untagged_addr(addr) addr
> +
> /*
> * For historical reasons, the following macros are grossly misnamed:
> */
> diff --git a/arch/m32r/include/asm/uaccess.h b/arch/m32r/include/asm/uaccess.h
> index 9d89bc3d8181..6e0fe6b215be 100644
> --- a/arch/m32r/include/asm/uaccess.h
> +++ b/arch/m32r/include/asm/uaccess.h
> @@ -16,6 +16,8 @@
> #include <asm/setup.h>
> #include <linux/prefetch.h>
>
> +#define untagged_addr(addr) addr
> +
> /*
> * The fs value determines whether argument validity checking should be
> * performed or not. If get_fs() == USER_DS, checking is performed, with
> diff --git a/arch/m68k/include/asm/uaccess.h b/arch/m68k/include/asm/uaccess.h
> index e896466a41a4..02e0c5878ad5 100644
> --- a/arch/m68k/include/asm/uaccess.h
> +++ b/arch/m68k/include/asm/uaccess.h
> @@ -5,3 +5,5 @@
> #include <asm/uaccess_mm.h>
> #endif
> #include <asm/extable.h>
> +
> +#define untagged_addr(addr) addr
> diff --git a/arch/metag/include/asm/uaccess.h b/arch/metag/include/asm/uaccess.h
> index a5311eb36e32..1b2f0478868a 100644
> --- a/arch/metag/include/asm/uaccess.h
> +++ b/arch/metag/include/asm/uaccess.h
> @@ -14,6 +14,8 @@
> * For historical reasons, these macros are grossly misnamed.
> */
>
> +#define untagged_addr(addr) addr
> +
> #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
>
> #define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF)
> diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h
> index 81f16aadbf9e..a66bc26660c3 100644
> --- a/arch/microblaze/include/asm/uaccess.h
> +++ b/arch/microblaze/include/asm/uaccess.h
> @@ -20,6 +20,8 @@
> #include <asm/extable.h>
> #include <linux/string.h>
>
> +#define untagged_addr(addr) addr
> +
> /*
> * On Microblaze the fs value is actually the top of the corresponding
> * address space.
> diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h
> index b71306947290..2db7606c388b 100644
> --- a/arch/mips/include/asm/uaccess.h
> +++ b/arch/mips/include/asm/uaccess.h
> @@ -16,6 +16,8 @@
> #include <asm/asm-eva.h>
> #include <asm/extable.h>
>
> +#define untagged_addr(addr) addr
> +
> /*
> * The fs value determines whether argument validity checking should be
> * performed or not. If get_fs() == USER_DS, checking is performed, with
> diff --git a/arch/mn10300/include/asm/uaccess.h b/arch/mn10300/include/asm/uaccess.h
> index 5af468fd1359..6604699b34b6 100644
> --- a/arch/mn10300/include/asm/uaccess.h
> +++ b/arch/mn10300/include/asm/uaccess.h
> @@ -17,6 +17,8 @@
> #include <linux/kernel.h>
> #include <asm/page.h>
>
> +#define untagged_addr(addr) addr
> +
> /*
> * The fs value determines whether argument validity checking should be
> * performed or not. If get_fs() == USER_DS, checking is performed, with
> diff --git a/arch/nios2/include/asm/uaccess.h b/arch/nios2/include/asm/uaccess.h
> index dfa3c7cb30b4..36152a7302a8 100644
> --- a/arch/nios2/include/asm/uaccess.h
> +++ b/arch/nios2/include/asm/uaccess.h
> @@ -19,6 +19,8 @@
>
> #include <asm/extable.h>
>
> +#define untagged_addr(addr) addr
> +
> /*
> * Segment stuff
> */
> diff --git a/arch/openrisc/include/asm/uaccess.h b/arch/openrisc/include/asm/uaccess.h
> index bbf5c79cce7a..5b43d13ab363 100644
> --- a/arch/openrisc/include/asm/uaccess.h
> +++ b/arch/openrisc/include/asm/uaccess.h
> @@ -27,6 +27,8 @@
> #include <asm/page.h>
> #include <asm/extable.h>
>
> +#define untagged_addr(addr) addr
> +
> /*
> * The fs value determines whether argument validity checking should be
> * performed or not. If get_fs() == USER_DS, checking is performed, with
> diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h
> index ea70e36ce6af..b0f3cd529c8d 100644
> --- a/arch/parisc/include/asm/uaccess.h
> +++ b/arch/parisc/include/asm/uaccess.h
> @@ -11,6 +11,8 @@
> #include <linux/bug.h>
> #include <linux/string.h>
>
> +#define untagged_addr(addr) addr
> +
> #define KERNEL_DS ((mm_segment_t){0})
> #define USER_DS ((mm_segment_t){1})
>
> diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h
> index 51bfeb8777f0..07ae1c318166 100644
> --- a/arch/powerpc/include/asm/uaccess.h
> +++ b/arch/powerpc/include/asm/uaccess.h
> @@ -8,6 +8,8 @@
> #include <asm/page.h>
> #include <asm/extable.h>
>
> +#define untagged_addr(addr) addr
> +
> /*
> * The fs value determines whether argument validity checking should be
> * performed or not. If get_fs() == USER_DS, checking is performed, with
> diff --git a/arch/riscv/include/asm/uaccess.h b/arch/riscv/include/asm/uaccess.h
> index 14b0b22fb578..e774239aac24 100644
> --- a/arch/riscv/include/asm/uaccess.h
> +++ b/arch/riscv/include/asm/uaccess.h
> @@ -25,6 +25,8 @@
> #include <asm/byteorder.h>
> #include <asm/asm.h>
>
> +#define untagged_addr(addr) addr
> +
> #define __enable_user_access() \
> __asm__ __volatile__ ("csrs sstatus, %0" : : "r" (SR_SUM) : "memory")
> #define __disable_user_access() \
> diff --git a/arch/score/include/asm/uaccess.h b/arch/score/include/asm/uaccess.h
> index a233f3236846..fd16c2a71091 100644
> --- a/arch/score/include/asm/uaccess.h
> +++ b/arch/score/include/asm/uaccess.h
> @@ -5,6 +5,8 @@
> #include <linux/kernel.h>
> #include <asm/extable.h>
>
> +#define untagged_addr(addr) addr
> +
> #define get_ds() (KERNEL_DS)
> #define get_fs() (current_thread_info()->addr_limit)
> #define segment_eq(a, b) ((a).seg == (b).seg)
> diff --git a/arch/sh/include/asm/uaccess.h b/arch/sh/include/asm/uaccess.h
> index 32eb56e00c11..31f3ea075190 100644
> --- a/arch/sh/include/asm/uaccess.h
> +++ b/arch/sh/include/asm/uaccess.h
> @@ -5,6 +5,8 @@
> #include <asm/segment.h>
> #include <asm/extable.h>
>
> +#define untagged_addr(addr) addr
> +
> #define __addr_ok(addr) \
> ((unsigned long __force)(addr) < current_thread_info()->addr_limit.seg)
>
> diff --git a/arch/sparc/include/asm/uaccess.h b/arch/sparc/include/asm/uaccess.h
> index dd85bc2c2cad..70c2f5ea09ce 100644
> --- a/arch/sparc/include/asm/uaccess.h
> +++ b/arch/sparc/include/asm/uaccess.h
> @@ -7,6 +7,8 @@
> #include <asm/uaccess_32.h>
> #endif
>
> +#define untagged_addr(addr) addr
> +
> #define user_addr_max() \
> (uaccess_kernel() ? ~0UL : TASK_SIZE)
>
> diff --git a/arch/tile/include/asm/uaccess.h b/arch/tile/include/asm/uaccess.h
> index cb4fbe7e4f88..7d365b087dcb 100644
> --- a/arch/tile/include/asm/uaccess.h
> +++ b/arch/tile/include/asm/uaccess.h
> @@ -22,6 +22,8 @@
> #include <asm/processor.h>
> #include <asm/page.h>
>
> +#define untagged_addr(addr) addr
> +
> /*
> * The fs value determines whether argument validity checking should be
> * performed or not. If get_fs() == USER_DS, checking is performed, with
> diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
> index aae77eb8491c..3c233fbdd32b 100644
> --- a/arch/x86/include/asm/uaccess.h
> +++ b/arch/x86/include/asm/uaccess.h
> @@ -12,6 +12,8 @@
> #include <asm/smap.h>
> #include <asm/extable.h>
>
> +#define untagged_addr(addr) addr
> +
> /*
> * The fs value determines whether argument validity checking should be
> * performed or not. If get_fs() == USER_DS, checking is performed, with
> diff --git a/arch/xtensa/include/asm/uaccess.h b/arch/xtensa/include/asm/uaccess.h
> index f1158b4c629c..130e419c4d6e 100644
> --- a/arch/xtensa/include/asm/uaccess.h
> +++ b/arch/xtensa/include/asm/uaccess.h
> @@ -20,6 +20,8 @@
> #include <asm/types.h>
> #include <asm/extable.h>
>
> +#define untagged_addr(addr) addr
> +
> /*
> * The fs value determines whether argument validity checking should
> * be performed or not. If get_fs() == USER_DS, checking is
> diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
> index 6b2e63df2739..2c46d2253dba 100644
> --- a/include/asm-generic/uaccess.h
> +++ b/include/asm-generic/uaccess.h
> @@ -35,6 +35,8 @@ static inline void set_fs(mm_segment_t fs)
> #define segment_eq(a, b) ((a).seg == (b).seg)
> #endif
>
> +#define untagged_addr(addr) addr
> +
> #define access_ok(type, addr, size) __access_ok((unsigned long)(addr),(size))
>
> /*
>
^ permalink raw reply
* Re: [RFC PATCH 0/6] arm64: untag user pointers passed to the kernel
From: Robin Murphy @ 2018-03-09 14:15 UTC (permalink / raw)
To: Andrey Konovalov, Catalin Marinas, Will Deacon, Mark Rutland,
Al Viro, Philippe Ombredanne, Greg Kroah-Hartman, Thomas Gleixner,
Kate Stewart, Andrew Morton, Kirill A . Shutemov, Ingo Molnar,
Aneesh Kumar K . V, Minchan Kim, Michal Hocko, Shaohua Li,
Andrea Arcangeli, Anshuman Khandual, Mike Rapoport,
Vlastimil Babka, Naoya Horiguchi, Shakeel Butt, Joonsoo Kim,
Hugh Dickins, Mel Gorman, Jérôme Glisse, Mike Kravetz,
Zi Yan, linux-arm-kernel, linux-kernel, linux-mm,
Richard Henderson, Ivan Kokshaysky, Matt Turner, Vineet Gupta,
Russell King, Mark Salter, Aurelien Jacquiot, Mikael Starvik,
Jesper Nilsson, Tony Luck, Fenghua Yu, Geert Uytterhoeven,
James Hogan, Michal Simek, Ralf Baechle, David Howells,
Ley Foon Tan, Jonas Bonn, Stefan Kristiansson, Stafford Horne,
James E . J . Bottomley, Helge Deller, Benjamin Herrenschmidt,
Paul Mackerras, Michael Ellerman, Palmer Dabbelt, Albert Ou,
Chen Liqin, Lennox Wu, Yoshinori Sato, Rich Felker,
David S . Miller, Ingo Molnar, x86, Chris Zankel, Max Filippov,
Arnd Bergmann, linux-alpha, linux-snps-arc, adi-buildroot-devel,
linux-c6x-dev, linux-cris-kernel, linux-ia64, linux-m68k,
linux-metag, linux-mips, linux-am33-list, nios2-dev, openrisc,
linux-parisc, linuxppc-dev, linux-riscv, linux-sh, sparclinux,
linux-xtensa, linux-arch
Cc: Dmitry Vyukov, Kostya Serebryany, Evgeniy Stepanov, Lee Smith,
Ramana Radhakrishnan, Jacob Bramley, Ruben Ayrapetyan
In-Reply-To: <cover.1520600533.git.andreyknvl@google.com>
Hi Andrey,
On 09/03/18 14:01, Andrey Konovalov wrote:
> arm64 has a feature called Top Byte Ignore, which allows to embed pointer
> tags into the top byte of each pointer. Userspace programs (such as
> HWASan, a memory debugging tool [1]) might use this feature and pass
> tagged user pointers to the kernel through syscalls or other interfaces.
If you propose changing the ABI, then
Documentation/arm64/tagged-pointers.txt needs to reflect the new one,
since passing nonzero tags via syscalls is currently explicitly forbidden.
Robin.
> This patch makes a few of the kernel interfaces accept tagged user
> pointers. The kernel is already able to handle user faults with tagged
> pointers and has the untagged_addr macro, which this patchset reuses.
>
> We're not trying to cover all possible ways the kernel accepts user
> pointers in one patchset, so this one should be considered as a start.
> It would be nice to learn about the interfaces that I missed though.
>
> Sending this as an RFC, as I'm not sure if this should be committed as is,
> and would like to receive some feedback.
>
> Thanks!
>
> [1] http://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html
>
> Andrey Konovalov (6):
> arm64: add type casts to untagged_addr macro
> arm64: untag user addresses in copy_from_user and others
> mm, arm64: untag user addresses in memory syscalls
> mm, arm64: untag user addresses in mm/gup.c
> lib, arm64: untag addrs passed to strncpy_from_user and strnlen_user
> arch: add untagged_addr definition for other arches
>
> arch/alpha/include/asm/uaccess.h | 2 ++
> arch/arc/include/asm/uaccess.h | 1 +
> arch/arm/include/asm/uaccess.h | 2 ++
> arch/arm64/include/asm/uaccess.h | 9 +++++++--
> arch/blackfin/include/asm/uaccess.h | 2 ++
> arch/c6x/include/asm/uaccess.h | 2 ++
> arch/cris/include/asm/uaccess.h | 2 ++
> arch/frv/include/asm/uaccess.h | 2 ++
> arch/ia64/include/asm/uaccess.h | 2 ++
> arch/m32r/include/asm/uaccess.h | 2 ++
> arch/m68k/include/asm/uaccess.h | 2 ++
> arch/metag/include/asm/uaccess.h | 2 ++
> arch/microblaze/include/asm/uaccess.h | 2 ++
> arch/mips/include/asm/uaccess.h | 2 ++
> arch/mn10300/include/asm/uaccess.h | 2 ++
> arch/nios2/include/asm/uaccess.h | 2 ++
> arch/openrisc/include/asm/uaccess.h | 2 ++
> arch/parisc/include/asm/uaccess.h | 2 ++
> arch/powerpc/include/asm/uaccess.h | 2 ++
> arch/riscv/include/asm/uaccess.h | 2 ++
> arch/score/include/asm/uaccess.h | 2 ++
> arch/sh/include/asm/uaccess.h | 2 ++
> arch/sparc/include/asm/uaccess.h | 2 ++
> arch/tile/include/asm/uaccess.h | 2 ++
> arch/x86/include/asm/uaccess.h | 2 ++
> arch/xtensa/include/asm/uaccess.h | 2 ++
> include/asm-generic/uaccess.h | 2 ++
> lib/strncpy_from_user.c | 2 ++
> lib/strnlen_user.c | 2 ++
> mm/gup.c | 12 ++++++++++++
> mm/madvise.c | 2 ++
> mm/mempolicy.c | 6 ++++++
> mm/mincore.c | 2 ++
> mm/mlock.c | 5 +++++
> mm/mmap.c | 9 +++++++++
> mm/mprotect.c | 2 ++
> mm/mremap.c | 2 ++
> mm/msync.c | 3 +++
> 38 files changed, 105 insertions(+), 2 deletions(-)
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox