1. 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
  2. 08 9月, 2016 1 次提交
  3. 18 7月, 2016 1 次提交
  4. 05 7月, 2016 1 次提交
  5. 10 6月, 2016 3 次提交
  6. 10 2月, 2016 4 次提交
  7. 30 11月, 2015 1 次提交
  8. 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
  9. 08 5月, 2015 1 次提交
  10. 17 3月, 2015 1 次提交
  11. 06 3月, 2015 1 次提交
  12. 23 1月, 2015 4 次提交
  13. 28 11月, 2014 2 次提交
  14. 10 7月, 2014 2 次提交
  15. 16 5月, 2014 3 次提交
  16. 06 5月, 2014 1 次提交
  17. 29 4月, 2014 2 次提交
  18. 22 4月, 2014 6 次提交
  19. 17 1月, 2014 1 次提交
    • M
      KVM: s390: enable Transactional Execution · 7feb6bb8
      Michael Mueller 提交于
      This patch enables transactional execution for KVM guests
      on s390 systems zec12 or later.
      
      We rework the allocation of the page containing the sie_block
      to also back the Interception Transaction Diagnostic Block.
      If available the TE facilities will be enabled.
      
      Setting bit 73 and 50 in vfacilities bitmask reveals the HW
      facilities Transactional Memory and Constraint Transactional
      Memory respectively to the KVM guest.
      
      Furthermore, the patch restores the Program-Interruption TDB
      from the Interception TDB in case a program interception has
      occurred and the ITDB has a valid format.
      Signed-off-by: NMichael Mueller <mimu@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      7feb6bb8
  20. 25 9月, 2013 1 次提交
  21. 21 6月, 2013 1 次提交
  22. 21 5月, 2013 1 次提交