1. 06 12月, 2017 2 次提交
    • G
      KVM: s390: Remove redundant license text · 940f89a5
      Greg Kroah-Hartman 提交于
      Now that the SPDX tag is in all arch/s390/kvm/ files, that identifies
      the license in a specific and legally-defined manner.  So the extra GPL
      text wording can be removed as it is no longer needed at all.
      
      This is done on a quest to remove the 700+ different ways that files in
      the kernel describe the GPL license text.  And there's unneeded stuff
      like the address (sometimes incorrect) for the FSF which is never
      needed.
      
      No copyright headers or other non-license-description text was removed.
      
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cohuck@redhat.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Message-Id: <20171124140043.10062-9-gregkh@linuxfoundation.org>
      Acked-by: NCornelia Huck <cohuck@redhat.com>
      Acked-by: N"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      940f89a5
    • G
      KVM: s390: add SPDX identifiers to the remaining files · d809aa23
      Greg Kroah-Hartman 提交于
      It's good to have SPDX identifiers in all files to make it easier to
      audit the kernel tree for correct licenses.
      
      Update the arch/s390/kvm/ files with the correct SPDX license
      identifier based on the license text in the file itself.  The SPDX
      identifier is a legally binding shorthand, which can be used instead of
      the full boiler plate text.
      
      This work is based on a script and data from Thomas Gleixner, Philippe
      Ombredanne, and Kate Stewart.
      
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cohuck@redhat.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Message-Id: <20171124140043.10062-3-gregkh@linuxfoundation.org>
      Acked-by: NCornelia Huck <cohuck@redhat.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      d809aa23
  2. 09 10月, 2017 1 次提交
  3. 21 6月, 2016 1 次提交
    • D
      KVM: s390: vsie: initial support for nested virtualization · a3508fbe
      David Hildenbrand 提交于
      This patch adds basic support for nested virtualization on s390x, called
      VSIE (virtual SIE) and allows it to be used by the guest if the necessary
      facilities are supported by the hardware and enabled for the guest.
      
      In order to make this work, we have to shadow the sie control block
      provided by guest 2. In order to gain some performance, we have to
      reuse the same shadow blocks as good as possible. For now, we allow
      as many shadow blocks as we have VCPUs (that way, every VCPU can run the
      VSIE concurrently).
      
      We have to watch out for the prefix getting unmapped out of our shadow
      gmap and properly get the VCPU out of VSIE in that case, to fault the
      prefix pages back in. We use the PROG_REQUEST bit for that purpose.
      
      This patch is based on an initial prototype by Tobias Elpelt.
      Acked-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NDavid Hildenbrand <dahi@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      a3508fbe
  4. 10 6月, 2016 1 次提交
    • J
      KVM: s390: Add sthyi emulation · 95ca2cb5
      Janosch Frank 提交于
      Store Hypervisor Information is an emulated z/VM instruction that
      provides a guest with basic information about the layers it is running
      on. This includes information about the cpu configuration of both the
      machine and the lpar, as well as their names, machine model and
      machine type. This information enables an application to determine the
      maximum capacity of CPs and IFLs available to software.
      
      The instruction is available whenever the facility bit 74 is set,
      otherwise executing it results in an operation exception.
      
      It is important to check the validity flags in the sections before
      using data from any structure member. It is not guaranteed that all
      members will be valid on all machines / machine configurations.
      Signed-off-by: NJanosch Frank <frankja@linux.vnet.ibm.com>
      Reviewed-by: NDavid Hildenbrand <dahi@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      95ca2cb5
  5. 26 1月, 2016 1 次提交
  6. 22 4月, 2014 2 次提交
    • D
      KVM: s390: hardware support for guest debugging · 27291e21
      David Hildenbrand 提交于
      This patch adds support to debug the guest using the PER facility on s390.
      Single-stepping, hardware breakpoints and hardware watchpoints are supported. In
      order to use the PER facility of the guest without it noticing it, the control
      registers of the guest have to be patched and access to them has to be
      intercepted(stctl, stctg, lctl, lctlg).
      
      All PER program interrupts have to be intercepted and only the relevant PER
      interrupts for the guest have to be given back. Special care has to be taken
      about repeated exits on the same hardware breakpoint. The intervention of the
      host in the guests PER configuration is not fully transparent. PER instruction
      nullification can not be used by the guest and too many storage alteration
      events may be reported to the guest (if it is activated for special address
      ranges only) when the host concurrently debugging it.
      Signed-off-by: NDavid Hildenbrand <dahi@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      27291e21
    • H
      KVM: s390: add architecture compliant guest access functions · 22938978
      Heiko Carstens 提交于
      The new guest memory access function write_guest() and read_guest() can be
      used to access guest memory in an architecture compliant way.
      These functions will look at the vcpu's PSW and select the correct address
      space for memory access and also perform correct address wrap around.
      In case DAT is turned on, page tables will be walked otherwise access will
      happen to real or absolute memory.
      
      Any access exception will be recognized and exception data will be stored
      in the vcpu's kvm_vcpu_arch.pgm member. Subsequently an exception can be
      injected if necessary.
      
      Missing are:
      - key protection checks
      - access register mode support
      - program event recording support
      
      This patch also adds write_guest_real(), read_guest_real(),
      write_guest_absolute() and read_guest_absolute() guest functions which can
      be used to access real and absolute storage. These functions currently do
      not perform any access checks, since there is no use case (yet?).
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Reviewed-by: NThomas Huth <thuth@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      22938978
  7. 21 3月, 2014 1 次提交
  8. 30 1月, 2014 1 次提交
  9. 19 5月, 2013 1 次提交
  10. 06 3月, 2013 1 次提交
  11. 24 7月, 2011 1 次提交
    • M
      [S390] move sie code to entry.S · 603d1a50
      Martin Schwidefsky 提交于
      The entry to / exit from sie has subtle dependencies to the first level
      interrupt handler. Move the sie assembler code to entry64.S and replace
      the SIE_HOOK callback with a test and the new _TIF_SIE bit.
      In addition this patch fixes several problems in regard to the check for
      the_TIF_EXIT_SIE bits. The old code checked the TIF bits before executing
      the interrupt handler and it only modified the instruction address if it
      pointed directly to the sie instruction. In both cases it could miss
      a TIF bit that normally would cause an exit from the guest and would
      reenter the guest context.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      603d1a50
  12. 17 3月, 2011 1 次提交
  13. 27 4月, 2008 6 次提交
    • C
      KVM: s390: intercepts for diagnose instructions · e28acfea
      Christian Borntraeger 提交于
      This patch introduces interpretation of some diagnose instruction intercepts.
      Diagnose is our classic architected way of doing a hypercall. This patch
      features the following diagnose codes:
      - vm storage size, that tells the guest about its memory layout
      - time slice end, which is used by the guest to indicate that it waits
        for a lock and thus cannot use up its time slice in a useful way
      - ipl functions, which a guest can use to reset and reboot itself
      
      In order to implement ipl functions, we also introduce an exit reason that
      causes userspace to perform various resets on the virtual machine. All resets
      are described in the principles of operation book, except KVM_S390_RESET_IPL
      which causes a reboot of the machine.
      Acked-by: NMartin Schwidefsky <martin.schwidefsky@de.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NCarsten Otte <cotte@de.ibm.com>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      e28acfea
    • C
      KVM: s390: interprocessor communication via sigp · 5288fbf0
      Christian Borntraeger 提交于
      This patch introduces in-kernel handling of _some_ sigp interprocessor
      signals (similar to ipi).
      kvm_s390_handle_sigp() decodes the sigp instruction and calls individual
      handlers depending on the operation requested:
      - sigp sense tries to retrieve information such as existence or running state
        of the remote cpu
      - sigp emergency sends an external interrupt to the remove cpu
      - sigp stop stops a remove cpu
      - sigp stop store status stops a remote cpu, and stores its entire internal
        state to the cpus lowcore
      - sigp set arch sets the architecture mode of the remote cpu. setting to
        ESAME (s390x 64bit) is accepted, setting to ESA/S390 (s390, 31 or 24 bit) is
        denied, all others are passed to userland
      - sigp set prefix sets the prefix register of a remote cpu
      
      For implementation of this, the stop intercept indication starts to get reused
      on purpose: a set of action bits defines what to do once a cpu gets stopped:
      ACTION_STOP_ON_STOP  really stops the cpu when a stop intercept is recognized
      ACTION_STORE_ON_STOP stores the cpu status to lowcore when a stop intercept is
                           recognized
      Acked-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NCarsten Otte <cotte@de.ibm.com>
      Signed-off-by: NCarsten Otte <cotte@de.ibm.com>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      5288fbf0
    • C
      KVM: s390: intercepts for privileged instructions · 453423dc
      Christian Borntraeger 提交于
      This patch introduces in-kernel handling of some intercepts for privileged
      instructions:
      
      handle_set_prefix()        sets the prefix register of the local cpu
      handle_store_prefix()      stores the content of the prefix register to memory
      handle_store_cpu_address() stores the cpu number of the current cpu to memory
      handle_skey()              just decrements the instruction address and retries
      handle_stsch()             delivers condition code 3 "operation not supported"
      handle_chsc()              same here
      handle_stfl()              stores the facility list which contains the
                                 capabilities of the cpu
      handle_stidp()             stores cpu type/model/revision and such
      handle_stsi()              stores information about the system topology
      Acked-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NCarsten Otte <cotte@de.ibm.com>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      453423dc
    • C
      KVM: s390: interrupt subsystem, cpu timer, waitpsw · ba5c1e9b
      Carsten Otte 提交于
      This patch contains the s390 interrupt subsystem (similar to in kernel apic)
      including timer interrupts (similar to in-kernel-pit) and enabled wait
      (similar to in kernel hlt).
      
      In order to achieve that, this patch also introduces intercept handling
      for instruction intercepts, and it implements load control instructions.
      
      This patch introduces an ioctl KVM_S390_INTERRUPT which is valid for both
      the vm file descriptors and the vcpu file descriptors. In case this ioctl is
      issued against a vm file descriptor, the interrupt is considered floating.
      Floating interrupts may be delivered to any virtual cpu in the configuration.
      
      The following interrupts are supported:
      SIGP STOP       - interprocessor signal that stops a remote cpu
      SIGP SET PREFIX - interprocessor signal that sets the prefix register of a
                        (stopped) remote cpu
      INT EMERGENCY   - interprocessor interrupt, usually used to signal need_reshed
                        and for smp_call_function() in the guest.
      PROGRAM INT     - exception during program execution such as page fault, illegal
                        instruction and friends
      RESTART         - interprocessor signal that starts a stopped cpu
      INT VIRTIO      - floating interrupt for virtio signalisation
      INT SERVICE     - floating interrupt for signalisations from the system
                        service processor
      
      struct kvm_s390_interrupt, which is submitted as ioctl parameter when injecting
      an interrupt, also carrys parameter data for interrupts along with the interrupt
      type. Interrupts on s390 usually have a state that represents the current
      operation, or identifies which device has caused the interruption on s390.
      
      kvm_s390_handle_wait() does handle waitpsw in two flavors: in case of a
      disabled wait (that is, disabled for interrupts), we exit to userspace. In case
      of an enabled wait we set up a timer that equals the cpu clock comparator value
      and sleep on a wait queue.
      
      [christian: change virtio interrupt to 0x2603]
      Acked-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NCarsten Otte <cotte@de.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      ba5c1e9b
    • C
      KVM: s390: sie intercept handling · 8f2abe6a
      Christian Borntraeger 提交于
      This path introduces handling of sie intercepts in three flavors: Intercepts
      are either handled completely in-kernel by kvm_handle_sie_intercept(),
      or passed to userspace with corresponding data in struct kvm_run in case
      kvm_handle_sie_intercept() returns -ENOTSUPP.
      In case of partial execution in kernel with the need of userspace support,
      kvm_handle_sie_intercept() may choose to set up struct kvm_run and return
      -EREMOTE.
      
      The trivial intercept reasons are handled in this patch:
      handle_noop() just does nothing for intercepts that don't require our support
        at all
      handle_stop() is called when a cpu enters stopped state, and it drops out to
        userland after updating our vcpu state
      handle_validity() faults in the cpu lowcore if needed, or passes the request
        to userland
      Acked-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NCarsten Otte <cotte@de.ibm.com>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      8f2abe6a
    • H
      KVM: s390: arch backend for the kvm kernel module · b0c632db
      Heiko Carstens 提交于
      This patch contains the port of Qumranet's kvm kernel module to IBM zSeries
       (aka s390x, mainframe) architecture. It uses the mainframe's virtualization
      instruction SIE to run virtual machines with up to 64 virtual CPUs each.
      This port is only usable on 64bit host kernels, and can only run 64bit guest
      kernels. However, running 31bit applications in guest userspace is possible.
      
      The following source files are introduced by this patch
      arch/s390/kvm/kvm-s390.c    similar to arch/x86/kvm/x86.c, this implements all
                                  arch callbacks for kvm. __vcpu_run calls back into
                                  sie64a to enter the guest machine context
      arch/s390/kvm/sie64a.S      assembler function sie64a, which enters guest
                                  context via SIE, and switches world before and after                            that
      include/asm-s390/kvm_host.h contains all vital data structures needed to run
                                  virtual machines on the mainframe
      include/asm-s390/kvm.h      defines kvm_regs and friends for user access to
                                  guest register content
      arch/s390/kvm/gaccess.h     functions similar to uaccess to access guest memory
      arch/s390/kvm/kvm-s390.h    header file for kvm-s390 internals, extended by
                                  later patches
      Acked-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NCarsten Otte <cotte@de.ibm.com>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      b0c632db