Re: [PATCH v3 6/9] kbuild: consolidate Devicetree dtb build rules

2018-10-01 Thread Geert Uytterhoeven
On Fri, Sep 28, 2018 at 8:42 PM Rob Herring  wrote:
> On Fri, Sep 28, 2018 at 12:21 PM Andreas Färber  wrote:
> > Am 13.09.18 um 17:51 schrieb Geert Uytterhoeven:
> > > On Wed, Sep 12, 2018 at 3:02 AM Masahiro Yamada
> > >  wrote:
> > >> Even x86 can enable OF and OF_UNITTEST.
> > >>
> > >> Another solution might be,
> > >> guard it by 'depends on ARCH_SUPPORTS_OF'.
> > >>
> > >> This is actually what ACPI does.
> > >>
> > >> menuconfig ACPI
> > >> bool "ACPI (Advanced Configuration and Power Interface) Support"
> > >> depends on ARCH_SUPPORTS_ACPI
> > >>  ...
> > >
> > > ACPI is a real platform feature, as it depends on firmware.
> > >
> > > CONFIG_OF can be enabled, and DT overlays can be loaded, on any platform,
> > > even if it has ACPI ;-)
> >
> > How would loading a DT overlay work on an ACPI platform? I.e., what
> > would it overlay against and how to practically load such a file?
>
> The DT unittests do just that. I run them on x86 and UM builds. In
> this case, the loading source is built-in.
>
> > I wonder whether that could be helpful for USB devices and serdev...
>
> How to load the overlays is pretty orthogonal to the issues to be
> solved here. It would certainly be possible to move forward with
> prototyping this and just have the overlay built-in. It may not even
> need to be an overlay if we can support multiple root nodes.

You indeed need to refer to some anchors for most use cases, although a
simple MMIO device could just be anchored to the root node.

Topologies hanging off a USB device would be my first use case, too,
for serdev, or for e.g. the mcp2210 USB-SPI bridge.

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

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

Re: [PATCH] DRM: UDL: get rid of useless vblank initialization

2018-10-01 Thread Daniel Vetter
On Fri, Sep 28, 2018 at 05:41:26PM +0300, Eugeniy Paltsev wrote:
> UDL doesn't support vblank functionality so we don't need to
> initialize vblank here (we are able to send page flip
> completion events even without vblank initialization)
> 
> Moreover current drm_vblank_init call with num_crtcs > 0 causes
> sending DRM_EVENT_FLIP_COMPLETE event with zero timestamp every
> time. This breaks userspace apps (for example weston) which
> relies on timestamp value.
> 
> Cc: sta...@vger.kernel.org
> Signed-off-by: Eugeniy Paltsev 

Reviewed-by: Daniel Vetter 

> ---
>  drivers/gpu/drm/udl/udl_main.c | 7 +--
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c
> index f455f095a146..1b014d92855b 100644
> --- a/drivers/gpu/drm/udl/udl_main.c
> +++ b/drivers/gpu/drm/udl/udl_main.c
> @@ -350,15 +350,10 @@ int udl_driver_load(struct drm_device *dev, unsigned 
> long flags)
>   if (ret)
>   goto err;
>  
> - ret = drm_vblank_init(dev, 1);
> - if (ret)
> - goto err_fb;
> -
>   drm_kms_helper_poll_init(dev);
>  
>   return 0;
> -err_fb:
> - udl_fbdev_cleanup(dev);
> +
>  err:
>   if (udl->urbs.count)
>   udl_free_urb_list(dev);
> -- 
> 2.14.4
> 
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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


Re: [PATCH v3 6/9] kbuild: consolidate Devicetree dtb build rules

2018-10-01 Thread Rob Herring
On Mon, Oct 1, 2018 at 12:49 AM Masahiro Yamada
 wrote:
>
> Hi Rob,
>
>
> 2018年9月29日(土) 0:43 Rob Herring :
>
> > +#
> > ---
> > +# Devicetree files
> > +
> > +ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/boot/dts/),)
> > +dtstree := arch/$(SRCARCH)/boot/dts
> > +endif
> > +
> > +ifneq ($(dtstree),)
> > +
> > +%.dtb : scripts_dtc
>
> %.dtb: prepare3 prepare

