1. 19 9月, 2018 1 次提交
  2. 14 9月, 2018 1 次提交
    • A
      ARC: build: Get rid of toolchain check · 615f6445
      Alexey Brodkin 提交于
      This check is very naive: we simply test if GCC invoked without
      "-mcpu=XXX" has ARC700 define set. In that case we think that GCC
      was built with "--with-cpu=arc700" and has libgcc built for ARC700.
      
      Otherwise if ARC700 is not defined we think that everythng was built
      for ARCv2.
      
      But in reality our life is much more interesting.
      
      1. Regardless of GCC configuration (i.e. what we pass in "--with-cpu"
         it may generate code for any ARC core).
      
      2. libgcc might be built with explicitly specified "--mcpu=YYY"
      
      That's exactly what happens in case of multilibbed toolchains:
       - GCC is configured with default settings
       - All the libs built for many different CPU flavors
      
      I.e. that check gets in the way of usage of multilibbed
      toolchains. And even non-multilibbed toolchains are affected.
      OpenEmbedded also builds GCC without "--with-cpu" because
      each and every target component later is compiled with explicitly
      set "-mcpu=ZZZ".
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      615f6445
  3. 11 9月, 2018 1 次提交
    • V
      ARCv2: build: use mcpu=hs38 iso generic mcpu=archs · 00a99339
      Vineet Gupta 提交于
      helps gcc with better instruction selections such as 64-bit multiply MPYD
      
      before
      ------
      82c34b58 <sched_clock>:
      82c34b58:	ld	r2,[0x83068d00]
      82c34b60:	add_s	r2,r2,0x7530
      82c34b66:	mov_s	r0,0x989680
      82c34b6c:	mpymu	r5,r2,r0
      82c34b70:	mpy	r4,r2,r0
      82c34b74:	mov_s	r0,r4
      82c34b76:	j_s.d	[blink]
      82c34b78:	mov_s	r1,r5
      82c34b7a:	nop_s
      
      after
      ------
      82c34b7c <sched_clock>:
      82c34b7c:	ld	r0,[0x83064d00]
      82c34b84:	add_s	r0,r0,0x7530
      82c34b8a:	mpydu	r0,r0,0x989680
      82c34b92:	j_s	[blink]
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      00a99339
  4. 31 8月, 2018 1 次提交
  5. 24 8月, 2018 1 次提交
  6. 14 6月, 2018 1 次提交
    • A
      ARC: Explicitly add -mmedium-calls to CFLAGS · 74c11e30
      Alexey Brodkin 提交于
      GCC built for arc*-*-linux has "-mmedium-calls" implicitly enabled by default
      thus we don't see any problems during Linux kernel compilation.
      ----------------------------->8------------------------
      arc-linux-gcc -mcpu=arc700 -Q --help=target | grep calls
        -mlong-calls                          [disabled]
        -mmedium-calls                        [enabled]
      ----------------------------->8------------------------
      
      But if we try to use so-called Elf32 toolchain with GCC configured for
      arc*-*-elf* then we'd see the following failure:
      ----------------------------->8------------------------
      init/do_mounts.o: In function 'init_rootfs':
      do_mounts.c:(.init.text+0x108): relocation truncated to fit: R_ARC_S21W_PCREL
      against symbol 'unregister_filesystem' defined in .text section in fs/filesystems.o
      
      arc-elf32-ld: final link failed: Symbol needs debug section which does not exist
      make: *** [vmlinux] Error 1
      ----------------------------->8------------------------
      
      That happens because neither "-mmedium-calls" nor "-mlong-calls" are enabled in
      Elf32 GCC:
      ----------------------------->8------------------------
      arc-elf32-gcc -mcpu=arc700 -Q --help=target | grep calls
        -mlong-calls                          [disabled]
        -mmedium-calls                        [disabled]
      ----------------------------->8------------------------
      
      Now to make it possible to use Elf32 toolchain for building Linux kernel
      we're explicitly add "-mmedium-calls" to CFLAGS.
      
      And since we add "-mmedium-calls" to the global CFLAGS there's no point in
      having per-file copies thus removing them.
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      74c11e30
  7. 04 10月, 2017 1 次提交
  8. 02 9月, 2017 1 次提交
    • A
      ARC: [plat-hsdk] initial port for HSDK board · a518d637
      Alexey Brodkin 提交于
      This initial port adds support of ARC HS Development Kit board with some
      basic features such serial port, USB, SD/MMC and Ethernet.
      
      Essentially we run Linux kernel on all 4 cores (i.e. utilize SMP) and
      heavily use IO Coherency for speeding-up DMA-aware peripherals.
      
      Note as opposed to other ARC boards we link Linux kernel to
      0x9000_0000 intentionally because cores 1 and 3 configured with DCCM
      situated at our more usual link base 0x8000_0000. We still can use
      memory region starting at 0x8000_0000 as we reallocate DCCM in our
      platform code.
      
      Note that PAE remapping for DMA clients does not work due to an RTL bug,
      so CREG_PAE register must be programmed to all zeroes, otherwise it will
      cause problems with DMA to/from peripherals even if PAE40 is not used.
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      a518d637
  9. 04 8月, 2017 1 次提交
  10. 20 3月, 2017 1 次提交
  11. 12 11月, 2016 1 次提交
    • A
      Kbuild: enable -Wmaybe-uninitialized warning for "make W=1" · a76bcf55
      Arnd Bergmann 提交于
      Traditionally, we have always had warnings about uninitialized variables
      enabled, as this is part of -Wall, and generally a good idea [1], but it
      also always produced false positives, mainly because this is a variation
      of the halting problem and provably impossible to get right in all cases
      [2].
      
      Various people have identified cases that are particularly bad for false
      positives, and in commit e74fc973 ("Turn off -Wmaybe-uninitialized
      when building with -Os"), I turned off the warning for any build that
      was done with CC_OPTIMIZE_FOR_SIZE.  This drastically reduced the number
      of false positive warnings in the default build but unfortunately had
      the side effect of turning the warning off completely in 'allmodconfig'
      builds, which in turn led to a lot of warnings (both actual bugs, and
      remaining false positives) to go in unnoticed.
      
      With commit 877417e6 ("Kbuild: change CC_OPTIMIZE_FOR_SIZE
      definition") enabled the warning again for allmodconfig builds in v4.7
      and in v4.8-rc1, I had finally managed to address all warnings I get in
      an ARM allmodconfig build and most other maybe-uninitialized warnings
      for ARM randconfig builds.
      
      However, commit 6e8d666e ("Disable "maybe-uninitialized" warning
      globally") was merged at the same time and disabled it completely for
      all configurations, because of false-positive warnings on x86 that I had
      not addressed until then.  This caused a lot of actual bugs to get
      merged into mainline, and I sent several dozen patches for these during
      the v4.9 development cycle.  Most of these are actual bugs, some are for
      correct code that is safe because it is only called under external
      constraints that make it impossible to run into the case that gcc sees,
      and in a few cases gcc is just stupid and finds something that can
      obviously never happen.
      
      I have now done a few thousand randconfig builds on x86 and collected
      all patches that I needed to address every single warning I got (I can
      provide the combined patch for the other warnings if anyone is
      interested), so I hope we can get the warning back and let people catch
      the actual bugs earlier.
      
      This reverts the change to disable the warning completely and for now
      brings it back at the "make W=1" level, so we can get it merged into
      mainline without introducing false positives.  A follow-up patch enables
      it on all levels unless some configuration option turns it off because
      of false-positives.
      
      Link: https://rusty.ozlabs.org/?p=232 [1]
      Link: https://gcc.gnu.org/wiki/Better_Uninitialized_Warnings [2]
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a76bcf55
  12. 09 11月, 2016 1 次提交
    • V
      Revert "ARC: build: retire old toggles" · 76a08404
      Vineet Gupta 提交于
      This has caused a bunch of build failures at a few sites, with GNU
      2015.12 and older as the assembler seems to need -mlock to be able to
      grok llock/scond instructions for ARC700 builds.
      different places since the
      older tools still seem to release
      of tools which most people are using seem to trip with the -mlock flag
      not being passed.
      
      This reverts commit c3005475.
      76a08404
  13. 29 10月, 2016 1 次提交
  14. 01 10月, 2016 3 次提交
    • V
      ARC: dw2 unwind: add infrastructure for adding cfi pseudo ops to asm · 5a205a32
      Vineet Gupta 提交于
      1. detect whether binutils supports the cfi pseudo ops
      2. define conditional macros to generate the ops
      3. define new ENTRY_CFI/END_CFI to annotate hand asm code.
         - Needed because we don't want to emit dwarf info in general ENTRY/END
           used by lowest level trap/exception/interrutp handlers as unwinder
           gets confused trying to unwind out of them. We want unwinder to
           instead stop when it hits onfo those routines
         - These provide minimal start/end cfi ops assuming routine doesn't
           touch stack memory/regs
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      5a205a32
    • V
      ARC: dw2 unwind: don't force dwarf 2 · 2d048642
      Vineet Gupta 提交于
      In .debug_frame based unwinding regime, we used to force -gdwarf-2 since
      kernel unwinder only claimed to handle dwarf 2. This changed since commit
      6d0d5060 ("ARC: dw2 unwind: Don't bail for CIE.version != 1")
      which added some support beyond dwarf 2, atleast to handle CIE != 1
      
      The ill-effect of -gdwarf-2 is that it forces generation of .debug_*
      sections, which bloats loadable modules .ko files. For the curious, this
      doesn't affect vmlinx binary since linker script discards .debug_* but
      same discard is not yet implemented for modules.
      
      So it seems we can drop the -gdwarf-2 toggle, which should not be needed
      anyways given that we now use .eh_frame based unwinding.
      
      I've verified using GNU 2016.09-engo10 that the actual unwind info is
      not different with or w/o this toggle - but the debug_* sections are
      gone for good.
      
      before
      -----
      arc-linux-readelf -S q_proc.ko-unwinding-1-eh_frame-switch | grep debug
        [15] .debug_info       PROGBITS        00000000 000300 00d08d 00 	0   0  1
        [16] .rela.debug_info  RELA            00000000 0162a0 008844 0c   I 29  15  4
        [17] .debug_abbrev     PROGBITS        00000000 00d38d 0005f8 00 	0   0  1
        [18] .debug_loc        PROGBITS        00000000 00d985 000070 00 	0   0  1
        [19] .rela.debug_loc   RELA            00000000 01eae4 0000c0 0c   I 29  18  4
        [20] .debug_aranges    PROGBITS        00000000 00d9f5 000040 00 	0   0  1
        [21] .rela.debug_arang RELA            00000000 01eba4 000030 0c   I 29  20  4
        [22] .debug_ranges     PROGBITS        00000000 00da35 000018 00 	0   0  1
        [23] .rela.debug_range RELA            00000000 01ebd4 000030 0c   I 29  22  4
        [24] .debug_line       PROGBITS        00000000 00da4d 000b5b 00 	0   0  1
        [25] .rela.debug_line  RELA            00000000 01ec04 0000cc 0c   I 29  24  4
        [26] .debug_str        PROGBITS        00000000 00e5a8 007831 01   MS 0   0  1
      
      after
      ----
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      2d048642
    • V
      ARC: dw2 unwind: switch to .eh_frame based unwinding · 6716dbbd
      Vineet Gupta 提交于
      So finally after almost 8 years of dealing with .debug_frame, we are
      finally switching to .eh_frame. The reason being stripped kernel
      binaries had non-functional unwinder as .debug_frame was gone.
      Also, in general .eh_frame seems more common way of doing unwinding.
      
      This also folds a revert of f52e126c ("ARC: unwind: ensure that
      .debug_frame is generated (vs. .eh_frame)") to ensure that we start
      getting .eh_frame
      Reported-by: NDaniel Mentz <danielmentz@google.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      6716dbbd
  15. 28 7月, 2016 1 次提交
    • L
      Disable "maybe-uninitialized" warning globally · 6e8d666e
      Linus Torvalds 提交于
      Several build configurations had already disabled this warning because
      it generates a lot of false positives.  But some had not, and it was
      still enabled for "allmodconfig" builds, for example.
      
      Looking at the warnings produced, every single one I looked at was a
      false positive, and the warnings are frequent enough (and big enough)
      that they can easily hide real problems that you don't notice in the
      noise generated by -Wmaybe-uninitialized.
      
      The warning is good in theory, but this is a classic case of a warning
      that causes more problems than the warning can solve.
      
      If gcc gets better at avoiding false positives, we may be able to
      re-enable this warning.  But as is, we're better off without it, and I
      want to be able to see the *real* warnings.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6e8d666e
  16. 28 6月, 2016 1 次提交
    • V
      ARC: unwind: ensure that .debug_frame is generated (vs. .eh_frame) · f52e126c
      Vineet Gupta 提交于
      With recent binutils update to support dwarf CFI pseudo-ops in gas, we
      now get .eh_frame vs. .debug_frame. Although the call frame info is
      exactly the same in both, the CIE differs, which the current kernel
      unwinder can't cope with.
      
      This broke both the kernel unwinder as well as loadable modules (latter
      because of a new unhandled relo R_ARC_32_PCREL from .rela.eh_frame in
      the module loader)
      
      The ideal solution would be to switch unwinder to .eh_frame.
      For now however we can make do by just ensureing .debug_frame is
      generated by removing -fasynchronous-unwind-tables
      
       .eh_frame    generated with -gdwarf-2 -fasynchronous-unwind-tables
       .debug_frame generated with -gdwarf-2
      
      Fixes STAR 9001058196
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      f52e126c
  17. 30 5月, 2016 1 次提交
  18. 09 5月, 2016 1 次提交
  19. 18 3月, 2016 1 次提交
    • V
      ARC: build: Turn off -Wmaybe-uninitialized for ARC gcc 4.8 · a69fe1a2
      Vineet Gupta 提交于
      linux-next has been reporting gazillion warnings for ARC build and
      I finally decided to take a bite:
      
      http://kisskb.ellerman.id.au/kisskb/buildresult/12638735/
      
      Most of the them are due to -Wmaybe-uninitialized
      
      | ../kernel/sysctl.c: In function '__do_proc_doulongvec_minmax':
      | ../kernel/sysctl.c:1928:12: warning: 'p' may be used uninitialized in this function [-Wmaybe-uninitialized]
      |   ret = tmp - *buf;
      |            ^
      | ../kernel/sysctl.c:2342:29: note: 'p' was declared here
      |  char *kbuf = NULL, *p;
      |                     ^
      | ...
      | ...
      
      Cursory look at code seemed fine and a definite gcc false positive in say
      kernel/sysctl.c
      
      Mystery was why only for ARC (and not with ARM linaro toolchain based
      off same gcc 4.8). Turns out that -O3 (default for ARC) triggers these
      and if I enable -O3 for ARM kernel build, I see the same splat.
      
      I initially wanted to disable this only for gcc 4.8, but Arnd reported
      it is seen even on gcc 6.0 for ARM with -O3. Thus better to disable
      this independent of gcc version.
      
      Cc: Claudiu Zissulescu <Claudiu.Zissulescu@synopsys.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: linux-kbuild@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      a69fe1a2
  20. 12 3月, 2016 1 次提交
    • V
      ARC: build: Better way to detect ISA compatible toolchain · 20d78037
      Vineet Gupta 提交于
      ARC architecture has 2 instruction sets: ARCompact/ARCv2.
      While same gcc supports compiling for either (using appropriate toggles),
      we can't use the same toolchain to build kernel because libgcc needs
      to be unique and the toolchian (uClibc based) is not multilibed.
      
      uClibc toolchain is convenient since it allows all userspace and
      kernel to be built with a single install for an ISA.
      
      This however means 2 gnu installs (with same triplet prefix) are needed
      for building for 2 ISA and need to be in PATH.
      As developers we keep switching the builds, but would occassionally fail
      to update the PATH leading to usage of wrong tools. And this would only
      show up at the end of kernel build when linking incompatible libgcc.
      
      So the initial solution was to have gcc define a special preprocessor macro
      DEFAULT_CPU_xxx which is unique for default toolchain configuration.
      Claudiu proposed using grep for an existing preprocessor macro which is
      again uniquely defined per ISA.
      
      Cc: Michal Marek <mmarek@suse.cz>
      Suggested-by: NClaudiu Zissulescu <claziss@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      20d78037
  21. 11 3月, 2016 1 次提交
  22. 18 2月, 2016 1 次提交
  23. 21 12月, 2015 1 次提交
    • V
      ARC: Fix linking errors with CONFIG_MODULE + CONFIG_CC_OPTIMIZE_FOR_SIZE · 07fd7d4b
      Vineet Gupta 提交于
      At -Os, ARC gcc generates millicode thunk for function prologue/epilogue,
      which are served by libgcc.
      
      Modules historically are NOT linked with libgcc to avoid code bloat, reducing
      runtime relocation fixups etc. I even once tried doing that but got lost
      in makefile intricacies.
      
      This means modules at -Os don't get the millicode thunks, causing build
      failures below:
      
      | MODPOST 5 modules
      | ERROR: "__ld_r13_to_r18" [crypto/sha256_generic.ko] undefined!
      | ERROR: "__ld_r13_to_r18_ret" [crypto/sha256_generic.ko] undefined!
      | ERROR: "__st_r13_to_r18" [crypto/sha256_generic.ko] undefined!
      | ERROR: "__ld_r13_to_r17_ret" [crypto/sha256_generic.ko] undefined!
      | ERROR: "__st_r13_to_r17" [crypto/sha256_generic.ko] undefined!
      | ERROR: "__ld_r13_to_r16_ret" [crypto/sha256_generic.ko] undefined!
      | ERROR: "__st_r13_to_r16" [crypto/sha256_generic.ko] undefined!
      |....
      |....
      
      Workaround that by inhibiting millicode thunks for loadable modules
      
      Fixes STAR 9000641864:
      ("Linux built with optimizations for size emits errors for modules")
      Reported-by: NAnton Kolesov <akolesov@synosys.com>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      07fd7d4b
  24. 28 10月, 2015 1 次提交
  25. 20 7月, 2015 1 次提交
  26. 06 7月, 2015 1 次提交
    • V
      ARC: Override toplevel default -O2 with -O3 · 97709069
      Vineet Gupta 提交于
      ARC kernels have historically been built with -O3, despite top level
      Makefile defaulting to -O2. This was facilitated by implicitly ordering
      of arch makefile include AFTER top level assigned -O2.
      
      An upstream fix to top level a1c48bb1 ("Makefile: Fix unrecognized
      cross-compiler command line options") changed the ordering, making ARC
      -O3 defunct.
      
      Fix that by NOT relying on any ordering whatsoever and use the proper
      arch override facility now present in kbuild (ARCH_*FLAGS)
      
      Depends-on: ("kbuild: Allow arch Makefiles to override {cpp,ld,c}flags")
      Suggested-by: NMichal Marek <mmarek@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: stable@vger.kernel.org # 3.16+
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      97709069
  27. 28 6月, 2015 2 次提交
  28. 22 6月, 2015 1 次提交
    • V
      ARCv2: Support for ARCv2 ISA and HS38x cores · 1f6ccfff
      Vineet Gupta 提交于
      The notable features are:
          - SMP configurations of upto 4 cores with coherency
          - Optional L2 Cache and IO-Coherency
          - Revised Interrupt Architecture (multiple priorites, reg banks,
              auto stack switch, auto regfile save/restore)
          - MMUv4 (PIPT dcache, Huge Pages)
          - Instructions for
      	* 64bit load/store: LDD, STD
      	* Hardware assisted divide/remainder: DIV, REM
      	* Function prologue/epilogue: ENTER_S, LEAVE_S
      	* IRQ enable/disable: CLRI, SETI
      	* pop count: FFS, FLS
      	* SETcc, BMSKN, XBFU...
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      1f6ccfff
  29. 19 6月, 2015 3 次提交
  30. 19 5月, 2015 1 次提交
  31. 17 12月, 2014 1 次提交
  32. 13 10月, 2014 1 次提交
  33. 27 6月, 2013 1 次提交
    • V
      ARC: Adjustments for gcc 4.8 · 5a45da02
      Vineet Gupta 提交于
      * DWARF unwinder related
        + Force DWARF2 compliant .debug_frame (gcc 4.8 defaults to DWARF4
          which kernel unwinder can't grok).
        + Discard the additional .eh_frame generated
        + Discard the dwarf4 debug info generated by -gdwarf-2 for normal
          no debug case
      
      * 4.8 already uses arc600 multilibs for -mno-mpy
      
      * switch to using uclibc compiler (to get -mmedium-calls and -mno-sdata)
        and also since buildroot can only use 1 toolchain
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      5a45da02
  34. 22 6月, 2013 1 次提交
  35. 07 5月, 2013 1 次提交