[PATCH 08/12] kexec: don't invoke OOM-killer for control page allocation

2016-04-28 Thread Russell King
If we are unable to find a suitable page when allocating the control
page, do not invoke the OOM-killer: killing processes probably isn't
going to help.

Signed-off-by: Russell King 
---
 include/linux/kexec.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 2cc643c6e870..1b32ab587f66 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -41,7 +41,7 @@
 #endif
 
 #ifndef KEXEC_CONTROL_MEMORY_GFP
-#define KEXEC_CONTROL_MEMORY_GFP GFP_KERNEL
+#define KEXEC_CONTROL_MEMORY_GFP (GFP_KERNEL | __GFP_NORETRY)
 #endif
 
 #ifndef KEXEC_CONTROL_PAGE_SIZE
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 04/12] ARM: provide arm_has_idmap_alias() helper

2016-04-28 Thread Russell King
Provide a helper to indicate whether we need to perform special handling
for boot identity mapping aliases or not.

Signed-off-by: Russell King 
---
 arch/arm/include/asm/memory.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index ca208335fde6..31c07a2cc100 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -295,6 +295,11 @@ extern long long arch_phys_to_idmap_offset;
  * of physical memory for idmap purposes.  Most cases should leave these
  * untouched.  Note: this can only return addresses less than 4GiB.
  */
+static inline bool arm_has_idmap_alias(void)
+{
+   return IS_ENABLED(CONFIG_MMU) && arch_phys_to_idmap_offset != 0;
+}
+
 #define IDMAP_INVALID_ADDR ((u32)~0)
 
 static inline unsigned long phys_to_idmap(phys_addr_t addr)
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 05/12] ARM: kdump: advertise boot aliased crash kernel resource

2016-04-28 Thread Russell King
Advertise a resource which describes where the crash kernel is located
in the boot view of RAM.  This allows kexec-tools to have this vital
information.

Signed-off-by: Russell King 
---
 arch/arm/kernel/setup.c | 16 
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index d9317eec1eba..19b25ad61385 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -1003,9 +1003,25 @@ static void __init reserve_crashkernel(void)
(unsigned long)(crash_base >> 20),
(unsigned long)(total_mem >> 20));
 
+   /* The crashk resource must always be located in normal mem */
crashk_res.start = crash_base;
crashk_res.end = crash_base + crash_size - 1;
insert_resource(_resource, _res);
+
+   if (arm_has_idmap_alias()) {
+   /*
+* If we have a special RAM alias for use at boot, we
+* need to advertise to kexec tools where the alias is.
+*/
+   static struct resource crashk_boot_res = {
+   .name = "Crash kernel (boot alias)",
+   .flags = IORESOURCE_BUSY | IORESOURCE_MEM,
+   };
+
+   crashk_boot_res.start = phys_to_idmap(crash_base);
+   crashk_boot_res.end = crashk_boot_res.start + crash_size - 1;
+   insert_resource(_resource, _boot_res);
+   }
 }
 #else
 static inline void reserve_crashkernel(void) {}
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 10/12] kexec: arrange for paddr_vmcoreinfo_note() to return phys_addr_t

2016-04-28 Thread Russell King
On PAE systems (eg, ARM LPAE) the vmcore note may be located above
4GB physical on 32-bit architectures, so we need a wider type than
"unsigned long" here.  Arrange for paddr_vmcoreinfo_note() to return
a phys_addr_t, thereby allowing it to be located above 4GB.

This makes no difference for kexec-tools, as they already assume a
64-bit type when reading from this file.

Signed-off-by: Russell King 
---
 arch/ia64/kernel/machine_kexec.c | 2 +-
 include/linux/kexec.h| 2 +-
 kernel/kexec_core.c  | 2 +-
 kernel/ksysfs.c  | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/ia64/kernel/machine_kexec.c b/arch/ia64/kernel/machine_kexec.c
index b72cd7a07222..599507bcec91 100644
--- a/arch/ia64/kernel/machine_kexec.c
+++ b/arch/ia64/kernel/machine_kexec.c
@@ -163,7 +163,7 @@ void arch_crash_save_vmcoreinfo(void)
 #endif
 }
 
-unsigned long paddr_vmcoreinfo_note(void)
+phys_addr_t paddr_vmcoreinfo_note(void)
 {
return ia64_tpa((unsigned long)(char *)_note);
 }
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 1b32ab587f66..52a3a221bcb2 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -235,7 +235,7 @@ void crash_unmap_reserved_pages(void);
 void arch_crash_save_vmcoreinfo(void);
 __printf(1, 2)
 void vmcoreinfo_append_str(const char *fmt, ...);
-unsigned long paddr_vmcoreinfo_note(void);
+phys_addr_t paddr_vmcoreinfo_note(void);
 
 #define VMCOREINFO_OSRELEASE(value) \
vmcoreinfo_append_str("OSRELEASE=%s\n", value)
diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index d719a4d0ef55..f9847e5822e6 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -1377,7 +1377,7 @@ void vmcoreinfo_append_str(const char *fmt, ...)
 void __weak arch_crash_save_vmcoreinfo(void)
 {}
 
-unsigned long __weak paddr_vmcoreinfo_note(void)
+phys_addr_t __weak paddr_vmcoreinfo_note(void)
 {
return __pa((unsigned long)(char *)_note);
 }
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
index 152da4a48867..9f1920d2d0c6 100644
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -128,8 +128,8 @@ KERNEL_ATTR_RW(kexec_crash_size);
 static ssize_t vmcoreinfo_show(struct kobject *kobj,
   struct kobj_attribute *attr, char *buf)
 {
-   return sprintf(buf, "%lx %x\n",
-  paddr_vmcoreinfo_note(),
+   phys_addr_t vmcore_base = paddr_vmcoreinfo_note();
+   return sprintf(buf, "%pa %x\n", _base,
   (unsigned int)sizeof(vmcoreinfo_note));
 }
 KERNEL_ATTR_RO(vmcoreinfo);
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/12] kexec: allow architectures to override boot mapping

2016-04-28 Thread Russell King
kexec physical addresses are the boot-time view of the system.  For
certain ARM systems (such as Keystone 2), the boot view of the system
does not match the kernel's view of the system: the boot view uses a
special alias in the lower 4GB of the physical address space.

To cater for these kinds of setups, we need to translate between the
boot view physical addresses and the normal kernel view physical
addresses.  This patch extracts the current transation points into
linux/kexec.h, and allows an architecture to override the functions.

Due to the translations required, we unfortunately end up with six
translation functions, which are reduced down to four that the
architecture can override.

