Re: [PATCH] arc: kernel: Return -EFAULT if copy_to_user() fails

2021-03-03 Thread Vineet Gupta

On 3/1/21 4:05 AM, Wang Qing wrote:

The copy_to_user() function returns the number of bytes remaining to be
copied, but we want to return -EFAULT if the copy doesn't complete.

Signed-off-by: Wang Qing 


Acked-by: Vineet Gupta 

Do you want me to pick this up via ARC tree ?

Thx,
-Vineet


---
  arch/arc/kernel/signal.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arc/kernel/signal.c b/arch/arc/kernel/signal.c
index a78d8f7..fdbe06c
--- a/arch/arc/kernel/signal.c
+++ b/arch/arc/kernel/signal.c
@@ -96,7 +96,7 @@ stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs 
*regs,
 sizeof(sf->uc.uc_mcontext.regs.scratch));
err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(sigset_t));
  
-	return err;

+   return err ? -EFAULT : 0;
  }
  
  static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf)

@@ -110,7 +110,7 @@ static int restore_usr_regs(struct pt_regs *regs, struct 
rt_sigframe __user *sf)
&(sf->uc.uc_mcontext.regs.scratch),
sizeof(sf->uc.uc_mcontext.regs.scratch));
if (err)
-   return err;
+   return -EFAULT;
  
  	set_current_blocked(&set);

regs->bta= uregs.scratch.bta;




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


Re: [PATCH 10/11] pragma once: delete few backslashes

2021-03-03 Thread Vineet Gupta

On 2/28/21 9:05 AM, Alexey Dobriyan wrote:

 From 251ca5673886b5bb0a42004944290b9d2b267a4a Mon Sep 17 00:00:00 2001
From: Alexey Dobriyan 
Date: Fri, 19 Feb 2021 13:37:24 +0300
Subject: [PATCH 10/11] pragma once: delete few backslashes

Some macros contain one backslash too many and end up being the last
macro in a header file. When #pragma once conversion script truncates
the last #endif and whitespace before it, such backslash triggers
a warning about "OMG file ends up in a backslash-newline".

Needless to say I don't want to handle another case in my script,
so delete useless backslashes instead.

Signed-off-by: Alexey Dobriyan 


Acked-by: Vineet Gupta#arch/arc bits

Thx,
-Vineet


---
  arch/arc/include/asm/cacheflush.h  | 2 +-
  drivers/net/ethernet/mellanox/mlxsw/item.h | 2 +-
  include/linux/once.h   | 2 +-
  include/media/drv-intf/exynos-fimc.h   | 2 +-
  4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arc/include/asm/cacheflush.h 
b/arch/arc/include/asm/cacheflush.h
index e201b4b1655a..46704c341b17 100644
--- a/arch/arc/include/asm/cacheflush.h
+++ b/arch/arc/include/asm/cacheflush.h
@@ -112,6 +112,6 @@ do {
\
  } while (0)
  
  #define copy_from_user_page(vma, page, vaddr, dst, src, len)		\

-   memcpy(dst, src, len);  \
+   memcpy(dst, src, len)
  
  #endif

diff --git a/drivers/net/ethernet/mellanox/mlxsw/item.h 
b/drivers/net/ethernet/mellanox/mlxsw/item.h
index e92cadc98128..cc0133401dd1 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/item.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/item.h
@@ -504,6 +504,6 @@ mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, u16 
index, u8 val) \
return __mlxsw_item_bit_array_set(buf,  
\
  &__ITEM_NAME(_type, _cname, _iname),  
\
  index, val);  
\
-}  
\
+}
  
  #endif