I assume you didn't mean to drop scripts_dtc as that doesn't work.

Why "prepare" here and not on dtbs?

> because we need to make sure KERNELRELEASE
> is correctly defined before dtbs_install happens.

Yes, indeed. With prepare3 added I get:

cp: cannot create regular file
'/boot/dtbs/4.19.0-rc3-9-g0afba9b7b2ea-dirty': No such file or
directory

vs. with it:

cp: cannot create regular file '/boot/dtbs/': Not a directory

>
>
> > +   $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
> > +
> > +PHONY += dtbs dtbs_install
> > +dtbs: scripts_dtc
>
>
> dtbs: prepare3 scripts_dtc
>
>
>
> > +   $(Q)$(MAKE) $(build)=$(dtstree)
> > +
> > +dtbs_install: dtbs
>
>
> Please do not have dtbs_install to depend on dtbs.
>
> No install targets should ever trigger building anything
> in the source tree.
>
>
> For the background, see the commit log of
> 19514fc665ffbce624785f76ee7ad0ea6378a527

Okay, thanks.

Rob

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

Re: [PATCH v3 6/9] kbuild: consolidate Devicetree dtb build rules

2018-10-01 Thread Masahiro Yamada
Hi Rob,


2018年10月1日(月) 22:26 Rob Herring :
>
> On Mon, Oct 1, 2018 at 12:49 AM Masahiro Yamada
>  wrote:
> >
> > Hi Rob,
> >
> >
> > 2018年9月29日(土) 0:43 Rob Herring :
> >
> > > +#
> > > ---
> > > +# Devicetree files
> > > +
> > > +ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/boot/dts/),)
> > > +dtstree := arch/$(SRCARCH)/boot/dts
> > > +endif
> > > +
> > > +ifneq ($(dtstree),)
> > > +
> > > +%.dtb : scripts_dtc
> >
> > %.dtb: prepare3 prepare
>
> I assume you didn't mean to drop scripts_dtc as that doesn't work.
>
> Why "prepare" here and not on dtbs?


Sorry, my mistake.


%.dtb: prepare3 scripts_dtc

is the correct one.



> > because we need to make sure KERNELRELEASE
> > is correctly defined before dtbs_install happens.
>
> Yes, indeed. With prepare3 added I get:
>
> cp: cannot create regular file
> '/boot/dtbs/4.19.0-rc3-9-g0afba9b7b2ea-dirty': No such file or
> directory
>
> vs. with it:
>
> cp: cannot create regular file '/boot/dtbs/': Not a directory
>
> >
> >
> > > +   $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
> > > +
> > > +PHONY += dtbs dtbs_install
> > > +dtbs: scripts_dtc
> >
> >
> > dtbs: prepare3 scripts_dtc
> >
> >
> >
> > > +   $(Q)$(MAKE) $(build)=$(dtstree)
> > > +
> > > +dtbs_install: dtbs
> >
> >
> > Please do not have dtbs_install to depend on dtbs.
> >
> > No install targets should ever trigger building anything
> > in the source tree.
> >
> >
> > For the background, see the commit log of
> > 19514fc665ffbce624785f76ee7ad0ea6378a527
>
> Okay, thanks.
>
> Rob



-- 
Best Regards
Masahiro Yamada

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

[PATCH v4 0/9] Devicetree build consolidation

2018-10-01 Thread Rob Herring
This series addresses a couple of issues I have with building dts files.

First, the ability to build all the dts files in the tree. This has been
supported on most arches for some time with powerpc being the main
exception. The reason powerpc wasn't supported was it needed a change
in the location built dtb files are put.

Secondly, it's a pain to acquire all the cross-compilers needed to build
dtbs for each arch. There's no reason to build with the cross compiler and
the host compiler is perfectly fine as we only need the pre-processor.

