Re: [PATCH v2 2/5] ARC: SMP: Pass virq to smp_ipi_irq_setup instead of hwirq

2016-10-24 Thread Vineet Gupta
On 10/24/2016 05:46 AM, Yuriy Kolerov wrote:
> This function takes a cpu number and a virq number and registers an
> appropriate handler per cpu. However smp_ipi_irq_setup is incorrectly
> used in several places of ARC platform code - hwirq is passed instead of
> virq. There is a code with an example of inccorect usage of smp_ipi_irq_setup:
> 
> smp_ipi_irq_setup(cpu, IPI_IRQ);
> smp_ipi_irq_setup(cpu, SOFTIRQ_IRQ);
> 
> where IPI_IRQ and SOFTIRQ_IRQ are hwirq numbers for per cpu interrupts.
> Since smp_ipi_irq_setup must be taken a virq number insdead of a hwirq
> number then it is necessary to fix usage of this function this way:
> 
> smp_ipi_irq_setup(cpu, irq_find_mapping(NULL, IPI_IRQ));
> smp_ipi_irq_setup(cpu, irq_find_mapping(NULL, SOFTIRQ_IRQ));
> 
> The idea is to find an appropriate mapping of  to virq
> by using irq_find_mapping function. NULL value is used as a domain
> argument (a default domain) since smp_ipi_irq_setup is used for
> registering an IRQ handler for a root interrupt controller (a default
> IRQ domain must be used).
> 
> Signed-off-by: Yuriy Kolerov 
> ---
>  arch/arc/kernel/mcip.c| 5 +++--
>  arch/arc/plat-eznps/smp.c | 2 +-
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arc/kernel/mcip.c b/arch/arc/kernel/mcip.c
> index 72f9179..28ff766 100644
> --- a/arch/arc/kernel/mcip.c
> +++ b/arch/arc/kernel/mcip.c
> @@ -11,6 +11,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -22,8 +23,8 @@ static DEFINE_RAW_SPINLOCK(mcip_lock);
>  
>  static void mcip_setup_per_cpu(int cpu)
>  {
> - smp_ipi_irq_setup(cpu, IPI_IRQ);
> - smp_ipi_irq_setup(cpu, SOFTIRQ_IRQ);
> + smp_ipi_irq_setup(cpu, irq_find_mapping(NULL, IPI_IRQ));
> + smp_ipi_irq_setup(cpu, irq_find_mapping(NULL, SOFTIRQ_IRQ));

Can we do this slightly differently. smp_ipi_irq_setup() is just a helper 
anyways,
can we keep the interface the same (maybe explicit'ify that it takes hwirq). And
call irq_find_mapping() inside it - this will reduce the code churn !


>  }
>  
>  static void mcip_ipi_send(int cpu)
> diff --git a/arch/arc/plat-eznps/smp.c b/arch/arc/plat-eznps/smp.c
> index 5e901f8..dd996e0 100644
> --- a/arch/arc/plat-eznps/smp.c
> +++ b/arch/arc/plat-eznps/smp.c
> @@ -134,7 +134,7 @@ static void eznps_ipi_send(int cpu)
>  
>  static void eznps_init_per_cpu(int cpu)
>  {
> - smp_ipi_irq_setup(cpu, NPS_IPI_IRQ);
> + smp_ipi_irq_setup(cpu, irq_find_mapping(NULL, NPS_IPI_IRQ));
>  
>   eznps_init_core(cpu);
>   mtm_enable_core(cpu);
> 


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH v2 1/5] ARC: SMP: Use "unsigned virq" in smp_ipi_irq_setup instead of "signed irq"

2016-10-24 Thread Vineet Gupta
Hi Yuriy,

On 10/24/2016 05:46 AM, Yuriy Kolerov wrote:
> This function takes a cpu number and a virq number and registers an
> appropriate handler per cpu. However smp_ipi_irq_setup is incorrectly
> used in several places of ARC platform code - hwirq is passed instead
> of virq. This patch is intended to clarify declaration of virq argument
> to prevent passing of hwirq instead of virq in future.
> 
> Signed-off-by: Yuriy Kolerov 

So this series is missing the cover letter which makes it a bit hard to gauge 
the
end goal.
It seems patch [1-3]/5 are fixes which can be applied right away.
And [4-5]/5 help fix the irq affinity setting. What this doesn't say is which
platforms does it fix. And do we not need the hierarchical irq domains, 
specially
for the AXS platform which has 3 interrupt controllers stacked up.

> ---
>  arch/arc/include/asm/smp.h | 4 ++--
>  arch/arc/kernel/smp.c  | 8 
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arc/include/asm/smp.h b/arch/arc/include/asm/smp.h
> index 89fdd1b..3ebebbc 100644
> --- a/arch/arc/include/asm/smp.h
> +++ b/arch/arc/include/asm/smp.h
> @@ -37,9 +37,9 @@ extern const char *arc_platform_smp_cpuinfo(void);
>   * API expected BY platform smp code (FROM arch smp code)
>   *
>   * smp_ipi_irq_setup:
> - *   Takes @cpu and @irq to which the arch-common ISR is hooked up
> + *   Takes @cpu and @virq to which the arch-common ISR is hooked up
>   */
> -extern int smp_ipi_irq_setup(int cpu, int irq);
> +extern int smp_ipi_irq_setup(int cpu, unsigned int virq);
>  
>  /*
>   * struct plat_smp_ops   - SMP callbacks provided by platform to ARC SMP
> diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c
> index f183cc6..ec4d956 100644
> --- a/arch/arc/kernel/smp.c
> +++ b/arch/arc/kernel/smp.c
> @@ -351,7 +351,7 @@ irqreturn_t do_IPI(int irq, void *dev_id)
>   */
>  static DEFINE_PER_CPU(int, ipi_dev);
>  
> -int smp_ipi_irq_setup(int cpu, int irq)
> +int smp_ipi_irq_setup(int cpu, unsigned int virq)
>  {
>   int *dev = per_cpu_ptr(_dev, cpu);
>  
> @@ -359,12 +359,12 @@ int smp_ipi_irq_setup(int cpu, int irq)
>   if (!cpu) {
>   int rc;
>  
> - rc = request_percpu_irq(irq, do_IPI, "IPI Interrupt", dev);
> + rc = request_percpu_irq(virq, do_IPI, "IPI Interrupt", dev);
>   if (rc)
> - panic("Percpu IRQ request failed for %d\n", irq);
> + panic("Percpu IRQ request failed for %d\n", virq);
>   }
>  
> - enable_percpu_irq(irq, 0);
> + enable_percpu_irq(virq, 0);
>  
>   return 0;
>  }
> 


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


RE: [PATCH v2] drm/arcpgu: Accommodate adv7511 switch to DRM bridge

2016-10-24 Thread Alexey Brodkin
Hi Daniel,

> -Original Message-
> From: linux-snps-arc [mailto:linux-snps-arc-boun...@lists.infradead.org] On 
> Behalf Of Alexey Brodkin
> Sent: 19 октября 2016 г. 12:33
> To: dri-de...@lists.freedesktop.org; arch...@codeaurora.org; 
> eugeniy.palt...@synopsys.com
> Cc: linux-snps-arc@lists.infradead.org; linux-ker...@vger.kernel.org
> Subject: Re: [PATCH v2] drm/arcpgu: Accommodate adv7511 switch to DRM bridge
> 
> Hi Archit, all,
> 
> On Wed, 2016-10-19 at 14:43 +0530, Archit Taneja wrote:
> >
> > On 10/19/2016 01:16 PM, Eugeniy Paltsev wrote:
> > >
> > > ARC PGU driver starts crashing on initialization after
> > > 'commit e12c2f645557 ("drm/i2c: adv7511: Convert to drm_bridge")'
> > > This happenes because in "arcpgu_drm_hdmi_init" function we get pointer
> > > of "drm_i2c_encoder_driver" structure, which doesn't exist after
> > > adv7511 hdmi encoder interface changed from slave encoder to drm bridge.
> > > So, when we call "encoder_init" function from this structure driver
> > > crashes.
> 
> [snip]
> 
> > Looks good now.
> >
> > Reviewed-by: Archit Taneja 
> 
> And IMHO it would be really good to get this one back-ported to 4.8
> because it really fixes kernel crash if ARC PGU driver is used.
> 
> It might be a bit of a problem because patch itself a little-bit larger
> than formal requirement for stable backports but let's see if it gets 
> accepted.

Could you please pick this one up?
I may alternatively send a pull-request to David but not sure if 1 patch worth 
it.

Also if that's not really too late it would be good to get this one in 4.9 
since the patch
In question fixes a real driver crash on its instantiation.
Actually driver crash happens since 4.8 but I failed to notice it earlier and 
given amount
of changes I think there's barely a chance for it it to be accepted in stable 
branches...
which in its turn makes at least 4.9 very desirable.

-Alexey

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

[PATCH v2 4/5] ARC: MCIP: Set an initial affinity value in idu_irq_map

2016-10-24 Thread Yuriy Kolerov
Originally an initial distribution mode (its value resides in Device Tree)
for each common interrupt is set in idu_irq_xlate. This leads to the
following problems. idu_irq_xlate may be called several times during parsing
of the Device Tree and it is semantically wrong to configure an initial
distribution mode here. Also a value of affinity (CPUs bitmap) is not saved
to irq_desc structure for the virq - later (after parsing of the DT) kernel
sees that affinity is not set and sets a default value of affinity (all
cores in round robin mode). As a result a value of affinity from Device
Tree is ignored.

To fix it I created a buffer for initial CPUs bitmaps from Device Tree.
In idu_irq_xlate those bitmaps are saved to the buffer. Then affinity
for virq is set manually in idu_irq_map. It works because idu_irq_xlate
is always called before idu_irq_map.

Despite the fact that it works I think that it must be rewritten to
eliminate usage of the buffer and move all logic to idu_irq_map but
I do not know how to do it correctly.

Signed-off-by: Yuriy Kolerov 
---
 arch/arc/kernel/mcip.c | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/arch/arc/kernel/mcip.c b/arch/arc/kernel/mcip.c
index 51a218c..090f0a1 100644
--- a/arch/arc/kernel/mcip.c
+++ b/arch/arc/kernel/mcip.c
@@ -12,12 +12,15 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
 
 static char smp_cpuinfo_buf[128];
 static int idu_detected;
+static unsigned long idu_cirq_to_dest[CONFIG_ARC_NUMBER_OF_INTERRUPTS];
 
 static DEFINE_RAW_SPINLOCK(mcip_lock);
 
@@ -232,9 +235,15 @@ static void idu_cascade_isr(struct irq_desc *desc)
 
 static int idu_irq_map(struct irq_domain *d, unsigned int virq, 
irq_hw_number_t hwirq)
 {
+   cpumask_t mask;
+
irq_set_chip_and_handler(virq, _irq_chip, handle_level_irq);
irq_set_status_flags(virq, IRQ_MOVE_PCNTXT);
 
+   cpumask_clear();
+   cpumask_bits()[0] |= idu_cirq_to_dest[hwirq];
+   irq_set_affinity(virq, );
+
return 0;
 }
 
@@ -252,8 +261,7 @@ static int idu_irq_xlate(struct irq_domain *d, struct 
device_node *n,
if (distri == 0) {
/* 0 - Round Robin to all cpus, otherwise 1 bit per core */
raw_spin_lock_irqsave(_lock, flags);
-   idu_set_dest(hwirq, BIT(num_online_cpus()) - 1);
-   idu_set_mode(hwirq, IDU_M_TRIG_LEVEL, IDU_M_DISTRI_RR);
+   idu_cirq_to_dest[hwirq] = BIT(num_online_cpus()) - 1;
raw_spin_unlock_irqrestore(_lock, flags);
} else {
/*
@@ -267,8 +275,7 @@ static int idu_irq_xlate(struct irq_domain *d, struct 
device_node *n,
hwirq, cpu);
 
raw_spin_lock_irqsave(_lock, flags);
-   idu_set_dest(hwirq, cpu);
-   idu_set_mode(hwirq, IDU_M_TRIG_LEVEL, IDU_M_DISTRI_DEST);
+   idu_cirq_to_dest[hwirq] = cpu;
raw_spin_unlock_irqrestore(_lock, flags);
}
 
-- 
2.7.4



___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH v2 3/5] ARC: MCIP: Use hwirq instead of virq for resolution of IDU IRQ handlers

2016-10-24 Thread Yuriy Kolerov
Multicore ARC configurations use IDU (Interrupt Distribution Unit) for
distributing of common interrupts. In fact IDU is a interrupt controller
on top of main per core interrupt controller.

All common IRQs are physically and linearly mapped to per core
interrupts. E.g. <0, 1, 2, 3> common IDU interrupts may be mapped to per
core <24, 25, 26, 27> interrupts. An initialization code of IDU
controller (idu_of_init) creates mappings for all parent interrupts
<24, 25, ...> and sets a chained IDU handler for them. In the same
time idu_of_init must save the first met parent hwirq (idu_first_irq)
thus in future it is possible to figure out what common hwirq has come
by subtracting of idu_first_irq from the current parent hwirq (see
idu_cascade_isr).

The problem is that idu_of_init and idu_cascade_isr use parent virtual
IRQs as hardware IRQs and perform all the above-described manipulations
on virtual IRQs. But it is wrong and hardware IRQs must be used instead.

Signed-off-by: Yuriy Kolerov 
---
 arch/arc/kernel/mcip.c | 20 +---
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/arch/arc/kernel/mcip.c b/arch/arc/kernel/mcip.c
index 28ff766..51a218c 100644
--- a/arch/arc/kernel/mcip.c
+++ b/arch/arc/kernel/mcip.c
@@ -220,16 +220,14 @@ static struct irq_chip idu_irq_chip = {
 
 };
 
-static int idu_first_irq;
+static irq_hw_number_t idu_first_hwirq;
 
 static void idu_cascade_isr(struct irq_desc *desc)
 {
-   struct irq_domain *domain = irq_desc_get_handler_data(desc);
-   unsigned int core_irq = irq_desc_get_irq(desc);
-   unsigned int idu_irq;
-
-   idu_irq = core_irq - idu_first_irq;
-   generic_handle_irq(irq_find_mapping(domain, idu_irq));
+   struct irq_domain *idu_domain = irq_desc_get_handler_data(desc);
+   irq_hw_number_t core_hwirq = irqd_to_hwirq(irq_desc_get_irq_data(desc));
+   irq_hw_number_t idu_hwirq = core_hwirq - idu_first_hwirq;
+   generic_handle_irq(irq_find_mapping(idu_domain, idu_hwirq));
 }
 
 static int idu_irq_map(struct irq_domain *d, unsigned int virq, 
irq_hw_number_t hwirq)
@@ -295,7 +293,7 @@ idu_of_init(struct device_node *intc, struct device_node 
*parent)
struct irq_domain *domain;
/* Read IDU BCR to confirm nr_irqs */
int nr_irqs = of_irq_count(intc);
-   int i, irq;
+   int i, virq;
 
if (!idu_detected)
panic("IDU not detected, but DeviceTree using it");
@@ -313,11 +311,11 @@ idu_of_init(struct device_node *intc, struct device_node 
*parent)
 * however we need it to get the parent virq and set IDU handler
 * as first level isr
 */
-   irq = irq_of_parse_and_map(intc, i);
+   virq = irq_of_parse_and_map(intc, i);
if (!i)
-   idu_first_irq = irq;
+   idu_first_hwirq = irqd_to_hwirq(irq_get_irq_data(virq));
 
-   irq_set_chained_handler_and_data(irq, idu_cascade_isr, domain);
+   irq_set_chained_handler_and_data(virq, idu_cascade_isr, domain);
}
 
__mcip_cmd(CMD_IDU_ENABLE, 0);
-- 
2.7.4



___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH v2 2/5] ARC: SMP: Pass virq to smp_ipi_irq_setup instead of hwirq

2016-10-24 Thread Yuriy Kolerov
This function takes a cpu number and a virq number and registers an
appropriate handler per cpu. However smp_ipi_irq_setup is incorrectly
used in several places of ARC platform code - hwirq is passed instead of
virq. There is a code with an example of inccorect usage of smp_ipi_irq_setup:

smp_ipi_irq_setup(cpu, IPI_IRQ);
smp_ipi_irq_setup(cpu, SOFTIRQ_IRQ);

where IPI_IRQ and SOFTIRQ_IRQ are hwirq numbers for per cpu interrupts.
Since smp_ipi_irq_setup must be taken a virq number insdead of a hwirq
number then it is necessary to fix usage of this function this way:

smp_ipi_irq_setup(cpu, irq_find_mapping(NULL, IPI_IRQ));
smp_ipi_irq_setup(cpu, irq_find_mapping(NULL, SOFTIRQ_IRQ));

The idea is to find an appropriate mapping of  to virq
by using irq_find_mapping function. NULL value is used as a domain
argument (a default domain) since smp_ipi_irq_setup is used for
registering an IRQ handler for a root interrupt controller (a default
IRQ domain must be used).

Signed-off-by: Yuriy Kolerov 
---
 arch/arc/kernel/mcip.c| 5 +++--
 arch/arc/plat-eznps/smp.c | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arc/kernel/mcip.c b/arch/arc/kernel/mcip.c
index 72f9179..28ff766 100644
--- a/arch/arc/kernel/mcip.c
+++ b/arch/arc/kernel/mcip.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -22,8 +23,8 @@ static DEFINE_RAW_SPINLOCK(mcip_lock);
 
 static void mcip_setup_per_cpu(int cpu)
 {
-   smp_ipi_irq_setup(cpu, IPI_IRQ);
-   smp_ipi_irq_setup(cpu, SOFTIRQ_IRQ);
+   smp_ipi_irq_setup(cpu, irq_find_mapping(NULL, IPI_IRQ));
+   smp_ipi_irq_setup(cpu, irq_find_mapping(NULL, SOFTIRQ_IRQ));
 }
 
 static void mcip_ipi_send(int cpu)
diff --git a/arch/arc/plat-eznps/smp.c b/arch/arc/plat-eznps/smp.c
index 5e901f8..dd996e0 100644
--- a/arch/arc/plat-eznps/smp.c
+++ b/arch/arc/plat-eznps/smp.c
@@ -134,7 +134,7 @@ static void eznps_ipi_send(int cpu)
 
 static void eznps_init_per_cpu(int cpu)
 {
-   smp_ipi_irq_setup(cpu, NPS_IPI_IRQ);
+   smp_ipi_irq_setup(cpu, irq_find_mapping(NULL, NPS_IPI_IRQ));
 
eznps_init_core(cpu);
mtm_enable_core(cpu);
-- 
2.7.4



___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH] ARC: return -EFAULT on failed access_ok for arc_usr_cmpxchg syscall

2016-10-24 Thread Colin King
From: Colin Ian King 

arc_usr_cmpxchg currently returns an uninitialized value in ret
on a failed access_ok call. Instead, return -EFAULT.

Signed-off-by: Colin Ian King 
---
 arch/arc/kernel/process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arc/kernel/process.c b/arch/arc/kernel/process.c
index a746008..9ae3e1c 100644
--- a/arch/arc/kernel/process.c
+++ b/arch/arc/kernel/process.c
@@ -47,7 +47,7 @@ SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, expected, 
int, new)
int ret;
 
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
-   return ret;
+   return -EFAULT;
 
