Re: [PATCH 1/6] powerpc/syscalls: Switch trivial cases to SYSCALL_DEFINE

2018-05-06 Thread Michael Ellerman
"Naveen N. Rao"  writes:

> Michael Ellerman wrote:
>> From: Al Viro 
>> 
>> Signed-off-by: Al Viro 
>> ---
>>  arch/powerpc/kernel/pci_32.c   | 6 +++---
>>  arch/powerpc/kernel/pci_64.c   | 4 ++--
>>  arch/powerpc/mm/subpage-prot.c | 4 +++-
>>  arch/powerpc/platforms/cell/spu_syscalls.c | 3 ++-
>>  4 files changed, 10 insertions(+), 7 deletions(-)
>> 
>
> I suppose we can also do this for switch_endian?

Yeah. It'd nice to have an automated test that every syscall is
available via FTRACE_SYSCALLS, I just haven't got around to writing one.

cheers

> diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
> index 466216506eb2..290265f2700c 100644
> --- a/arch/powerpc/kernel/syscalls.c
> +++ b/arch/powerpc/kernel/syscalls.c
> @@ -123,7 +123,7 @@ long ppc_fadvise64_64(int fd, int advice, u32 
> offset_high, u32 offset_low,
>(u64)len_high << 32 | len_low, advice);
>  }
>  
> -long sys_switch_endian(void)
> +SYSCALL_DEFINE0(switch_endian)
>  {
>   struct thread_info *ti;
>
>
> - Naveen


Re: [PATCH 1/6] powerpc/syscalls: Switch trivial cases to SYSCALL_DEFINE

2018-05-06 Thread Michael Ellerman
"Naveen N. Rao"  writes:

> Michael Ellerman wrote:
>> From: Al Viro 
>> 
>> Signed-off-by: Al Viro 
>> ---
>>  arch/powerpc/kernel/pci_32.c   | 6 +++---
>>  arch/powerpc/kernel/pci_64.c   | 4 ++--
>>  arch/powerpc/mm/subpage-prot.c | 4 +++-
>>  arch/powerpc/platforms/cell/spu_syscalls.c | 3 ++-
>>  4 files changed, 10 insertions(+), 7 deletions(-)
>> 
>
> I suppose we can also do this for switch_endian?

Yeah. It'd nice to have an automated test that every syscall is
available via FTRACE_SYSCALLS, I just haven't got around to writing one.

cheers

> diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
> index 466216506eb2..290265f2700c 100644
> --- a/arch/powerpc/kernel/syscalls.c
> +++ b/arch/powerpc/kernel/syscalls.c
> @@ -123,7 +123,7 @@ long ppc_fadvise64_64(int fd, int advice, u32 
> offset_high, u32 offset_low,
>(u64)len_high << 32 | len_low, advice);
>  }
>  
> -long sys_switch_endian(void)
> +SYSCALL_DEFINE0(switch_endian)
>  {
>   struct thread_info *ti;
>
>
> - Naveen


Re: [PATCH 1/6] powerpc/syscalls: Switch trivial cases to SYSCALL_DEFINE

2018-05-04 Thread Naveen N. Rao

Michael Ellerman wrote:

From: Al Viro 

Signed-off-by: Al Viro 
---
 arch/powerpc/kernel/pci_32.c   | 6 +++---
 arch/powerpc/kernel/pci_64.c   | 4 ++--
 arch/powerpc/mm/subpage-prot.c | 4 +++-
 arch/powerpc/platforms/cell/spu_syscalls.c | 3 ++-
 4 files changed, 10 insertions(+), 7 deletions(-)



I suppose we can also do this for switch_endian?

diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
index 466216506eb2..290265f2700c 100644
--- a/arch/powerpc/kernel/syscalls.c
+++ b/arch/powerpc/kernel/syscalls.c
@@ -123,7 +123,7 @@ long ppc_fadvise64_64(int fd, int advice, u32 offset_high, 
u32 offset_low,
 (u64)len_high << 32 | len_low, advice);
}