I started addressing just those 2 problems, but kept finding small
differences such as target dependencies and dtbs_install support across
architectures. Instead of trying to align all these, I've consolidated the
build targets moving them out of the arch makefiles.

I'd like to take the series via the DT tree.

PPC maintainers, really need you review/ack on this especially patch 1.

Rob


v4:
 - Make dtbs and %.dtb rules depend on arch/$ARCH/boot/dts path rather than
   CONFIG_OF_EARLY_FLATTREE
 - Fix install path missing kernel version for dtbs_install
 - Fix "make CONFIG_OF_ALL_DTBS=y" for arches like ARM which selectively
   enable CONFIG_OF (and therefore dtc)

v3:
 - Rework dtc dependency to avoid 2 entry paths to scripts/dtc/. Essentially,
   I copied 'scripts_basic'.
 - Add missing scripts_basic dependency for dtc and missing PHONY tag.
 - Drop the '|' order only from dependencies
 - Drop %.dtb.S and %.dtb.o as top-level targets
 - PPC: remove duplicate mpc5200 dtbs from image-y targets

v2:
 - Fix $arch/boot/dts path check for out of tree builds
 - Fix dtc dependency for building built-in dtbs
 - Fix microblaze built-in dtb building
 - Add dtbs target for microblaze


Rob Herring (9):
  powerpc: build .dtb files in dts directory
  nios2: build .dtb files in dts directory
  nios2: use common rules to build built-in dtb
  nios2: fix building all dtbs
  c6x: use common built-in dtb support
  kbuild: consolidate Devicetree dtb build rules
  powerpc: enable building all dtbs
  c6x: enable building all dtbs
  microblaze: enable building all dtbs

 Makefile   | 37 +++-
 arch/arc/Makefile  |  6 
 arch/arm/Makefile  | 20 +--
 arch/arm64/Makefile| 17 +
 arch/c6x/Makefile  |  2 --
 arch/c6x/boot/dts/Makefile | 17 -
 arch/c6x/boot/dts/linked_dtb.S |  2 --
 arch/c6x/include/asm/sections.h|  1 -
 arch/c6x/kernel/setup.c|  4 +--
 arch/c6x/kernel/vmlinux.lds.S  | 10 --
 arch/h8300/Makefile| 11 +-
 arch/microblaze/Makefile   |  4 +--
 arch/microblaze/boot/dts/Makefile  |  4 +++
 arch/mips/Makefile | 15 +---
 arch/nds32/Makefile|  2 +-
 arch/nios2/Makefile| 11 +-
 arch/nios2/boot/Makefile   | 22 
 arch/nios2/boot/dts/Makefile   |  6 
 arch/nios2/boot/linked_dtb.S   | 19 ---
 arch/powerpc/Makefile  |  3 --
 arch/powerpc/boot/Makefile | 55 ++
 arch/powerpc/boot/dts/Makefile |  6 
 arch/powerpc/boot/dts/fsl/Makefile |  4 +++
 arch/xtensa/Makefile   | 12 +--
 scripts/Makefile   |  3 +-
 scripts/Makefile.lib   |  2 +-
 scripts/dtc/Makefile   |  2 +-
 27 files changed, 102 insertions(+), 195 deletions(-)
 delete mode 100644 arch/c6x/boot/dts/linked_dtb.S
 create mode 100644 arch/nios2/boot/dts/Makefile
 delete mode 100644 arch/nios2/boot/linked_dtb.S
 create mode 100644 arch/powerpc/boot/dts/Makefile
 create mode 100644 arch/powerpc/boot/dts/fsl/Makefile

--
2.17.1

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


[PATCH v4 6/9] kbuild: consolidate Devicetree dtb build rules