Signed-off-by: Russell King 
---
 include/linux/kexec.h | 38 ++
 kernel/kexec.c|  3 ++-
 kernel/kexec_core.c   | 26 +-
 3 files changed, 53 insertions(+), 14 deletions(-)

diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 52a3a221bcb2..99cb9dac7909 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -318,6 +318,44 @@ int __weak arch_kexec_apply_relocations_add(const Elf_Ehdr 
*ehdr,
 int __weak arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr 
*sechdrs,
unsigned int relsec);
 
+#ifndef page_to_boot_pfn
+static inline unsigned long page_to_boot_pfn(struct page *page)
+{
+   return page_to_pfn(page);
+}
+#endif
+
+#ifndef boot_pfn_to_page
+static inline struct page *boot_pfn_to_page(unsigned long boot_pfn)
+{
+   return pfn_to_page(boot_pfn);
+}
+#endif
+
+#ifndef phys_to_boot_phys
+static inline unsigned long phys_to_boot_phys(phys_addr_t phys)
+{
+   return phys;
+}
+#endif
+
+#ifndef boot_phys_to_phys
+static inline phys_addr_t boot_phys_to_phys(unsigned long boot_phys)
+{
+   return boot_phys;
+}
+#endif
+
+static inline unsigned long virt_to_boot_phys(void *addr)
+{
+   return phys_to_boot_phys(__pa((unsigned long)addr));
+}
+
+static inline void *boot_phys_to_virt(unsigned long entry)
+{
+   return phys_to_virt(boot_phys_to_phys(entry));
+}
+
 #else /* !CONFIG_KEXEC_CORE */
 struct pt_regs;
 struct task_struct;
diff --git a/kernel/kexec.c b/kernel/kexec.c
index ee70aef5cd81..dd49d572a5e2 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -48,7 +48,8 @@ static int kimage_alloc_init(struct kimage **rimage, unsigned 
long entry,
 
if (kexec_on_panic) {
/* Verify we have a valid entry point */
-   if ((entry < crashk_res.start) || (entry > crashk_res.end))
+   if ((entry < phys_to_boot_phys(crashk_res.start)) ||
+   (entry > phys_to_boot_phys(crashk_res.end)))
return -EADDRNOTAVAIL;
}
 
diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index f9847e5822e6..d04940ccc58d 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -229,8 +229,8 @@ int sanity_check_segment_list(struct kimage *image)
mstart = image->segment[i].mem;
mend = mstart + image->segment[i].memsz - 1;
/* Ensure we are within the crash kernel limits */
-   if ((mstart < crashk_res.start) ||
-   (mend > crashk_res.end))
+   if ((mstart < phys_to_boot_phys(crashk_res.start)) ||
+   (mend > phys_to_boot_phys(crashk_res.end)))
return result;
}
}
@@ -354,7 +354,7 @@ static struct page 
*kimage_alloc_normal_control_pages(struct kimage *image,
pages = kimage_alloc_pages(KEXEC_CONTROL_MEMORY_GFP, order);
if (!pages)
break;
-   pfn   = page_to_pfn(pages);
+   pfn   = page_to_boot_pfn(pages);
epfn  = pfn + count;
addr  = pfn << PAGE_SHIFT;
eaddr = epfn << PAGE_SHIFT;
@@ -480,7 +480,7 @@ static int kimage_add_entry(struct kimage *image, 
kimage_entry_t entry)
return -ENOMEM;
 
ind_page = page_address(page);
-   *image->entry = virt_to_phys(ind_page) | IND_INDIRECTION;
+   *image->entry = virt_to_boot_phys(ind_page) | IND_INDIRECTION;
image->entry = ind_page;
image->last_entry = ind_page +
  ((PAGE_SIZE/sizeof(kimage_entry_t)) - 1);
@@ -535,13 +535,13 @@ void kimage_terminate(struct kimage *image)
 #define for_each_kimage_entry(image, ptr, entry) \
for (ptr = >head; (entry = *ptr) && !(entry & IND_DONE); \
ptr = (entry & IND_INDIRECTION) ? \
-   phys_to_virt((entry & PAGE_MASK)) : ptr + 1)
+   boot_phys_to_virt((entry & PAGE_MASK)) : ptr + 1)
 
 static void kimage_free_entry(kimage_entry_t entry)
 {
struct page *page;
 
-   

[PATCH 09/12] kexec: ensure user memory sizes do not wrap

2016-04-28 Thread Russell King
Ensure that user memory sizes do not wrap around when validating the
user input, which can lead to the following input validation working
incorrectly.

Signed-off-by: Russell King 
---
 kernel/kexec_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index 8d34308ea449..d719a4d0ef55 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -169,6 +169,8 @@ int sanity_check_segment_list(struct kimage *image)
 
mstart = image->segment[i].mem;
mend   = mstart + image->segment[i].memsz;
+   if (mstart > mend)
+   return result;
if ((mstart & ~PAGE_MASK) || (mend & ~PAGE_MASK))
return result;
if (mend >= KEXEC_DESTINATION_MEMORY_LIMIT)
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/12] ARM: provide improved virt_to_idmap() functionality

2016-04-28 Thread Russell King
For kexec, we need more functionality from the IDMAP system.  We need to
be able to convert physical addresses to their identity mappped versions
as well as virtual addresses.

Convert the existing arch_virt_to_idmap() to deal with physical
addresses instead.

Acked-by: Santosh Shilimkar 
Signed-off-by: Russell King 
---
 arch/arm/include/asm/memory.h | 33 ++---
 arch/arm/mach-keystone/keystone.c |  7 +--
 arch/arm/mm/idmap.c   |  2 +-
 3 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 9427fd632552..ca208335fde6 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -288,19 +288,38 @@ static inline void *phys_to_virt(phys_addr_t x)
 #define __va(x)((void 
*)__phys_to_virt((phys_addr_t)(x)))
 #define pfn_to_kaddr(pfn)  __va((phys_addr_t)(pfn) << PAGE_SHIFT)
 
-extern unsigned long (*arch_virt_to_idmap)(unsigned long x);
+extern long long arch_phys_to_idmap_offset;
 
 /*
- * These are for systems that have a hardware interconnect supported alias of
- * physical memory for idmap purposes.  Most cases should leave these
+ * These are for systems that have a hardware interconnect supported alias
+ * of physical memory for idmap purposes.  Most cases should leave these
  * untouched.  Note: this can only return addresses less than 4GiB.
  */