-long sys_switch_endian(void)
+SYSCALL_DEFINE0(switch_endian)
{
struct thread_info *ti;


- Naveen




Re: [PATCH 1/6] powerpc/syscalls: Switch trivial cases to SYSCALL_DEFINE

2018-05-04 Thread Naveen N. Rao

Michael Ellerman wrote:

From: Al Viro 

Signed-off-by: Al Viro 
---
 arch/powerpc/kernel/pci_32.c   | 6 +++---
 arch/powerpc/kernel/pci_64.c   | 4 ++--
 arch/powerpc/mm/subpage-prot.c | 4 +++-
 arch/powerpc/platforms/cell/spu_syscalls.c | 3 ++-
 4 files changed, 10 insertions(+), 7 deletions(-)



I suppose we can also do this for switch_endian?

diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
index 466216506eb2..290265f2700c 100644
--- a/arch/powerpc/kernel/syscalls.c
+++ b/arch/powerpc/kernel/syscalls.c
@@ -123,7 +123,7 @@ long ppc_fadvise64_64(int fd, int advice, u32 offset_high, 
u32 offset_low,
 (u64)len_high << 32 | len_low, advice);
}

-long sys_switch_endian(void)
+SYSCALL_DEFINE0(switch_endian)
{
struct thread_info *ti;


- Naveen




Re: [PATCH 1/6] powerpc/syscalls: Switch trivial cases to SYSCALL_DEFINE

2018-05-03 Thread Mathieu Malaterre
On Wed, May 2, 2018 at 3:20 PM, Michael Ellerman  wrote:
> From: Al Viro 

Maybe add:

Link: https://github.com/linuxppc/linux/issues/131

For the series: compile, build without error (W=1), and works on my system.

> Signed-off-by: Al Viro 
> ---
>  arch/powerpc/kernel/pci_32.c   | 6 +++---
>  arch/powerpc/kernel/pci_64.c   | 4 ++--
>  arch/powerpc/mm/subpage-prot.c | 4 +++-
>  arch/powerpc/platforms/cell/spu_syscalls.c | 3 ++-
>  4 files changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
> index 85ad2f78b889..af36e46c3ed6 100644
> --- a/arch/powerpc/kernel/pci_32.c
> +++ b/arch/powerpc/kernel/pci_32.c
> @@ -16,6 +16,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  #include 
>  #include 
> @@ -283,7 +284,8 @@ pci_bus_to_hose(int bus)
>   * Note that the returned IO or memory base is a physical address
>   */
>
> -long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
> +SYSCALL_DEFINE3(pciconfig_iobase, long, which,
> +   unsigned long, bus, unsigned long, devfn)
>  {
> struct pci_controller* hose;
> long result = -EOPNOTSUPP;
> @@ -307,5 +309,3 @@ long sys_pciconfig_iobase(long which, unsigned long bus, 
> unsigned long devfn)
>
> return result;
>  }
> -
> -
> diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
> index 15ce0306b092..dff28f903512 100644
> --- a/arch/powerpc/kernel/pci_64.c
> +++ b/arch/powerpc/kernel/pci_64.c
> @@ -203,8 +203,8 @@ void pcibios_setup_phb_io_space(struct pci_controller 
> *hose)
>  #define IOBASE_ISA_IO  3
>  #define IOBASE_ISA_MEM 4
>
> -long sys_pciconfig_iobase(long which, unsigned long in_bus,
> - unsigned long in_devfn)
> +SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus,
> + unsigned long, in_devfn)
>  {
> struct pci_controller* hose;
> struct pci_bus *tmp_bus, *bus = NULL;
> diff --git a/arch/powerpc/mm/subpage-prot.c b/arch/powerpc/mm/subpage-prot.c
> index f14a07c2fb90..9d16ee251fc0 100644
> --- a/arch/powerpc/mm/subpage-prot.c
> +++ b/arch/powerpc/mm/subpage-prot.c
> @@ -13,6 +13,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  #include 
>  #include 
> @@ -185,7 +186,8 @@ static void subpage_mark_vma_nohuge(struct mm_struct *mm, 
> unsigned long addr,
>   * in a 2-bit field won't allow writes to a page that is otherwise
>   * write-protected.
>   */
> -long sys_subpage_prot(unsigned long addr, unsigned long len, u32 __user *map)
> +SYSCALL_DEFINE3(subpage_prot, unsigned long, addr,
> +   unsigned long, len, u32 __user *, map)
>  {
> struct mm_struct *mm = current->mm;
> struct subpage_prot_table *spt = >context.spt;
> diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c 
> b/arch/powerpc/platforms/cell/spu_syscalls.c
> index 5e6e0bad6db6..263413a34823 100644
> --- a/arch/powerpc/platforms/cell/spu_syscalls.c
> +++ b/arch/powerpc/platforms/cell/spu_syscalls.c
> @@ -26,6 +26,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  #include 
>
> @@ -90,7 +91,7 @@ SYSCALL_DEFINE4(spu_create, const char __user *, name, 
> unsigned int, flags,
> return ret;
>  }
>
> -asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user 
> *ustatus)
> +SYSCALL_DEFINE3(spu_run,int, fd, __u32 __user *, unpc, __u32 __user *, 
> ustatus)
>  {
> long ret;
> struct fd arg;
> --
> 2.14.1
>


Re: [PATCH 1/6] powerpc/syscalls: Switch trivial cases to SYSCALL_DEFINE

2018-05-03 Thread Mathieu Malaterre
On Wed, May 2, 2018 at 3:20 PM, Michael Ellerman  wrote:
> From: Al Viro 

Maybe add:

Link: https://github.com/linuxppc/linux/issues/131

For the series: compile, build without error (W=1), and works on my system.

> Signed-off-by: Al Viro 
> ---
>  arch/powerpc/kernel/pci_32.c   | 6 +++---
>  arch/powerpc/kernel/pci_64.c   | 4 ++--
>  arch/powerpc/mm/subpage-prot.c | 4 +++-
>  arch/powerpc/platforms/cell/spu_syscalls.c | 3 ++-
>  4 files changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
> index 85ad2f78b889..af36e46c3ed6 100644
> --- a/arch/powerpc/kernel/pci_32.c
> +++ b/arch/powerpc/kernel/pci_32.c
> @@ -16,6 +16,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  #include 
>  #include 
> @@ -283,7 +284,8 @@ pci_bus_to_hose(int bus)
>   * Note that the returned IO or memory base is a physical address
>   */
>
> -long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
> +SYSCALL_DEFINE3(pciconfig_iobase, long, which,
> +   unsigned long, bus, unsigned long, devfn)
>  {
> struct pci_controller* hose;
> long result = -EOPNOTSUPP;
> @@ -307,5 +309,3 @@ long sys_pciconfig_iobase(long which, unsigned long bus, 
> unsigned long devfn)
>
> return result;
>  }
> -
> -
> diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
> index 15ce0306b092..dff28f903512 100644
> --- a/arch/powerpc/kernel/pci_64.c
> +++ b/arch/powerpc/kernel/pci_64.c
> @@ -203,8 +203,8 @@ void pcibios_setup_phb_io_space(struct pci_controller 
> *hose)
>  #define IOBASE_ISA_IO  3
>  #define IOBASE_ISA_MEM 4
>
> -long sys_pciconfig_iobase(long which, unsigned long in_bus,
> - unsigned long in_devfn)
> +SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus,
> + unsigned long, in_devfn)
>  {
> struct pci_controller* hose;
> struct pci_bus *tmp_bus, *bus = NULL;
> diff --git a/arch/powerpc/mm/subpage-prot.c b/arch/powerpc/mm/subpage-prot.c
> index f14a07c2fb90..9d16ee251fc0 100644
> --- a/arch/powerpc/mm/subpage-prot.c
> +++ b/arch/powerpc/mm/subpage-prot.c
> @@ -13,6 +13,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  #include 
>  #include 
> @@ -185,7 +186,8 @@ static void subpage_mark_vma_nohuge(struct mm_struct *mm, 
> unsigned long addr,
>   * in a 2-bit field won't allow writes to a page that is otherwise
>   * write-protected.
>   */
> -long sys_subpage_prot(unsigned long addr, unsigned long len, u32 __user *map)
> +SYSCALL_DEFINE3(subpage_prot, unsigned long, addr,
> +   unsigned long, len, u32 __user *, map)
>  {
> struct mm_struct *mm = current->mm;
> struct subpage_prot_table *spt = >context.spt;
> diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c 
> b/arch/powerpc/platforms/cell/spu_syscalls.c
> index 5e6e0bad6db6..263413a34823 100644
> --- a/arch/powerpc/platforms/cell/spu_syscalls.c
> +++ b/arch/powerpc/platforms/cell/spu_syscalls.c
> @@ -26,6 +26,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  #include 
>
> @@ -90,7 +91,7 @@ SYSCALL_DEFINE4(spu_create, const char __user *, name, 
> unsigned int, flags,
> return ret;
>  }
>
> -asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user 
> *ustatus)
> +SYSCALL_DEFINE3(spu_run,int, fd, __u32 __user *, unpc, __u32 __user *, 
> ustatus)
>  {
> long ret;
> struct fd arg;
> --
> 2.14.1
>


[PATCH 1/6] powerpc/syscalls: Switch trivial cases to SYSCALL_DEFINE

2018-05-02 Thread Michael Ellerman
From: Al Viro 

Signed-off-by: Al Viro 
---
 arch/powerpc/kernel/pci_32.c   | 6 +++---
 arch/powerpc/kernel/pci_64.c   | 4 ++--
 arch/powerpc/mm/subpage-prot.c | 4 +++-
 arch/powerpc/platforms/cell/spu_syscalls.c | 3 ++-
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 85ad2f78b889..af36e46c3ed6 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -283,7 +284,8 @@ pci_bus_to_hose(int bus)
  * Note that the returned IO or memory base is a physical address
  */
 
-long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
+SYSCALL_DEFINE3(pciconfig_iobase, long, which,
+   unsigned long, bus, unsigned long, devfn)
 {
struct pci_controller* hose;
long result = -EOPNOTSUPP;
@@ -307,5 +309,3 @@ long sys_pciconfig_iobase(long which, unsigned long bus, 
unsigned long devfn)
 
return result;
 }
-
-
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 15ce0306b092..dff28f903512 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -203,8 +203,8 @@ void pcibios_setup_phb_io_space(struct pci_controller *hose)
 #define IOBASE_ISA_IO  3
 #define IOBASE_ISA_MEM 4
 
-long sys_pciconfig_iobase(long which, unsigned long in_bus,
- unsigned long in_devfn)
+SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus,
+ unsigned long, in_devfn)
 {
struct pci_controller* hose;
struct pci_bus *tmp_bus, *bus = NULL;
diff --git a/arch/powerpc/mm/subpage-prot.c b/arch/powerpc/mm/subpage-prot.c
index f14a07c2fb90..9d16ee251fc0 100644
--- a/arch/powerpc/mm/subpage-prot.c
+++ b/arch/powerpc/mm/subpage-prot.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -185,7 +186,8 @@ static void subpage_mark_vma_nohuge(struct mm_struct *mm, 
unsigned long addr,
  * in a 2-bit field won't allow writes to a page that is otherwise
  * write-protected.
  */
-long sys_subpage_prot(unsigned long addr, unsigned long len, u32 __user *map)
+SYSCALL_DEFINE3(subpage_prot, unsigned long, addr,
+   unsigned long, len, u32 __user *, map)
 {
struct mm_struct *mm = current->mm;
struct subpage_prot_table *spt = >context.spt;
diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c 
b/arch/powerpc/platforms/cell/spu_syscalls.c
index 5e6e0bad6db6..263413a34823 100644
--- a/arch/powerpc/platforms/cell/spu_syscalls.c
+++ b/arch/powerpc/platforms/cell/spu_syscalls.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -90,7 +91,7 @@ SYSCALL_DEFINE4(spu_create, const char __user *, name, 
unsigned int, flags,
return ret;
 }
 
-asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus)
+SYSCALL_DEFINE3(spu_run,int, fd, __u32 __user *, unpc, __u32 __user *, ustatus)
 {
long ret;
struct fd arg;
-- 
2.14.1



[PATCH 1/6] powerpc/syscalls: Switch trivial cases to SYSCALL_DEFINE

2018-05-02 Thread Michael Ellerman
From: Al Viro 

Signed-off-by: Al Viro 
---
 arch/powerpc/kernel/pci_32.c   | 6 +++---
 arch/powerpc/kernel/pci_64.c   | 4 ++--
 arch/powerpc/mm/subpage-prot.c | 4 +++-
 arch/powerpc/platforms/cell/spu_syscalls.c | 3 ++-
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 85ad2f78b889..af36e46c3ed6 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -283,7 +284,8 @@ pci_bus_to_hose(int bus)
  * Note that the returned IO or memory base is a physical address
  */
 
-long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
+SYSCALL_DEFINE3(pciconfig_iobase, long, which,
+   unsigned long, bus, unsigned long, devfn)
 {
struct pci_controller* hose;
long result = -EOPNOTSUPP;
@@ -307,5 +309,3 @@ long sys_pciconfig_iobase(long which, unsigned long bus, 
unsigned long devfn)
 
return result;
 }
-
-
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 15ce0306b092..dff28f903512 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -203,8 +203,8 @@ void pcibios_setup_phb_io_space(struct pci_controller *hose)
 #define IOBASE_ISA_IO  3
 #define IOBASE_ISA_MEM 4
 
-long sys_pciconfig_iobase(long which, unsigned long in_bus,
- unsigned long in_devfn)
+SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus,
+ unsigned long, in_devfn)
 {
struct pci_controller* hose;
struct pci_bus *tmp_bus, *bus = NULL;
diff --git a/arch/powerpc/mm/subpage-prot.c b/arch/powerpc/mm/subpage-prot.c
index f14a07c2fb90..9d16ee251fc0 100644
--- a/arch/powerpc/mm/subpage-prot.c
+++ b/arch/powerpc/mm/subpage-prot.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -185,7 +186,8 @@ static void subpage_mark_vma_nohuge(struct mm_struct *mm, 
unsigned long addr,
  * in a 2-bit field won't allow writes to a page that is otherwise
  * write-protected.
  */
-long sys_subpage_prot(unsigned long addr, unsigned long len, u32 __user *map)
+SYSCALL_DEFINE3(subpage_prot, unsigned long, addr,
+   unsigned long, len, u32 __user *, map)
 {
struct mm_struct *mm = current->mm;
struct subpage_prot_table *spt = >context.spt;
diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c 
b/arch/powerpc/platforms/cell/spu_syscalls.c
index 5e6e0bad6db6..263413a34823 100644
--- a/arch/powerpc/platforms/cell/spu_syscalls.c
+++ b/arch/powerpc/platforms/cell/spu_syscalls.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -90,7 +91,7 @@ SYSCALL_DEFINE4(spu_create, const char __user *, name, 
unsigned int, flags,
return ret;
 }
 
-asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus)
+SYSCALL_DEFINE3(spu_run,int, fd, __u32 __user *, unpc, __u32 __user *, ustatus)
 {
long ret;
struct fd arg;
-- 
2.14.1