preempt_disable();
 
-- 
2.9.3


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH] asm-generic: Drop getrlimit and setrlimit syscalls from default list

2016-10-24 Thread James Hogan
On Sat, Oct 22, 2016 at 03:14:04PM +0300, Yury Norov wrote:
> The newer prlimit64 syscall provides all the functionality provided by
> the getrlimit and setrlimit syscalls and adds the pid of target process,
> so future architectures won't need to include getrlimit and setrlimit.
> 
> Therefore drop getrlimit and setrlimit syscalls from the generic syscall
> list unless __ARCH_WANT_SET_GET_RLIMIT is defined by the architecture's
> unistd.h prior to including asm-generic/unistd.h, and adjust all
> architectures using the generic syscall list to define it so that no
> in-tree architectures are affected.
> 
> Cc: Vineet Gupta 
> Cc: Catalin Marinas 
> Cc: Will Deacon 
> Cc: Mark Salter 
> Cc: Aurelien Jacquiot 
> Cc: Yoshinori Sato 
> Cc: Richard Kuo 
> Cc: James Hogan 
> Cc: Ley Foon Tan 
> Cc: Jonas Bonn 
> Cc: Chen Liqin 
> Cc: Lennox Wu 
> Cc: Chris Metcalf 
> Cc: Guan Xuetao 
> Cc: Arnd Bergmann 
> Cc: Andrew Pinski 
> Cc: linux-snps-arc@lists.infradead.org
> Cc: linux-ker...@vger.kernel.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-c6x-...@linux-c6x.org
> Cc: uclinux-h8-de...@lists.sourceforge.jp
> Cc: linux-hexa...@vger.kernel.org
> Cc: linux-me...@vger.kernel.org
> Cc: nios2-...@lists.rocketboards.org
> Cc: linux-a...@vger.kernel.or
> Signed-off-by: Yury Norov 
> 
> ---
>  arch/arc/include/uapi/asm/unistd.h   | 1 +
>  arch/arm64/include/uapi/asm/unistd.h | 1 +
>  arch/c6x/include/uapi/asm/unistd.h   | 1 +
>  arch/h8300/include/uapi/asm/unistd.h | 1 +
>  arch/hexagon/include/uapi/asm/unistd.h   | 1 +
>  arch/metag/include/uapi/asm/unistd.h | 1 +

