1. 23 7月, 2014 1 次提交
    • P
      x86, cpu: Fix cache topology for early P4-SMT · 2a226155
      Peter Zijlstra 提交于
      P4 systems with cpuid level < 4 can have SMT, but the cache topology
      description available (cpuid2) does not include SMP information.
      
      Now we know that SMT shares all cache levels, and therefore we can
      mark all available cache levels as shared.
      
      We do this by setting cpu_llc_id to ->phys_proc_id, since that's
      the same for each SMT thread. We can do this unconditional since if
      there's no SMT its still true, the one CPU shares cache with only
      itself.
      
      This fixes a problem where such CPUs report an incorrect LLC CPU mask.
      
      This in turn fixes a crash in the scheduler where the topology was
      build wrong, it assumes the LLC mask to include at least the SMT CPUs.
      
      Cc: Josh Boyer <jwboyer@redhat.com>
      Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
      Tested-by: NBruno Wolff III <bruno@wolff.to>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20140722133514.GM12054@laptop.lanSigned-off-by: NH. Peter Anvin <hpa@zytor.com>
      2a226155
  2. 22 7月, 2014 1 次提交
    • S
      x86_32, entry: Store badsys error code in %eax · 8142b215
      Sven Wegener 提交于
      Commit 554086d8 ("x86_32, entry: Do syscall exit work on badsys
      (CVE-2014-4508)") introduced a regression in the x86_32 syscall entry
      code, resulting in syscall() not returning proper errors for undefined
      syscalls on CPUs supporting the sysenter feature.
      
      The following code:
      
      > int result = syscall(666);
      > printf("result=%d errno=%d error=%s\n", result, errno, strerror(errno));
      
      results in:
      
      > result=666 errno=0 error=Success
      
      Obviously, the syscall return value is the called syscall number, but it
      should have been an ENOSYS error. When run under ptrace it behaves
      correctly, which makes it hard to debug in the wild:
      
      > result=-1 errno=38 error=Function not implemented
      
      The %eax register is the return value register. For debugging via ptrace
      the syscall entry code stores the complete register context on the
      stack. The badsys handlers only store the ENOSYS error code in the
      ptrace register set and do not set %eax like a regular syscall handler
      would. The old resume_userspace call chain contains code that clobbers
      %eax and it restores %eax from the ptrace registers afterwards. The same
      goes for the ptrace-enabled call chain. When ptrace is not used, the
      syscall return value is the passed-in syscall number from the untouched
      %eax register.
      
      Use %eax as the return value register in syscall_badsys and
      sysenter_badsys, like a real syscall handler does, and have the caller
      push the value onto the stack for ptrace access.
      Signed-off-by: NSven Wegener <sven.wegener@stealer.net>
      Link: http://lkml.kernel.org/r/alpine.LNX.2.11.1407221022380.31021@titan.int.lan.stealer.netReviewed-and-tested-by: NAndy Lutomirski <luto@amacapital.net>
      Cc: <stable@vger.kernel.org> # If 554086d8 is backported
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      8142b215
  3. 21 7月, 2014 9 次提交
  4. 20 7月, 2014 11 次提交
  5. 19 7月, 2014 18 次提交