1. 12 8月, 2016 2 次提交
  2. 10 8月, 2016 1 次提交
    • H
      s390/pageattr: handle numpages parameter correctly · 4d81aaa5
      Heiko Carstens 提交于
      Both set_memory_ro() and set_memory_rw() will modify the page
      attributes of at least one page, even if the numpages parameter is
      zero.
      
      The author expected that calling these functions with numpages == zero
      would never happen. However with the new 444d13ff ("modules: add
      ro_after_init support") feature this happens frequently.
      
      Therefore do the right thing and make these two functions return
      gracefully if nothing should be done.
      
      Fixes crashes on module load like this one:
      
      Unable to handle kernel pointer dereference in virtual kernel address space
      Failing address: 000003ff80008000 TEID: 000003ff80008407
      Fault in home space mode while using kernel ASCE.
      AS:0000000000d18007 R3:00000001e6aa4007 S:00000001e6a10800 P:00000001e34ee21d
      Oops: 0004 ilc:3 [#1] SMP
      Modules linked in: x_tables
      CPU: 10 PID: 1 Comm: systemd Not tainted 4.7.0-11895-g3fa9045 #4
      Hardware name: IBM              2964 N96              703              (LPAR)
      task: 00000001e9118000 task.stack: 00000001e9120000
      Krnl PSW : 0704e00180000000 00000000005677f8 (rb_erase+0xf0/0x4d0)
                 R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:2 PM:0 RI:0 EA:3
      Krnl GPRS: 000003ff80008b20 000003ff80008b20 000003ff80008b70 0000000000b9d608
                 000003ff80008b20 0000000000000000 00000001e9123e88 000003ff80008950
                 00000001e485ab40 000003ff00000000 000003ff80008b00 00000001e4858480
                 0000000100000000 000003ff80008b68 00000000001d5998 00000001e9123c28
      Krnl Code: 00000000005677e8: ec1801c3007c        cgij    %r1,0,8,567b6e
                 00000000005677ee: e32010100020        cg      %r2,16(%r1)
                #00000000005677f4: a78401c2            brc     8,567b78
                >00000000005677f8: e35010080024        stg     %r5,8(%r1)
                 00000000005677fe: ec5801af007c        cgij    %r5,0,8,567b5c
                 0000000000567804: e30050000024        stg     %r0,0(%r5)
                 000000000056780a: ebacf0680004        lmg     %r10,%r12,104(%r15)
                 0000000000567810: 07fe                bcr     15,%r14
      Call Trace:
      ([<000003ff80008900>] __this_module+0x0/0xffffffffffffd700 [x_tables])
      ([<0000000000264fd4>] do_init_module+0x12c/0x220)
      ([<00000000001da14a>] load_module+0x24e2/0x2b10)
      ([<00000000001da976>] SyS_finit_module+0xbe/0xd8)
      ([<0000000000803b26>] system_call+0xd6/0x264)
      Last Breaking-Event-Address:
       [<000000000056771a>] rb_erase+0x12/0x4d0
       Kernel panic - not syncing: Fatal exception: panic_on_oops
      Reported-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Reported-and-tested-by: NSebastian Ott <sebott@linux.vnet.ibm.com>
      Fixes: e8a97e42 ("s390/pageattr: allow kernel page table splitting")
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      4d81aaa5
  3. 09 8月, 2016 1 次提交
  4. 08 8月, 2016 4 次提交
  5. 04 8月, 2016 1 次提交
    • K
      dma-mapping: use unsigned long for dma_attrs · 00085f1e
      Krzysztof Kozlowski 提交于
      The dma-mapping core and the implementations do not change the DMA
      attributes passed by pointer.  Thus the pointer can point to const data.
      However the attributes do not have to be a bitfield.  Instead unsigned
      long will do fine:
      
      1. This is just simpler.  Both in terms of reading the code and setting
         attributes.  Instead of initializing local attributes on the stack
         and passing pointer to it to dma_set_attr(), just set the bits.
      
      2. It brings safeness and checking for const correctness because the
         attributes are passed by value.
      
      Semantic patches for this change (at least most of them):
      
          virtual patch
          virtual context
      
          @r@
          identifier f, attrs;
      
          @@
          f(...,
          - struct dma_attrs *attrs
          + unsigned long attrs
          , ...)
          {
          ...
          }
      
          @@
          identifier r.f;
          @@
          f(...,
          - NULL
          + 0
           )
      
      and
      
          // Options: --all-includes
          virtual patch
          virtual context
      
          @r@
          identifier f, attrs;
          type t;
      
          @@
          t f(..., struct dma_attrs *attrs);
      
          @@
          identifier r.f;
          @@
          f(...,
          - NULL
          + 0
           )
      
      Link: http://lkml.kernel.org/r/1468399300-5399-2-git-send-email-k.kozlowski@samsung.comSigned-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Acked-by: NVineet Gupta <vgupta@synopsys.com>
      Acked-by: NRobin Murphy <robin.murphy@arm.com>
      Acked-by: NHans-Christian Noren Egtvedt <egtvedt@samfundet.no>
      Acked-by: Mark Salter <msalter@redhat.com> [c6x]
      Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> [cris]
      Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> [drm]
      Reviewed-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Acked-by: Joerg Roedel <jroedel@suse.de> [iommu]
      Acked-by: Fabien Dessenne <fabien.dessenne@st.com> [bdisp]
      Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com> [vb2-core]
      Acked-by: David Vrabel <david.vrabel@citrix.com> [xen]
      Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> [xen swiotlb]
      Acked-by: Joerg Roedel <jroedel@suse.de> [iommu]
      Acked-by: Richard Kuo <rkuo@codeaurora.org> [hexagon]
      Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [m68k]
      Acked-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> [s390]
      Acked-by: NBjorn Andersson <bjorn.andersson@linaro.org>
      Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no> [avr32]
      Acked-by: Vineet Gupta <vgupta@synopsys.com> [arc]
      Acked-by: Robin Murphy <robin.murphy@arm.com> [arm64 and dma-iommu]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      00085f1e
  6. 31 7月, 2016 10 次提交
  7. 29 7月, 2016 1 次提交
  8. 27 7月, 2016 4 次提交
  9. 19 7月, 2016 1 次提交
    • A
      Kbuild: arch: look for generated headers in obtree · 58ab5e0c
      Arnd Bergmann 提交于
      There are very few files that need add an -I$(obj) gcc for the preprocessor
      or the assembler. For C files, we add always these for both the objtree and
      srctree, but for the other ones we require the Makefile to add them, and
      Kbuild then adds it for both trees.
      
      As a preparation for changing the meaning of the -I$(obj) directive to
      only refer to the srctree, this changes the two instances in arch/x86 to use
      an explictit $(objtree) prefix where needed, otherwise we won't find the
      headers any more, as reported by the kbuild 0day builder.
      
      arch/x86/realmode/rm/realmode.lds.S:75:20: fatal error: pasyms.h: No such file or directory
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      58ab5e0c
  10. 18 7月, 2016 4 次提交
  11. 16 7月, 2016 1 次提交
    • D
      perf, events: add non-linear data support for raw records · 7e3f977e
      Daniel Borkmann 提交于
      This patch adds support for non-linear data on raw records. It
      extends raw records to have one or multiple fragments that will
      be written linearly into the ring slot, where each fragment can
      optionally have a custom callback handler to walk and extract
      complex, possibly non-linear data.
      
      If a callback handler is provided for a fragment, then the new
      __output_custom() will be used instead of __output_copy() for
      the perf_output_sample() part. perf_prepare_sample() does all
      the size calculation only once, so perf_output_sample() doesn't
      need to redo the same work anymore, meaning real_size and padding
      will be cached in the raw record. The raw record becomes 32 bytes
      in size without holes; to not increase it further and to avoid
      doing unnecessary recalculations in fast-path, we can reuse
      next pointer of the last fragment, idea here is borrowed from
      ZERO_OR_NULL_PTR(), which should keep the perf_output_sample()
      path for PERF_SAMPLE_RAW minimal.
      
      This facility is needed for BPF's event output helper as a first
      user that will, in a follow-up, add an additional perf_raw_frag
      to its perf_raw_record in order to be able to more efficiently
      dump skb context after a linear head meta data related to it.
      skbs can be non-linear and thus need a custom output function to
      dump buffers. Currently, the skb data needs to be copied twice;
      with the help of __output_custom() this work only needs to be
      done once. Future users could be things like XDP/BPF programs
      that work on different context though and would thus also have
      a different callback function.
      
      The few users of raw records are adapted to initialize their frag
      data from the raw record itself, no change in behavior for them.
      The code is based upon a PoC diff provided by Peter Zijlstra [1].
      
        [1] http://thread.gmane.org/gmane.linux.network/421294Suggested-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7e3f977e
  12. 14 7月, 2016 3 次提交
  13. 13 7月, 2016 2 次提交
  14. 06 7月, 2016 1 次提交
  15. 05 7月, 2016 1 次提交
  16. 04 7月, 2016 2 次提交
    • H
      s390: have unique symbol for __switch_to address · 46210c44
      Heiko Carstens 提交于
      After linking there are several symbols for the same address that the
      __switch_to symbol points to. E.g.:
      
      000000000089b9c0 T __kprobes_text_start
      000000000089b9c0 T __lock_text_end
      000000000089b9c0 T __lock_text_start
      000000000089b9c0 T __sched_text_end
      000000000089b9c0 T __switch_to
      
      When disassembling with "objdump -d" this results in a missing
      __switch_to function. It would be named __kprobes_text_start
      instead. To unconfuse objdump add a nop in front of the kprobes text
      section. That way __switch_to appears again.
      
      Obviously this solution is sort of a hack, since it also depends on
      link order if this works or not. However it is the best I can come up
      with for now.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      46210c44
    • H
      s390/cpuinfo: show maximum thread id · 10f4954a
      Heiko Carstens 提交于
      Expose the maximum thread id with /proc/cpuinfo.
      With the new line the output looks like this:
      
      vendor_id       : IBM/S390
      bogomips per cpu: 20325.00
      max thread id   : 1
      
      With this new interface it is possible to always tell the correct
      number of cpu threads potentially being used by the kernel.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      10f4954a
  17. 01 7月, 2016 1 次提交