* Re: [PATCH 3/3] powerpc/ftrace: simplify prepare_ftrace_return
From: Steven Rostedt @ 2014-09-23 23:54 UTC (permalink / raw)
To: Anton Blanchard; +Cc: paulus, linuxppc-dev
In-Reply-To: <20140923194604.233bdbad@gandalf.local.home>
On Tue, 23 Sep 2014 19:46:04 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> This could be broken from the earlier patches, I haven't run just this
> test. I probably should on them.
I went back and tested, and it breaks under the first patch.
-- Steve
^ permalink raw reply
* [PATCH 1/2] powerpc: Add VM_FAULT_HWPOISON handling to powerpc page fault handler
From: Anton Blanchard @ 2014-09-24 0:27 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev
do_page_fault was missing knowledge of HWPOISON, and we would oops
if userspace tried to access a poisoned page:
kernel BUG at arch/powerpc/mm/fault.c:180!
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/mm/fault.c | 36 +++++++++++++++++++++---------------
1 file changed, 21 insertions(+), 15 deletions(-)
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 51ab9e7..c3728c1 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -114,22 +114,31 @@ static int store_updates_sp(struct pt_regs *regs)
#define MM_FAULT_CONTINUE -1
#define MM_FAULT_ERR(sig) (sig)
-static int do_sigbus(struct pt_regs *regs, unsigned long address)
+static int do_sigbus(struct pt_regs *regs, unsigned long address,
+ unsigned int fault)
{
siginfo_t info;
up_read(¤t->mm->mmap_sem);
- if (user_mode(regs)) {
- current->thread.trap_nr = BUS_ADRERR;
- info.si_signo = SIGBUS;
- info.si_errno = 0;
- info.si_code = BUS_ADRERR;
- info.si_addr = (void __user *)address;
- force_sig_info(SIGBUS, &info, current);
- return MM_FAULT_RETURN;
+ if (!user_mode(regs))
+ return MM_FAULT_ERR(SIGBUS);
+
+ current->thread.trap_nr = BUS_ADRERR;
+ info.si_signo = SIGBUS;
+ info.si_errno = 0;
+ info.si_code = BUS_ADRERR;
+ info.si_addr = (void __user *)address;
+
+#ifdef CONFIG_MEMORY_FAILURE
+ if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) {
+ pr_err("MCE: Killing %s:%d due to hardware memory corruption fault at %lx\n",
+ current->comm, current->pid, address);
+ info.si_code = BUS_MCEERR_AR;
}
- return MM_FAULT_ERR(SIGBUS);
+#endif
+ force_sig_info(SIGBUS, &info, current);
+ return MM_FAULT_RETURN;
}
static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault)
@@ -170,11 +179,8 @@ static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault)
return MM_FAULT_RETURN;
}
- /* Bus error. x86 handles HWPOISON here, we'll add this if/when
- * we support the feature in HW
- */
- if (fault & VM_FAULT_SIGBUS)
- return do_sigbus(regs, addr);
+ if (fault & (VM_FAULT_SIGBUS|VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE))
+ return do_sigbus(regs, addr, fault);
/* We don't understand the fault code, this is fatal */
BUG();
--
1.9.1
^ permalink raw reply related
* [PATCH 2/2] powerpc: Fill in si_addr_lsb siginfo field
From: Anton Blanchard @ 2014-09-24 0:27 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev
In-Reply-To: <1411518427-14408-1-git-send-email-anton@samba.org>
Fill in the si_addr_lsb siginfo field so the hwpoison code can
pass to userspace the length of memory that has been corrupted.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/mm/fault.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index c3728c1..3b16c58 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -33,6 +33,7 @@
#include <linux/magic.h>
#include <linux/ratelimit.h>
#include <linux/context_tracking.h>
+#include <linux/hugetlb.h>
#include <asm/firmware.h>
#include <asm/page.h>
@@ -118,6 +119,7 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address,
unsigned int fault)
{
siginfo_t info;
+ unsigned int lsb = 0;
up_read(¤t->mm->mmap_sem);
@@ -136,7 +138,13 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address,
current->comm, current->pid, address);
info.si_code = BUS_MCEERR_AR;
}
+
+ if (fault & VM_FAULT_HWPOISON_LARGE)
+ lsb = hstate_index_to_shift(VM_FAULT_GET_HINDEX(fault));
+ if (fault & VM_FAULT_HWPOISON)
+ lsb = PAGE_SHIFT;
#endif
+ info.si_addr_lsb = lsb;
force_sig_info(SIGBUS, &info, current);
return MM_FAULT_RETURN;
}
--
1.9.1
^ permalink raw reply related
* Re: [PATCH 3/3] powerpc/ftrace: simplify prepare_ftrace_return
From: Anton Blanchard @ 2014-09-24 2:22 UTC (permalink / raw)
To: Steven Rostedt; +Cc: paulus, linuxppc-dev
In-Reply-To: <20140923195436.45ae7e2c@gandalf.local.home>
Hi Steve,
> > This could be broken from the earlier patches, I haven't run just
> > this test. I probably should on them.
>
> I went back and tested, and it breaks under the first patch.
Thanks for testing. It looks like some toolchains have issues
other than the -fno-no-omit-frame-pointer one, and -mno-sched-epilog
works around it.
I'll drop that patch and respin.
Anton
^ permalink raw reply
* Re: [2/4] powerpc/eeh: Introduce eeh_ops::err_inject
From: Michael Ellerman @ 2014-09-24 2:23 UTC (permalink / raw)
To: Gavin Shan, linuxppc-dev; +Cc: mikey, qiudayu, Gavin Shan
In-Reply-To: <1409039779-392-3-git-send-email-gwshan@linux.vnet.ibm.com>
On Tue, 2014-26-08 at 07:56:17 UTC, Gavin Shan wrote:
> From: Mike Qiu <qiudayu@linux.vnet.ibm.com>
>
> +
> + /* Firmware supports error injection ? */
> + ret = opal_check_token(OPAL_PCI_ERR_INJCT);
> + if (ret != OPAL_TOKEN_PRESENT) {
> + pr_warn("%s: Firmware not support error injection (%lld)\n",
> + __func__, ret);
This doesn't build, we dropped OPAL_TOKEN_PRESENT.
I've replaced it with:
if (!opal_check_token(OPAL_PCI_ERR_INJCT)) {
pr_warn("%s: Firmware doesn't support error injection (%lld)\n",
__func__, ret);
cheers
^ permalink raw reply
* Re: [PATCH 3/3] powerpc/ftrace: simplify prepare_ftrace_return
From: Benjamin Herrenschmidt @ 2014-09-24 2:24 UTC (permalink / raw)
To: Anton Blanchard; +Cc: paulus, linuxppc-dev, Steven Rostedt
In-Reply-To: <20140924122202.62feb950@kryten>
On Wed, 2014-09-24 at 12:22 +1000, Anton Blanchard wrote:
> Hi Steve,
>
> > > This could be broken from the earlier patches, I haven't run just
> > > this test. I probably should on them.
> >
> > I went back and tested, and it breaks under the first patch.
>
> Thanks for testing. It looks like some toolchains have issues
> other than the -fno-no-omit-frame-pointer one, and -mno-sched-epilog
> works around it.
>
> I'll drop that patch and respin.
Or maybe do a toolchain check / or enable it in LE ?
Ben.
^ permalink raw reply
* Re: [PATCH 3/3] powerpc/ftrace: simplify prepare_ftrace_return
From: Anton Blanchard @ 2014-09-24 2:33 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: paulus, linuxppc-dev, Steven Rostedt, Alan Modra
In-Reply-To: <1411525460.4184.29.camel@pasglop>
Hi Ben,
> > I'll drop that patch and respin.
>
> Or maybe do a toolchain check / or enable it in LE ?
We are scratching our heads trying to remember details of the issue
right now. In retrospect we should have linked the gcc bugzilla or
gcc commit details in the kernel commit message :)
Steve: what gcc version are you building with?
Anton
^ permalink raw reply
* Re: [PATCH 3/3] powerpc/ftrace: simplify prepare_ftrace_return
From: Steven Rostedt @ 2014-09-24 2:44 UTC (permalink / raw)
To: Anton Blanchard; +Cc: Alan Modra, paulus, linuxppc-dev
In-Reply-To: <20140924123307.7649bec8@kryten>
On Wed, 24 Sep 2014 12:33:07 +1000
Anton Blanchard <anton@samba.org> wrote:
> Hi Ben,
>
> > > I'll drop that patch and respin.
> >
> > Or maybe do a toolchain check / or enable it in LE ?
>
> We are scratching our heads trying to remember details of the issue
> right now. In retrospect we should have linked the gcc bugzilla or
> gcc commit details in the kernel commit message :)
>
> Steve: what gcc version are you building with?
>
powerpc64-linux-gcc (GCC) 4.6.3
I got it from here:
https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.6.3/
-- Steve
^ permalink raw reply
* [PATCH v4 1/3] MSI/powerpc: Use __read_msi_msg() instead of read_msi_msg()
From: Yijing Wang @ 2014-09-24 3:09 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: Yijing Wang, linux-pci, linuxppc-dev
Read_msi_msg() only be called in rtas_setup_msi_irqs(),
use __read_msi_msg() instead of read_msi_msg for
simplification.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: linuxppc-dev@lists.ozlabs.org
---
arch/powerpc/platforms/pseries/msi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
index 18ff462..dae71df 100644
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -485,7 +485,7 @@ again:
irq_set_msi_desc(virq, entry);
/* Read config space back so we can restore after reset */
- read_msi_msg(virq, &msg);
+ __read_msi_msg(entry, &msg);
entry->msg = msg;
}
--
1.7.1
^ permalink raw reply related
* Re: [PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms
From: Yijing Wang @ 2014-09-24 3:52 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linux-mips, linux-ia64, linux-pci, Bharat.Bhushan, sparclinux,
linux-arch, linux-s390, Russell King, Joerg Roedel, x86,
Sebastian Ott, xen-devel, arnab.basu, Arnd Bergmann,
Konrad Rzeszutek Wilk, Chris Metcalf, Thomas Gleixner,
linux-arm-kernel, Xinwei Hu, Tony Luck, Ralf Baechle, iommu,
Wuyun, linuxppc-dev, David S. Miller
In-Reply-To: <20140923210936.GC27117@google.com>
On 2014/9/24 5:09, Bjorn Helgaas wrote:
> On Fri, Sep 05, 2014 at 06:09:45PM +0800, Yijing Wang wrote:
>> This series is based Bjorn's pci-next branch + Alexander Gordeev's two patches
>> "Remove arch_msi_check_device()" link: https://lkml.org/lkml/2014/7/12/41
>>
>> Currently, there are a lot of weak arch functions in MSI code.
>> Thierry Reding Introduced MSI chip framework to configure MSI/MSI-X in arm.
>> This series use MSI chip framework to refactor MSI code across all platforms
>> to eliminate weak arch functions. It has been tested fine in x86(with or without
>> irq remap).
>
> I see you plan some updates, so I'll look for a v2 posting after v3.17 releases.
> It will be great to get rid of some of those weak functions!
Thanks, I will send out the new version soon.
Thanks!
Yijing.
>
> Bjorn
>
> .
>
--
Thanks!
Yijing
^ permalink raw reply
* [PATCH 1/3] powerpc: Don't build powernv for other platform defconfigs
From: Michael Ellerman @ 2014-09-24 5:57 UTC (permalink / raw)
To: linuxppc-dev
Because powernv arrived after these other platforms, the defconfigs
didn't have PPC_POWERNV disabled, and being default y it gets turned on.
If we're going to bother having defconfigs for the specific platforms
then they should only build the code required for those platforms.
The grab bag of everything config is ppc64_defconfig.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/configs/cell_defconfig | 1 +
arch/powerpc/configs/celleb_defconfig | 1 +
arch/powerpc/configs/g5_defconfig | 1 +
arch/powerpc/configs/maple_defconfig | 1 +
arch/powerpc/configs/pasemi_defconfig | 1 +
5 files changed, 5 insertions(+)
diff --git a/arch/powerpc/configs/cell_defconfig b/arch/powerpc/configs/cell_defconfig
index 45fd06cdc3e8..7a7b3c879f96 100644
--- a/arch/powerpc/configs/cell_defconfig
+++ b/arch/powerpc/configs/cell_defconfig
@@ -18,6 +18,7 @@ CONFIG_OPROFILE=m
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_PPC_POWERNV is not set
# CONFIG_PPC_PSERIES is not set
# CONFIG_PPC_PMAC is not set
CONFIG_PPC_PS3=y
diff --git a/arch/powerpc/configs/celleb_defconfig b/arch/powerpc/configs/celleb_defconfig
index 77d7bf3ca2ac..acccbfde8a50 100644
--- a/arch/powerpc/configs/celleb_defconfig
+++ b/arch/powerpc/configs/celleb_defconfig
@@ -15,6 +15,7 @@ CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
+# CONFIG_PPC_POWERNV is not set
# CONFIG_PPC_PSERIES is not set
# CONFIG_PPC_PMAC is not set
CONFIG_PPC_CELLEB=y
diff --git a/arch/powerpc/configs/g5_defconfig b/arch/powerpc/configs/g5_defconfig
index 7594c5ac6481..6fab06f7f411 100644
--- a/arch/powerpc/configs/g5_defconfig
+++ b/arch/powerpc/configs/g5_defconfig
@@ -16,6 +16,7 @@ CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
+# CONFIG_PPC_POWERNV is not set
# CONFIG_PPC_PSERIES is not set
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
diff --git a/arch/powerpc/configs/maple_defconfig b/arch/powerpc/configs/maple_defconfig
index c8b6a9ddb21b..fbd9e4163311 100644
--- a/arch/powerpc/configs/maple_defconfig
+++ b/arch/powerpc/configs/maple_defconfig
@@ -16,6 +16,7 @@ CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_PPC_POWERNV is not set
# CONFIG_PPC_PSERIES is not set
# CONFIG_PPC_PMAC is not set
CONFIG_PPC_MAPLE=y
diff --git a/arch/powerpc/configs/pasemi_defconfig b/arch/powerpc/configs/pasemi_defconfig
index e5e7838af008..3e72c8c06a0d 100644
--- a/arch/powerpc/configs/pasemi_defconfig
+++ b/arch/powerpc/configs/pasemi_defconfig
@@ -14,6 +14,7 @@ CONFIG_MODULE_UNLOAD=y
# CONFIG_BLK_DEV_BSG is not set
CONFIG_PARTITION_ADVANCED=y
CONFIG_MAC_PARTITION=y
+# CONFIG_PPC_POWERNV is not set
# CONFIG_PPC_PSERIES is not set
# CONFIG_PPC_PMAC is not set
CONFIG_PPC_PASEMI=y
--
1.9.1
^ permalink raw reply related
* [PATCH 2/3] powerpc: Enable CONFIG_CRASH_DUMP=y for ppc64_defconfig
From: Michael Ellerman @ 2014-09-24 5:57 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1411538232-31516-1-git-send-email-mpe@ellerman.id.au>
It pulls in more code, including causing us to build a relocatable
kernel, which is good for testing.
The resulting kernel is still usable as a non-crash dump kernel.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/configs/ppc64_defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig
index f6c02f8cdc62..b9b769e4a23e 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -50,6 +50,7 @@ CONFIG_HZ_100=y
CONFIG_BINFMT_MISC=m
CONFIG_PPC_TRANSACTIONAL_MEM=y
CONFIG_KEXEC=y
+CONFIG_CRASH_DUMP=y
CONFIG_IRQ_ALL_CPUS=y
CONFIG_MEMORY_HOTREMOVE=y
CONFIG_SCHED_SMT=y
--
1.9.1
^ permalink raw reply related
* [PATCH 3/3] powerpc/kdump: crash_dump.c needs to include io.h
From: Michael Ellerman @ 2014-09-24 5:57 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1411538232-31516-1-git-send-email-mpe@ellerman.id.au>
For __ioremap().
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/kernel/crash_dump.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c
index 7a13f378ca2c..c78e6dac4d7d 100644
--- a/arch/powerpc/kernel/crash_dump.c
+++ b/arch/powerpc/kernel/crash_dump.c
@@ -13,6 +13,7 @@
#include <linux/crash_dump.h>
#include <linux/bootmem.h>
+#include <linux/io.h>
#include <linux/memblock.h>
#include <asm/code-patching.h>
#include <asm/kdump.h>
--
1.9.1
^ permalink raw reply related
* Re: [PATCH 1/3] powerpc: Don't build powernv for other platform defconfigs
From: Stephen Rothwell @ 2014-09-24 6:34 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
In-Reply-To: <1411538232-31516-1-git-send-email-mpe@ellerman.id.au>
[-- Attachment #1: Type: text/plain, Size: 394 bytes --]
Hi Michael,
On Wed, 24 Sep 2014 15:57:10 +1000 Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> Because powernv arrived after these other platforms, the defconfigs
> didn't have PPC_POWERNV disabled, and being default y it gets turned on.
Well, that raises the question of why PPC_POWERNV is default y at all?
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 3/3] powerpc/kdump: crash_dump.c needs to include io.h
From: Stephen Rothwell @ 2014-09-24 6:36 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
In-Reply-To: <1411538232-31516-3-git-send-email-mpe@ellerman.id.au>
[-- Attachment #1: Type: text/plain, Size: 340 bytes --]
Hi Michael,
On Wed, 24 Sep 2014 15:57:12 +1000 Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> For __ioremap().
So does that mean that you really want this patch before 2/3 so that you
don't introduce an unnecessary bisection breakage in ppc64_defconfig?
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 1/2] powerpc: Add VM_FAULT_HWPOISON handling to powerpc page fault handler
From: Stephen Rothwell @ 2014-09-24 6:40 UTC (permalink / raw)
To: Anton Blanchard; +Cc: paulus, linuxppc-dev
In-Reply-To: <1411518427-14408-1-git-send-email-anton@samba.org>
[-- Attachment #1: Type: text/plain, Size: 838 bytes --]
Hi Anton,
On Wed, 24 Sep 2014 10:27:06 +1000 Anton Blanchard <anton@samba.org> wrote:
>
> - if (user_mode(regs)) {
> - current->thread.trap_nr = BUS_ADRERR;
> - info.si_signo = SIGBUS;
> - info.si_errno = 0;
> - info.si_code = BUS_ADRERR;
> - info.si_addr = (void __user *)address;
> - force_sig_info(SIGBUS, &info, current);
> - return MM_FAULT_RETURN;
> + if (!user_mode(regs))
> + return MM_FAULT_ERR(SIGBUS);
> +
> + current->thread.trap_nr = BUS_ADRERR;
> + info.si_signo = SIGBUS;
> + info.si_errno = 0;
> + info.si_code = BUS_ADRERR;
> + info.si_addr = (void __user *)address;
If you had done this as 2 patches (one to remove the indent and a
second to fix the actual problem), it would have been much easier to
review ...
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* [PATCH 1/3] powerpc: Simplify do_sigbus
From: Anton Blanchard @ 2014-09-24 6:59 UTC (permalink / raw)
To: benh, paulus, mpe, amodra, torvalds, sfr; +Cc: linuxppc-dev
Exit out early for a kernel fault, avoiding indenting of
most of the function.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/mm/fault.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 51ab9e7..abc8c81 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -120,16 +120,16 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address)
up_read(¤t->mm->mmap_sem);
- if (user_mode(regs)) {
- current->thread.trap_nr = BUS_ADRERR;
- info.si_signo = SIGBUS;
- info.si_errno = 0;
- info.si_code = BUS_ADRERR;
- info.si_addr = (void __user *)address;
- force_sig_info(SIGBUS, &info, current);
- return MM_FAULT_RETURN;
- }
- return MM_FAULT_ERR(SIGBUS);
+ if (!user_mode(regs))
+ return MM_FAULT_ERR(SIGBUS);
+
+ current->thread.trap_nr = BUS_ADRERR;
+ info.si_signo = SIGBUS;
+ info.si_errno = 0;
+ info.si_code = BUS_ADRERR;
+ info.si_addr = (void __user *)address;
+ force_sig_info(SIGBUS, &info, current);
+ return MM_FAULT_RETURN;
}
static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault)
--
1.9.1
^ permalink raw reply related
* [PATCH 2/3] powerpc: Add VM_FAULT_HWPOISON handling to powerpc page fault handler
From: Anton Blanchard @ 2014-09-24 6:59 UTC (permalink / raw)
To: benh, paulus, mpe, amodra, torvalds, sfr; +Cc: linuxppc-dev
In-Reply-To: <1411541999-21457-1-git-send-email-anton@samba.org>
do_page_fault was missing knowledge of HWPOISON, and we would oops
if userspace tried to access a poisoned page:
kernel BUG at arch/powerpc/mm/fault.c:180!
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/mm/fault.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index abc8c81..588b6cc 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -114,7 +114,8 @@ static int store_updates_sp(struct pt_regs *regs)
#define MM_FAULT_CONTINUE -1
#define MM_FAULT_ERR(sig) (sig)
-static int do_sigbus(struct pt_regs *regs, unsigned long address)
+static int do_sigbus(struct pt_regs *regs, unsigned long address,
+ unsigned int fault)
{
siginfo_t info;
@@ -128,6 +129,13 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address)
info.si_errno = 0;
info.si_code = BUS_ADRERR;
info.si_addr = (void __user *)address;
+#ifdef CONFIG_MEMORY_FAILURE
+ if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) {
+ pr_err("MCE: Killing %s:%d due to hardware memory corruption fault at %lx\n",
+ current->comm, current->pid, address);
+ info.si_code = BUS_MCEERR_AR;
+ }
+#endif
force_sig_info(SIGBUS, &info, current);
return MM_FAULT_RETURN;
}
@@ -170,11 +178,8 @@ static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault)
return MM_FAULT_RETURN;
}
- /* Bus error. x86 handles HWPOISON here, we'll add this if/when
- * we support the feature in HW
- */
- if (fault & VM_FAULT_SIGBUS)
- return do_sigbus(regs, addr);
+ if (fault & (VM_FAULT_SIGBUS|VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE))
+ return do_sigbus(regs, addr, fault);
/* We don't understand the fault code, this is fatal */
BUG();
--
1.9.1
^ permalink raw reply related
* [PATCH 3/3] powerpc: Fill in si_addr_lsb siginfo field
From: Anton Blanchard @ 2014-09-24 6:59 UTC (permalink / raw)
To: benh, paulus, mpe, amodra, torvalds, sfr; +Cc: linuxppc-dev
In-Reply-To: <1411541999-21457-1-git-send-email-anton@samba.org>
Fill in the si_addr_lsb siginfo field so the hwpoison code can
pass to userspace the length of memory that has been corrupted.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/mm/fault.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 588b6cc..24b3f49 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -33,6 +33,7 @@
#include <linux/magic.h>
#include <linux/ratelimit.h>
#include <linux/context_tracking.h>
+#include <linux/hugetlb.h>
#include <asm/firmware.h>
#include <asm/page.h>
@@ -118,6 +119,7 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address,
unsigned int fault)
{
siginfo_t info;
+ unsigned int lsb = 0;
up_read(¤t->mm->mmap_sem);
@@ -135,7 +137,13 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address,
current->comm, current->pid, address);
info.si_code = BUS_MCEERR_AR;
}
+
+ if (fault & VM_FAULT_HWPOISON_LARGE)
+ lsb = hstate_index_to_shift(VM_FAULT_GET_HINDEX(fault));
+ if (fault & VM_FAULT_HWPOISON)
+ lsb = PAGE_SHIFT;
#endif
+ info.si_addr_lsb = lsb;
force_sig_info(SIGBUS, &info, current);
return MM_FAULT_RETURN;
}
--
1.9.1
^ permalink raw reply related
* Re: [PATCH 1/2] powerpc: Add VM_FAULT_HWPOISON handling to powerpc page fault handler
From: Anton Blanchard @ 2014-09-24 7:00 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: paulus, linuxppc-dev
In-Reply-To: <20140924164005.2b142a4a@canb.auug.org.au>
Hi Stephen,
> If you had done this as 2 patches (one to remove the indent and a
> second to fix the actual problem), it would have been much easier to
> review ...
Good idea, I separated it out and resubmitted.
Anton
^ permalink raw reply
* [PATCH] powerpc/8xx: Remove Kconfig symbol FADS
From: Paul Bolle @ 2014-09-24 8:06 UTC (permalink / raw)
To: Vitaly Bordug, Benjamin Herrenschmidt, Paul Mackerras,
Michael Ellerman
Cc: linuxppc-dev, linux-kernel
Commit 39eb56da2b53 ("pcmcia: Remove m8xx_pcmcia driver") removed the
only driver that used CONFIG_FADS. Setting the Kconfig symbol FADS is
pointless since that commit. Remove it.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
Done on top of next-20140923. Tested with "git grep" only.
Another cleanup might be to remove MPC8XXFADS (or "FADS") from the "8xx
Machine Type" choice. Is there any reason left to pick "FADS" as a
machine type?
arch/powerpc/platforms/8xx/Kconfig | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/powerpc/platforms/8xx/Kconfig b/arch/powerpc/platforms/8xx/Kconfig
index 247fdea0c8be..831f2e718b06 100644
--- a/arch/powerpc/platforms/8xx/Kconfig
+++ b/arch/powerpc/platforms/8xx/Kconfig
@@ -1,6 +1,3 @@
-config FADS
- bool
-
config CPM1
bool
select CPM
@@ -13,7 +10,6 @@ choice
config MPC8XXFADS
bool "FADS"
- select FADS
config MPC86XADS
bool "MPC86XADS"
--
1.9.3
^ permalink raw reply related
* Re: [PATCH v4 04/11] drivers: base: support cpu cache information interface to userspace via sysfs
From: Greg Kroah-Hartman @ 2014-09-24 6:35 UTC (permalink / raw)
To: Sudeep Holla
Cc: linux-s390@vger.kernel.org, Lorenzo Pieralisi,
linux-ia64@vger.kernel.org, Heiko Carstens, x86@kernel.org,
Stephen Boyd, LKML, linux-api@vger.kernel.org,
linux390@de.ibm.com, linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
In-Reply-To: <20140917190048.GA4063@kroah.com>
On Wed, Sep 17, 2014 at 12:00:48PM -0700, Greg Kroah-Hartman wrote:
> On Wed, Sep 17, 2014 at 06:25:10PM +0100, Sudeep Holla wrote:
> > Hi Greg,
> >
> > On 03/09/14 18:00, Sudeep Holla wrote:
> > >From: Sudeep Holla <sudeep.holla@arm.com>
> > >
> > >This patch adds initial support for providing processor cache information
> > >to userspace through sysfs interface. This is based on already existing
> > >implementations(x86, ia64, s390 and powerpc) and hence the interface is
> > >intended to be fully compatible.
> > >
> > >The main purpose of this generic support is to avoid further code
> > >duplication to support new architectures and also to unify all the existing
> > >different implementations.
> > >
> > >This implementation maintains the hierarchy of cache objects which reflects
> > >the system's cache topology. Cache devices are instantiated as needed as
> > >CPUs come online. The cache information is replicated per-cpu even if they are
> > >shared. A per-cpu array of cache information maintained is used mainly for
> > >sysfs-related book keeping.
> > >
> > >It also implements the shared_cpu_map attribute, which is essential for
> > >enabling both kernel and user-space to discover the system's overall cache
> > >topology.
> > >
> > >This patch also add the missing ABI documentation for the cacheinfo sysfs
> > >interface already, which is well defined and widely used.
> > >
> >
> > Can you review the first 4 patches in this series please ?
>
> It's in my todo queue, which is really long at the moment due to me
> going to conferences (at one right now...) Will be working on this
> soon, thanks for your patience.
Based on the review comments, I think you are going to change at least
the first patch, right? Please resend the latest version of this
series, with all of the accumulated tested-by and acked lines and
resend.
thanks,
greg k-h
^ permalink raw reply
* [PATCH 1/5] char: hw_random: Remove .owner field for driver
From: Kiran Padwal @ 2014-09-24 9:57 UTC (permalink / raw)
To: mpm, kgene.kim, olof, gregkh, sboyd
Cc: linux-samsung-soc, linuxppc-dev, linux-kernel, linux-arm-kernel,
Kiran Padwal
There is no need to init .owner field.
Based on the patch from Peter Griffin <peter.griffin@linaro.org>
"mmc: remove .owner field for drivers using module_platform_driver"
This patch removes the superflous .owner field for drivers which
use the module_platform_driver API, as this is overriden in
platform_driver_register anyway."
Signed-off-by: Kiran Padwal <kiran.padwal@smartplayin.com>
---
drivers/char/hw_random/atmel-rng.c | 1 -
drivers/char/hw_random/bcm2835-rng.c | 1 -
drivers/char/hw_random/bcm63xx-rng.c | 1 -
drivers/char/hw_random/exynos-rng.c | 1 -
drivers/char/hw_random/msm-rng.c | 1 -
drivers/char/hw_random/n2-drv.c | 1 -
drivers/char/hw_random/octeon-rng.c | 1 -
drivers/char/hw_random/omap3-rom-rng.c | 1 -
drivers/char/hw_random/pasemi-rng.c | 1 -
drivers/char/hw_random/ppc4xx-rng.c | 1 -
drivers/char/hw_random/timeriomem-rng.c | 1 -
11 files changed, 11 deletions(-)
diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
index 851bc7e..25a4de2 100644
--- a/drivers/char/hw_random/atmel-rng.c
+++ b/drivers/char/hw_random/atmel-rng.c
@@ -128,7 +128,6 @@ static struct platform_driver atmel_trng_driver = {
.remove = atmel_trng_remove,
.driver = {
.name = "atmel-trng",
- .owner = THIS_MODULE,
#ifdef CONFIG_PM
.pm = &atmel_trng_pm_ops,
#endif /* CONFIG_PM */
diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c
index e900961..7192ec2 100644
--- a/drivers/char/hw_random/bcm2835-rng.c
+++ b/drivers/char/hw_random/bcm2835-rng.c
@@ -99,7 +99,6 @@ MODULE_DEVICE_TABLE(of, bcm2835_rng_of_match);
static struct platform_driver bcm2835_rng_driver = {
.driver = {
.name = "bcm2835-rng",
- .owner = THIS_MODULE,
.of_match_table = bcm2835_rng_of_match,
},
.probe = bcm2835_rng_probe,
diff --git a/drivers/char/hw_random/bcm63xx-rng.c b/drivers/char/hw_random/bcm63xx-rng.c
index 36581ea..ba6a65a 100644
--- a/drivers/char/hw_random/bcm63xx-rng.c
+++ b/drivers/char/hw_random/bcm63xx-rng.c
@@ -162,7 +162,6 @@ static struct platform_driver bcm63xx_rng_driver = {
.remove = bcm63xx_rng_remove,
.driver = {
.name = "bcm63xx-rng",
- .owner = THIS_MODULE,
},
};
diff --git a/drivers/char/hw_random/exynos-rng.c b/drivers/char/hw_random/exynos-rng.c
index 9f8277c..beaa157 100644
--- a/drivers/char/hw_random/exynos-rng.c
+++ b/drivers/char/hw_random/exynos-rng.c
@@ -169,7 +169,6 @@ static UNIVERSAL_DEV_PM_OPS(exynos_rng_pm_ops, exynos_rng_runtime_suspend,
static struct platform_driver exynos_rng_driver = {
.driver = {
.name = "exynos-rng",
- .owner = THIS_MODULE,
.pm = &exynos_rng_pm_ops,
},
.probe = exynos_rng_probe,
diff --git a/drivers/char/hw_random/msm-rng.c b/drivers/char/hw_random/msm-rng.c
index 148521e..cea1c70 100644
--- a/drivers/char/hw_random/msm-rng.c
+++ b/drivers/char/hw_random/msm-rng.c
@@ -185,7 +185,6 @@ static struct platform_driver msm_rng_driver = {
.remove = msm_rng_remove,
.driver = {
.name = KBUILD_MODNAME,
- .owner = THIS_MODULE,
.of_match_table = of_match_ptr(msm_rng_of_match),
}
};
diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c
index 292a588..843d6f6 100644
--- a/drivers/char/hw_random/n2-drv.c
+++ b/drivers/char/hw_random/n2-drv.c
@@ -750,7 +750,6 @@ MODULE_DEVICE_TABLE(of, n2rng_match);
static struct platform_driver n2rng_driver = {
.driver = {
.name = "n2rng",
- .owner = THIS_MODULE,
.of_match_table = n2rng_match,
},
.probe = n2rng_probe,
diff --git a/drivers/char/hw_random/octeon-rng.c b/drivers/char/hw_random/octeon-rng.c
index b5cc342..be1c3f6 100644
--- a/drivers/char/hw_random/octeon-rng.c
+++ b/drivers/char/hw_random/octeon-rng.c
@@ -117,7 +117,6 @@ static int __exit octeon_rng_remove(struct platform_device *pdev)
static struct platform_driver octeon_rng_driver = {
.driver = {
.name = "octeon_rng",
- .owner = THIS_MODULE,
},
.probe = octeon_rng_probe,
.remove = __exit_p(octeon_rng_remove),
diff --git a/drivers/char/hw_random/omap3-rom-rng.c b/drivers/char/hw_random/omap3-rom-rng.c
index 6f2eaff..a405cdc 100644
--- a/drivers/char/hw_random/omap3-rom-rng.c
+++ b/drivers/char/hw_random/omap3-rom-rng.c
@@ -126,7 +126,6 @@ static int omap3_rom_rng_remove(struct platform_device *pdev)
static struct platform_driver omap3_rom_rng_driver = {
.driver = {
.name = "omap3-rom-rng",
- .owner = THIS_MODULE,
},
.probe = omap3_rom_rng_probe,
.remove = omap3_rom_rng_remove,
diff --git a/drivers/char/hw_random/pasemi-rng.c b/drivers/char/hw_random/pasemi-rng.c
index c66279b..ebd6f65 100644
--- a/drivers/char/hw_random/pasemi-rng.c
+++ b/drivers/char/hw_random/pasemi-rng.c
@@ -142,7 +142,6 @@ static struct of_device_id rng_match[] = {
static struct platform_driver rng_driver = {
.driver = {
.name = "pasemi-rng",
- .owner = THIS_MODULE,
.of_match_table = rng_match,
},
.probe = rng_probe,
diff --git a/drivers/char/hw_random/ppc4xx-rng.c b/drivers/char/hw_random/ppc4xx-rng.c
index 521f76b..c85d31a 100644
--- a/drivers/char/hw_random/ppc4xx-rng.c
+++ b/drivers/char/hw_random/ppc4xx-rng.c
@@ -133,7 +133,6 @@ static struct of_device_id ppc4xx_rng_match[] = {
static struct platform_driver ppc4xx_rng_driver = {
.driver = {
.name = MODULE_NAME,
- .owner = THIS_MODULE,
.of_match_table = ppc4xx_rng_match,
},
.probe = ppc4xx_rng_probe,
diff --git a/drivers/char/hw_random/timeriomem-rng.c b/drivers/char/hw_random/timeriomem-rng.c
index b6ab9ac..cf37db2 100644
--- a/drivers/char/hw_random/timeriomem-rng.c
+++ b/drivers/char/hw_random/timeriomem-rng.c
@@ -200,7 +200,6 @@ MODULE_DEVICE_TABLE(of, timeriomem_rng_match);
static struct platform_driver timeriomem_rng_driver = {
.driver = {
.name = "timeriomem_rng",
- .owner = THIS_MODULE,
.of_match_table = timeriomem_rng_match,
},
.probe = timeriomem_rng_probe,
--
1.7.9.5
^ permalink raw reply related
* [PATCHv8 0/6] Getting rid of get_unused_fd() / enable close-on-exec
From: Yann Droneaud @ 2014-09-24 13:11 UTC (permalink / raw)
To: Richard Guy Briggs, Eric Paris, Tony Luck, Fenghua Yu, linux-ia64,
Jeremy Kerr, Arnd Bergmann, Benjamin Herrenschmidt,
Paul Mackerras, Michael Ellerman, linuxppc-dev, cbe-oss-dev,
Al Viro, linux-fsdevel, Andrew Morton, Jiri Kosina
Cc: Yann Droneaud, linux-api, linux-kernel, Ulrich Drepper
TL;DR:
- Trivial patches to replace calls to get_unused_fd() by
get_unused_fd_flags(0);
- Patch to remove get_unused_fd();
- Patch to add support O_CLOEXEC in fanotify_init().
Hi,
Please find the eighth revision of my patchset to remove
get_unused_fd() macro in order to help subsystems to use
get_unused_fd_flags() (or anon_inode_getfd()) with flags either
provided by the userspace or set to O_CLOEXEC by default where
appropriate.
Without get_unused_fd() macro, more subsystems are likely to use
get_unused_fd_flags() (or anon_inode_getfd()) and be taught to
provide an API that let userspace choose the opening flags of
the file descriptor.
Not allowing userspace to provide the "open" flags or not using
O_CLOEXEC by default should be considered bad practice from
security point of view: in most case O_CLOEXEC must be used to
not leak file descriptor across exec().
Not allowing userspace to atomically set close-on-exec flag and
not using O_CLOEXEC should be avoided to protect multi-threaded
program from race condition when it tried to set close-on-exec
flag using fcntl(fd, F_SETFD, FD_CLOEXEC) after opening the file
descriptor.
Example:
int fd;
int ret;
fd = open(filename, O_RDONLY);
if (fd < 0) {
perror("open");
return -1;
}
/*
* window opened for another thread to call fork(),
* then the new process can call exec() at any time
* and the file descriptor would be inherited
*/
ret = fcntl(fd, F_SETFD, FD_CLOEXEC)
if (ret < 0) {
perror("fnctl()");
close(fd);
return -1;
}
vs.:
int fd;
fd = open(filename, O_RDONLY | O_CLOEXEC);
if (fd < 0) {
perror("open");
return -1;
}
Using O_CLOEXEC by default when flags are not (eg. cannot be)
provided by userspace is the safest bet as it allows userspace
to choose, if, when and where the file descriptor is going to be
inherited across exec(): userspace is free to call fcntl() to
remove FD_CLOEXEC flag in the child process that will call
exec().
Unfortunately, O_CLOEXEC cannot be made the default for most
existing system calls as it's not the default behavior for
POSIX / Unix. Reader interested in this issue could have a look
at "Ghosts of Unix past, part 2: Conflated designs" [1] article
by Neil Brown.
FAQ:
- Why do one want close-on-exec ?
Setting close-on-exec flag on file descriptor ensure it won't be
inherited silently by child, child of child, etc. when executing
another program.
If the file descriptor is not closed, some kernel resources can
be locked until the last process with the opened file descriptor
exit.
If the file descriptor is not closed, this can lead to a
security issue, eg. making resources available to a less
privileged program allowing information leak and/or deny of
service.
- Why do one need atomic close-on-exec ?
Even if it's possible to set close-on-exec flag through call to
fcntl() as shown previously, it introduces a race condition in
multi-threaded process, where a thread call fork() / exec()
while another thread is between call to open() and fcntl().
Additionally, using close-on-exec free the programmer from
tracking manually which file descriptor is to be closed in a
child before calling exec(): in a program using multiple
third-party libraries, it's difficult to know which file
descriptor must be closed. AFAIK, while there's a atexit(),
pthread_atfork(), there's no atexec() userspace function
in libc to allow libraries to register a handler in order
to close its opened file descriptor before exec().
- Why default to close-on-exec ?
Some kernel interfaces don't allow userspace to pass a
O_CLOEXEC-like flag when creating a new file descriptor.
In such cases, if possible (see below), O_CLOEXEC must be made
the default so that userspace doesn't have to call fcntl()
which, as demonstrated previously, is open to race condition
in multi-threaded program.
- How to choose between flag 0 or O_CLOEXEC in call to
get_unused_fd_flags() (or anon_inode_getfd()) ?
Short: Will it break existing application ? Will it break kernel
ABI ?
If answer is no, use O_CLOEXEC.
If answer is yes, use 0.
Long: If userspace expect to retrieve a file descriptor with
plain old Unix(tm) semantics, O_CLOEXEC must not be made
the default, as it could break some applications expecting
that the file descriptor will be inherited across exec().
But for some subsystems, such as InfiniBand, KVM, VFIO,
etc. it makes no sense to have file descriptors inherited
across exec() since those are tied to resources that will
vanish when a another program will replace the current
one by mean of exec(), so it's safe to use O_CLOEXEC in
such cases.
For others, like XFS, the file descriptor is retrieved by
one program and will be used by a different program,
executed as a child. In this case, setting O_CLOEXEC would
break existing application which do not expect to have to
call fcntl(fd, F_SETFD, 0) to make it available across
exec().
If file descriptor created by a subsystem is not tied to
the current process resources, it's likely legal to use it
in a different process context, thus O_CLOEXEC must not be
the default.
If one, as a subsystem maintainer, cannot tell for sure
that no userspace program ever rely current behavior, eg.
file descriptor being inherited across exec(), then the
default flag *must* be kept 0 to not break application.
- This subsystem cannot be turned to use O_CLOEXEC by default:
If O_CLOEXEC cannot be made the default, it would be interesting
to think to extend the API to have a (set of) function(s) taking
a flag parameter so that userspace can atomically request
close-on-exec if it need it (and it should need it !).
- Background:
One might want to read "Secure File Descriptor Handling" [2] by
Ulrich Drepper who is responsible of adding O_CLOEXEC flag on
open(), and flags alike on other syscalls.
One might also want to read PEP-446 "Make newly created file
descriptors non-inheritable" [3] by Victor Stinner since it has
lot more background information on file descriptor leaking.
One would also like to read "Excuse me son, but your code is
leaking !!!" [4] by Dan Walsh for advice.
[1] http://lwn.net/Articles/412131/
[2] http://udrepper.livejournal.com/20407.html
[3] http://www.python.org/dev/peps/pep-0446/
[4] http://danwalsh.livejournal.com/53603.html
- Statistics:
In linux-next, tag next-20140924, they're currently:
- 33 calls to fd_install()
with one call part of anon_inode_getfd()
- 26 calls to get_unused_fd_flags()
with one call part of anon_inode_getfd()
with another part of get_unused_fd() macro
- 11 calls to anon_inode_getfd()
- 8 calls to anon_inode_getfile()
with one call part of anon_inode_getfd()
- 6 calls to get_unused_fd()
Changes from patchset v7 [PATCHSETv7]
- Rebased on top of latest -next
- Simplified commit message for trivial patches
- Proofread commit messages
- Addded CC: linux-api@vger.kernel.org
Changes from patchset v6 [PATCHSETv6]
- Rebased on top of latest -next
- Added Cc: trivial@kernel.org for the first trivials
patches.
Changes from patchset v5 [PATCHSETv5]
- perf: introduce a flag to enable close-on-exec in
perf_event_open()
DROPPED: applied upstream, commit a21b0b354d4a.
Changes from patchset v4 [PATCHSETv4]:
- rewrote cover letter following discussion with perf
maintainer. Thanks to Peter Zijlstra.
- modified a bit some commit messages.
- events: use get_unused_fd_flags(0) instead of get_unused_fd()
DROPPED: replaced by following patch.
- perf: introduce a flag to enable close-on-exec in
perf_event_open()
NEW: instead of hard coding the flags to 0, this patch
allows userspace to specify close-on-exec flag.
- fanotify: use get_unused_fd_flags(0) instead of get_unused_fd()
DROPPED: replaced by following patch.
- fanotify: enable close-on-exec on events' fd when requested in
fanotify_init()
NEW: instead of hard coding the flags to 0, this patch
enable close-on-exec if userspace request it.
Changes from patchset v3 [PATCHSETv3]:
- industrialio: use anon_inode_getfd() with O_CLOEXEC flag
DROPPED: applied upstream, commit a646fbf0fd11.
Changes from patchset v2 [PATCHSETv2]:
- android/sw_sync: use get_unused_fd_flags(O_CLOEXEC) instead
of get_unused_fd()
DROPPED: applied upstream, commit 45acea57335e.
- android/sync: use get_unused_fd_flags(O_CLOEXEC) instead of
get_unused_fd()
DROPPED: applied upstream, commit 9c6cd3b39048.
- vfio: use get_unused_fd_flags(0) instead of get_unused_fd()
DROPPED: applied upstream, commit a5d550703d2c.
Additionally subsystem maintainer applied another patch on top
to set the flags to O_CLOEXEC, commit 5d042fbdbb2d.
- industrialio: use anon_inode_getfd() with O_CLOEXEC flag
NEW: propose to use O_CLOEXEC as default flag.
Changes from patchset v1 [PATCHSETv1]:
- explicitly added subsystem maintainers as mail recepients.
- infiniband: use get_unused_fd_flags(0) instead of
get_unused_fd()
DROPPED: subsystem maintainer applied another patch
using get_unused_fd_flags(O_CLOEXEC) as suggested,
commit da183c7af844.
- android/sw_sync: use get_unused_fd_flags(0) instead of
get_unused_fd()
MODIFIED: use get_unused_fd_flags(O_CLOEXEC) as suggested.
- android/sync: use get_unused_fd_flags(0) instead of
get_unused_fd()
MODIFIED: use get_unused_fd_flags(O_CLOEXEC) as suggested.
- xfs: use get_unused_fd_flags(0) instead of get_unused_fd()
DROPPED: applied asis by subsystem maintainer, commit 862a62937e76.
- sctp: use get_unused_fd_flags(0) instead of get_unused_fd()
DROPPED: applied asis by subsystem maintainer, commit 8a59bd3e9b29.
Links:
[PATCHSETv7]
http://lkml.kernel.org/r/cover.1401630396.git.ydroneaud@opteya.com
[PATCHSETv6]
http://lkml.kernel.org/r/cover.1394532336.git.ydroneaud@opteya.com
[PATCHSETv5]
http://lkml.kernel.org/r/cover.1388952061.git.ydroneaud@opteya.com
[PATCHSETv4]
http://lkml.kernel.org/r/cover.1383121137.git.ydroneaud@opteya.com
[PATCHSETv3]
http://lkml.kernel.org/r/cover.1378460926.git.ydroneaud@opteya.com
[PATCHSETv2]
http://lkml.kernel.org/r/cover.1376327678.git.ydroneaud@opteya.com
[PATCHSETv1]
http://lkml.kernel.org/r/cover.1372777600.git.ydroneaud@opteya.com
Yann Droneaud (6):
fanotify: enable close-on-exec on events' fd when requested in
fanotify_init()
ia64: trivial: replace get_unused_fd() by get_unused_fd_flags(0)
ppc/cell: trivial: replace get_unused_fd() by get_unused_fd_flags(0)
binfmt_misc: trivial: replace get_unused_fd() by
get_unused_fd_flags(0)
file: trivial: replace get_unused_fd() by get_unused_fd_flags(0)
file: remove get_unused_fd() macro
arch/ia64/kernel/perfmon.c | 2 +-
arch/powerpc/platforms/cell/spufs/inode.c | 4 ++--
fs/binfmt_misc.c | 2 +-
fs/file.c | 2 +-
fs/notify/fanotify/fanotify_user.c | 2 +-
include/linux/file.h | 1 -
6 files changed, 6 insertions(+), 7 deletions(-)
--
1.9.3
^ permalink raw reply
* [PATCHv8 3/6] ppc/cell: trivial: replace get_unused_fd() by get_unused_fd_flags(0)
From: Yann Droneaud @ 2014-09-24 13:11 UTC (permalink / raw)
To: Jeremy Kerr, Arnd Bergmann, Benjamin Herrenschmidt,
Paul Mackerras, Michael Ellerman, Al Viro, Andrew Morton,
Jiri Kosina
Cc: Yann Droneaud, cbe-oss-dev, linux-fsdevel, linuxppc-dev,
linux-kernel
In-Reply-To: <cover.1411562410.git.ydroneaud@opteya.com>
This patch replaces calls to get_unused_fd() with equivalent call to
get_unused_fd_flags(0) to preserve current behavor for existing code.
In a further patch, get_unused_fd() will be removed so that new code
start using get_unused_fd_flags(), with the hope O_CLOEXEC could be
used, either by default or choosen by userspace.
Link: http://lkml.kernel.org/r/cover.1411562410.git.ydroneaud@opteya.com
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: trivial@kernel.org
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
---
arch/powerpc/platforms/cell/spufs/inode.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 87ba7cf99cd7..51effcec30d8 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -301,7 +301,7 @@ static int spufs_context_open(struct path *path)
int ret;
struct file *filp;
- ret = get_unused_fd();
+ ret = get_unused_fd_flags(0);
if (ret < 0)
return ret;
@@ -518,7 +518,7 @@ static int spufs_gang_open(struct path *path)
int ret;
struct file *filp;
- ret = get_unused_fd();
+ ret = get_unused_fd_flags(0);
if (ret < 0)
return ret;
--
1.9.3
^ permalink raw reply related
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