2018-10-01 Thread Rob Herring
There is nothing arch specific about building dtb files other than their
location under /arch/*/boot/dts/. Keeping each arch aligned is a pain.
The dependencies and supported targets are all slightly different.
Also, a cross-compiler for each arch is needed, but really the host
compiler preprocessor is perfectly fine for building dtbs. Move the
build rules to a common location and remove the arch specific ones. This
is done in a single step to avoid warnings about overriding rules.

The build dependencies had been a mixture of 'scripts' and/or 'prepare'.
These pull in several dependencies some of which need a target compiler
(specifically devicetable-offsets.h) and aren't needed to build dtbs.
All that is really needed is dtc, so adjust the dependencies to only be
dtc.

This change enables support 'dtbs_install' on some arches which were
missing the target.

Acked-by: Will Deacon 
Acked-by: Paul Burton 
Acked-by: Ley Foon Tan 
Cc: Masahiro Yamada 
Cc: Michal Marek 
Cc: Vineet Gupta 
Cc: Russell King 
Cc: Catalin Marinas 
Cc: Yoshinori Sato 
Cc: Michal Simek 
Cc: Ralf Baechle 
Cc: James Hogan 
Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Michael Ellerman 
Cc: Chris Zankel 
Cc: Max Filippov 
Cc: linux-kbu...@vger.kernel.org
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: uclinux-h8-de...@lists.sourceforge.jp
Cc: linux-m...@linux-mips.org
Cc: nios2-...@lists.rocketboards.org
Cc: linuxppc-...@lists.ozlabs.org
Cc: linux-xte...@linux-xtensa.org
Signed-off-by: Rob Herring 
---
v4:
 - Make dtbs and %.dtb rules depend on arch/$ARCH/boot/dts path rather than
   CONFIG_OF_EARLY_FLATTREE
 - Fix install path missing kernel version for dtbs_install
 - Fix "make CONFIG_OF_ALL_DTBS=y" for arches like ARM which selectively
   enable CONFIG_OF (and therefore dtc)


 Makefile  | 37 ++-
 arch/arc/Makefile |  6 -
 arch/arm/Makefile | 20 +
 arch/arm64/Makefile   | 17 +-
 arch/c6x/Makefile |  2 --
 arch/h8300/Makefile   | 11 +
 arch/microblaze/Makefile  |  4 +---
 arch/microblaze/boot/dts/Makefile |  2 ++
 arch/mips/Makefile| 15 +
 arch/nds32/Makefile   |  2 +-
 arch/nios2/Makefile   |  7 --
 arch/nios2/boot/Makefile  |  4 
 arch/powerpc/Makefile |  3 ---
 arch/xtensa/Makefile  | 12 +-
 scripts/Makefile  |  3 +--
 scripts/Makefile.lib  |  2 +-
 scripts/dtc/Makefile  |  2 +-
 17 files changed, 48 insertions(+), 101 deletions(-)

diff --git a/Makefile b/Makefile
index 6c3da3e10f07..251875470c5b 100644
--- a/Makefile
+++ b/Makefile
@@ -1061,7 +1061,7 @@ include/config/kernel.release: $(srctree)/Makefile FORCE
 # Carefully list dependencies so we do not try to build scripts twice
 # in parallel
 PHONY += scripts
-scripts: scripts_basic asm-generic gcc-plugins $(autoksyms_h)
+scripts: scripts_basic scripts_dtc asm-generic gcc-plugins $(autoksyms_h)
$(Q)$(MAKE) $(build)=$(@)

 # Things we need to do before we recursively start building the kernel
@@ -1205,6 +1205,35 @@ kselftest-merge:
$(srctree)/tools/testing/selftests/*/config
+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig

+# ---
+# Devicetree files
+
+ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/boot/dts/),)
+dtstree := arch/$(SRCARCH)/boot/dts
+endif
+
+ifneq ($(dtstree),)
+
+%.dtb: prepare3 scripts_dtc
+   $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
+
+PHONY += dtbs dtbs_install
+dtbs: prepare3 scripts_dtc
+   $(Q)$(MAKE) $(build)=$(dtstree)
+
+dtbs_install:
+   $(Q)$(MAKE) $(dtbinst)=$(dtstree)
+
+ifdef CONFIG_OF_EARLY_FLATTREE
+all: dtbs
+endif
+
+endif
+
+PHONY += scripts_dtc
+scripts_dtc: scripts_basic
+   $(Q)$(MAKE) $(build)=scripts/dtc
+
 # ---
 # Modules

