[PATCH v5] u-boot: Add mkenvimage tool

2018-11-21 Thread Alexey Brodkin
This utility is used for creation of images containing
usable in run-time U-Boot environment.

As of today this utility is added per-board like here [1]
for Intel Edison board.

[1] 
http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-edison/tree/meta-intel-edison-bsp/recipes-bsp/u-boot/u-boot-tools_2014.04.bb

Given there're quite some U-Boot tools that we may want to add later
this recipe name switch from "u-boot-mkimage" to generic "u-boot-tools"
still for compatibility we provide "u-boot-mkimage" with help
of PROVIDES as well as proposed "u-boot-mkenvimage".

Signed-off-by: Alexey Brodkin 
Cc: Richard Purdie 
Cc: Otavio Salvador 
Cc: Martin Jansa 
Cc: Ross Burton 
Cc: Marek Vasut 
---

Changes v4 -> v5:
 * Added backward compatibility with "u-boot-mkimage" recipe
 * Improved handling of nativesdk
 * Update all references from "u-boot-mkimage" to "u-boot-tools"

Changes v3 -> v4:
 * Updated maintainer info to make Yocto autobuilder happy again

Changes v2 -> v3:
 * Recipe renamed to "u-boot-tools" to better match its contents
   (especially in the future as we add more tools there)
 * Existing "u-boot-mkimage" and newly introduced "u-boot-mkenvimage"
   made avaialble via PROVIDES

Changes v1 -> v2:
 * Got rid of a separate recipe and instead added mkenvimage
   to u-boot mkimage recipe

 meta/classes/image_types.bbclass   |  2 +-
 meta/classes/kernel-fitimage.bbclass   |  2 +-
 meta/classes/kernel-uimage.bbclass |  2 +-
 meta/conf/distro/include/distro_alias.inc  |  2 +-
 meta/conf/distro/include/maintainers.inc   |  2 +-
 ...boot-mkimage_2018.07.bb => u-boot-tools_2018.07.bb} | 18 +-
 6 files changed, 22 insertions(+), 6 deletions(-)
 rename meta/recipes-bsp/u-boot/{u-boot-mkimage_2018.07.bb => 
u-boot-tools_2018.07.bb} (66%)

diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 05e5b0a2e0..5c406481ef 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -308,7 +308,7 @@ CONVERSION_DEPENDS_lzo = "lzop-native"
 CONVERSION_DEPENDS_zip = "zip-native"
 CONVERSION_DEPENDS_sum = "mtd-utils-native"
 CONVERSION_DEPENDS_bmap = "bmap-tools-native"
-CONVERSION_DEPENDS_u-boot = "u-boot-mkimage-native"
+CONVERSION_DEPENDS_u-boot = "u-boot-tools-native"
 CONVERSION_DEPENDS_vmdk = "qemu-native"
 CONVERSION_DEPENDS_vdi = "qemu-native"
 CONVERSION_DEPENDS_qcow2 = "qemu-native"
