1. 12 Dec, 2009 1 commit
  2. 11 Dec, 2009 2 commits
  3. 07 Dec, 2009 18 commits
  4. 05 Dec, 2009 1 commit
  5. 04 Dec, 2009 1 commit
  6. 03 Dec, 2009 4 commits
    • Carsten Otte's avatar
      KVM: s390: Fix prefix register checking in arch/s390/kvm/sigp.c · f50146bd
      Carsten Otte authored
      
      
      This patch corrects the checking of the new address for the prefix register.
      On s390, the prefix register is used to address the cpu's lowcore (address
      0...8k). This check is supposed to verify that the memory is readable and
      present.
      copy_from_guest is a helper function, that can be used to read from guest
      memory. It applies prefixing, adds the start address of the guest memory in
      user, and then calls copy_from_user. Previous code was obviously broken for
      two reasons:
      - prefixing should not be applied here. The current prefix register is
        going to be updated soon, and the address we're looking for will be
        0..8k after we've updated the register
      - we're adding the guest origin (gmsor) twice: once in subject code
        and once in copy_from_guest
      
      With kuli, we did not hit this problem because (a) we were lucky with
      previous prefix register content, and (b) our guest memory was mmaped
      very low into user address space.
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarCarsten Otte <cotte@de.ibm.com>
      Reported-by: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      f50146bd
    • Carsten Otte's avatar
      KVM: s390: Make psw available on all exits, not just a subset · d7b0b5eb
      Carsten Otte authored
      
      
      This patch moves s390 processor status word into the base kvm_run
      struct and keeps it up-to date on all userspace exits.
      
      The userspace ABI is broken by this, however there are no applications
      in the wild using this.  A capability check is provided so users can
      verify the updated API exists.
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarCarsten Otte <cotte@de.ibm.com>
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      d7b0b5eb
    • Alexander Graf's avatar
      KVM: Activate Virtualization On Demand · 10474ae8
      Alexander Graf authored
      
      
      X86 CPUs need to have some magic happening to enable the virtualization
      extensions on them. This magic can result in unpleasant results for
      users, like blocking other VMMs from working (vmx) or using invalid TLB
      entries (svm).
      
      Currently KVM activates virtualization when the respective kernel module
      is loaded. This blocks us from autoloading KVM modules without breaking
      other VMMs.
      
      To circumvent this problem at least a bit, this patch introduces on
      demand activation of virtualization. This means, that instead
      virtualization is enabled on creation of the first virtual machine
      and disabled on destruction of the last one.
      
      So using this, KVM can be easily autoloaded, while keeping other
      hypervisors usable.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      10474ae8
    • Avi Kivity's avatar
      KVM: Return -ENOTTY on unrecognized ioctls · 367e1319
      Avi Kivity authored
      
      
      Not the incorrect -EINVAL.
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      367e1319
  7. 26 Nov, 2009 1 commit
    • Ilya Loginov's avatar
      block: add helpers to run flush_dcache_page() against a bio and a request's pages · 2d4dc890
      Ilya Loginov authored
      
      
      Mtdblock driver doesn't call flush_dcache_page for pages in request.  So,
      this causes problems on architectures where the icache doesn't fill from
      the dcache or with dcache aliases.  The patch fixes this.
      
      The ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE symbol was introduced to avoid
      pointless empty cache-thrashing loops on architectures for which
      flush_dcache_page() is a no-op.  Every architecture was provided with this
      flush pages on architectires where ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE is
      equal 1 or do nothing otherwise.
      
      See "fix mtd_blkdevs problem with caches on some architectures" discussion
      on LKML for more information.
      Signed-off-by: default avatarIlya Loginov <isloginov@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Peter Horton <phorton@bitbox.co.uk>
      Cc: "Ed L. Cashin" <ecashin@coraid.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      2d4dc890
  8. 18 Nov, 2009 1 commit
  9. 17 Nov, 2009 1 commit
    • Lin Ming's avatar
      timekeeping: Fix clock_gettime vsyscall time warp · 0696b711
      Lin Ming authored
      Since commit 0a544198
      
       "timekeeping: Move NTP adjusted clock multiplier
      to struct timekeeper" the clock multiplier of vsyscall is updated with
      the unmodified clock multiplier of the clock source and not with the
      NTP adjusted multiplier of the timekeeper.
      
      This causes user space observerable time warps:
      new CLOCK-warp maximum: 120 nsecs,  00000025c337c537 -> 00000025c337c4bf
      
      Add a new argument "mult" to update_vsyscall() and hand in the
      timekeeping internal NTP adjusted multiplier.
      Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
      Cc: "Zhang Yanmin" <yanmin_zhang@linux.intel.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Tony Luck <tony.luck@intel.com>
      LKML-Reference: <1258436990.17765.83.camel@minggr.sh.intel.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      0696b711
  10. 13 Nov, 2009 3 commits
    • Thomas Gleixner's avatar
      locking: Make inlining decision Kconfig based · 6beb0009
      Thomas Gleixner authored
      commit 892a7c67
      
       (locking: Allow arch-inlined spinlocks) implements the
      selection of which lock functions are inlined based on defines in
      arch/.../spinlock.h: #define __always_inline__LOCK_FUNCTION
      
      Despite of the name __always_inline__* the lock functions can be built
      out of line depending on config options. Also if the arch does not set
      some inline defines the generic code might set them; again depending on
      config options.
      
      This makes it unnecessary hard to figure out when and which lock
      functions are inlined. Aside of that it makes it way harder and
      messier for -rt to manipulate the lock functions.
      
      Convert the inlining decision to CONFIG switches. Each lock function
      is inlined depending on CONFIG_INLINE_*. The configs implement the
      existing dependencies. The architecture code can select ARCH_INLINE_*
      to signal that it wants the corresponding lock function inlined.
      ARCH_INLINE_* is necessary as Kconfig ignores "depends on"
      restrictions when a config element is selected.
      
      No functional change.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <20091109151428.504477141@linutronix.de>
      Acked-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Reviewed-by: default avatarIngo Molnar <mingo@elte.hu>
      Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      6beb0009
    • Christian Borntraeger's avatar
      [S390] s390: fix single stepping on svc0 · bcc6525f
      Christian Borntraeger authored
      
      
      On s390 there are two ways of specifying the system call number for
      the svc instruction. The standard way is to use the immediate field
      in the instruction (or to use EXecute for values unknown during
      assemble time). This can encode 256 system calls.
      The kernel ABI also allows to put the system call number in r1 and
      then execute svc 0 to enable system call numbers > 255.
      
      It turns out that single stepping svc 0 is broken, since the PER
      program check handler uses r1. We have to use a different register.
      Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      bcc6525f
    • Martin Schwidefsky's avatar
      [S390] reset cputime accounting after IPL from NSS · b89031e0
      Martin Schwidefsky authored
      
      
      After an IPL from NSS the uptime of the system is incorrect. The reason
      is that the startup code in head.S is not executed in case of an IPL
      from NSS. Due to that sched_clock_base_cc which is used to initialze
      wall_to_monotonic contains the time stamp when the NSS has been created
      instead of the time stamp of the system start.
      
      Reinitialize the cputime accounting values in create_kernel_nss after
      the SAVESYS CP command that created the NSS segment.
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      b89031e0
  11. 12 Nov, 2009 1 commit
  12. 11 Nov, 2009 1 commit
  13. 06 Nov, 2009 1 commit
  14. 05 Nov, 2009 1 commit
    • Martin Schwidefsky's avatar
      nohz: Introduce arch_needs_cpu · 3c5d92a0
      Martin Schwidefsky authored
      
      
      Allow the architecture to request a normal jiffy tick when the system
      goes idle and tick_nohz_stop_sched_tick is called . On s390 the hook is
      used to prevent the system going fully idle if there has been an
      interrupt other than a clock comparator interrupt since the last wakeup.
      
      On s390 the HiperSockets response time for 1 connection ping-pong goes
      down from 42 to 34 microseconds. The CPU cost decreases by 27%.
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      LKML-Reference: <20090929122533.402715150@de.ibm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      3c5d92a0
  15. 29 Oct, 2009 3 commits
    • Heiko Carstens's avatar
      [S390] smp: fix sigp sense handling · b3dcf3de
      Heiko Carstens authored
      
      
      sigp sense only returns the status of a cpu if it is non zero. If the
      status of the sensed cpu is all zeros condition code 0 (accpeted) is
      set and no status bits are returned.
      The current code however assumes that a status was returned and tests
      bits in it. This means uninitalized data is accessed with random
      results.
      Worst case is that the code that checks if cpu is offline on cpu
      hotplug assumes that the target cpu is offline while it is still
      running. This leads potentially to memory corruption since resources
      that are still needed by the target cpu will be freed and could be
      resused while still in use.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      b3dcf3de
    • Heiko Carstens's avatar
      [S390] smp: fix sigp stop handling · f8501ba7
      Heiko Carstens authored
      
      
      According to the architecture a cpu must not necessarily enter stopped
      state after completion of a sigp instruction with "stop" order code.
      So remove the BUG() statement after self sending sigp stop to avoid
      that it ever gets reached.
      Also add a sigp busy check to make sure that the order gets delivered.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      f8501ba7
    • Martin Schwidefsky's avatar
      [S390] cputime: fix overflow on 31 bit systems · 70f5dc51
      Martin Schwidefsky authored
      
      
      The cputime_to_msecs / cputime_to_clock_t and cputime64_to_clock_t
      cause fixpoint divide exceptions if the cputime is too large.
      On a machine that collected 49.7 days worth of idle time reading
      from /proc/stat will generate oopses like this:
      
      Kernel BUG at 001b0c92 [verbose debug info unavailable]
      fixpoint divide exception: 0009 [#13] SMP
      Modules linked in: ipv6
      CPU: 1 Tainted: G      D   2.6.27.10 #5
      Process cat (pid: 21352, task: 1fb34138, ksp: 1d2a3d98)
      Krnl PSW : 070c2000 801b0c92 (show_stat+0x2ca/0x68c)
                 R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:0 CC:2 PM:0
      Krnl GPRS: 00000001 00001388 00000bb8 0015d2a1
                 00000000 00000000 000003e8 0001fd91
                 00000000 00000000 0000129d eecd2ff0
                 1cc533b9 0036f780 801b0bce 1d2a3cc0
      Krnl Code: 801b0c86: f18890abf198       mvo     171(9,%r9),408(9,%r15)
                 801b0c8c: 98abf170           lm      %r10,%r11,368(%r15)
                 801b0c90: 1da1               dr      %r10,%r1
                >801b0c92: 90abf170           stm     %r10,%r11,368(%r15)
                 801b0c96: 98abf190           lm      %r10,%r11,400(%r15)
                 801b0c9a: 1da1               dr      %r10,%r1
                 801b0c9c: 90abf190           stm     %r10,%r11,400(%r15)
                 801b0ca0: 18a3               lr      %r10,%r3
      Call Trace:
      ([<00000000001b09f4>] show_stat+0x2c/0x68c)
       [<000000000018dcee>] seq_read+0xb2/0x364
       [<00000000001a9980>] proc_reg_read+0x68/0x98
       [<00000000001705ee>] vfs_read+0x6e/0xe8
       [<0000000000170732>] sys_read+0x36/0x78
       [<000000000010f750>] sysc_do_restart+0x12/0x16
       [<0000000077f3ad6a>] 0x77f3ad6a
       <4>---[ end trace 1436ea9559d3de9e ]---
      Reported-by: default avatarMike Frysinger <vapier@gentoo.org>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      70f5dc51