@@ -1414,6 +1443,12 @@ help:
@echo  '  kselftest-merge - Merge all the config dependencies of 
kselftest to existing'
@echo  '.config.'
@echo  ''
+   @$(if $(dtstree), \
+   echo 'Devicetree:'; \
+   echo '* dtbs- Build device tree blobs for enabled 
boards'; \
+   echo '  dtbs_install- Install dtbs to 
$(INSTALL_DTBS_PATH)'; \
+   echo '')
+
@echo 'Userspace tools targets:'
@echo '  use "make tools/help"'
@echo '  or  "cd tools; make help"'
diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index 99cce77ab98f..caece8866080 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -124,11 +124,5 @@ boot_targets += uImage uImage.bin uImage.gz
 $(boot_targets): vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

-%.dtb %.dtb.S %.dtb.o: scripts

Re: [PATCH v2] ARC: prevent showing irrelevant exception info in signal message

2018-10-01 Thread Eugeniy Paltsev
Hi Vineet,

any chance you could look at this?
Otherwise we will both forget what it is all about :)

On Tue, 2018-08-07 at 16:59 +0300, Eugeniy Paltsev wrote:
> We process signals in the end of syscall/exception handler.
> It the signal is fatal we print register's content using
> show_regs function. show_regs() also prints information about
> last exception happened.
> 
> In case of multicore system we can catch the situation when we
> will print wrong information about exception. See the example:
> __
> CPU-0: started to handle page fault
> CPU-1: sent signal to process, which is executed on CPU-0
> CPU-0: ended page fault handle. Started to process signal before
>returnig to userspace. Process signal, which is send from
>CPU-0. As th signal is fatal we call show_regs().
>show_regs() will show information about last exception
>which is *page fault* (instead of "trap" which is used for
>signals and happened on CPU-0)
> 
> So we will get message like this:
># ./waitpid02
>   potentially unexpected fatal signal 8.
>   Path: /home/waitpid02
>   CPU: 0 PID: 100 Comm: waitpid02 Not tainted 4.10.0-rc4 #2
>   task: 9f11c200 task.stack: 9f3ae000
> 
>   [ECR   ]: 0x00050200 => Invalid Write @ 0x by insn @ 0x000123ec
>   [EFA   ]: 0x
>   [BLINK ]: 0x123ea
>   [ERET  ]: 0x123ec
> @off 0x123ec in [/home/waitpid02]
> VMA: 0x0001 to 0x00016000
>   [STAT32]: 0x80080882 : IE U
>   BTA: 0x000123ea  SP: 0x5ffd3db0  FP: 0x
>   LPS: 0x20031684 LPE: 0x2003169a LPC: 0x0006
>   [-other-info-]
> 
> This message is confusing because it show information about page fault
> ( [ECR   ]: 0x00050200 => Invalid Write ) which is absolutely irrelevant
> to signal.
> 
> This situation was reproduced with waitpid02 LTP test.
> _
> 
> So remove printing information about exceptions from show_regs()
> to avoid confusing messages. Print information about exceptions
> only in required places instead of show_regs()
> 
> Now we don't print information about exceptions if signal is simply
> send by another userspace app. So in case of waitpid02 we will print
> next message:
> _
># ./waitpid02
>   potentially unexpected fatal signal 8.
>   Path: /root/waitpid02
>   CPU: 2 PID: 105 Comm: waitpid02 Not tainted 
> 4.18.0-rc8-2-gde0f6d6aeb53-dirty #17
>   [ECR   ]: 0x00050100
>   [EFA   ]: 0x
>   [BLINK ]: 0x20001486
>   [-other-info-]
> _
> 
> This patch fix
> STAR 9001146055: waitpid02: Invalid Write @ 0x by insn @ 0x000123ec
> 
> NOTE:
> To be more clear I give examples of different faults (signal-based,
> userspace/kernelspace exception-based) with different values of
> "/proc/sys/kernel/print-fatal-signals" option.
> 
> 0) NULL pointer access from user space, print-fatal-signals == 1:
> >8---
>  # ./arc_hell
> Exception: arc_hell[103]: at 0x2003a35c [off 0x2e35c in 
> /lib/libuClibc-1.0.18.so, VMA: 2000c000:20072000]
>   ECR: 0x00050100 => Invalid Read @ 0x by insn @ 0x2003a35c
> potentially unexpected fatal signal 11.
> Path: /root/arc_hell
> CPU: 1 PID: 103 Comm: arc_hell Not tainted 
> 4.18.0-rc8-2-gde0f6d6aeb53-dirty #17
> [ECR   ]: 0x00050100
> [EFA   ]: 0x
> [BLINK ]: 0x20039ef8
> [ERET  ]: 0x2003a35c
> [STAT32]: 0x80080882 : IE U
> BTA: 0x2003a358  SP: 0x5fa27dc4  FP: 0x5fa27de8
> LPS: 0x2003a628 LPE: 0x2003a62c LPC: 0x
> r00: 0x r01: 0x200740b0 r02: 0x0001
> r03: 0x0007 r04: 0x80808080 r05: 0x2f2f2f2f
> r06: 0x7c7a2f43 r07: 0x r08: 0x1a131100
> r09: 0x2008b1e0 r10: 0x20003a5c r11: 0x20004038
> r12: 0x20039ef8 r13: 0x200740b0 r14: 0x
> r15: 0x200740b0 r16: 0x r17: 0x0007d468
> r18: 0x0009313a r19: 0x r20: 0x0009c22c
> r21: 0x0009c23c r22: 0x0009ab64 r23: 0x
> r24: 0x0009dfc5 r25: 0x20004b70
> 
> Segmentation fault
> >8---
> 
> 1) NULL pointer access from user space, print-fatal-signals == 0:
> >8---
>  # ./arc_hell
> Exception: arc_hell[107]: at 0x2003a35c [off 0x2e35c in 
> /lib/libuClibc-1.0.18.so, VMA: 2000c000:20072000]
>   ECR: 0x00050100 => Invalid Read @ 0x by insn @ 0x2003a35c
> Segmentation fault
> >8---
> 
> 2) Process killed by signal (waitpid02 test), print-fatal-signals == 1:
> >8---
>  # ./waitpid02
> potentially unexpected fatal signal 8.
> Path: /root/waitpid02
> CPU: 2 PID: 105 Comm: waitpid02 Not tainted 
> 4.18.0-rc8-2-gde0f6d6aeb53-dirty #17
> [ECR   ]: 0x00050100
> [EFA   ]: 0x
> [BLINK ]: 0x20001486
> [ERET  ]: 0x2000146c
> [STAT32]: 0x80080082 : IE U
> BTA: 0x2fc4  SP: 0x5fa21d64  FP: 0x
> LPS: 0x200524a0 LPE: 0x200524b6 LPC: 0x0006
> r00: 0x2000c0dc r01: 0x0018 r02: 0x0001159a
> r03: 0x0001 r04: 0x r05: 0x0045
> r06: 0x004e r

