1. 31 5月, 2018 14 次提交
  2. 29 3月, 2018 1 次提交
  3. 28 3月, 2018 2 次提交
  4. 27 3月, 2018 2 次提交
    • A
      x86/alternatives: Fixup alternative_call_2 · bd627103
      Alexey Dobriyan 提交于
      The following pattern fails to compile while the same pattern
      with alternative_call() does:
      
      	if (...)
      		alternative_call_2(...);
      	else
      		alternative_call_2(...);
      
      as it expands into
      
      	if (...)
      	{
      	};	<===
      	else
      	{
      	};
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NBorislav Petkov <bp@suse.de>
      Link: https://lkml.kernel.org/r/20180114120504.GA11368@avx2
      bd627103
    • S
      perf/x86/intel: Fix linear IP of PEBS real_ip on Haswell and later CPUs · 71eb9ee9
      Stephane Eranian 提交于
      this patch fix a bug in how the pebs->real_ip is handled in the PEBS
      handler. real_ip only exists in Haswell and later processor. It is
      actually the eventing IP, i.e., where the event occurred. As opposed
      to the pebs->ip which is the PEBS interrupt IP which is always off
      by one.
      
      The problem is that the real_ip just like the IP needs to be fixed up
      because PEBS does not record all the machine state registers, and
      in particular the code segement (cs). This is why we have the set_linear_ip()
      function. The problem was that set_linear_ip() was only used on the pebs->ip
      and not the pebs->real_ip.
      
      We have profiles which ran into invalid callstacks because of this.
      Here is an example:
      
       .....  0: ffffffffffffff80 recent entry, marker kernel v
       .....  1: 000000000040044d <= user address in kernel space!
       .....  2: fffffffffffffe00 marker enter user v
       .....  3: 000000000040044d
       .....  4: 00000000004004b6 oldest entry
      
      Debugging output in get_perf_callchain():
      
       [  857.769909] CALLCHAIN: CPU8 ip=40044d regs->cs=10 user_mode(regs)=0
      
      The problem is that the kernel entry in 1: points to a user level
      address. How can that be?
      
      The reason is that with PEBS sampling the instruction that caused the event
      to occur and the instruction where the CPU was when the interrupt was posted
      may be far apart. And sometime during that time window, the privilege level may
      change. This happens, for instance, when the PEBS sample is taken close to a
      kernel entry point. Here PEBS, eventing IP (real_ip) captured a user level
      instruction. But by the time the PMU interrupt fired, the processor had already
      entered kernel space. This is why the debug output shows a user address with
      user_mode() false.
      
      The problem comes from PEBS not recording the code segment (cs) register.
      The register is used in x86_64 to determine if executing in kernel vs user
      space. This is okay because the kernel has a software workaround called
      set_linear_ip(). But the issue in setup_pebs_sample_data() is that
      set_linear_ip() is never called on the real_ip value when it is available
      (Haswell and later) and precise_ip > 1.
      
      This patch fixes this problem and eliminates the callchain discrepancy.
      
      The patch restructures the code around set_linear_ip() to minimize the number
      of times the IP has to be set.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      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: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: kan.liang@intel.com
      Link: http://lkml.kernel.org/r/1521788507-10231-1-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      71eb9ee9
  5. 26 3月, 2018 1 次提交
  6. 25 3月, 2018 1 次提交
  7. 24 3月, 2018 7 次提交
  8. 23 3月, 2018 10 次提交
  9. 22 3月, 2018 2 次提交
    • N
      MIPS: ralink: Fix booting on MT7621 · a63d706e
      NeilBrown 提交于
      Since commit 3af5a67c ("MIPS: Fix early CM probing") the MT7621 has
      not been able to boot.
      
      This commit caused mips_cm_probe() to be called before
      mt7621.c::proc_soc_init().
      
      prom_soc_init() has a comment explaining that mips_cm_probe() "wipes out
      the bootloader config" and means that configuration registers are no
      longer available. It has some code to re-enable this config.
      
      Before this re-enable code is run, the sysc register cannot be read, so
      when SYSC_REG_CHIP_NAME0 is read, a garbage value is returned and
      panic() is called.
      
      If we move the config-repair code to the top of prom_soc_init(), the
      registers can be read and boot can proceed.
      
      Very occasionally, the first register read after the reconfiguration
      returns garbage, so add a call to __sync().
      
      Fixes: 3af5a67c ("MIPS: Fix early CM probing")
      Signed-off-by: NNeilBrown <neil@brown.name>
      Reviewed-by: NMatt Redfearn <matt.redfearn@mips.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: <stable@vger.kernel.org> # 4.5+
      Patchwork: https://patchwork.linux-mips.org/patch/18859/Signed-off-by: NJames Hogan <jhogan@kernel.org>
      a63d706e
    • N
      MIPS: ralink: Remove ralink_halt() · 891731f6
      NeilBrown 提交于
      ralink_halt() does nothing that machine_halt() doesn't already do, so it
      adds no value.
      
      It actually causes incorrect behaviour due to the "unreachable()" at the
      end. This tells the compiler that the end of the function will never be
      reached, which isn't true. The compiler responds by not adding a
      'return' instruction, so control simply moves on to whatever bytes come
      afterwards in memory. In my tested, that was the ralink_restart()
      function. This means that an attempt to 'halt' the machine would
      actually cause a reboot.
      
      So remove ralink_halt() so that a 'halt' really does halt.
      
      Fixes: c06e836a ("MIPS: ralink: adds reset code")
      Signed-off-by: NNeilBrown <neil@brown.name>
      Cc: John Crispin <john@phrozen.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: <stable@vger.kernel.org> # 3.9+
      Patchwork: https://patchwork.linux-mips.org/patch/18851/Signed-off-by: NJames Hogan <jhogan@kernel.org>
      891731f6