+#define IDMAP_INVALID_ADDR ((u32)~0)
+
+static inline unsigned long phys_to_idmap(phys_addr_t addr)
+{
+   if (IS_ENABLED(CONFIG_MMU) && arch_phys_to_idmap_offset) {
+   addr += arch_phys_to_idmap_offset;
+   if (addr > (u32)~0)
+   addr = IDMAP_INVALID_ADDR;
+   }
+   return addr;
+}
+
+static inline phys_addr_t idmap_to_phys(unsigned long idmap)
+{
+   phys_addr_t addr = idmap;
+
+   if (IS_ENABLED(CONFIG_MMU) && arch_phys_to_idmap_offset)
+   addr -= arch_phys_to_idmap_offset;
+
+   return addr;
+}
+
 static inline unsigned long __virt_to_idmap(unsigned long x)
 {
-   if (IS_ENABLED(CONFIG_MMU) && arch_virt_to_idmap)
-   return arch_virt_to_idmap(x);
-   else
-   return __virt_to_phys(x);
+   return phys_to_idmap(__virt_to_phys(x));
 }
 
 #define virt_to_idmap(x)   __virt_to_idmap((unsigned long)(x))
diff --git a/arch/arm/mach-keystone/keystone.c 
b/arch/arm/mach-keystone/keystone.c
index e6b9cb1e6709..a33a296b00dc 100644
--- a/arch/arm/mach-keystone/keystone.c
+++ b/arch/arm/mach-keystone/keystone.c
@@ -63,11 +63,6 @@ static void __init keystone_init(void)
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
-static unsigned long keystone_virt_to_idmap(unsigned long x)
-{
-   return (phys_addr_t)(x) - CONFIG_PAGE_OFFSET + KEYSTONE_LOW_PHYS_START;
-}
-
 static long long __init keystone_pv_fixup(void)
 {
long long offset;
@@ -91,7 +86,7 @@ static long long __init keystone_pv_fixup(void)
offset = KEYSTONE_HIGH_PHYS_START - KEYSTONE_LOW_PHYS_START;
 
/* Populate the arch idmap hook */
-   arch_virt_to_idmap = keystone_virt_to_idmap;
+   arch_phys_to_idmap_offset = -offset;
 
return offset;
 }
diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c
index bd274a05b8ff..c1a48f88764e 100644
--- a/arch/arm/mm/idmap.c
+++ b/arch/arm/mm/idmap.c
@@ -15,7 +15,7 @@
  * page tables.
  */
 pgd_t *idmap_pgd;
-unsigned long (*arch_virt_to_idmap)(unsigned long x);
+long long arch_phys_to_idmap_offset;
 
 #ifdef CONFIG_ARM_LPAE
 static void idmap_add_pmd(pud_t *pud, unsigned long addr, unsigned long end,
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 01/12] ARM: kexec: fix crashkernel= handling

2016-04-28 Thread Russell King
When the kernel crashkernel parameter is specified with just a size, we
are supposed to allocate a region from RAM to store the crashkernel.
However, ARM merely reserves physical address zero with no checking that
there is even RAM there.

Fix this by lifting similar code from x86, importing it to ARM with the
ARM specific parameters added.  In the absence of any platform specific
information, we allocate the crashkernel region from the first 512MB of
physical memory.

Update the kdump documentation to reflect this change.

Signed-off-by: Russell King 
---
 Documentation/kdump/kdump.txt | 13 +++--
 arch/arm/kernel/setup.c   | 29 +
 2 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt
index bc4bd5a44b88..88ff63d5fde3 100644
--- a/Documentation/kdump/kdump.txt
+++ b/Documentation/kdump/kdump.txt
@@ -263,12 +263,6 @@ been removed from the machine.
 crashkernel=:[,:,...][@offset]
 range=start-[end]
 
-Please note, on arm, the offset is required.
-crashkernel=:[,:,...]@offset
-range=start-[end]
-
-'start' is inclusive and 'end' is exclusive.
-
 For example:
 
 crashkernel=512M-2G:64M,2G-:128M
@@ -307,10 +301,9 @@ Boot into System Kernel
on the memory consumption of the kdump system. In general this is not
dependent on the memory size of the production system.
 
-   On arm, use "crashkernel=Y@X". Note that the start address of the kernel
-   will be aligned to 128MiB (0x0800), so if the start address is not then
-   any space below the alignment point may be overwritten by the dump-capture 
kernel,
-   which means it is possible that the vmcore is not that precise as expected.
+   On arm, the use of "crashkernel=Y@X" is no longer necessary; the
+   kernel will automatically locate the crash kernel image within the
+   first 512MB of RAM if X is not given.
 
 
 Load the Dump-capture Kernel
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 139791ed473d..77b54c461c52 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -938,6 +938,13 @@ static int __init init_machine_late(void)
 late_initcall(init_machine_late);
 
 #ifdef CONFIG_KEXEC