diff --git a/include/linux/once.h b/include/linux/once.h
index 9225ee6d96c7..0af450ff94a5 100644
--- a/include/linux/once.h
+++ b/include/linux/once.h
@@ -55,6 +55,6 @@ void __do_once_done(bool *done, struct static_key_true 
*once_key,
  #define get_random_once(buf, nbytes)   \
DO_ONCE(get_random_bytes, (buf), (nbytes))
  #define get_random_once_wait(buf, nbytes)\
-   DO_ONCE(get_random_bytes_wait, (buf), (nbytes))  \
+   DO_ONCE(get_random_bytes_wait, (buf), (nbytes))
  
  #endif /* _LINUX_ONCE_H */

diff --git a/include/media/drv-intf/exynos-fimc.h 
b/include/media/drv-intf/exynos-fimc.h
index 6b9ef631d6bb..6c5fbdacf4b5 100644
--- a/include/media/drv-intf/exynos-fimc.h
+++ b/include/media/drv-intf/exynos-fimc.h
@@ -152,6 +152,6 @@ static inline struct exynos_video_entity 
*vdev_to_exynos_video_entity(
  #define fimc_pipeline_call(ent, op, args...)\
((!(ent) || !(ent)->pipe) ? -ENOENT : \
(((ent)->pipe->ops && (ent)->pipe->ops->op) ? \
-   (ent)->pipe->ops->op(((ent)->pipe), ##args) : -ENOIOCTLCMD))  \
+   (ent)->pipe->ops->op(((ent)->pipe), ##args) : -ENOIOCTLCMD))
  
  #endif /* S5P_FIMC_H_ */





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


Re: Bug#980963: dpkg: Please add ARC architecture

2021-03-03 Thread Helmut Grohne
On Sat, Feb 06, 2021 at 07:25:35PM +, Alexey Brodkin wrote:
> Any chances to get updates on this one some time soon?

No. The triplet cannot be changed once added. Therefore, the addition is
often deferred. The absence of the triplet can easily be worked around.
A bootstrap can be prototyped already. A major missing piece though is
glibc 2.32 being packaged in Debian. That likely is a prerequisite for
resolving this bug.

Things that often need architecture-specific support for a new
architecture include:
 * guile-X.Y (cross support)
 * libgc
 * libxcrypt (symbols)
 * nspr
 * openssl (packaging)

Are any of these fixed or confirmed working for arc?

I suggest that you coordinate with Vineet Gupta as he is already working
on this.

Helmut


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


Re: Bug#980963: dpkg: Please add ARC architecture

2021-03-03 Thread Vineet Gupta
On Wed, 3 Mar 2021 19:04:36 +0100 Helmut Grohne  wrote:
 > On Sat, Feb 06, 2021 at 07:25:35PM +, Alexey Brodkin wrote:
 > > Any chances to get updates on this one some time soon?
 >
 > No. The triplet cannot be changed once added. Therefore, the addition is
 > often deferred. The absence of the triplet can easily be worked around.
 > A bootstrap can be prototyped already. A major missing piece though is
 > glibc 2.32 being packaged in Debian. That likely is a prerequisite for
 > resolving this bug.
 >
 > Things that often need architecture-specific support for a new
 > architecture include:
 > * guile-X.Y (cross support)
 > * libgc
 > * libxcrypt (symbols)
 > * nspr
 > * openssl (packaging)
 >
 > Are any of these fixed or confirmed working for arc?
 >
 > I suggest that you coordinate with Vineet Gupta as he is already working
 > on this.

The current WIP is at

https://github.com/foss-for-synopsys-dwc-arc-processors/rebootstrap.git

The deal breaker is glibc support since debian is at 2.31 while ARC port was 
merged in 2.32. So here we patch in the entire ARC port :-)

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


Re: Bug#980963: dpkg: Please add ARC architecture

2021-03-03 Thread Alexey Brodkin
Hi Helmut,

> On Sat, Feb 06, 2021 at 07:25:35PM +, Alexey Brodkin wrote:
> > Any chances to get updates on this one some time soon?
> 
> No. The triplet cannot be changed once added. Therefore, the addition is
> often deferred. The absence of the triplet can easily be worked around.
> A bootstrap can be prototyped already. A major missing piece though is
> glibc 2.32 being packaged in Debian. That likely is a prerequisite for
> resolving this bug.

Well not sure why there's a dependency on glibc as w/o ARC target support
in dpkg nothing could be built for ARC. For example I did built Binutils
with fixed dpkg.

> Things that often need architecture-specific support for a new
> architecture include:
>  * guile-X.Y (cross support)
>  * libgc

Above 2 are not [yet] supported but seems to be easy ones.

>  * libxcrypt (symbols)

Not sure about "libxcrypt" (whatver that means), but libgpg-error supports ARC 
since 2018, see:
https://github.com/gpg/libgpg-error/commit/48c8f8ddfc80551db7615e1eb3555c1dc3f6a657

>  * nspr

Done in 2019, see 
https://hg.mozilla.org/projects/nspr/rev/cc73b6c7dab2e8053533e1f2c0c23dc721e10b76

>  * openssl (packaging)

Not sure what needs to be done here as I know we build a lot of complex
things with OpenEmbedded/Yocto and openssl libs are being built for sure.

> Are any of these fixed or confirmed working for arc?

See above, quite some do work.
 
-Alexey
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: Bug#980963: dpkg: Please add ARC architecture

2021-03-03 Thread Helmut Grohne
Hi Alexey,

On Wed, Mar 03, 2021 at 07:35:39PM +, Alexey Brodkin wrote:
> Well not sure why there's a dependency on glibc as w/o ARC target support
> in dpkg nothing could be built for ARC. For example I did built Binutils
> with fixed dpkg.

There is no hard dependency in that direction. Just pushback on adding
lots of Debian architectures that never really take off. For instance,
or1k was never fully bootstrapped. It'll be merged. Just not now. (Not
speaking as a dpkg maintainer here, just telling what will happen from
experience.)

> > Things that often need architecture-specific support for a new
> > architecture include:
> >  * guile-X.Y (cross support)
> >  * libgc
> 
> Above 2 are not [yet] supported but seems to be easy ones.

guile-X.Y is quite mechanical, yes. libgc can be a little more
difficult.

> >  * libxcrypt (symbols)
> 
> Not sure about "libxcrypt" (whatver that means), but libgpg-error supports 
> ARC since 2018, see:

https://tracker.debian.org/pkg/libxcrypt

> https://github.com/gpg/libgpg-error/commit/48c8f8ddfc80551db7615e1eb3555c1dc3f6a657

This should be unneeded. libgpg-error now defaults to
force_use_syscfg=no and no longer needs arch-specific changes.

> >  * nspr
> 
> Done in 2019, see 
> https://hg.mozilla.org/projects/nspr/rev/cc73b6c7dab2e8053533e1f2c0c23dc721e10b76

Great.

> >  * openssl (packaging)
> 
> Not sure what needs to be done here as I know we build a lot of complex
> things with OpenEmbedded/Yocto and openssl libs are being built for sure.

https://sources.debian.org/src/openssl/1.1.1j-1/debian/patches/debian-targets.patch/

> > Are any of these fixed or confirmed working for arc?
> 
> See above, quite some do work.

Impressive. Some work is left. What also is left is demonstrating that
it actually works. It seems that Vineet is working on integrating it.

Helmut


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