Re: [PATCH v2] ARC: prevent showing irrelevant exception info in signal message

2018-10-01 Thread Vineet Gupta
On 10/01/2018 09:50 AM, Eugeniy Paltsev wrote:
> Hi Vineet,
>
> any chance you could look at this?
> Otherwise we will both forget what it is all about :)

I was busy with non Linux stuff for quite some time - hopefully that should be
wrapped up and I can get back to tending you ;-)

-Vineet

>
> On Tue, 2018-08-07 at 16:59 +0300, Eugeniy Paltsev wrote:
>> We process signals in the end of syscall/exception handler.
>> It the signal is fatal we print register's content using
>> show_regs function. show_regs() also prints information about
>> last exception happened.
>>
>> In case of multicore system we can catch the situation when we
>> will print wrong information about exception. See the example:
>> __
>> CPU-0: started to handle page fault
>> CPU-1: sent signal to process, which is executed on CPU-0
>> CPU-0: ended page fault handle. Started to process signal before
>>returnig to userspace. Process signal, which is send from
>>CPU-0. As th signal is fatal we call show_regs().
>>show_regs() will show information about last exception
>>which is *page fault* (instead of "trap" which is used for
>>signals and happened on CPU-0)
>>
>> So we will get message like this:
>># ./waitpid02
>>   potentially unexpected fatal signal 8.
>>   Path: /home/waitpid02
>>   CPU: 0 PID: 100 Comm: waitpid02 Not tainted 4.10.0-rc4 #2
>>   task: 9f11c200 task.stack: 9f3ae000
>>
>>   [ECR   ]: 0x00050200 => Invalid Write @ 0x by insn @ 0x000123ec
>>   [EFA   ]: 0x
>>   [BLINK ]: 0x123ea
>>   [ERET  ]: 0x123ec
>> @off 0x123ec in [/home/waitpid02]
>> VMA: 0x0001 to 0x00016000
>>   [STAT32]: 0x80080882 : IE U
>>   BTA: 0x000123ea  SP: 0x5ffd3db0  FP: 0x
>>   LPS: 0x20031684 LPE: 0x2003169a LPC: 0x0006
>>   [-other-info-]
>>
>> This message is confusing because it show information about page fault
>> ( [ECR   ]: 0x00050200 => Invalid Write ) which is absolutely irrelevant
>> to signal.
>>
>> This situation was reproduced with waitpid02 LTP test.
>> _
>>
>> So remove printing information about exceptions from show_regs()
>> to avoid confusing messages. Print information about exceptions
>> only in required places instead of show_regs()
>>
>> Now we don't print information about exceptions if signal is simply
>> send by another userspace app. So in case of waitpid02 we will print
>> next message:
>> _
>># ./waitpid02
>>   potentially unexpected fatal signal 8.
>>   Path: /root/waitpid02
>>   CPU: 2 PID: 105 Comm: waitpid02 Not tainted 
>> 4.18.0-rc8-2-gde0f6d6aeb53-dirty #17
>>   [ECR   ]: 0x00050100
>>   [EFA   ]: 0x
>>   [BLINK ]: 0x20001486
>>   [-other-info-]
>> _
>>
>> This patch fix
>> STAR 9001146055: waitpid02: Invalid Write @ 0x by insn @ 0x000123ec
>>
>> NOTE:
>> To be more clear I give examples of different faults (signal-based,
>> userspace/kernelspace exception-based) with different values of
>> "/proc/sys/kernel/print-fatal-signals" option.
>>
>> 0) NULL pointer access from user space, print-fatal-signals == 1:
>> >8---
>>  # ./arc_hell
>> Exception: arc_hell[103]: at 0x2003a35c [off 0x2e35c in 
>> /lib/libuClibc-1.0.18.so, VMA: 2000c000:20072000]
>>   ECR: 0x00050100 => Invalid Read @ 0x by insn @ 0x2003a35c
>> potentially unexpected fatal signal 11.
>> Path: /root/arc_hell
>> CPU: 1 PID: 103 Comm: arc_hell Not tainted 
>> 4.18.0-rc8-2-gde0f6d6aeb53-dirty #17
>> [ECR   ]: 0x00050100
>> [EFA   ]: 0x
>> [BLINK ]: 0x20039ef8
>> [ERET  ]: 0x2003a35c
>> [STAT32]: 0x80080882 : IE U
>> BTA: 0x2003a358  SP: 0x5fa27dc4  FP: 0x5fa27de8
>> LPS: 0x2003a628 LPE: 0x2003a62c LPC: 0x
>> r00: 0x r01: 0x200740b0 r02: 0x0001
>> r03: 0x0007 r04: 0x80808080 r05: 0x2f2f2f2f
>> r06: 0x7c7a2f43 r07: 0x r08: 0x1a131100
>> r09: 0x2008b1e0 r10: 0x20003a5c r11: 0x20004038
>> r12: 0x20039ef8 r13: 0x200740b0 r14: 0x
>> r15: 0x200740b0 r16: 0x r17: 0x0007d468
>> r18: 0x0009313a r19: 0x r20: 0x0009c22c
>> r21: 0x0009c23c r22: 0x0009ab64 r23: 0x
>> r24: 0x0009dfc5 r25: 0x20004b70
>>
>> Segmentation fault
>> >8---
>>
>> 1) NULL pointer access from user space, print-fatal-signals == 0:
>> >8---
>>  # ./arc_hell
>> Exception: arc_hell[107]: at 0x2003a35c [off 0x2e35c in 
>> /lib/libuClibc-1.0.18.so, VMA: 2000c000:20072000]
>>   ECR: 0x00050100 => Invalid Read @ 0x by insn @ 0x2003a35c
>> Segmentation fault
>> >8---
>>
>> 2) Process killed by signal (waitpid02 test), print-fatal-signals == 1:
>> >8---
>>  # ./waitpid02
>> potentially unexpected fatal signal 8.
>> Path: /root/waitpid02
>> CPU: 2 PID: 105 Comm: waitpid02 Not tainted 
>> 4.18.0-rc8-2-gde0f6d6aeb53-dirty #17
>> [ECR   ]: 0x00050100
>> [EFA   ]: 0x