+/*
+ * The crash region must be aligned to 128MB to avoid
+ * zImage relocating below the reserved region.
+ */
+#define CRASH_ALIGN(128 << 20)
+#define CRASH_ADDR_MAX (PHYS_OFFSET + (512 << 20))
+
 static inline unsigned long long get_total_mem(void)
 {
unsigned long total;
@@ -965,6 +972,28 @@ static void __init reserve_crashkernel(void)
if (ret)
return;
 
+   if (crash_base <= 0) {
+   unsigned long long crash_max = CRASH_ADDR_MAX;
+   if (crash_max > (u32)~0)
+   crash_max = (u32)~0;
+   crash_base = memblock_find_in_range(CRASH_ALIGN, crash_max,
+   crash_size, CRASH_ALIGN);
+   if (!crash_base) {
+   pr_err("crashkernel reservation failed - No suitable 
area found.\n");
+   return;
+   }
+   } else {
+   unsigned long long start;
+
+   start = memblock_find_in_range(crash_base,
+  crash_base + crash_size,
+  crash_size, SECTION_SIZE);
+   if (start != crash_base) {
+   pr_err("crashkernel reservation failed - memory is in 
use.\n");
+   return;
+   }
+   }
+
ret = memblock_reserve(crash_base, crash_size);
if (ret < 0) {
pr_warn("crashkernel reservation failed - memory is in use 
(0x%lx)\n",
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 07/12] ARM: keystone: dts: add psci command definition

2016-04-28 Thread Russell King
From: Vitaly Andrianov 

This commit adds definition for cpu_on, cpu_off and cpu_suspend commands.
These definitions must match the corresponding PSCI definitions in
boot monitor.

Having those command and corresponding PSCI support in boot monitor allows
run time CPU hot plugin.

Signed-off-by: Keerthy 
Signed-off-by: Vitaly Andrianov 
Signed-off-by: Russell King 
---

This patch is already queued by Santosh, and only exists as part of this
series for completeness.

 arch/arm/boot/dts/keystone.dtsi | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/keystone.dtsi b/arch/arm/boot/dts/keystone.dtsi
index 3f272826f537..007648971744 100644
--- a/arch/arm/boot/dts/keystone.dtsi
+++ b/arch/arm/boot/dts/keystone.dtsi
@@ -59,6 +59,14 @@
 ;
};
 
+   psci {
+   compatible  = "arm,psci";
+   method  = "smc";
+   cpu_suspend = <0x8401>;
+   cpu_off = <0x8402>;
+   cpu_on  = <0x8403>;
+   };
+
soc {
#address-cells = <1>;
#size-cells = <1>;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 40/41] Documentation: x86: fix spelling mistakes

2016-04-28 Thread Jonathan Corbet
On Mon, 25 Apr 2016 07:37:06 +0100
Eric Engestrom  wrote:

>  Documentation/x86/intel_mpx.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to the docs tree, thanks.

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Changed the path from to the incorrect drivers/char/sysrq.c to drivers/tty/sysrq.c

2016-04-28 Thread Jonathan Corbet
On Thu, 28 Apr 2016 10:15:24 +0200
René Nyffenegger  wrote:

> You're right, the lines were wrapped at character 78. I have fixed that
> and sent the patch to myself. The attached patch should work now.

The patch applies, but the above text is not a proper commit message, so
I still can't apply it without editing it.  I've done that this time
around, but, in the future, please be sure that the entire patch posting
is suitable for application.

Thanks,

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 32/41] Documentation: pps: fix spelling mistake

2016-04-28 Thread Jonathan Corbet
On Mon, 25 Apr 2016 07:36:58 +0100
Eric Engestrom  wrote:

>  Documentation/pps/pps.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to the docs tree, thanks.

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 39/41] Documentation: vm: fix spelling mistakes

2016-04-28 Thread Jonathan Corbet
On Mon, 25 Apr 2016 07:37:05 +0100
Eric Engestrom  wrote:

>  Documentation/vm/transhuge.txt | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Applied to the docs tree, thanks.

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 39/41] Documentation: vm: fix spelling mistakes

2016-04-28 Thread Jonathan Corbet
On Thu, 28 Apr 2016 07:31:43 -0600
Jonathan Corbet  wrote:

> On Mon, 25 Apr 2016 07:37:05 +0100
> Eric Engestrom  wrote:
> 
> >  Documentation/vm/transhuge.txt | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)  
> 
> Applied to the docs tree, thanks.

Actually, I've just unapplied this one; it conflicts against changes in
Andrew's tree and, thus, linux-next.  Andrew, maybe you'd like to take it
on top of what you have now?

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 41/41] Documentation: xillybus: fix spelling mistake

2016-04-28 Thread Jonathan Corbet
On Mon, 25 Apr 2016 07:37:07 +0100
Eric Engestrom  wrote:

>  Documentation/xillybus.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to the docs tree, thanks.

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] Documentation: fix common spelling mistakes

2016-04-28 Thread Jonathan Corbet
On Tue, 26 Apr 2016 16:41:21 -0700
Kees Cook  wrote:

> This fixes several spelling mistakes in the Documentation/ tree, which
> are caught by checkpatch.pl's spell checking.

I've applied this to the docs tree, thanks.

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Documentation:Update Documentation/zh_CN/arm64/booting.txt

2016-04-28 Thread Fu Wei

Hi Jonathan,

On 04/28/2016 09:16 PM, Jonathan Corbet wrote:

On Thu, 21 Apr 2016 17:42:28 +0100
Will Deacon  wrote:


-C: 1926e54f115725a9248d0c4c65c22acaf94de4c4
+C: 55f058e7574c3615dea4615573a19bdb258696c6


Just curious, but what are these SHAs supposed to represent? Neither of
them looks particularly relevant to me.


I'm kind of assuming it's the head of the repo at the time the update was
done.


yes, you are right. :-)
next time, I just need to do
"git diff 55f058e7574c3615dea4615573a19bdb258696c6..HEAD  > 
doc.patch" to see the difference :-)




I've applied the patch to the docs tree, anyway.


Great thanks for your help! :-)



Thanks,

jon


--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 29/41] Documentation: lzo: fix spelling mistakes

2016-04-28 Thread Jonathan Corbet
On Mon, 25 Apr 2016 07:36:55 +0100
Eric Engestrom  wrote:

>  Documentation/lzo.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to the docs tree, thanks.

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 27/41] Documentation: laptops: fix spelling mistake

2016-04-28 Thread Jonathan Corbet
On Mon, 25 Apr 2016 07:36:53 +0100
Eric Engestrom  wrote:

> -laptops, being called "Toshiba HDD Protection - Shock Sensor" officialy,
> +laptops, being called "Toshiba HDD Protection - Shock Sensor" officially,

Applied to the docs tree, thanks.

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Documentation:Update Documentation/zh_CN/arm64/booting.txt

2016-04-28 Thread Fu Wei

Hi Will

On 04/22/2016 12:42 AM, Will Deacon wrote:

On Thu, Apr 21, 2016 at 09:45:40PM +0800, w...@redhat.com wrote:

From: Fu Wei 

This is a update of Chinese documentation: Documentation/zh_CN/arm64/booting.txt

It is based on the modifications of Documentation/arm64/booting.txt in 
submission:
"a7f8de16".

Signed-off-by: Fu Wei 
---
  Documentation/zh_CN/arm64/booting.txt | 20 
  1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/Documentation/zh_CN/arm64/booting.txt 
b/Documentation/zh_CN/arm64/booting.txt
index 1145bf8..c1dd968 100644
--- a/Documentation/zh_CN/arm64/booting.txt
+++ b/Documentation/zh_CN/arm64/booting.txt
@@ -8,7 +8,7 @@ or if there is a problem with the translation.

  M:Will Deacon 
  zh_CN:Fu Wei 
-C: 1926e54f115725a9248d0c4c65c22acaf94de4c4
+C: 55f058e7574c3615dea4615573a19bdb258696c6


Just curious, but what are these SHAs supposed to represent? Neither of
them looks particularly relevant to me.


Sorry for late response.

This is the checkout point when I translated the documentation.

I learn it from "MAINTAINERS", I would like to upstream my script patch 
to keep track of the Documentation status. It can tell me

(1)which English doc is updated since I submitted the translation.
(2)which doc haven't been translated(a list)

M: original doc Maintainer(Maybe I should use "En" ro "E" for English)?
zh_CN: Chinese doc maintainer
C: Commit number or Checkout point

And my plan is that the patch can also be used in other languages, like 
"ja_JP" and "ko_KR". I hope that can help or encourage more and more 
people to do the doc translation work. And that can help people using 
another language to learn and enjoy the kernel development more easily.




Will


--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] hrtimers: doc cleanup

2016-04-28 Thread Jonathan Corbet
On Thu, 21 Apr 2016 21:39:15 +0800
Cao jin  wrote:

> It has:
> a tense correction(led->leads);
> a typo(unevitably->inevitably);

I've applied this to the docs tree, thanks.

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 34/41] Documentation: robust-futexes: fix spelling mistakes

2016-04-28 Thread Jonathan Corbet
On Mon, 25 Apr 2016 07:37:00 +0100
Eric Engestrom  wrote:

>  Documentation/robust-futexes.txt | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Applied to the docs tree, thanks.

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 35/41] Documentation: scsi: fix spelling mistakes

2016-04-28 Thread Jonathan Corbet
On Mon, 25 Apr 2016 07:37:01 +0100
Eric Engestrom  wrote:

>  Documentation/scsi/ChangeLog.megaraid_sas | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)

Applied to the docs tree (after fixing trailing whitespace errors - the
new and the old ones).

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v7 22/24] [media] rtl2832: change the i2c gate to be mux-locked

2016-04-28 Thread Wolfram Sang
On Wed, Apr 20, 2016 at 05:18:02PM +0200, Peter Rosin wrote:
> The root i2c adapter lock is then no longer held by the i2c mux during
> accesses behind the i2c gate, and such accesses need to take that lock
> just like any other ordinary i2c accesses do.
> 
> So, declare the i2c gate mux-locked, and zap the regmap overrides
> that makes the i2c accesses unlocked and use plain old regmap
> accesses. This also removes the need for the regmap wrappers used by
> rtl2832_sdr, so deconvolute the code further and provide the regmap
> handle directly instead of the wrapper functions.
> 
> Signed-off-by: Peter Rosin 

Antti, I'd need some tag from you since this is not the i2c realm.



signature.asc
Description: PGP signature


Re: [PATCH v7 16/24] i2c: allow adapter drivers to override the adapter locking

2016-04-28 Thread Peter Rosin


On 2016-04-28 22:50, Wolfram Sang wrote:
> On Wed, Apr 20, 2016 at 05:17:56PM +0200, Peter Rosin wrote:
>> Add i2c_lock_bus() and i2c_unlock_bus(), which call the new lock_bus and
>> unlock_bus ops in the adapter. These funcs/ops take an additional flags
>> argument that indicates for what purpose the adapter is locked.
>>
>> There are two flags, I2C_LOCK_ADAPTER and I2C_LOCK_SEGMENT, but they are
>> both implemented the same. For now. Locking the adapter means that the
>> whole bus is locked, locking the segment means that only the current bus
>> segment is locked (i.e. i2c traffic on the parent side of mux is still
>> allowed even if the child side of the mux is locked.
>>
>> Also support a trylock_bus op (but no function to call it, as it is not
>> expected to be needed outside of the i2c core).
>>
>> Implement i2c_lock_adapter/i2c_unlock_adapter in terms of the new locking
>> scheme (i.e. lock with the I2C_LOCK_ADAPTER flag).
>>
>> Annotate some of the locking with explicit I2C_LOCK_SEGMENT flags.
>>
>> Signed-off-by: Peter Rosin 
> Letting you know that I start reviewing the 2nd part of your series. Did
> the first glimpse today. Will hopefully do the in-depth part this
> weekend. One thing already:
>
>> +static void i2c_adapter_lock_bus(struct i2c_adapter *adapter, int flags)
> Shouldn't flags be unsigned?
>

Yes, obviously... I'll make that change locally and wait for the rest.

Cheers,
Peter

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 20/25] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2016-04-28 Thread Arnd Bergmann
On Thursday 28 April 2016 22:19:14 Yury Norov wrote:
> 
> Yes, we need. Otherwise we have circular dependency like this:
> arch/arm64/kernel/sys_ilp32.c:60:0: warning: "__SC_WRAP" redefined
>  #define __SC_WRAP(nr, sym) [nr] = compat_##sym,
>   ^
>   In file included from include/asm-generic/unistd.h:1:0,
>from ./arch/arm64/include/uapi/asm/unistd.h:16,
>from ./arch/arm64/include/asm/unistd.h:62,
>from ./include/uapi/linux/unistd.h:7,
>from include/linux/syscalls.h:23,
>from arch/arm64/kernel/sys_ilp32.c:30:
> include/uapi/asm-generic/unistd.h:33:0: note: this is the location of the 
> previous definition
>  #define __SC_WRAP __SYSCALL
> 
> Defining __SYSCALL_COMPAT at the top of the file does not help much.

Hmm, this sounds like something that we should fix in the asm-generic/unistd.h
file. Is it just for __SC_WRAP, or also the other macros?

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 20/25] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2016-04-28 Thread Yury Norov
On Thu, Apr 28, 2016 at 10:43:59PM +0200, Arnd Bergmann wrote:
> On Thursday 28 April 2016 22:19:14 Yury Norov wrote:
> > 
> > Yes, we need. Otherwise we have circular dependency like this:
> > arch/arm64/kernel/sys_ilp32.c:60:0: warning: "__SC_WRAP" redefined
> >  #define __SC_WRAP(nr, sym) [nr] = compat_##sym,
> >   ^
> >   In file included from include/asm-generic/unistd.h:1:0,
> >from ./arch/arm64/include/uapi/asm/unistd.h:16,
> >from ./arch/arm64/include/asm/unistd.h:62,
> >from ./include/uapi/linux/unistd.h:7,
> >from include/linux/syscalls.h:23,
> >from arch/arm64/kernel/sys_ilp32.c:30:
> > include/uapi/asm-generic/unistd.h:33:0: note: this is the location of the 
> > previous definition
> >  #define __SC_WRAP __SYSCALL
> > 
> > Defining __SYSCALL_COMPAT at the top of the file does not help much.
> 
> Hmm, this sounds like something that we should fix in the asm-generic/unistd.h
> file. Is it just for __SC_WRAP, or also the other macros?
> 
>   Arnd

For __SYSCALL and __SC_WRAP:

diff --git a/arch/arm64/kernel/sys_ilp32.c
b/arch/arm64/kernel/sys_ilp32.c
index 1458ad7..410d817 100644
--- a/arch/arm64/kernel/sys_ilp32.c
+++ b/arch/arm64/kernel/sys_ilp32.c
@@ -17,6 +17,8 @@
 * along with this program.  If not, see
 * .
 */

+#define __SYSCALL_COMPAT
+
 #include 
 #include 
 #include 
@@ -48,13 +50,12 @@ asmlinkage long
 ilp32_sys_rt_sigreturn_wrapper(void);
   
 #include 
 
-#undef __SYSCALL
-#undef __SC_COMP
-#undef __SC_WRAP
-#undef __SC_3264
-#undef __SC_COMP_3264
 