diff --git a/meta/classes/kernel-fitimage.bbclass 
b/meta/classes/kernel-fitimage.bbclass
index 4c4fd99ff4..328bef4069 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -4,7 +4,7 @@ python __anonymous () {
 kerneltypes = d.getVar('KERNEL_IMAGETYPES') or ""
 if 'fitImage' in kerneltypes.split():
 depends = d.getVar("DEPENDS")
-depends = "%s u-boot-mkimage-native dtc-native" % depends
+depends = "%s u-boot-tools-native dtc-native" % depends
 d.setVar("DEPENDS", depends)
 
 uarch = d.getVar("UBOOT_ARCH")
diff --git a/meta/classes/kernel-uimage.bbclass 
b/meta/classes/kernel-uimage.bbclass
index c2de6bb40d..cedb4fa070 100644
--- a/meta/classes/kernel-uimage.bbclass
+++ b/meta/classes/kernel-uimage.bbclass
@@ -3,7 +3,7 @@ inherit kernel-uboot
 python __anonymous () {
 if "uImage" in d.getVar('KERNEL_IMAGETYPES'):
 depends = d.getVar("DEPENDS")
-depends = "%s u-boot-mkimage-native" % depends
+depends = "%s u-boot-tools-native" % depends
 d.setVar("DEPENDS", depends)
 
 # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
diff --git a/meta/conf/distro/include/distro_alias.inc 
b/meta/conf/distro/include/distro_alias.inc
index 7502542e89..f23db1e8a4 100644
--- a/meta/conf/distro/include/distro_alias.inc
+++ b/meta/conf/distro/include/distro_alias.inc
@@ -354,7 +354,7 @@ DISTRO_PN_ALIAS_pn-tremor = "OSPDT 
upstream=http://www.xiph.org/vorbis/;
 DISTRO_PN_ALIAS_pn-ttf-bitstream-vera = "Debian=ttf-bitstream-vera 
Ubuntu=ttf-bitstream-vera"
 DISTRO_PN_ALIAS_pn-tzcode = "OSPDT"
 DISTRO_PN_ALIAS_pn-u-boot-fw-utils = "Ubuntu=u-boot-tools Debian=u-boot-tools"
-DISTRO_PN_ALIAS_pn-u-boot-mkimage = "Ubuntu=uboot-mkimage Debian=uboot-mkimage"
+DISTRO_PN_ALIAS_pn-u-boot-tools = "Ubuntu=u-boot-tools Debian=uboot-tools"
 DISTRO_PN_ALIAS_pn-udev = "Mandriva=udev Fedora=udev"
 DISTRO_PN_ALIAS_pn-udev-extraconf = "OE-Core"
 DISTRO_PN_ALIAS_pn-unfs3 = "Debian=unfs3 Fedora=unfs3"
diff --git a/meta/conf/distro/include/maintainers.inc 
b/meta/conf/distro/include/maintainers.inc
index 0889c1c429..825c24a3f8 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -654,7 +654,7 @@ RECIPE_MAINTAINER_pn-tzcode-native = "Armin Kuster 
"
 RECIPE_MAINTAINER_pn-tzdata = "Armin Kuster "
 RECIPE_MAINTAINER_pn-u-boot = "Marek Vasut "
 RECIPE_MAINTAINER_pn-u-boot-fw-utils = "Marek Vasut "
-RECIPE_MAINTAINER_pn-u-boot-mkimage = 

[PATCH] arc: [nsim] Disable NFS

2018-11-21 Thread Alexey Brodkin
Pure nSIM models only CPU core and serial port thus
no point in having NFS enabled.

Signed-off-by: Alexey Brodkin 
---
 arch/arc/configs/nsim_700_defconfig| 1 -
 arch/arc/configs/nsim_hs_defconfig | 1 -
 arch/arc/configs/nsim_hs_smp_defconfig | 1 -
 3 files changed, 3 deletions(-)

diff --git a/arch/arc/configs/nsim_700_defconfig 
b/arch/arc/configs/nsim_700_defconfig
index 8e0b8b134cd9..4754145f6e1b 100644
--- a/arch/arc/configs/nsim_700_defconfig
+++ b/arch/arc/configs/nsim_700_defconfig
@@ -54,7 +54,6 @@ CONFIG_EXT2_FS=y
 CONFIG_EXT2_FS_XATTR=y
 CONFIG_TMPFS=y
 # CONFIG_MISC_FILESYSTEMS is not set
-CONFIG_NFS_FS=y
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 # CONFIG_ENABLE_MUST_CHECK is not set
 # CONFIG_DEBUG_PREEMPT is not set
diff --git a/arch/arc/configs/nsim_hs_defconfig 
b/arch/arc/configs/nsim_hs_defconfig
index 739b90e5e893..38525155773b 100644
--- a/arch/arc/configs/nsim_hs_defconfig
+++ b/arch/arc/configs/nsim_hs_defconfig
@@ -55,7 +55,6 @@ CONFIG_EXT2_FS=y
 CONFIG_EXT2_FS_XATTR=y
 CONFIG_TMPFS=y
 # CONFIG_MISC_FILESYSTEMS is not set
-CONFIG_NFS_FS=y
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 # CONFIG_ENABLE_MUST_CHECK is not set
 # CONFIG_DEBUG_PREEMPT is not set
diff --git a/arch/arc/configs/nsim_hs_smp_defconfig 
b/arch/arc/configs/nsim_hs_smp_defconfig
index b5895bdf3a93..c5d35069a35c 100644
--- a/arch/arc/configs/nsim_hs_smp_defconfig
+++ b/arch/arc/configs/nsim_hs_smp_defconfig
@@ -54,6 +54,5 @@ CONFIG_EXT2_FS=y
 CONFIG_EXT2_FS_XATTR=y
 CONFIG_TMPFS=y
 # CONFIG_MISC_FILESYSTEMS is not set
-CONFIG_NFS_FS=y
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 # CONFIG_ENABLE_MUST_CHECK is not set
-- 
2.16.2


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


Re: Misaligned Access

2018-11-21 Thread Arnd Bergmann
On Wed, Nov 21, 2018 at 9:15 PM Vineet Gupta  wrote:
>
> On 11/21/18 12:12 PM, Arnd Bergmann wrote:
> > On Wed, Nov 21, 2018 at 8:42 PM Vineet Gupta  
> > wrote:
> >> +CC lkml, Arnd : subject matter expert
> >>
> >> On 11/21/18 10:06 AM, Vitor Soares wrote:
> >>> I use the follow function to get data from a RX Fifo.
> >>>
> >>>
> >>> static void dw_i3c_master_read_rx_fifo(struct dw_i3c_master *master,
> >>> u8 *bytes, int nbytes)
> >>> {
> >>>  readsl(master->regs + RX_TX_DATA_PORT, bytes, nbytes / 4);
> >> So the semantics are reading the same fifo register N times, to get the N 
> >> words,
> >> hence read*s*l is appropriate. That however expects the buffer to be 4 
> >> bytes
> >> aligned, hence your issue. You can't possibly use the reads*b* as we want 
> >> the
> >>
> >> The obvious but crude hack is to use a temp array for readsl and then copy 
> >> over
> >> using memcpy, but I'm sure there are better ways, @Arnd ? To summarize is 
> >> issue is
> >> a driver triggering unaligned access due to the misinteraction of API 
> >> (driver get
> >> an unaligned u8 *) which goes against expectations of io accessor readl  
> >> (needed
> >> since the register contents are 4 bytes)
> > Is this again on ARC or some other architecture that cannot do unaligned
> > access to normal RAM? On ARMv7 or x86, you should never see a problem
> > because the CPU handles misaligned writes. On ARMv4/v5, the readsl()
> > implementation internally aligns the access to the output buffer so it
> > will work correctly.
>
> This is indeed on ARC: on ARC700 unaligned access to RAM was never supported 
> and
> on HS38x cores, it is configurable, so the API probably needs to support both 
> cases.

Ok, then I think you need to overwrite readsl() with a variant that
uses put_unaligned() instead the plain pointer dereference for the
output.

  Arnd

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


Re: Misaligned Access

2018-11-21 Thread Vineet Gupta
On 11/21/18 12:12 PM, Arnd Bergmann wrote:
> On Wed, Nov 21, 2018 at 8:42 PM Vineet Gupta  
> wrote:
>> +CC lkml, Arnd : subject matter expert
>>
>> On 11/21/18 10:06 AM, Vitor Soares wrote:
>>> I use the follow function to get data from a RX Fifo.
>>>
>>>
>>> static void dw_i3c_master_read_rx_fifo(struct dw_i3c_master *master,
>>> u8 *bytes, int nbytes)
>>> {
>>>  readsl(master->regs + RX_TX_DATA_PORT, bytes, nbytes / 4);
>> So the semantics are reading the same fifo register N times, to get the N 
>> words,
>> hence read*s*l is appropriate. That however expects the buffer to be 4 bytes
>> aligned, hence your issue. You can't possibly use the reads*b* as we want the
>>
>> The obvious but crude hack is to use a temp array for readsl and then copy 
>> over
>> using memcpy, but I'm sure there are better ways, @Arnd ? To summarize is 
>> issue is
>> a driver triggering unaligned access due to the misinteraction of API 
>> (driver get
>> an unaligned u8 *) which goes against expectations of io accessor readl  
>> (needed
>> since the register contents are 4 bytes)
> Is this again on ARC or some other architecture that cannot do unaligned
> access to normal RAM? On ARMv7 or x86, you should never see a problem
> because the CPU handles misaligned writes. On ARMv4/v5, the readsl()
> implementation internally aligns the access to the output buffer so it
> will work correctly.

This is indeed on ARC: on ARC700 unaligned access to RAM was never supported and
on HS38x cores, it is configurable, so the API probably needs to support both 
cases.

Thx,
-Vineet

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


Re: Misaligned Access

2018-11-21 Thread Arnd Bergmann
On Wed, Nov 21, 2018 at 8:42 PM Vineet Gupta  wrote:
>
> +CC lkml, Arnd : subject matter expert
>
> On 11/21/18 10:06 AM, Vitor Soares wrote:
> > I use the follow function to get data from a RX Fifo.
> >
> >
> > static void dw_i3c_master_read_rx_fifo(struct dw_i3c_master *master,
> > u8 *bytes, int nbytes)
> > {
> >  readsl(master->regs + RX_TX_DATA_PORT, bytes, nbytes / 4);
>
> So the semantics are reading the same fifo register N times, to get the N 
> words,
> hence read*s*l is appropriate. That however expects the buffer to be 4 bytes
> aligned, hence your issue. You can't possibly use the reads*b* as we want the
>
> The obvious but crude hack is to use a temp array for readsl and then copy 
> over
> using memcpy, but I'm sure there are better ways, @Arnd ? To summarize is 
> issue is
> a driver triggering unaligned access due to the misinteraction of API (driver 
> get
> an unaligned u8 *) which goes against expectations of io accessor readl  
> (needed
> since the register contents are 4 bytes)

Is this again on ARC or some other architecture that cannot do unaligned
access to normal RAM? On ARMv7 or x86, you should never see a problem
because the CPU handles misaligned writes. On ARMv4/v5, the readsl()
implementation internally aligns the access to the output buffer so it
will work correctly.

  Arnd

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


Re: [PATCH v2 16/15 v2] syscall_get_arch: add "struct task_struct *" argument

2018-11-21 Thread Paul Burton
Hi Dmitry,

On Wed, Nov 21, 2018 at 10:35:12PM +0300, Dmitry V. Levin wrote:
> This argument is required to extend the generic ptrace API with
> PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going to be
> called from ptrace_request() along with other syscall_get_* functions
> with a tracee as their argument.
> 
> This change partially reverts commit 5e937a9ae913 ("syscall_get_arch:
> remove useless function arguments").
> 
> Reviewed-by: Andy Lutomirski  # for x86
> Reviewed-by: Palmer Dabbelt 
> Cc: linux-au...@redhat.com
> Cc: linux-al...@vger.kernel.org
> Cc: linux-a...@vger.kernel.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-c6x-...@linux-c6x.org
> Cc: linux-hexa...@vger.kernel.org
> Cc: linux-i...@vger.kernel.org
> Cc: linux-m...@lists.linux-m68k.org
> Cc: linux-m...@linux-mips.org
> Cc: linux-par...@vger.kernel.org
> Cc: linux-ri...@lists.infradead.org
> Cc: linux-s...@vger.kernel.org
> Cc: linux...@vger.kernel.org
> Cc: linux-snps-arc@lists.infradead.org
> Cc: linux...@lists.infradead.org
> Cc: linux-xte...@linux-xtensa.org
> Cc: linuxppc-...@lists.ozlabs.org
> Cc: nios2-...@lists.rocketboards.org
> Cc: openr...@lists.librecores.org
> Cc: sparcli...@vger.kernel.org
> Cc: uclinux-h8-de...@lists.sourceforge.jp
> Cc: x...@kernel.org
> Signed-off-by: Dmitry V. Levin 
> ---
> 
> v2: cleaned up mips part, added Reviewed-by

I thought the last one was v2? :)

Anyway, this looks fine to me now:

Acked-by: Paul Burton  # MIPS parts

Thanks,
Paul

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


Re: Misaligned Access

2018-11-21 Thread Vineet Gupta
+CC lkml, Arnd : subject matter expert

On 11/21/18 10:06 AM, Vitor Soares wrote:
> I use the follow function to get data from a RX Fifo.
>
>
> static void dw_i3c_master_read_rx_fifo(struct dw_i3c_master *master,
> u8 *bytes, int nbytes)
> {
>  readsl(master->regs + RX_TX_DATA_PORT, bytes, nbytes / 4);

So the semantics are reading the same fifo register N times, to get the N words,
hence read*s*l is appropriate. That however expects the buffer to be 4 bytes
aligned, hence your issue. You can't possibly use the reads*b* as we want the

The obvious but crude hack is to use a temp array for readsl and then copy over
using memcpy, but I'm sure there are better ways, @Arnd ? To summarize is issue 
is
a driver triggering unaligned access due to the misinteraction of API (driver 
get
an unaligned u8 *) which goes against expectations of io accessor readl  (needed
since the register contents are 4 bytes)


>  if (nbytes & 3) {
>  u32 tmp;
>
>  readsl(master->regs + RX_TX_DATA_PORT, , 1);
>  memcpy(bytes + (nbytes & ~3), , nbytes & 3);
>  }
> }
>
>
> and the pointer u8 *bytes is what is unaligned and breaks when inside of 
> realdsl() it does:
>
>  *buf++ = x;
>
>
> Note that the u8 *bytes pointer is the __u8 *buf of the i2c_msg struct.


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


[PATCH v2 16/15 v2] syscall_get_arch: add "struct task_struct *" argument

2018-11-21 Thread Dmitry V. Levin
This argument is required to extend the generic ptrace API with
PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going to be
called from ptrace_request() along with other syscall_get_* functions
with a tracee as their argument.

This change partially reverts commit 5e937a9ae913 ("syscall_get_arch:
remove useless function arguments").

Reviewed-by: Andy Lutomirski  # for x86
Reviewed-by: Palmer Dabbelt 
Cc: linux-au...@redhat.com
Cc: linux-al...@vger.kernel.org
Cc: linux-a...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-c6x-...@linux-c6x.org
Cc: linux-hexa...@vger.kernel.org
Cc: linux-i...@vger.kernel.org
Cc: linux-m...@lists.linux-m68k.org
Cc: linux-m...@linux-mips.org
Cc: linux-par...@vger.kernel.org
Cc: linux-ri...@lists.infradead.org
Cc: linux-s...@vger.kernel.org
Cc: linux...@vger.kernel.org
Cc: linux-snps-arc@lists.infradead.org
Cc: linux...@lists.infradead.org
Cc: linux-xte...@linux-xtensa.org
Cc: linuxppc-...@lists.ozlabs.org
Cc: nios2-...@lists.rocketboards.org
Cc: openr...@lists.librecores.org
Cc: sparcli...@vger.kernel.org
Cc: uclinux-h8-de...@lists.sourceforge.jp
Cc: x...@kernel.org
Signed-off-by: Dmitry V. Levin 
---

v2: cleaned up mips part, added Reviewed-by

 arch/alpha/include/asm/syscall.h  |  2 +-
 arch/arc/include/asm/syscall.h|  2 +-
 arch/arm/include/asm/syscall.h|  2 +-
 arch/arm64/include/asm/syscall.h  |  4 ++--
 arch/c6x/include/asm/syscall.h|  2 +-
 arch/h8300/include/asm/syscall.h  |  2 +-
 arch/hexagon/include/asm/syscall.h|  2 +-
 arch/ia64/include/asm/syscall.h   |  2 +-
 arch/m68k/include/asm/syscall.h   |  2 +-
 arch/microblaze/include/asm/syscall.h |  2 +-
 arch/mips/include/asm/syscall.h   |  6 +++---
 arch/mips/kernel/ptrace.c |  2 +-
 arch/nds32/include/asm/syscall.h  |  2 +-
 arch/nios2/include/asm/syscall.h  |  2 +-
 arch/openrisc/include/asm/syscall.h   |  2 +-
 arch/parisc/include/asm/syscall.h |  4 ++--
 arch/powerpc/include/asm/syscall.h| 10 --
 arch/riscv/include/asm/syscall.h  |  2 +-
 arch/s390/include/asm/syscall.h   |  4 ++--
 arch/sh/include/asm/syscall_32.h  |  2 +-
 arch/sh/include/asm/syscall_64.h  |  2 +-
 arch/sparc/include/asm/syscall.h  |  5 +++--
 arch/unicore32/include/asm/syscall.h  |  2 +-
 arch/x86/include/asm/syscall.h|  8 +---
 arch/x86/um/asm/syscall.h |  2 +-
 arch/xtensa/include/asm/syscall.h |  2 +-
 include/asm-generic/syscall.h |  3 ++-
 kernel/auditsc.c  |  4 ++--
 kernel/seccomp.c  |  4 ++--
 29 files changed, 50 insertions(+), 40 deletions(-)

diff --git a/arch/alpha/include/asm/syscall.h b/arch/alpha/include/asm/syscall.h
index d73a6fcb519c..11c688c1d7ec 100644
--- a/arch/alpha/include/asm/syscall.h
+++ b/arch/alpha/include/asm/syscall.h
@@ -4,7 +4,7 @@
 
 #include 
 
-static inline int syscall_get_arch(void)
+static inline int syscall_get_arch(struct task_struct *task)
 {
return AUDIT_ARCH_ALPHA;
 }
diff --git a/arch/arc/include/asm/syscall.h b/arch/arc/include/asm/syscall.h
index 10b2e7523bc8..7834baa61de8 100644
--- a/arch/arc/include/asm/syscall.h
+++ b/arch/arc/include/asm/syscall.h
@@ -69,7 +69,7 @@ syscall_get_arguments(struct task_struct *task, struct 
pt_regs *regs,
}
 }
 
-static inline int syscall_get_arch(void)
+static inline int syscall_get_arch(struct task_struct *task)
 {
return IS_ENABLED(CONFIG_ISA_ARCOMPACT)
? (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)
diff --git a/arch/arm/include/asm/syscall.h b/arch/arm/include/asm/syscall.h
index 06dea6bce293..3940ceac0bdc 100644
--- a/arch/arm/include/asm/syscall.h
+++ b/arch/arm/include/asm/syscall.h
@@ -104,7 +104,7 @@ static inline void syscall_set_arguments(struct task_struct 
*task,
memcpy(>ARM_r0 + i, args, n * sizeof(args[0]));
 }
 
-static inline int syscall_get_arch(void)
+static inline int syscall_get_arch(struct task_struct *task)
 {
/* ARM tasks don't change audit architectures on the fly. */
return AUDIT_ARCH_ARM;
diff --git a/arch/arm64/include/asm/syscall.h b/arch/arm64/include/asm/syscall.h
index ad8be16a39c9..1870df03f774 100644
--- a/arch/arm64/include/asm/syscall.h
+++ b/arch/arm64/include/asm/syscall.h
@@ -117,9 +117,9 @@ static inline void syscall_set_arguments(struct task_struct 
*task,
  * We don't care about endianness (__AUDIT_ARCH_LE bit) here because
  * AArch64 has the same system calls both on little- and big- endian.
  */
-static inline int syscall_get_arch(void)
+static inline int syscall_get_arch(struct task_struct *task)
 {
-   if (is_compat_task())
+   if (is_compat_thread(task_thread_info(task)))
return AUDIT_ARCH_ARM;
 
return AUDIT_ARCH_AARCH64;
diff --git a/arch/c6x/include/asm/syscall.h b/arch/c6x/include/asm/syscall.h
index 39dbd1ef994c..595057191c9c 100644
--- a/arch/c6x/include/asm/syscall.h
+++ b/arch/c6x/include/asm/syscall.h
@@ -121,7 

RE: [PATCH] arc: [devboards] Add support of NFSv3 ACL

2018-11-21 Thread Alexey Brodkin
Hi Vineet,

> -Original Message-
> From: Vineet Gupta
> Sent: Wednesday, November 21, 2018 8:40 PM
> To: Alexey Brodkin ; linux-snps-arc@lists.infradead.org
> Cc: linux-ker...@vger.kernel.org; Cupertino Miranda ; 
> sta...@vger.kernel.org
> Subject: Re: [PATCH] arc: [devboards] Add support of NFSv3 ACL
> 
> On 11/20/18 2:30 AM, Alexey Brodkin wrote:
> > By default NFSv3 doesn't support ACL (Access Control Lists)
> > which might be quite convenient to have so that
> > mounted NFS behaves exactly as any other local file-system.
> >
> > In particular missing support of ACL makes umask useless.
> > This among other thigs fixes Glibc's "nptl/tst-umask1".
> >
> > Signed-off-by: Alexey Brodkin 
> > Cc: Cupertino Miranda 
> > Cc: sta...@vger.kernel.org
> 
> What is this fixing in the kernel, for this to be stable backported  ?

It fixing not kernel problem indeed but user-space providing
complete ACL-enabled NFS share support. IMHO we should have had
that enabled with basic NFS support back in the day.

Part of the problem is ACL is not an essential part of NFSv3 spec and so
it is implemented as an option though I don't see a lot of sense in having
incomplete UNIX file-system even though for most of cases it works OK.

> > ---
> >  arch/arc/configs/axs101_defconfig  | 1 +
> >  arch/arc/configs/axs103_defconfig  | 1 +
> >  arch/arc/configs/axs103_smp_defconfig  | 1 +
> >  arch/arc/configs/hsdk_defconfig| 1 +
> >  arch/arc/configs/nps_defconfig | 1 +
> >  arch/arc/configs/nsimosci_defconfig| 1 +
> >  arch/arc/configs/nsimosci_hs_defconfig | 1 +
> >  arch/arc/configs/nsimosci_hs_smp_defconfig | 1 +
> >  arch/arc/configs/vdk_hs38_defconfig| 1 +
> >  arch/arc/configs/vdk_hs38_smp_defconfig| 1 +
> 
> I understand a sweeping change is easy, more consistent so a good guiding
> principel in general. But really all these defconfigs need NFS ? We keep on
> increasing the bloat with this. IMHO we should update only relevant 
> defconfigs.

Well my point is in having similarly equipped platforms so that we may rely on
results we're getting on all of them. Thus all platforms supporting networking
got that update.

Maybe NPS is not that important as we most probably not going to use it
for verification of anything so this one could be dropped.

Speaking about bloat...
->8---
# git grep NFS torvalds/master arch/arc/configs/ | grep nsim_
torvalds/master:arch/arc/configs/nsim_700_defconfig:57:CONFIG_NFS_FS=y
torvalds/master:arch/arc/configs/nsim_hs_defconfig:58:CONFIG_NFS_FS=y
torvalds/master:arch/arc/configs/nsim_hs_smp_defconfig:57:CONFIG_NFS_FS=y
->8---

It's a nonsense I guess as obviously there's no way to have networking on
pure nSIM platforms, right? And that I'm going to clean-up in a separate patch.

As for other boards I realize that we add more config options over time
but that's how we make them more useful and capable.
Moreover since we're talking about _defconfigs_ here I guess there're
many other options we don't touch but they still change so over time
we still cannot compare the same defconfigs as apples vs apples.

-Alexey

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


Re: [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument

2018-11-21 Thread Dmitry V. Levin
Hi Paul,

On Wed, Nov 21, 2018 at 06:40:06PM +, Paul Burton wrote:
> Hi Dmitry,
> 
> On Wed, Nov 21, 2018 at 03:44:22AM +0300, Dmitry V. Levin wrote:
> > This argument is required to extend the generic ptrace API
> > with PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going to be
> > called from ptrace_request() along with other syscall_get_* functions
> > with a tracee as their argument.
> > 
> > This change partially reverts commit 5e937a9ae913 ("syscall_get_arch:
> > remove useless function arguments").
> > 
> >%
> > 
> > diff --git a/arch/mips/include/asm/syscall.h 
> > b/arch/mips/include/asm/syscall.h
> > index 0170602a1e4e..52b633f20abd 100644
> > --- a/arch/mips/include/asm/syscall.h
> > +++ b/arch/mips/include/asm/syscall.h
> > @@ -73,7 +73,7 @@ static inline unsigned long mips_get_syscall_arg(unsigned 
> > long *arg,
> >  #ifdef CONFIG_64BIT
> > case 4: case 5: case 6: case 7:
> >  #ifdef CONFIG_MIPS32_O32
> > -   if (test_thread_flag(TIF_32BIT_REGS))
> > +   if (test_ti_thread_flag(task_thread_info(task), TIF_32BIT_REGS))
> > return get_user(*arg, (int *)usp + n);
> > else
> >  #endif
> 
> This ought to be test_tsk_thread_flag(task, TIF_32BIT_REGS) instead of
> open-coding test_tsk_thread_flag.

This will be corrected, thanks for letting me know.

> More fundamentally though, this change doesn't seem to be (directly)
> related to the change you describe in the commit message - it's not
> syscall_get_arch being modified here. I suspect this should be a
> separate commit, or if not please explain in the commit message why this
> change is included.

Good point, this is a fix that should not have been included into this commit.
The bug was found while preparing the syscall_get_arch change, and this
hunk just slipped in.  I'll send it as a separate commit.

> Compounding the lack of clarity is the fact that I only received this
> patch, not the whole series, so I can't view the change in the context
> of the rest of the series.
> 
> > @@ -140,14 +140,14 @@ extern const unsigned long sys_call_table[];
> >  extern const unsigned long sys32_call_table[];
> >  extern const unsigned long sysn32_call_table[];
> >  
> > -static inline int syscall_get_arch(void)
> > +static inline int syscall_get_arch(struct task_struct *task)
> >  {
> > int arch = AUDIT_ARCH_MIPS;
> >  #ifdef CONFIG_64BIT
> > -   if (!test_thread_flag(TIF_32BIT_REGS)) {
> > +   if (!test_ti_thread_flag(task_thread_info(task), TIF_32BIT_REGS)) {
> > arch |= __AUDIT_ARCH_64BIT;
> > /* N32 sets only TIF_32BIT_ADDR */
> > -   if (test_thread_flag(TIF_32BIT_ADDR))
> > +   if (test_ti_thread_flag(task_thread_info(task), TIF_32BIT_ADDR))
> > arch |= __AUDIT_ARCH_CONVENTION_MIPS64_N32;
> > }
> >  #endif
> 
> This does seem like the described change, but there are 2 more instances
> of open-coding test_tsk_thread_flag which ought to be cleaned up.

This will be cleaned up, thanks for letting me know.


-- 
ldv


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

Re: [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument

2018-11-21 Thread Paul Burton
Hi Dmitry,

On Wed, Nov 21, 2018 at 03:44:22AM +0300, Dmitry V. Levin wrote:
> This argument is required to extend the generic ptrace API
> with PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going to be
> called from ptrace_request() along with other syscall_get_* functions
> with a tracee as their argument.
> 
> This change partially reverts commit 5e937a9ae913 ("syscall_get_arch:
> remove useless function arguments").
> 
>%
> 
> diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h
> index 0170602a1e4e..52b633f20abd 100644
> --- a/arch/mips/include/asm/syscall.h
> +++ b/arch/mips/include/asm/syscall.h
> @@ -73,7 +73,7 @@ static inline unsigned long mips_get_syscall_arg(unsigned 
> long *arg,
>  #ifdef CONFIG_64BIT
>   case 4: case 5: case 6: case 7:
>  #ifdef CONFIG_MIPS32_O32
> - if (test_thread_flag(TIF_32BIT_REGS))
> + if (test_ti_thread_flag(task_thread_info(task), TIF_32BIT_REGS))
>   return get_user(*arg, (int *)usp + n);
>   else
>  #endif

This ought to be test_tsk_thread_flag(task, TIF_32BIT_REGS) instead of
open-coding test_tsk_thread_flag.

More fundamentally though, this change doesn't seem to be (directly)
related to the change you describe in the commit message - it's not
syscall_get_arch being modified here. I suspect this should be a
separate commit, or if not please explain in the commit message why this
change is included.

Compounding the lack of clarity is the fact that I only received this
patch, not the whole series, so I can't view the change in the context
of the rest of the series.

> @@ -140,14 +140,14 @@ extern const unsigned long sys_call_table[];
>  extern const unsigned long sys32_call_table[];
>  extern const unsigned long sysn32_call_table[];
>  
> -static inline int syscall_get_arch(void)
> +static inline int syscall_get_arch(struct task_struct *task)
>  {
>   int arch = AUDIT_ARCH_MIPS;
>  #ifdef CONFIG_64BIT
> - if (!test_thread_flag(TIF_32BIT_REGS)) {
> + if (!test_ti_thread_flag(task_thread_info(task), TIF_32BIT_REGS)) {
>   arch |= __AUDIT_ARCH_64BIT;
>   /* N32 sets only TIF_32BIT_ADDR */
> - if (test_thread_flag(TIF_32BIT_ADDR))
> + if (test_ti_thread_flag(task_thread_info(task), TIF_32BIT_ADDR))
>   arch |= __AUDIT_ARCH_CONVENTION_MIPS64_N32;
>   }
>  #endif

This does seem like the described change, but there are 2 more instances
of open-coding test_tsk_thread_flag which ought to be cleaned up.

Thanks,
Paul

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


Re: [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument

2018-11-21 Thread Palmer Dabbelt

On Tue, 20 Nov 2018 16:44:22 PST (-0800), l...@altlinux.org wrote:

This argument is required to extend the generic ptrace API
with PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going to be
called from ptrace_request() along with other syscall_get_* functions
with a tracee as their argument.

This change partially reverts commit 5e937a9ae913 ("syscall_get_arch:
remove useless function arguments").

Cc: linux-al...@vger.kernel.org
Cc: linux-a...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-au...@redhat.com
Cc: linux-c6x-...@linux-c6x.org
Cc: linux-hexa...@vger.kernel.org
Cc: linux-i...@vger.kernel.org
Cc: linux-m...@lists.linux-m68k.org
Cc: linux-m...@linux-mips.org
Cc: linux-par...@vger.kernel.org
Cc: linux-ri...@lists.infradead.org
Cc: linux-s...@vger.kernel.org
Cc: linux...@vger.kernel.org
Cc: linux-snps-arc@lists.infradead.org
Cc: linux...@lists.infradead.org
Cc: linux-xte...@linux-xtensa.org
Cc: linuxppc-...@lists.ozlabs.org
Cc: nios2-...@lists.rocketboards.org
Cc: openr...@lists.librecores.org
Cc: sparcli...@vger.kernel.org
Cc: uclinux-h8-de...@lists.sourceforge.jp
Cc: x...@kernel.org
Signed-off-by: Dmitry V. Levin 


Reviewed-by: Palmer Dabbelt 

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


Re: [PATCH] arc: [devboards] Add support of NFSv3 ACL

2018-11-21 Thread Sasha Levin
Hi,

[This is an automated email]

This commit has been processed because it contains a -stable tag.
The stable tag indicates that it's relevant for the following trees: all

The bot has tested the following trees: v4.19.2, v4.18.19, v4.14.81, v4.9.137, 
v4.4.163, v3.18.125.

v4.19.2: Build OK!
v4.18.19: Build OK!
v4.14.81: Build OK!
v4.9.137: Failed to apply! Possible dependencies:
Unable to calculate

v4.4.163: Failed to apply! Possible dependencies:
Unable to calculate

v3.18.125: Failed to apply! Possible dependencies:
556cc1c5f528 ("ARC: [axs101] Add support for AXS101 SDP (software 
development platform)")


How should we proceed with this patch?

--
Thanks,
Sasha

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


Re: [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument

2018-11-21 Thread Andy Lutomirski
On Tue, Nov 20, 2018 at 4:44 PM Dmitry V. Levin  wrote:
>
> This argument is required to extend the generic ptrace API
> with PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going to be
> called from ptrace_request() along with other syscall_get_* functions
> with a tracee as their argument.
>
> This change partially reverts commit 5e937a9ae913 ("syscall_get_arch:
> remove useless function arguments").
>

Reviewed-by: Andy Lutomirski  # for x86

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