1. 02 4月, 2013 8 次提交
  2. 08 3月, 2013 7 次提交
  3. 06 3月, 2013 1 次提交
  4. 05 3月, 2013 3 次提交
  5. 14 2月, 2013 2 次提交
    • M
      s390/mm: implement software dirty bits · abf09bed
      Martin Schwidefsky 提交于
      The s390 architecture is unique in respect to dirty page detection,
      it uses the change bit in the per-page storage key to track page
      modifications. All other architectures track dirty bits by means
      of page table entries. This property of s390 has caused numerous
      problems in the past, e.g. see git commit ef5d437f
      "mm: fix XFS oops due to dirty pages without buffers on s390".
      
      To avoid future issues in regard to per-page dirty bits convert
      s390 to a fault based software dirty bit detection mechanism. All
      user page table entries which are marked as clean will be hardware
      read-only, even if the pte is supposed to be writable. A write by
      the user process will trigger a protection fault which will cause
      the user pte to be marked as dirty and the hardware read-only bit
      is removed.
      
      With this change the dirty bit in the storage key is irrelevant
      for Linux as a host, but the storage key is still required for
      KVM guests. The effect is that page_test_and_clear_dirty and the
      related code can be removed. The referenced bit in the storage
      key is still used by the page_test_and_clear_young primitive to
      provide page age information.
      
      For page cache pages of mappings with mapping_cap_account_dirty
      there will not be any change in behavior as the dirty bit tracking
      already uses read-only ptes to control the amount of dirty pages.
      Only for swap cache pages and pages of mappings without
      mapping_cap_account_dirty there can be additional protection faults.
      To avoid an excessive number of additional faults the mk_pte
      primitive checks for PageDirty if the pgprot value allows for writes
      and pre-dirties the pte. That avoids all additional faults for
      tmpfs and shmem pages until these pages are added to the swap cache.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      abf09bed
    • H
      s390/time: rename tod clock access functions · 1aae0560
      Heiko Carstens 提交于
      Fix name clash with some common code device drivers and add "tod"
      to all tod clock access function names.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      1aae0560
  6. 11 2月, 2013 1 次提交
  7. 30 1月, 2013 2 次提交
    • C
      s390/kvm: Fix instruction decoding · 0c29b229
      Christian Borntraeger 提交于
      Instructions with long displacement have a signed displacement.
      Currently the sign bit is interpreted as 2^20: Lets fix it by doing the
      sign extension from 20bit to 32bit and then use it as a signed variable
      in the addition (see kvm_s390_get_base_disp_rsy).
      
      Furthermore, there are lots of "int" in that code. This is problematic,
      because shifting on a signed integer is undefined/implementation defined
      if the bit value happens to be negative.
      Fortunately the promotion rules will make the right hand side unsigned
      anyway, so there is no real problem right now.
      Let's convert them anyway to unsigned where appropriate to avoid
      problems if the code is changed or copy/pasted later on.
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Reviewed-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NGleb Natapov <gleb@redhat.com>
      0c29b229
    • C
      s390/kvm: Fix store status for ACRS/FPRS · 15bc8d84
      Christian Borntraeger 提交于
      On store status we need to copy the current state of registers
      into a save area. Currently we might save stale versions:
      The sie state descriptor doesnt have fields for guest ACRS,FPRS,
      those registers are simply stored in the host registers. The host
      program must copy these away if needed. We do that in vcpu_put/load.
      
      If we now do a store status in KVM code between vcpu_put/load, the
      saved values are not up-to-date. Lets collect the ACRS/FPRS before
      saving them.
      
      This also fixes some strange problems with hotplug and virtio-ccw,
      since the low level machine check handler (on hotplug a machine check
      will happen) will revalidate all registers with the content of the
      save area.
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      CC: stable@vger.kernel.org
      Signed-off-by: NGleb Natapov <gleb@redhat.com>
      15bc8d84
  8. 17 1月, 2013 1 次提交
  9. 16 1月, 2013 1 次提交
    • H
      s390/time: fix sched_clock() overflow · ed4f2094
      Heiko Carstens 提交于
      Converting a 64 Bit TOD format value to nanoseconds means that the value
      must be divided by 4.096. In order to achieve that we multiply with 125
      and divide by 512.
      When used within sched_clock() this triggers an overflow after appr.
      417 days. Resulting in a sched_clock() return value that is much smaller
      than previously and therefore may cause all sort of weird things in
      subsystems that rely on a monotonic sched_clock() behaviour.
      
      To fix this implement a tod_to_ns() helper function which converts TOD
      values without overflow and call this function from both places that
      open coded the conversion: sched_clock() and kvm_s390_handle_wait().
      
      Cc: stable@kernel.org
      Reviewed-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      ed4f2094
  10. 12 1月, 2013 1 次提交
    • K
      arch/s390/kvm: remove depends on CONFIG_EXPERIMENTAL · b186ba6e
      Kees Cook 提交于
      The CONFIG_EXPERIMENTAL config item has not carried much meaning for a
      while now and is almost always enabled by default. As agreed during the
      Linux kernel summit, remove it from any "depends on" lines in Kconfigs.
      
      CC: Avi Kivity <avi@redhat.com>
      CC: Marcelo Tosatti <mtosatti@redhat.com>
      CC: Christian Borntraeger <borntraeger@de.ibm.com>
      CC: Cornelia Huck <cornelia.huck@de.ibm.com>
      CC: Martin Schwidefsky <schwidefsky@de.ibm.com>
      CC: Heiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Acked-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      b186ba6e
  11. 11 1月, 2013 1 次提交
  12. 08 1月, 2013 7 次提交
  13. 14 12月, 2012 1 次提交
  14. 28 11月, 2012 1 次提交
  15. 30 10月, 2012 1 次提交
    • F
      kvm: Directly account vtime to system on guest switch · b080935c
      Frederic Weisbecker 提交于
      Switching to or from guest context is done on ioctl context.
      So by the time we call kvm_guest_enter() or kvm_guest_exit()
      we know we are not running the idle task.
      
      As a result, we can directly account the cputime using
      vtime_account_system().
      
      There are two good reasons to do this:
      
      * We avoid some useless checks on guest switch. It optimizes
      a bit this fast path.
      
      * In the case of CONFIG_IRQ_TIME_ACCOUNTING, calling vtime_account()
      checks for irq time to account. This is pointless since we know
      we are not in an irq on guest switch. This is wasting cpu cycles
      for no good reason. vtime_account_system() OTOH is a no-op in
      this config option.
      
      * We can remove the irq disable/enable around kvm guest switch in s390.
      
      A further optimization may consist in introducing a vtime_account_guest()
      that directly calls account_guest_time().
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Xiantao Zhang <xiantao.zhang@intel.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      b080935c
  16. 11 10月, 2012 2 次提交
    • C
      s390/kvm: dont announce RRBM support · 87cac8f8
      Christian Borntraeger 提交于
      Newer kernels (linux-next with the transparent huge page patches)
      use rrbm if the feature is announced via feature bit 66.
      RRBM will cause intercepts, so KVM does not handle it right now,
      causing an illegal instruction in the guest.
      The  easy solution is to disable the feature bit for the guest.
      
      This fixes bugs like:
      Kernel BUG at 0000000000124c2a [verbose debug info unavailable]
      illegal operation: 0001 [#1] SMP
      Modules linked in: virtio_balloon virtio_net ipv6 autofs4
      CPU: 0 Not tainted 3.5.4 #1
      Process fmempig (pid: 659, task: 000000007b712fd0, ksp: 000000007bed3670)
      Krnl PSW : 0704d00180000000 0000000000124c2a (pmdp_clear_flush_young+0x5e/0x80)
           R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 EA:3
           00000000003cc000 0000000000000004 0000000000000000 0000000079800000
           0000000000040000 0000000000000000 000000007bed3918 000000007cf40000
           0000000000000001 000003fff7f00000 000003d281a94000 000000007bed383c
           000000007bed3918 00000000005ecbf8 00000000002314a6 000000007bed36e0
       Krnl Code:>0000000000124c2a: b9810025          ogr     %r2,%r5
                 0000000000124c2e: 41343000           la      %r3,0(%r4,%r3)
                 0000000000124c32: a716fffa           brct    %r1,124c26
                 0000000000124c36: b9010022           lngr    %r2,%r2
                 0000000000124c3a: e3d0f0800004       lg      %r13,128(%r15)
                 0000000000124c40: eb22003f000c       srlg    %r2,%r2,63
      [ 2150.713198] Call Trace:
      [ 2150.713223] ([<00000000002312c4>] page_referenced_one+0x6c/0x27c)
      [ 2150.713749]  [<0000000000233812>] page_referenced+0x32a/0x410
      [...]
      
      CC: stable@vger.kernel.org
      CC: Alex Graf <agraf@suse.de>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      87cac8f8
    • J
      s390/kvm: Interrupt injection bugfix · 82a12737
      Jason J. Herne 提交于
      EXTERNAL_CALL and EMERGENCY type interrupts need to preserve their interrupt
      code parameter when being injected from user space.
      Signed-off-by: NJason J. Herne <jjherne@us.ibm.com>
      Reviewed-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      82a12737