-#define __SYSCALL_COMPAT
 #define __SYSCALL(nr, sym) [nr] = sym,
 #define __SC_WRAP(nr, sym) [nr] = compat_##sym,
 
This patch makes gcc warn about redefinition.

arch/arm64/kernel/sys_ilp32.c:59:0: warning: "__SYSCALL" redefined
 #define __SYSCALL(nr, sym) [nr] = sym,
 ^
In file included from include/asm-generic/unistd.h:1:0,
 from ./arch/arm64/include/uapi/asm/unistd.h:16,
 from ./arch/arm64/include/asm/unistd.h:62,
 from ./include/uapi/linux/unistd.h:7,
 from include/linux/syscalls.h:23,
 from arch/arm64/kernel/sys_ilp32.c:30:
include/uapi/asm-generic/unistd.h:15:0: note: this is the location of the 
previous definition
 #define __SYSCALL(x, y)
 ^
arch/arm64/kernel/sys_ilp32.c:60:0: warning: "__SC_WRAP" redefined
 #define __SC_WRAP(nr, sym) [nr] = compat_##sym,
 ^
In file included from include/asm-generic/unistd.h:1:0,
 from ./arch/arm64/include/uapi/asm/unistd.h:16,
 from ./arch/arm64/include/asm/unistd.h:62,
 from ./include/uapi/linux/unistd.h:7,
 from include/linux/syscalls.h:23,
 from arch/arm64/kernel/sys_ilp32.c:30:
include/uapi/asm-generic/unistd.h:33:0: note: this is the location of the 
previous definition
 #define __SC_WRAP __SYSCALL
 ^
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 00/12] Fixing TI Keystone2 kexec

2016-04-28 Thread Simon Horman
Hi Russell,

On Thu, Apr 28, 2016 at 10:26:44AM +0100, Russell King - ARM Linux wrote:
> These changes are required for TI Keystone2 kexec to be functional.  TI
> Keystone2 has the run-time view of physical memory above 4GiB, but with
> a boot time alias below 4GiB which can only be used during the early
> boot.
> 
> This means we need to translate run-time physical addresses (which the
> kernel uses) to boot-time physical addresses, which, having discussed
> with Eric, is what the kexec tools and kexec kernel API requires.
> 
> We publish a special set of boot time resources in /proc/iomem, which
> the (modified) kexec tools look for in preference to the normal resources.
> Hence, if these are found, the kexec tools make use of these resources,
> and thus kexec tools use the boot-time view of physical memory.
> 
> The first three patches have been sitting in linux-next for a while.
> I'm going to put the next ARM specific three into linux-next next week.
> 
> I've sent Eric over a month ago all the patches, including the kexec
> tools patches, but I've heard nothing back.  I'm at a loss how to
> make progress on these patches - and as I'm being hassled about this,
> I'm going to be hassling the community about it, possibly with regular
> re-posts until there is some progress.

My experience is that usually Andrew Morton takes kexec patches
and that this has been the situation for many years now.

With regards to any kexec-tools patches that are appropriate for upstream:
please send them to the kexec mailing list with me CCed and I will see
about including them in the next release. If you have done so already then
I apologise for having missed them.

>  Documentation/kdump/kdump.txt | 13 ++--
>  arch/arm/boot/dts/keystone.dtsi   |  8 +
>  arch/arm/include/asm/kexec.h  | 24 +++
>  arch/arm/include/asm/memory.h | 38 ++-
>  arch/arm/kernel/machine_kexec.c   |  2 +-
>  arch/arm/kernel/setup.c   | 65 
> +--
>  arch/arm/mach-keystone/keystone.c |  7 +
>  arch/arm/mm/idmap.c   |  2 +-
>  arch/ia64/kernel/machine_kexec.c  |  2 +-
>  include/linux/kexec.h | 42 +++--
>  kernel/kexec.c|  3 +-
>  kernel/kexec_core.c   | 30 +-
>  kernel/ksysfs.c   |  4 +--
>  13 files changed, 193 insertions(+), 47 deletions(-)
> 
> -- 
> RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
> FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
> according to speedtest.net.
> 
> ___
> kexec mailing list
> ke...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 20/25] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2016-04-28 Thread Arnd Bergmann
On Friday 29 April 2016 01:21:37 Yury Norov wrote:
> index 1458ad7..410d817 100644
> --- a/arch/arm64/kernel/sys_ilp32.c
> +++ b/arch/arm64/kernel/sys_ilp32.c
> @@ -17,6 +17,8 @@
>  * along with this program.  If not, see
>  * .
>  */
> 
> +#define __SYSCALL_COMPAT
> +
>  #include 
>  #include 
>  #include 
> @@ -48,13 +50,12 @@ asmlinkage long
>  ilp32_sys_rt_sigreturn_wrapper(void);
>
>  #include 
>  
> -#undef __SYSCALL
> -#undef __SC_COMP
> -#undef __SC_WRAP
> -#undef __SC_3264
> -#undef __SC_COMP_3264
>  
> -#define __SYSCALL_COMPAT
>  #define __SYSCALL(nr, sym) [nr] = sym,
>  #define __SC_WRAP(nr, sym) [nr] = compat_##sym,
>  
> This patch makes gcc warn about redefinition.
> 
> arch/arm64/kernel/sys_ilp32.c:59:0: warning: "__SYSCALL" redefined
>  #define __SYSCALL(nr, sym) [nr] = sym,
>  ^
> In file included from include/asm-generic/unistd.h:1:0,
> 

Ok, I think I see it now. Can you #undef the two symbols at the
end of arch/arm64/include/uapi/asm/unistd.h or possibly
include/uapi/asm-generic/unistd.h?

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v7 22/24] [media] rtl2832: change the i2c gate to be mux-locked

2016-04-28 Thread Peter Rosin
On 2016-04-28 23:47, Wolfram Sang wrote:
> On Wed, Apr 20, 2016 at 05:18:02PM +0200, Peter Rosin wrote:
>> The root i2c adapter lock is then no longer held by the i2c mux during
>> accesses behind the i2c gate, and such accesses need to take that lock
>> just like any other ordinary i2c accesses do.
>>
>> So, declare the i2c gate mux-locked, and zap the regmap overrides
>> that makes the i2c accesses unlocked and use plain old regmap
>> accesses. This also removes the need for the regmap wrappers used by
>> rtl2832_sdr, so deconvolute the code further and provide the regmap
>> handle directly instead of the wrapper functions.
>>
>> Signed-off-by: Peter Rosin 
> Antti, I'd need some tag from you since this is not the i2c realm.
>

Antti sent this:

https://lkml.org/lkml/2016/4/20/828

and I added a Tested-by in v8

https://github.com/peda-r/i2c-mux/commit/c023584d34db7aacbc59f28386378131cfa970d2

