1. 30 5月, 2014 1 次提交
    • A
      KVM: PPC: Book3S PR: PAPR: Access RTAS in big endian · b59d9d26
      Alexander Graf 提交于
      When the guest does an RTAS hypercall it keeps all RTAS variables inside a
      big endian data structure.
      
      To make sure we don't have to bother about endianness inside the actual RTAS
      handlers, let's just convert the whole structure to host endian before we
      call our RTAS handlers and back to big endian when we return to the guest.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      b59d9d26
  2. 29 3月, 2014 1 次提交
    • P
      KVM: PPC: Book3S: Trim top 4 bits of physical address in RTAS code · b24f36f3
      Paul Mackerras 提交于
      The in-kernel emulation of RTAS functions needs to read the argument
      buffer from guest memory in order to find out what function is being
      requested.  The guest supplies the guest physical address of the buffer,
      and on a real system the code that reads that buffer would run in guest
      real mode.  In guest real mode, the processor ignores the top 4 bits
      of the address specified in load and store instructions.  In order to
      emulate that behaviour correctly, we need to mask off those bits
      before calling kvm_read_guest() or kvm_write_guest().  This adds that
      masking.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Acked-by: NScott Wood <scottwood@freescale.com>
      b24f36f3
  3. 17 10月, 2013 1 次提交
  4. 27 4月, 2013 3 次提交
    • P
      KVM: PPC: Book3S: Add support for ibm,int-on/off RTAS calls · d19bd862
      Paul Mackerras 提交于
      This adds support for the ibm,int-on and ibm,int-off RTAS calls to the
      in-kernel XICS emulation and corrects the handling of the saved
      priority by the ibm,set-xive RTAS call.  With this, ibm,int-off sets
      the specified interrupt's priority in its saved_priority field and
      sets the priority to 0xff (the least favoured value).  ibm,int-on
      restores the saved_priority to the priority field, and ibm,set-xive
      sets both the priority and the saved_priority to the specified
      priority value.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      d19bd862
    • B
      KVM: PPC: Book3S: Add kernel emulation for the XICS interrupt controller · bc5ad3f3
      Benjamin Herrenschmidt 提交于
      This adds in-kernel emulation of the XICS (eXternal Interrupt
      Controller Specification) interrupt controller specified by PAPR, for
      both HV and PR KVM guests.
      
      The XICS emulation supports up to 1048560 interrupt sources.
      Interrupt source numbers below 16 are reserved; 0 is used to mean no
      interrupt and 2 is used for IPIs.  Internally these are represented in
      blocks of 1024, called ICS (interrupt controller source) entities, but
      that is not visible to userspace.
      
      Each vcpu gets one ICP (interrupt controller presentation) entity,
      used to store the per-vcpu state such as vcpu priority, pending
      interrupt state, IPI request, etc.
      
      This does not include any API or any way to connect vcpus to their
      ICP state; that will be added in later patches.
      
      This is based on an initial implementation by Michael Ellerman
      <michael@ellerman.id.au> reworked by Benjamin Herrenschmidt and
      Paul Mackerras.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      [agraf: fix typo, add dependency on !KVM_MPIC]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      bc5ad3f3
    • M
      KVM: PPC: Book3S: Add infrastructure to implement kernel-side RTAS calls · 8e591cb7
      Michael Ellerman 提交于
      For pseries machine emulation, in order to move the interrupt
      controller code to the kernel, we need to intercept some RTAS
      calls in the kernel itself.  This adds an infrastructure to allow
      in-kernel handlers to be registered for RTAS services by name.
      A new ioctl, KVM_PPC_RTAS_DEFINE_TOKEN, then allows userspace to
      associate token values with those service names.  Then, when the
      guest requests an RTAS service with one of those token values, it
      will be handled by the relevant in-kernel handler rather than being
      passed up to userspace as at present.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      [agraf: fix warning]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      8e591cb7