Skip to content
Snippets Groups Projects
  1. Dec 06, 2013
  2. Dec 05, 2013
  3. Dec 04, 2013
    • Glauber Costa's avatar
      xen: use bsrq instead of bsrl for event channels · 587063a8
      Glauber Costa authored
      
      This patch fixes the Amazon crash many CPUs. Funny enough, it is not
      actually related to the number of CPUs. In that situation, the port
      numbers allocated for the event channels are quite high. I don't
      really know the reason for that, maybe the Hypervisor reserves the
      small bits for CPU related things...
      
      As we have more and more CPUs and the bits shift more and more rightwards,
      they eventually reach the second long word of the event channel quadword.
      
      But we have been operating this with brsl, which will only reach a long word.
      If bit 32, for instance, is 1, it  will be interpreted as bit 0 == 1. Bit 0
      having no registered handler, that will turn into a nullptr access.
      
      Cheers for Dima for doing most of the debugging and heavy lifting here.
      The hang issues are still present.
      
      Fixes #109.
      
      Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      Signed-off-by: default avatarDmitry Fleytman <dmitry@daynix.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      587063a8
    • Nadav Har'El's avatar
      Add a few missing __*_chk functions · 2f4b8777
      Nadav Har'El authored
      
      When source code is compiled with -D_FORTIFY_SOURCE on Linux, various
      functions are sometimes replaced by __*_chk variants (e.g., __strcpy_chk)
      which can help avoid buffer overflows when the compiler knows the buffer's
      size during compilation.
      
      If we want to run source compiled on Linux with -D_FORTIFY_SOURCE (either
      deliberately or unintentionally - see issue #111), we need to implement
      these functions otherwise the program will crash because of a missing
      symbol. We already implement a bunch of _chk functions, but we are
      definitely missing some more.
      
      This patch implements 6 more _chk functions which are needed to run
      the "rogue" program (mentioned in issue #111) when compiled with
      -D_FORTIFY_SOURCE=1.
      
      Following the philosophy of our existing *_chk functions, we do not
      aim for either ultimate performance or iron-clad security for our
      implementation of these functions. If this becomes important, we
      should revisit all our *_chk functions.
      
      When compiled with -D_FORTIFY_SOURCE=2, rogue still doesn't work, but
      not because of a missing symbol, but because it fails reading the
      terminfo file for a yet unknown reason (a patch for that issue will
      be sent separately).
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      2f4b8777
    • Dan Schatzberg's avatar
      x64: Fix rare SMP deadlock when acquiring stack · 43e77bbb
      Dan Schatzberg authored
      
      The SMP bringup code uses a linked list of stacks. The APs are all
      brought up concurrently and so to acquire a stack, they compare and swap
      on smp_stack_free. The current code works as long as the compare and
      swap succeeds, if it fails, then smp_stack_free MUST be read again
      otherwise the AP will be deadlocked. This patch fixes the current code
      by enforcing a re-read on a cmpxchg failure.
      
      Reviewed-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      Signed-off-by: default avatarDan Schatzberg <schatzberg.dan@gmail.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      43e77bbb
Loading