1. 21 3月, 2017 1 次提交
  2. 16 3月, 2017 1 次提交
  3. 06 2月, 2017 1 次提交
    • C
      KVM: s390: detect some program check loops · fb7dc1d4
      Christian Borntraeger 提交于
      Sometimes (e.g. early boot) a guest is broken in such ways that it loops
      100% delivering operation exceptions (illegal operation) but the pgm new
      PSW is not set properly. This will result in code being read from
      address zero, which usually contains another illegal op. Let's detect
      this case and return to userspace. Instead of only detecting
      this for address zero apply a heuristic that will work for any program
      check new psw.
      We do not want guest problem state to be able to trigger a guest panic,
      e.g. by faulting on an address that is the same as the program check
      new PSW, so we check for the problem state bit being off.
      
      With proper handling in userspace we
      a: get rid of CPU consumption of such broken guests
      b: keep the program old PSW. This allows to find out the original illegal
         operation - making debugging such early boot issues much easier than
         with single stepping
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Reviewed-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      fb7dc1d4
  4. 30 1月, 2017 1 次提交
  5. 21 10月, 2016 1 次提交
    • C
      KVM: s390: reject invalid modes for runtime instrumentation · a5efb6b6
      Christian Borntraeger 提交于
      Usually a validity intercept is a programming error of the host
      because of invalid entries in the state description.
      We can get a validity intercept if the mode of the runtime
      instrumentation control block is wrong. As the host does not know
      which modes are valid, this can be used by userspace to trigger
      a WARN.
      Instead of printing a WARN let's return an error to userspace as
      this can only happen if userspace provides a malformed initial
      value (e.g. on migration). The kernel should never warn on bogus
      input. Instead let's log it into the s390 debug feature.
      
      While at it, let's return -EINVAL for all validity intercepts as
      this will trigger an error in QEMU like
      
      error: kvm run failed Invalid argument
      PSW=mask 0404c00180000000 addr 000000000063c226 cc 00
      R00=000000000000004f R01=0000000000000004 R02=0000000000760005 R03=000000007fe0a000
      R04=000000000064ba2a R05=000000049db73dd0 R06=000000000082c4b0 R07=0000000000000041
      R08=0000000000000002 R09=000003e0804042a8 R10=0000000496152c42 R11=000000007fe0afb0
      [...]
      
      This will avoid an endless loop of validity intercepts.
      
      Cc: stable@vger.kernel.org # v4.5+
      Fixes: c6e5f166 ("KVM: s390: implement the RI support of guest")
      Acked-by: NFan Zhang <zhangfan@linux.vnet.ibm.com>
      Reviewed-by: NPierre Morel <pmorel@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      a5efb6b6
  6. 08 9月, 2016 1 次提交
  7. 18 7月, 2016 1 次提交
  8. 05 7月, 2016 1 次提交
  9. 10 6月, 2016 3 次提交
  10. 10 2月, 2016 4 次提交
  11. 30 11月, 2015 1 次提交
  12. 29 10月, 2015 1 次提交
    • C
      KVM: s390: use simple switch statement as multiplexer · 46b708ea
      Christian Borntraeger 提交于
      We currently do some magic shifting (by exploiting that exit codes
      are always a multiple of 4) and a table lookup to jump into the
      exit handlers. This causes some calculations and checks, just to
      do an potentially expensive function call.
      
      Changing that to a switch statement gives the compiler the chance
      to inline and dynamically decide between jump tables or inline
      compare and branches. In addition it makes the code more readable.
      
      bloat-o-meter gives me a small reduction in code size:
      
      add/remove: 0/7 grow/shrink: 1/1 up/down: 986/-1334 (-348)
      function                                     old     new   delta
      kvm_handle_sie_intercept                      72    1058    +986
      handle_prog                                  704     696      -8
      handle_noop                                   54       -     -54
      handle_partial_execution                      60       -     -60
      intercept_funcs                              120       -    -120
      handle_instruction                           198       -    -198
      handle_validity                              210       -    -210
      handle_stop                                  316       -    -316
      handle_external_interrupt                    368       -    -368
      
      Right now my gcc does conditional branches instead of jump tables.
      The inlining seems to give us enough cycles as some micro-benchmarking
      shows minimal improvements, but still in noise.
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Reviewed-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      46b708ea
  13. 08 5月, 2015 1 次提交
  14. 17 3月, 2015 1 次提交
  15. 06 3月, 2015 1 次提交
  16. 23 1月, 2015 4 次提交
  17. 28 11月, 2014 2 次提交
  18. 10 7月, 2014 2 次提交
  19. 16 5月, 2014 3 次提交
  20. 06 5月, 2014 1 次提交
  21. 29 4月, 2014 2 次提交
  22. 22 4月, 2014 6 次提交