Re: [PATCH v4 6/9] kbuild: consolidate Devicetree dtb build rules

2018-10-01 Thread Masahiro Yamada
2018年10月2日(火) 0:26 Rob Herring :
>
> There is nothing arch specific about building dtb files other than their
> location under /arch/*/boot/dts/. Keeping each arch aligned is a pain.
> The dependencies and supported targets are all slightly different.
> Also, a cross-compiler for each arch is needed, but really the host
> compiler preprocessor is perfectly fine for building dtbs. Move the
> build rules to a common location and remove the arch specific ones. This
> is done in a single step to avoid warnings about overriding rules.
>
> The build dependencies had been a mixture of 'scripts' and/or 'prepare'.
> These pull in several dependencies some of which need a target compiler
> (specifically devicetable-offsets.h) and aren't needed to build dtbs.
> All that is really needed is dtc, so adjust the dependencies to only be
> dtc.
>
> This change enables support 'dtbs_install' on some arches which were
> missing the target.
>
> Acked-by: Will Deacon 
> Acked-by: Paul Burton 
> Acked-by: Ley Foon Tan 
> Cc: Masahiro Yamada 

Please change this to

Acked-by: Masahiro Yamada 


Thanks.


> Cc: Michal Marek 
> Cc: Vineet Gupta 
> Cc: Russell King 
> Cc: Catalin Marinas 
> Cc: Yoshinori Sato 
> Cc: Michal Simek 
> Cc: Ralf Baechle 
> Cc: James Hogan 
> Cc: Benjamin Herrenschmidt 
> Cc: Paul Mackerras 
> Cc: Michael Ellerman 
> Cc: Chris Zankel 
> Cc: Max Filippov 
> Cc: linux-kbu...@vger.kernel.org
> Cc: linux-snps-arc@lists.infradead.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: uclinux-h8-de...@lists.sourceforge.jp
> Cc: linux-m...@linux-mips.org
> Cc: nios2-...@lists.rocketboards.org
> Cc: linuxppc-...@lists.ozlabs.org
> Cc: linux-xte...@linux-xtensa.org
> Signed-off-by: Rob Herring 
> ---
> v4:
>  - Make dtbs and %.dtb rules depend on arch/$ARCH/boot/dts path rather than
>CONFIG_OF_EARLY_FLATTREE
>  - Fix install path missing kernel version for dtbs_install
>  - Fix "make CONFIG_OF_ALL_DTBS=y" for arches like ARM which selectively
>enable CONFIG_OF (and therefore dtc)




-- 
Best Regards
Masahiro Yamada

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

Expecting Urgent Response.

2018-10-01 Thread Sean Kim.
Hello my dear.

Did you receive my email message to you? Please, get back to me ASAP as the 
matter is becoming late.  Expecting your urgent response.

Sean Kim.


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