1. 02 4月, 2011 11 次提交
    • B
      Implement PAPR CRQ hypercalls · b45d63b6
      Ben Herrenschmidt 提交于
      This patch implements the infrastructure and hypercalls necessary for the
      PAPR specified CRQ (Command Request Queue) mechanism.  This general
      request queueing system is used by many of the PAPR virtual IO devices,
      including the virtual scsi adapter.
      Signed-off-by: NBen Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      b45d63b6
    • D
      Implement sPAPR Virtual LAN (ibmveth) · 8d90ad90
      David Gibson 提交于
      This patch implements the PAPR specified Inter Virtual Machine Logical
      LAN; that is the virtual hardware used by the Linux ibmveth driver.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      8d90ad90
    • D
      Implement TCE translation for sPAPR VIO · ee86dfee
      David Gibson 提交于
      This patch implements the necessary infrastructure and hypercalls for
      sPAPR's TCE (Translation Control Entry) IOMMU mechanism.  This is necessary
      for all virtual IO devices which do DMA (i.e. nearly all of them).
      Signed-off-by: NBen Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      ee86dfee
    • D
      Add (virtual) interrupt to PAPR virtual tty device · 0201e2da
      David Gibson 提交于
      Now that we have implemented the PAPR "xics" virtualized interrupt
      controller, we can add interrupts in PAPR VIO devices.  This patch adds
      interrupt support to the PAPR virtual tty/console device.
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      0201e2da
    • D
      Add PAPR H_VIO_SIGNAL hypercall and infrastructure for VIO interrupts · 00dc738d
      David Gibson 提交于
      This patch adds infrastructure to support interrupts from PAPR virtual IO
      devices.  This includes correctly advertising those interrupts in the
      device tree, and implementing the H_VIO_SIGNAL hypercall, used to
      enable and disable individual device interrupts.
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      00dc738d
    • D
      Implement the PAPR (pSeries) virtualized interrupt controller (xics) · b5cec4c5
      David Gibson 提交于
      PAPR defines an interrupt control architecture which is logically divided
      into ICS (Interrupt Control Presentation, each unit is responsible for
      presenting interrupts to a particular "interrupt server", i.e. CPU) and
      ICS (Interrupt Control Source, each unit responsible for one or more
      hardware interrupts as numbered globally across the system).  All PAPR
      virtual IO devices expect to deliver interrupts via this mechanism.  In
      Linux, this interrupt controller system is handled by the "xics" driver.
      
      On pSeries systems, access to the interrupt controller is virtualized via
      hypercalls and RTAS methods.  However, the virtualized interface is very
      similar to the underlying interrupt controller hardware, and similar PICs
      exist un-virtualized in some other systems.
      
      This patch implements both the ICP and ICS sides of the PAPR interrupt
      controller.  For now, only the hypercall virtualized interface is provided,
      however it would be relatively straightforward to graft an emulated
      register interface onto the underlying interrupt logic if we want to add
      a machine with a hardware ICS/ICP system in the future.
      
      There are some limitations in this implementation: it is assumed for now
      that only one instance of the ICS exists, although a full xics system can
      have several, each responsible for a different group of hardware irqs.
      ICP/ICS can handle both level-sensitve (LSI) and message signalled (MSI)
      interrupt inputs.  For now, this implementation supports only MSI
      interrupts, since that is used by PAPR virtual IO devices.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      b5cec4c5
    • D
      Implement assorted pSeries hcalls and RTAS methods · 821303f5
      David Gibson 提交于
      This patch adds several small utility hypercalls and RTAS methods to
      the pSeries platform emulation.  Specifically:
      
      * 'display-character' rtas call
      
      This just prints a character to the console, it's occasionally used
      for early debug of the OS.  The support includes a hack to make this
      RTAS call respond on the normal token value present on real hardware,
      since some early debugging tools just assume this value without
      checking the device tree.
      
      * 'get-time-of-day' rtas call
      
      This one just takes the host real time, converts to the PAPR described
      format and returns it to the guest.
      
      * 'power-off' rtas call
      
      This one shuts down the emulated system.
      
      * H_DABR hypercall
      
      On pSeries, the DABR debug register is usually a hypervisor resource
      and virtualized through this hypercall.  If the hypercall is not
      present, Linux will under some circumstances attempt to manipulate the
      DABR directly which will fail on this emulated machine.
      
      This stub implementation is enough to stop that behaviour, although it
      doesn't actually implement the requested DABR operations as yet.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      821303f5
    • D
      Implement hcall based RTAS for pSeries machines · 39ac8455
      David Gibson 提交于
      On pSeries machines, operating systems can instantiate "RTAS" (Run-Time
      Abstraction Services), a runtime component of the firmware which implements
      a number of low-level, infrequently used operations.  On logical partitions
      under a hypervisor, many of the RTAS functions require hypervisor
      privilege.  For simplicity, therefore, hypervisor systems typically
      implement the in-partition RTAS as just a tiny wrapper around a hypercall
      which actually implements the various RTAS functions.
      
      This patch implements such a hypercall based RTAS for our emulated pSeries
      machine.  A tiny in-partition "firmware" calls a new hypercall, which
      looks up available RTAS services in a table.
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      39ac8455
    • D
      Virtual hash page table handling on pSeries machine · f43e3525
      David Gibson 提交于
      On pSeries logical partitions, excepting the old POWER4-style full system
      partitions, the guest does not have direct access to the hardware page
      table.  Instead, the pagetable exists in hypervisor memory, and the guest
      must manipulate it with hypercalls.
      
      However, our current pSeries emulation more closely resembles the old
      style where the guest must set up and handle the pagetables itself.  This
      patch converts it to act like a modern partition.
      
      This involves two things: first, the hash translation path is modified to
      permit the has table to be stored externally to the emulated machine's
      RAM.  The pSeries machine init code configures the CPUs to use this mode.
      
      Secondly, we emulate the PAPR hypercalls for manipulating the external
      hashed page table.
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      f43e3525
    • D
      Implement the bus structure for PAPR virtual IO · 4040ab72
      David Gibson 提交于
      This extends the "pseries" (PAPR) machine to include a virtual IO bus
      supporting the PAPR defined hypercall based virtual IO mechanisms.
      
      So far only one VIO device is provided, the vty / vterm, providing
      a full console (polled only, for now).
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      4040ab72
    • D
      Start implementing pSeries logical partition machine · 9fdf0c29
      David Gibson 提交于
      This patch adds a "pseries" machine to qemu.  This aims to emulate a
      logical partition on an IBM pSeries machine, compliant to the
      "PowerPC Architecture Platform Requirements" (PAPR) document.
      
      This initial version is quite limited, it implements a basic machine
      and PAPR hypercall emulation.  So far only one hypercall is present -
      H_PUT_TERM_CHAR - so that a (write-only) console is available.
      
      Multiple CPUs are permitted, with SMP entry handled kexec() style.
      
      The machine so far more resembles an old POWER4 style "full system
      partition" rather than a modern LPAR, in that the guest manages the
      page tables directly, rather than via hypercalls.
      
      The machine requires qemu to be configured with --enable-fdt.  The
      machine can (so far) only be booted with -kernel - i.e. no partition
      firmware is provided.
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      9fdf0c29