but the patch was never sent as an email, only as part of a pull request for

https://github.com/peda-r/i2c-mux/commits/mux-core-and-locking-8

So, I think all is ok, or do you need more than Tested-by?

Cheers,
Peter
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH nf-next] netfilter: allow logging from non-init namespaces

2016-04-28 Thread Michal Kubecek
Commit 69b34fb996b2 ("netfilter: xt_LOG: add net namespace support for
xt_LOG") disabled logging packets using the LOG target from non-init
namespaces. The motivation was to prevent containers from flooding
kernel log of the host. The plan was to keep it that way until syslog
namespace implementation allows containers to log in a safe way.

However, the work on syslog namespace seems to have hit a dead end
somewhere in 2013 and there are users who want to use xt_LOG in all
network namespaces. This patch allows to do so by setting

  /proc/sys/net/netfilter/nf_log_all_netns

to a nonzero value. This sysctl is only accessible from init_net so that
one cannot switch the behaviour from inside a container.

Signed-off-by: Michal Kubecek 
---
 Documentation/networking/netfilter-sysctl.txt | 10 ++
 include/net/netfilter/nf_log.h|  3 +++
 net/bridge/netfilter/ebt_log.c|  2 +-
 net/ipv4/netfilter/nf_log_arp.c   |  2 +-
 net/ipv4/netfilter/nf_log_ipv4.c  |  2 +-
 net/ipv6/netfilter/nf_log_ipv6.c  |  2 +-
 net/netfilter/nf_log.c| 22 ++
 7 files changed, 39 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/networking/netfilter-sysctl.txt

diff --git a/Documentation/networking/netfilter-sysctl.txt 
b/Documentation/networking/netfilter-sysctl.txt
new file mode 100644
index ..55791e50e169
--- /dev/null
+++ b/Documentation/networking/netfilter-sysctl.txt
@@ -0,0 +1,10 @@
+/proc/sys/net/netfilter/* Variables:
+
+nf_log_all_netns - BOOLEAN
+   0 - disabled (default)
+   not 0 - enabled
+
+   By default, only init_net namespace can log packets into kernel log
+   with LOG target; this aims to prevent containers from flooding host
+   kernel log. If enabled, this target also works in other network
+   namespaces. This variable is only accessible from init_net.
diff --git a/include/net/netfilter/nf_log.h b/include/net/netfilter/nf_log.h
index 57639fca223a..8c4b018eef72 100644
--- a/include/net/netfilter/nf_log.h
+++ b/include/net/netfilter/nf_log.h
@@ -49,6 +49,9 @@ struct nf_logger {
struct module   *me;
 };
 
+/* sysctl_nf_log_all_netns - allow LOG target in all network namespaces */
+extern int sysctl_nf_log_all_netns;
+
 /* Function to register/unregister log function. */
 int nf_log_register(u_int8_t pf, struct nf_logger *logger);
 void nf_log_unregister(struct nf_logger *logger);
diff --git a/net/bridge/netfilter/ebt_log.c b/net/bridge/netfilter/ebt_log.c
index 152300d164ac..735230ec0e49 100644
--- a/net/bridge/netfilter/ebt_log.c
+++ b/net/bridge/netfilter/ebt_log.c
@@ -78,7 +78,7 @@ ebt_log_packet(struct net *net, u_int8_t pf, unsigned int 
hooknum,
unsigned int bitmask;
 
/* FIXME: Disabled from containers until syslog ns is supported */
-   if (!net_eq(net, _net))
+   if (!net_eq(net, _net) && !sysctl_nf_log_all_netns)
return;
 
spin_lock_bh(_log_lock);
diff --git a/net/ipv4/netfilter/nf_log_arp.c b/net/ipv4/netfilter/nf_log_arp.c
index e7ad950cf9ef..39e1348dfe45 100644
--- a/net/ipv4/netfilter/nf_log_arp.c
+++ b/net/ipv4/netfilter/nf_log_arp.c
@@ -87,7 +87,7 @@ static void nf_log_arp_packet(struct net *net, u_int8_t pf,
struct nf_log_buf *m;
 
/* FIXME: Disabled from containers until syslog ns is supported */
-   if (!net_eq(net, _net))
+   if (!net_eq(net, _net) && !sysctl_nf_log_all_netns)
return;
 
m = nf_log_buf_open();
diff --git a/net/ipv4/netfilter/nf_log_ipv4.c b/net/ipv4/netfilter/nf_log_ipv4.c
index 076aadda0473..2b0083112ed8 100644
--- a/net/ipv4/netfilter/nf_log_ipv4.c
+++ b/net/ipv4/netfilter/nf_log_ipv4.c
@@ -319,7 +319,7 @@ static void nf_log_ip_packet(struct net *net, u_int8_t pf,
struct nf_log_buf *m;
 
/* FIXME: Disabled from containers until syslog ns is supported */
-   if (!net_eq(net, _net))
+   if (!net_eq(net, _net) && !sysctl_nf_log_all_netns)
return;
 
m = nf_log_buf_open();
diff --git a/net/ipv6/netfilter/nf_log_ipv6.c b/net/ipv6/netfilter/nf_log_ipv6.c
index 8dd869642f45..04960486d0e2 100644
--- a/net/ipv6/netfilter/nf_log_ipv6.c
+++ b/net/ipv6/netfilter/nf_log_ipv6.c
@@ -351,7 +351,7 @@ static void nf_log_ip6_packet(struct net *net, u_int8_t pf,
struct nf_log_buf *m;
 
/* FIXME: Disabled from containers until syslog ns is supported */
-   if (!net_eq(net, _net))
+   if (!net_eq(net, _net) && !sysctl_nf_log_all_netns)
return;
 
m = nf_log_buf_open();
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
index a5d41dfa9f05..a5f4c57b14c5 100644
--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
@@ -16,6 +16,9 @@
 #define NF_LOG_PREFIXLEN   128
 #define NFLOGGER_NAME_LEN  64
 
+int sysctl_nf_log_all_netns __read_mostly;
+EXPORT_SYMBOL(sysctl_nf_log_all_netns);
+
 

Re: [PATCH] Changed the path from to the incorrect drivers/char/sysrq.c to drivers/tty/sysrq.c

2016-04-28 Thread René Nyffenegger

Jonathan

You're right, the lines were wrapped at character 78. I have fixed that
and sent the patch to myself. The attached patch should work now.

René

Signed-off-by: René Nyffenegger 
---
 Documentation/sysrq.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt
index 13f5619..3a3b30a 100644
--- a/Documentation/sysrq.txt
+++ b/Documentation/sysrq.txt
@@ -212,7 +212,7 @@ it is currently registered in that slot. This is in case 
the slot has been
 overwritten since you registered it.
 
 The Magic SysRQ system works by registering key operations against a key op
-lookup table, which is defined in 'drivers/char/sysrq.c'. This key table has
+lookup table, which is defined in 'drivers/tty/sysrq.c'. This key table has
 a number of operations registered into it at compile time, but is mutable,
 and 2 functions are exported for interface to it:
register_sysrq_key and unregister_sysrq_key.
-- 
2.8.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 39/41] Documentation: vm: fix spelling mistakes

2016-04-28 Thread Andrew Morton
On Thu, 28 Apr 2016 07:46:07 -0600 Jonathan Corbet  wrote:

> On Thu, 28 Apr 2016 07:31:43 -0600
> Jonathan Corbet  wrote:
> 
> > On Mon, 25 Apr 2016 07:37:05 +0100
> > Eric Engestrom  wrote:
> > 
> > >  Documentation/vm/transhuge.txt | 6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)  
> > 
> > Applied to the docs tree, thanks.
> 
> Actually, I've just unapplied this one; it conflicts against changes in
> Andrew's tree and, thus, linux-next.  Andrew, maybe you'd like to take it
> on top of what you have now?

Sure.

That Documentation/vm/transhuge.txt paragraph isn't in great shape so
I gave it some extra help.


From: Eric Engestrom 
Subject: Documentation: vm: fix spelling mistakes

Signed-off-by: Eric Engestrom 
Cc: Jonathan Corbet 
Signed-off-by: Andrew Morton 
---

 Documentation/vm/transhuge.txt |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff -puN Documentation/vm/transhuge.txt~documentation-vm-fix-spelling-mistakes 
Documentation/vm/transhuge.txt
--- a/Documentation/vm/transhuge.txt~documentation-vm-fix-spelling-mistakes
+++ a/Documentation/vm/transhuge.txt
@@ -340,7 +340,7 @@ unaffected. libhugetlbfs will also work
 
 == Graceful fallback ==
 
-Code walking pagetables but unware about huge pmds can simply call
+Code walking pagetables but unaware about huge pmds can simply call
 split_huge_pmd(vma, pmd, addr) where the pmd is the one returned by
 pmd_offset. It's trivial to make the code transparent hugepage aware
 by just grepping for "pmd_offset" and adding split_huge_pmd where
@@ -414,7 +414,7 @@ tracking. The alternative is alter ->_ma
 map/unmap of the whole compound page.
 
 We set PG_double_map when a PMD of the page got split for the first time,
-but still have PMD mapping. The addtional references go away with last
+but still have PMD mapping. The additional references go away with last
 compound_mapcount.
 
 split_huge_page internally has to distribute the refcounts in the head
@@ -432,10 +432,10 @@ page->_mapcount.
 We safe against physical memory scanners too: the only legitimate way
 scanner can get reference to a page is get_page_unless_zero().
 
-All tail pages has zero ->_refcount until atomic_add(). It prevent scanner
-from geting reference to tail page up to the point. After the atomic_add()
-we don't care about ->_refcount value.  We already known how many references
-with should uncharge from head page.
+All tail pages have zero ->_refcount until atomic_add(). This prevents the
+scanner from getting a reference to the tail page up to that point. After the
+atomic_add() we don't care about the ->_refcount value.  We already known how
+many references should be uncharged from the head page.
 
 For head page get_page_unless_zero() will succeed and we don't mind. It's
 clear where reference should go after split: it will stay on head page.
_

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 20/25] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2016-04-28 Thread Yury Norov
On Tue, Apr 26, 2016 at 05:57:01PM +0100, Catalin Marinas wrote:
> On Wed, Apr 06, 2016 at 01:08:42AM +0300, Yury Norov wrote:
> > +/* Using non-compat syscalls where necessary */
> > +#define compat_sys_fadvise64_64sys_fadvise64_64
> > +#define compat_sys_fallocate   sys_fallocate
> > +#define compat_sys_ftruncate64 sys_ftruncate
> > +#define compat_sys_lookup_dcookie  sys_lookup_dcookie
> > +#define compat_sys_pread64 sys_pread64
> > +#define compat_sys_pwrite64sys_pwrite64
> > +#define compat_sys_readahead   sys_readahead
> > +#define compat_sys_shmat   sys_shmat
> 
> Why don't we use compat_sys_shmat? Is it because of COMPAT_SHMLBA?

Yes. COMPAT_SHMLBA is 4 pages, and it's aarch32-only limitation.

> 
> > +#define compat_sys_sync_file_range sys_sync_file_range
> > +#define compat_sys_truncate64  sys_truncate
> > +#define sys_llseek sys_lseek
> > +#define sys_mmap2 sys_mmap
> 
> Nitpick: there are some whitespace inconsistencies above (just convert
> all spaces to tabs).
> 
> I think you should also update Documentation/arm64/ilp32.txt to include
> the list above.

OK

> 
> > +
> > +#include 
> > +
> > +#undef __SYSCALL
> > +#undef __SC_COMP
> > +#undef __SC_WRAP
> > +#undef __SC_3264
> > +#undef __SC_COMP_3264
> 
> Minor detail: do we actually need to undef all these? Maybe we can get
> away with just defining __SYSCALL_COMPAT at the top of the file.
> 

Yes, we need. Otherwise we have circular dependency like this:
arch/arm64/kernel/sys_ilp32.c:60:0: warning: "__SC_WRAP" redefined
 #define __SC_WRAP(nr, sym) [nr] = compat_##sym,
  ^
  In file included from include/asm-generic/unistd.h:1:0,
   from ./arch/arm64/include/uapi/asm/unistd.h:16,
   from ./arch/arm64/include/asm/unistd.h:62,
   from ./include/uapi/linux/unistd.h:7,
   from include/linux/syscalls.h:23,
   from arch/arm64/kernel/sys_ilp32.c:30:
include/uapi/asm-generic/unistd.h:33:0: note: this is the location of the 
previous definition
 #define __SC_WRAP __SYSCALL

Defining __SYSCALL_COMPAT at the top of the file does not help much.

> > +
> > +#define __SYSCALL_COMPAT
> > +#define __SYSCALL(nr, sym) [nr] = sym,
> > +#define __SC_WRAP(nr, sym) [nr] = compat_##sym,
> > +
> > +/*
> > + * The sys_call_ilp32_table array must be 4K aligned to be accessible from
> > + * kernel/entry.S.
> > + */
> > +void *sys_call_ilp32_table[__NR_syscalls] __aligned(4096) = {
> > +   [0 ... __NR_syscalls - 1] = sys_ni_syscall,
> > +#include 
> > +};
> 
> -- 
> Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html