Acked-by: James Hogan  [metag]

Cheers
James

>  arch/nios2/include/uapi/asm/unistd.h | 1 +
>  arch/openrisc/include/uapi/asm/unistd.h  | 1 +
>  arch/score/include/uapi/asm/unistd.h | 1 +
>  arch/tile/include/uapi/asm/unistd.h  | 1 +
>  arch/unicore32/include/uapi/asm/unistd.h | 1 +
>  include/uapi/asm-generic/unistd.h| 5 +
>  12 files changed, 16 insertions(+)
> 
> diff --git a/arch/arc/include/uapi/asm/unistd.h 
> b/arch/arc/include/uapi/asm/unistd.h
> index 41fa2ec..928546d 100644
> --- a/arch/arc/include/uapi/asm/unistd.h
> +++ b/arch/arc/include/uapi/asm/unistd.h
> @@ -16,6 +16,7 @@
>  #define _UAPI_ASM_ARC_UNISTD_H
>  
>  #define __ARCH_WANT_RENAMEAT
> +#define __ARCH_WANT_SET_GET_RLIMIT
>  #define __ARCH_WANT_SYS_EXECVE
>  #define __ARCH_WANT_SYS_CLONE
>  #define __ARCH_WANT_SYS_VFORK
> diff --git a/arch/arm64/include/uapi/asm/unistd.h 
> b/arch/arm64/include/uapi/asm/unistd.h
> index 043d17a..48355a6 100644
> --- a/arch/arm64/include/uapi/asm/unistd.h
> +++ b/arch/arm64/include/uapi/asm/unistd.h
> @@ -15,5 +15,6 @@
>   */
>  
>  #define __ARCH_WANT_RENAMEAT
> +#define __ARCH_WANT_SET_GET_RLIMIT
>  
>  #include 
> diff --git a/arch/c6x/include/uapi/asm/unistd.h 
> b/arch/c6x/include/uapi/asm/unistd.h
> index 12d73d9..f676231 100644
> --- a/arch/c6x/include/uapi/asm/unistd.h
> +++ b/arch/c6x/include/uapi/asm/unistd.h
> @@ -15,6 +15,7 @@
>   */
>  
>  #define __ARCH_WANT_RENAMEAT
> +#define __ARCH_WANT_SET_GET_RLIMIT
>  #define __ARCH_WANT_SYS_CLONE
>  
>  /* Use the standard ABI for syscalls. */
> diff --git a/arch/h8300/include/uapi/asm/unistd.h 
> b/arch/h8300/include/uapi/asm/unistd.h
> index 7dd20ef..2f98394 100644
> --- a/arch/h8300/include/uapi/asm/unistd.h
> +++ b/arch/h8300/include/uapi/asm/unistd.h
> @@ -1,5 +1,6 @@
>  #define __ARCH_NOMMU
>  
>  #define __ARCH_WANT_RENAMEAT
> +#define __ARCH_WANT_SET_GET_RLIMIT
>  
>  #include 
> diff --git a/arch/hexagon/include/uapi/asm/unistd.h 
> b/arch/hexagon/include/uapi/asm/unistd.h
> index 2151760..52d585c 100644
> --- a/arch/hexagon/include/uapi/asm/unistd.h
> +++ b/arch/hexagon/include/uapi/asm/unistd.h
> @@ -28,6 +28,7 @@
>  
>  #define sys_mmap2 sys_mmap_pgoff
>  #define __ARCH_WANT_RENAMEAT
> +#define __ARCH_WANT_SET_GET_RLIMIT
>  #define __ARCH_WANT_SYS_EXECVE
>  #define __ARCH_WANT_SYS_CLONE
>  #define __ARCH_WANT_SYS_VFORK
> diff --git a/arch/metag/include/uapi/asm/unistd.h 
> b/arch/metag/include/uapi/asm/unistd.h
> index 459b6ec..16b5cb3 100644
> --- a/arch/metag/include/uapi/asm/unistd.h
> +++ b/arch/metag/include/uapi/asm/unistd.h
> @@ -8,6 +8,7 @@
>   */
>  
>  #define __ARCH_WANT_RENAMEAT
> +#define __ARCH_WANT_SET_GET_RLIMIT
>  
>  /* Use the standard ABI for syscalls. */
>  #include 
> diff --git a/arch/nios2/include/uapi/asm/unistd.h 
> b/arch/nios2/include/uapi/asm/unistd.h
> index 51a32c7..b0dda4d 100644
> --- a/arch/nios2/include/uapi/asm/unistd.h
> +++ b/arch/nios2/include/uapi/asm/unistd.h
> @@ -18,6 +18,7 @@
>   #define sys_mmap2