1. 20 11月, 2018 1 次提交
  2. 15 11月, 2018 2 次提交
  3. 14 11月, 2018 2 次提交
  4. 13 11月, 2018 5 次提交
    • O
      RISC-V: Silence some module warnings on 32-bit · ef3a6140
      Olof Johansson 提交于
      Fixes:
      
      arch/riscv/kernel/module.c: In function 'apply_r_riscv_32_rela':
      ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
      arch/riscv/kernel/module.c:23:27: note: format string is defined here
      arch/riscv/kernel/module.c: In function 'apply_r_riscv_pcrel_hi20_rela':
      ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
      arch/riscv/kernel/module.c:104:23: note: format string is defined here
      arch/riscv/kernel/module.c: In function 'apply_r_riscv_hi20_rela':
      ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
      arch/riscv/kernel/module.c:146:23: note: format string is defined here
      arch/riscv/kernel/module.c: In function 'apply_r_riscv_got_hi20_rela':
      ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
      arch/riscv/kernel/module.c:190:60: note: format string is defined here
      arch/riscv/kernel/module.c: In function 'apply_r_riscv_call_plt_rela':
      ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
      arch/riscv/kernel/module.c:214:24: note: format string is defined here
      arch/riscv/kernel/module.c: In function 'apply_r_riscv_call_rela':
      ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
      arch/riscv/kernel/module.c:236:23: note: format string is defined here
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      ef3a6140
    • O
      RISC-V: lib: Fix build error for 64-bit · 85d90b91
      Olof Johansson 提交于
      Fixes the following build error from tinyconfig:
      
      riscv64-unknown-linux-gnu-ld: kernel/sched/fair.o: in function `.L8':
      fair.c:(.text+0x70): undefined reference to `__lshrti3'
      riscv64-unknown-linux-gnu-ld: kernel/time/clocksource.o: in function `.L0 ':
      clocksource.c:(.text+0x334): undefined reference to `__lshrti3'
      
      Fixes: 7f47c73b ("RISC-V: Build tishift only on 64-bit")
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      85d90b91
    • D
      riscv: add missing vdso_install target · f157d411
      David Abdurachmanov 提交于
      Building kernel 4.20 for Fedora as RPM fails, because riscv is missing
      vdso_install target in arch/riscv/Makefile.
      Signed-off-by: NDavid Abdurachmanov <david.abdurachmanov@gmail.com>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      f157d411
    • D
      riscv: fix spacing in struct pt_regs · 10febb3e
      David Abdurachmanov 提交于
      Replace 8 spaces with tab to match styling.
      Signed-off-by: NDavid Abdurachmanov <david.abdurachmanov@gmail.com>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      10febb3e
    • A
      RISC-V: defconfig: Enable printk timestamps · 4ab49461
      Anup Patel 提交于
      The printk timestamps are very useful information to visually see
      where kernel is spending time during boot. It also helps us see
      the timing of hotplug events at runtime.
      
      This patch enables printk timestamps in RISC-V defconfig so that
      we have it enabled by default (similar to other architectures
      such as x86_64, arm64, etc).
      Signed-off-by: NAnup Patel <anup@brainfault.org>
      Acked-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      4ab49461
  5. 12 11月, 2018 11 次提交
    • R
      ARM: spectre-v2: per-CPU vtables to work around big.Little systems · 383fb3ee
      Russell King 提交于
      In big.Little systems, some CPUs require the Spectre workarounds in
      paths such as the context switch, but other CPUs do not.  In order
      to handle these differences, we need per-CPU vtables.
      
      We are unable to use the kernel's per-CPU variables to support this
      as per-CPU is not initialised at times when we need access to the
      vtables, so we have to use an array indexed by logical CPU number.
      
      We use an array-of-pointers to avoid having function pointers in
      the kernel's read/write .data section.
      Reviewed-by: NJulien Thierry <julien.thierry@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      383fb3ee
    • J
      ARM: 8810/1: vfp: Fix wrong assignement to ufp_exc · 5df7a99b
      Julien Thierry 提交于
      In vfp_preserve_user_clear_hwstate, ufp_exc->fpinst2 gets assigned to
      itself. It should actually be hwstate->fpinst2 that gets assigned to the
      ufp_exc field.
      
      Fixes commit 3aa2df6e ("ARM: 8791/1:
      vfp: use __copy_to_user() when saving VFP state").
      Reported-by: NDavid Binderman <dcb314@hotmail.com>
      Signed-off-by: NJulien Thierry <julien.thierry@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      5df7a99b
    • R
      ARM: add PROC_VTABLE and PROC_TABLE macros · e209950f
      Russell King 提交于
      Allow the way we access members of the processor vtable to be changed
      at compile time.  We will need to move to per-CPU vtables to fix the
      Spectre variant 2 issues on big.Little systems.
      
      However, we have a couple of calls that do not need the vtable
      treatment, and indeed cause a kernel warning due to the (later) use
      of smp_processor_id(), so also introduce the PROC_TABLE macro for
      these which always use CPU 0's function pointers.
      Reviewed-by: NJulien Thierry <julien.thierry@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      e209950f
    • R
      ARM: clean up per-processor check_bugs method call · 945aceb1
      Russell King 提交于
      Call the per-processor type check_bugs() method in the same way as we
      do other per-processor functions - move the "processor." detail into
      proc-fns.h.
      Reviewed-by: NJulien Thierry <julien.thierry@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      945aceb1
    • R
      ARM: split out processor lookup · 65987a85
      Russell King 提交于
      Split out the lookup of the processor type and associated error handling
      from the rest of setup_processor() - we will need to use this in the
      secondary CPU bringup path for big.Little Spectre variant 2 mitigation.
      Reviewed-by: NJulien Thierry <julien.thierry@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      65987a85
    • R
      ARM: make lookup_processor_type() non-__init · 899a42f8
      Russell King 提交于
      Move lookup_processor_type() out of the __init section so it is callable
      from (eg) the secondary startup code during hotplug.
      Reviewed-by: NJulien Thierry <julien.thierry@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      899a42f8
    • L
      drm/omap: Populate DSS children in omapdss driver · e0c827ac
      Laurent Pinchart 提交于
      The DSS DT node contains children that describe the DSS components
      (DISPC and internal encoders). Each of those components is handled by a
      platform driver, and thus needs to be backed by a platform device.
      
      The corresponding platform devices are created in mach-omap2 code by a
      call to of_platform_populate(). While this approach has worked so far,
      it doesn't model the hardware architecture very well, as it creates
      child devices before the parent is ready to handle them. This would be
      akin to creating I2C slaves before the I2C master is available.
      
      The task can be easily performed in the omapdss driver code instead,
      simplifying mach-omap2 code. We however can't remove the mach-omap2 code
      completely as the omap2fb driver still depends on it, but we can move it
      to the omap2fb-specific section, where it can stay until the omap2fb
      driver gets removed.
      
      This has the added benefit of not allowing DSS components to probe
      before the DSS itself, which led to runtime PM issues when the DSS probe
      is deferred.
      
      Fixes: 27d62452 ("drm/omap: dss: Acquire next dssdev at probe time")
      Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181110111654.4387-2-laurent.pinchart@ideasonboard.com
      e0c827ac
    • K
      perf/x86/intel/uncore: Support CoffeeLake 8th CBOX · 4d47d640
      Kan Liang 提交于
      Coffee Lake has 8 core products which has 8 Cboxes. The 8th CBOX is
      mapped into different MSR space.
      
      Increase the num_boxes to 8 to handle the new products. It will not
      impact the previous platforms, SkyLake, KabyLake and earlier CoffeeLake.
      Because the num_boxes will be recalculated in uncore_cpu_init and
      doesn't exceed the x86_max_cores.
      
      Introduce a new box flag bit to indicate the 8th CBOX.
      Signed-off-by: NKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Link: http://lkml.kernel.org/r/20181019170419.378-2-kan.liang@linux.intel.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      4d47d640
    • K
      perf/x86/intel/uncore: Add more IMC PCI IDs for KabyLake and CoffeeLake CPUs · c10a8de0
      Kan Liang 提交于
      KabyLake and CoffeeLake CPUs have the same client uncore events as SkyLake.
      
      Add the PCI IDs for the KabyLake Y, U, S processor lines and CoffeeLake U,
      H, S processor lines.
      Signed-off-by: NKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Link: http://lkml.kernel.org/r/20181019170419.378-1-kan.liang@linux.intel.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      c10a8de0
    • M
      powerpc/io: Fix the IO workarounds code to work with Radix · 43c6494f
      Michael Ellerman 提交于
      Back in 2006 Ben added some workarounds for a misbehaviour in the
      Spider IO bridge used on early Cell machines, see commit
      014da7ff ("[POWERPC] Cell "Spider" MMIO workarounds"). Later these
      were made to be generic, ie. not tied specifically to Spider.
      
      The code stashes a token in the high bits (59-48) of virtual addresses
      used for IO (eg. returned from ioremap()). This works fine when using
      the Hash MMU, but when we're using the Radix MMU the bits used for the
      token overlap with some of the bits of the virtual address.
      
      This is because the maximum virtual address is larger with Radix, up
      to c00fffffffffffff, and in fact we use that high part of the address
      range for ioremap(), see RADIX_KERN_IO_START.
      
      As it happens the bits that are used overlap with the bits that
      differentiate an IO address vs a linear map address. If the resulting
      address lies outside the linear mapping we will crash (see below), if
      not we just corrupt memory.
      
        virtio-pci 0000:00:00.0: Using 64-bit direct DMA at offset 800000000000000
        Unable to handle kernel paging request for data at address 0xc000000080000014
        ...
        CFAR: c000000000626b98 DAR: c000000080000014 DSISR: 42000000 IRQMASK: 0
        GPR00: c0000000006c54fc c00000003e523378 c0000000016de600 0000000000000000
        GPR04: c00c000080000014 0000000000000007 0fffffff000affff 0000000000000030
               ^^^^
        ...
        NIP [c000000000626c5c] .iowrite8+0xec/0x100
        LR [c0000000006c992c] .vp_reset+0x2c/0x90
        Call Trace:
          .pci_bus_read_config_dword+0xc4/0x120 (unreliable)
          .register_virtio_device+0x13c/0x1c0
          .virtio_pci_probe+0x148/0x1f0
          .local_pci_probe+0x68/0x140
          .pci_device_probe+0x164/0x220
          .really_probe+0x274/0x3b0
          .driver_probe_device+0x80/0x170
          .__driver_attach+0x14c/0x150
          .bus_for_each_dev+0xb8/0x130
          .driver_attach+0x34/0x50
          .bus_add_driver+0x178/0x2f0
          .driver_register+0x90/0x1a0
          .__pci_register_driver+0x6c/0x90
          .virtio_pci_driver_init+0x2c/0x40
          .do_one_initcall+0x64/0x280
          .kernel_init_freeable+0x36c/0x474
          .kernel_init+0x24/0x160
          .ret_from_kernel_thread+0x58/0x7c
      
      This hasn't been a problem because CONFIG_PPC_IO_WORKAROUNDS which
      enables this code is usually not enabled. It is only enabled when it's
      selected by PPC_CELL_NATIVE which is only selected by
      PPC_IBM_CELL_BLADE and that in turn depends on BIG_ENDIAN. So in order
      to hit the bug you need to build a big endian kernel, with IBM Cell
      Blade support enabled, as well as Radix MMU support, and then boot
      that on Power9 using Radix MMU.
      
      Still we can fix the bug, so let's do that. We simply use fewer bits
      for the token, taking the union of the restrictions on the address
      from both Hash and Radix, we end up with 8 bits we can use for the
      token. The only user of the token is iowa_mem_find_bus() which only
      supports 8 token values, so 8 bits is plenty for that.
      
      Fixes: 566ca99a ("powerpc/mm/radix: Add dummy radix_enabled()")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      43c6494f
    • M
      powerpc/mm/64s: Fix preempt warning in slb_allocate_kernel() · c8b00bb7
      Michael Ellerman 提交于
      With preempt enabled we see warnings in do_slb_fault():
      
        BUG: using smp_processor_id() in preemptible [00000000] code: kworker/u33:0/98
        futex hash table entries: 4096 (order: 3, 524288 bytes)
        caller is do_slb_fault+0x204/0x230
        CPU: 5 PID: 98 Comm: kworker/u33:0 Not tainted 4.19.0-rc3-gcc-7.3.1-00022-g1936f094 #138
        Call Trace:
          dump_stack+0xb4/0x104 (unreliable)
          check_preemption_disabled+0x148/0x150
          do_slb_fault+0x204/0x230
          data_access_slb_common+0x138/0x180
      
      This is caused by the get_paca() in slb_allocate_kernel(), which
      includes a call to debug_smp_processor_id().
      
      slb_allocate_kernel() can only be called from do_slb_fault(), and in
      that path interrupts are hard disabled and so we can't be preempted,
      but we can't update the preempt flags (in thread_info) because that
      could cause an SLB fault.
      
      So just use local_paca which is safe and doesn't cause the warning.
      
      Fixes: 48e7b769 ("powerpc/64s/hash: Convert SLB miss handlers to C")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      c8b00bb7
  6. 10 11月, 2018 1 次提交
  7. 09 11月, 2018 4 次提交
  8. 08 11月, 2018 4 次提交
    • A
      ubd: fix missing initialization of io_req · 0033dfd9
      Anton Ivanov 提交于
      The SYNC path doesn't initialize io_req->error, which can cause
      random errors. Before the conversion to blk-mq, we always
      completed requests with BLK_STS_OK status, but now we actually
      look at the error field and this issue becomes apparent.
      Signed-off-by: NAnton Ivanov <anton.ivanov@cambridgegreys.com>
      
      [axboe: fixed up commit message to explain what is actually going on]
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      0033dfd9
    • H
      arch/alpha, termios: implement BOTHER, IBSHIFT and termios2 · d0ffb805
      H. Peter Anvin (Intel) 提交于
      Alpha has had c_ispeed and c_ospeed, but still set speeds in c_cflags
      using arbitrary flags. Because BOTHER is not defined, the general
      Linux code doesn't allow setting arbitrary baud rates, and because
      CBAUDEX == 0, we can have an array overrun of the baud_rate[] table in
      drivers/tty/tty_baudrate.c if (c_cflags & CBAUD) == 037.
      
      Resolve both problems by #defining BOTHER to 037 on Alpha.
      
      However, userspace still needs to know if setting BOTHER is actually
      safe given legacy kernels (does anyone actually care about that on
      Alpha anymore?), so enable the TCGETS2/TCSETS*2 ioctls on Alpha, even
      though they use the same structure. Define struct termios2 just for
      compatibility; it is the exact same structure as struct termios. In a
      future patchset, this will be cleaned up so the uapi headers are
      usable from libc.
      Signed-off-by: NH. Peter Anvin (Intel) <hpa@zytor.com>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Cc: Eugene Syromiatnikov <esyr@redhat.com>
      Cc: <linux-alpha@vger.kernel.org>
      Cc: <linux-serial@vger.kernel.org>
      Cc: Johan Hovold <johan@kernel.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d0ffb805
    • T
      s390/perf: Change CPUM_CF return code in event init function · 0bb2ae1b
      Thomas Richter 提交于
      The function perf_init_event() creates a new event and
      assignes it to a PMU. This a done in a loop over all existing
      PMUs. For each listed PMU the event init function is called
      and if this function does return any other error than -ENOENT,
      the loop is terminated the creation of the event fails.
      
      If the event is invalid, return -ENOENT to try other PMUs.
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NHendrik Brueckner <brueckner@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      0bb2ae1b
    • J
      ubd: fix missing lock around request issue · 6961cd4d
      Jens Axboe 提交于
      We need to hold the device lock (and disable interrupts) while
      writing new commands, or we could be interrupted while that
      is happening and read invalid requests in the completion path.
      
      Fixes: 4e6da0fe ("um: Convert ubd driver to blk-mq")
      Tested-by: NRichard Weinberger <richard@nod.at>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      6961cd4d
  9. 07 11月, 2018 7 次提交
    • S
      KVM: PPC: Move and undef TRACE_INCLUDE_PATH/FILE · 28c5bcf7
      Scott Wood 提交于
      TRACE_INCLUDE_PATH and TRACE_INCLUDE_FILE are used by
      <trace/define_trace.h>, so like that #include, they should
      be outside #ifdef protection.
      
      They also need to be #undefed before defining, in case multiple trace
      headers are included by the same C file.  This became the case on
      book3e after commit cf4a6085 ("powerpc/mm: Add missing tracepoint for
      tlbie"), leading to the following build error:
      
         CC      arch/powerpc/kvm/powerpc.o
      In file included from arch/powerpc/kvm/powerpc.c:51:0:
      arch/powerpc/kvm/trace.h:9:0: error: "TRACE_INCLUDE_PATH" redefined
      [-Werror]
        #define TRACE_INCLUDE_PATH .
        ^
      In file included from arch/powerpc/kvm/../mm/mmu_decl.h:25:0,
                        from arch/powerpc/kvm/powerpc.c:48:
      ./arch/powerpc/include/asm/trace.h:224:0: note: this is the location of
      the previous definition
        #define TRACE_INCLUDE_PATH asm
        ^
      cc1: all warnings being treated as errors
      Reported-by: NChristian Zigotzky <chzigotzky@xenosoft.de>
      Signed-off-by: NScott Wood <oss@buserror.net>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      28c5bcf7
    • E
      x86/vsmp: Remove dependency on pv_irq_ops · a48777fd
      Eial Czerwacki 提交于
      vSMP dependency on pv_irq_ops has been removed some years ago, but the code
      still deals with pv_irq_ops.
      
      In short, "cap & ctl & (1 << 4)" is always returning 0, so all
      PARAVIRT/PARAVIRT_XXL code related to that can be removed.
      
      However, the rest of the code depends on CONFIG_PCI, so fix it accordingly.
      
      Rename set_vsmp_pv_ops to set_vsmp_ctl as the original name does not make
      sense anymore.
      Signed-off-by: NEial Czerwacki <eial@scalemp.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NShai Fultheim <shai@scalemp.com>
      Cc: Juergen Gross <jgross@suse.com>
      Link: https://lkml.kernel.org/r/1541439114-28297-1-git-send-email-eial@scalemp.com
      a48777fd
    • K
      x86/ldt: Remove unused variable in map_ldt_struct() · b082f2dd
      Kirill A. Shutemov 提交于
      Splitting out the sanity check in map_ldt_struct() moved page table syncing
      into a separate function, which made the pgd variable unused. Remove it.
      
      [ tglx: Massaged changelog ]
      
      Fixes: 9bae3197 ("x86/ldt: Split out sanity check in map_ldt_struct()")
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NAndy Lutomirski <luto@kernel.org>
      Cc: bp@alien8.de
      Cc: hpa@zytor.com
      Cc: dave.hansen@linux.intel.com
      Cc: peterz@infradead.org
      Cc: boris.ostrovsky@oracle.com
      Cc: jgross@suse.com
      Cc: bhe@redhat.com
      Cc: willy@infradead.org
      Cc: linux-mm@kvack.org
      Cc: stable@vger.kernel.org
      Link: https://lkml.kernel.org/r/20181026122856.66224-4-kirill.shutemov@linux.intel.com
      b082f2dd
    • K
      x86/ldt: Unmap PTEs for the slot before freeing LDT pages · a0e6e083
      Kirill A. Shutemov 提交于
      modify_ldt(2) leaves the old LDT mapped after switching over to the new
      one. The old LDT gets freed and the pages can be re-used.
      
      Leaving the mapping in place can have security implications. The mapping is
      present in the userspace page tables and Meltdown-like attacks can read
      these freed and possibly reused pages.
      
      It's relatively simple to fix: unmap the old LDT and flush TLB before
      freeing the old LDT memory.
      
      This further allows to avoid flushing the TLB in map_ldt_struct() as the
      slot is unmapped and flushed by unmap_ldt_struct() or has never been mapped
      at all.
      
      [ tglx: Massaged changelog and removed the needless line breaks ]
      
      Fixes: f55f0501 ("x86/pti: Put the LDT in its own PGD if PTI is on")
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: bp@alien8.de
      Cc: hpa@zytor.com
      Cc: dave.hansen@linux.intel.com
      Cc: luto@kernel.org
      Cc: peterz@infradead.org
      Cc: boris.ostrovsky@oracle.com
      Cc: jgross@suse.com
      Cc: bhe@redhat.com
      Cc: willy@infradead.org
      Cc: linux-mm@kvack.org
      Cc: stable@vger.kernel.org
      Link: https://lkml.kernel.org/r/20181026122856.66224-3-kirill.shutemov@linux.intel.com
      a0e6e083
    • K
      x86/mm: Move LDT remap out of KASLR region on 5-level paging · d52888aa
      Kirill A. Shutemov 提交于
      On 5-level paging the LDT remap area is placed in the middle of the KASLR
      randomization region and it can overlap with the direct mapping, the
      vmalloc or the vmap area.
      
      The LDT mapping is per mm, so it cannot be moved into the P4D page table
      next to the CPU_ENTRY_AREA without complicating PGD table allocation for
      5-level paging.
      
      The 4 PGD slot gap just before the direct mapping is reserved for
      hypervisors, so it cannot be used.
      
      Move the direct mapping one slot deeper and use the resulting gap for the
      LDT remap area. The resulting layout is the same for 4 and 5 level paging.
      
      [ tglx: Massaged changelog ]
      
      Fixes: f55f0501 ("x86/pti: Put the LDT in its own PGD if PTI is on")
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NAndy Lutomirski <luto@kernel.org>
      Cc: bp@alien8.de
      Cc: hpa@zytor.com
      Cc: dave.hansen@linux.intel.com
      Cc: peterz@infradead.org
      Cc: boris.ostrovsky@oracle.com
      Cc: jgross@suse.com
      Cc: bhe@redhat.com
      Cc: willy@infradead.org
      Cc: linux-mm@kvack.org
      Cc: stable@vger.kernel.org
      Link: https://lkml.kernel.org/r/20181026122856.66224-2-kirill.shutemov@linux.intel.com
      d52888aa
    • V
      acpi/nfit, x86/mce: Validate a MCE's address before using it · e8a308e5
      Vishal Verma 提交于
      The NFIT machine check handler uses the physical address from the mce
      structure, and compares it against information in the ACPI NFIT table
      to determine whether that location lies on an NVDIMM. The mce->addr
      field however may not always be valid, and this is indicated by the
      MCI_STATUS_ADDRV bit in the status field.
      
      Export mce_usable_address() which already performs validation for the
      address, and use it in the NFIT handler.
      
      Fixes: 6839a6d9 ("nfit: do an ARS scrub on hitting a latent media error")
      Reported-by: NRobert Elliott <elliott@hpe.com>
      Signed-off-by: NVishal Verma <vishal.l.verma@intel.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      CC: Arnd Bergmann <arnd@arndb.de>
      Cc: Dan Williams <dan.j.williams@intel.com>
      CC: Dave Jiang <dave.jiang@intel.com>
      CC: elliott@hpe.com
      CC: "H. Peter Anvin" <hpa@zytor.com>
      CC: Ingo Molnar <mingo@redhat.com>
      CC: Len Brown <lenb@kernel.org>
      CC: linux-acpi@vger.kernel.org
      CC: linux-edac <linux-edac@vger.kernel.org>
      CC: linux-nvdimm@lists.01.org
      CC: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
      CC: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      CC: Ross Zwisler <zwisler@kernel.org>
      CC: stable <stable@vger.kernel.org>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Tony Luck <tony.luck@intel.com>
      CC: x86-ml <x86@kernel.org>
      CC: Yazen Ghannam <yazen.ghannam@amd.com>
      Link: http://lkml.kernel.org/r/20181026003729.8420-2-vishal.l.verma@intel.com
      e8a308e5
    • V
      acpi/nfit, x86/mce: Handle only uncorrectable machine checks · 5d96c934
      Vishal Verma 提交于
      The MCE handler for nfit devices is called for memory errors on a
      Non-Volatile DIMM and adds the error location to a 'badblocks' list.
      This list is used by the various NVDIMM drivers to avoid consuming known
      poison locations during IO.
      
      The MCE handler gets called for both corrected and uncorrectable errors.
      Until now, both kinds of errors have been added to the badblocks list.
      However, corrected memory errors indicate that the problem has already
      been fixed by hardware, and the resulting interrupt is merely a
      notification to Linux.
      
      As far as future accesses to that location are concerned, it is
      perfectly fine to use, and thus doesn't need to be included in the above
      badblocks list.
      
      Add a check in the nfit MCE handler to filter out corrected mce events,
      and only process uncorrectable errors.
      
      Fixes: 6839a6d9 ("nfit: do an ARS scrub on hitting a latent media error")
      Reported-by: NOmar Avelar <omar.avelar@intel.com>
      Signed-off-by: NVishal Verma <vishal.l.verma@intel.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      CC: Arnd Bergmann <arnd@arndb.de>
      CC: Dan Williams <dan.j.williams@intel.com>
      CC: Dave Jiang <dave.jiang@intel.com>
      CC: elliott@hpe.com
      CC: "H. Peter Anvin" <hpa@zytor.com>
      CC: Ingo Molnar <mingo@redhat.com>
      CC: Len Brown <lenb@kernel.org>
      CC: linux-acpi@vger.kernel.org
      CC: linux-edac <linux-edac@vger.kernel.org>
      CC: linux-nvdimm@lists.01.org
      CC: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
      CC: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      CC: Ross Zwisler <zwisler@kernel.org>
      CC: stable <stable@vger.kernel.org>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Tony Luck <tony.luck@intel.com>
      CC: x86-ml <x86@kernel.org>
      CC: Yazen Ghannam <yazen.ghannam@amd.com>
      Link: http://lkml.kernel.org/r/20181026003729.8420-1-vishal.l.verma@intel.com
      5d96c934
  10. 06 11月, 2018 3 次提交
    • J
      parisc: Revert "Release spinlocks using ordered store" · 86d4d068
      John David Anglin 提交于
      This reverts commit d27dfa13.
      
      Unfortunately, this patch needs to be reverted.  We need the full sync
      barrier and not the limited barrier provided by using an ordered store.
      The sync ensures that all accesses and cache purge instructions that
      follow the sync are performed after all such instructions prior the sync
      instruction have completed executing.
      
      The patch breaks the rwlock implementation in glibc.  This caused the
      test-lock application in the libprelude testsuite to hang.  With the
      change reverted, the test runs correctly and the libprelude package
      builds successfully.
      Signed-off-by: NJohn David Anglin <dave.anglin@bell.net>
      Signed-off-by: NHelge Deller <deller@gmx.de>
      86d4d068
    • A
      ARM: 8809/1: proc-v7: fix Thumb annotation of cpu_v7_hvc_switch_mm · 6282e916
      Ard Biesheuvel 提交于
      Due to what appears to be a copy/paste error, the opening ENTRY()
      of cpu_v7_hvc_switch_mm() lacks a matching ENDPROC(), and instead,
      the one for cpu_v7_smc_switch_mm() is duplicated.
      
      Given that it is ENDPROC() that emits the Thumb annotation, the
      cpu_v7_hvc_switch_mm() routine will be called in ARM mode on a
      Thumb2 kernel, resulting in the following splat:
      
        Internal error: Oops - undefined instruction: 0 [#1] SMP THUMB2
        Modules linked in:
        CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.18.0-rc1-00030-g4d28ad89189d-dirty #488
        Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015
        PC is at cpu_v7_hvc_switch_mm+0x12/0x18
        LR is at flush_old_exec+0x31b/0x570
        pc : [<c0316efe>]    lr : [<c04117c7>]    psr: 00000013
        sp : ee899e50  ip : 00000000  fp : 00000001
        r10: eda28f34  r9 : eda31800  r8 : c12470e0
        r7 : eda1fc00  r6 : eda53000  r5 : 00000000  r4 : ee88c000
        r3 : c0316eec  r2 : 00000001  r1 : eda53000  r0 : 6da6c000
        Flags: nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
      
      Note the 'ISA ARM' in the last line.
      
      Fix this by using the correct name in ENDPROC().
      
      Cc: <stable@vger.kernel.org>
      Fixes: 10115105 ("ARM: spectre-v2: add firmware based hardening")
      Reviewed-by: NDave Martin <Dave.Martin@arm.com>
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      6282e916
    • M
      powerpc/mm/64s: Only use slbfee on CPUs that support it · 9586d569
      Michael Ellerman 提交于
      The slbfee instruction was only added in ISA 2.05 (Power6), it's not
      supported on older CPUs. We don't have a CPU feature for that ISA
      version though, so just use the ISA 2.06 feature flag.
      
      Fixes: e15a4fea ("powerpc/64s/hash: Add some SLB debugging tests")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      9586d569