1. 07 6月, 2016 5 次提交
    • A
      spapr_iommu: Introduce "enabled" state for TCE table · df7625d4
      Alexey Kardashevskiy 提交于
      Currently TCE tables are created once at start and their sizes never
      change. We are going to change that by introducing a Dynamic DMA windows
      support where DMA configuration may change during the guest execution.
      
      This changes spapr_tce_new_table() to create an empty zero-size IOMMU
      memory region (IOMMU MR). Only LIOBN is assigned by the time of creation.
      It still will be called once at the owner object (VIO or PHB) creation.
      
      This introduces an "enabled" state for TCE table objects, some
      helper functions are added:
      - spapr_tce_table_enable() receives TCE table parameters, stores in
      sPAPRTCETable and allocates a guest view of the TCE table
      (in the user space or KVM) and sets the correct size on the IOMMU MR;
      - spapr_tce_table_disable() disposes the table and resets the IOMMU MR
      size; it is made public as the following DDW code will be using it.
      
      This changes the PHB reset handler to do the default DMA initialization
      instead of spapr_phb_realize(). This does not make differenct now but
      later with more than just one DMA window, we will have to remove them all
      and create the default one on a system reset.
      
      No visible change in behaviour is expected except the actual table
      will be reallocated every reset. We might optimize this later.
      
      The other way to implement this would be dynamically create/remove
      the TCE table QOM objects but this would make migration impossible
      as the migration code expects all QOM objects to exist at the receiver
      so we have to have TCE table objects created when migration begins.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      df7625d4
    • A
      vmstate: Define VARRAY with VMS_ALLOC · 705124ea
      Alexey Kardashevskiy 提交于
      This allows dynamic allocation for migrating arrays.
      
      Already existing VMSTATE_VARRAY_UINT32 requires an array to be
      pre-allocated, however there are cases when the size is not known in
      advance and there is no real need to enforce it.
      
      This defines another variant of VMSTATE_VARRAY_UINT32 with WMS_ALLOC
      flag which tells the receiving side to allocate memory for the array
      before receiving the data.
      
      The first user of it is a dynamic DMA window which existence and size
      are totally dynamic.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      705124ea
    • B
      kvm: API to obtain max supported mem slots · 44f2e6c1
      Bharata B Rao 提交于
      Introduce kvm_get_max_memslots() API that can be used to obtain the
      maximum number of memslots supported by KVM.
      Signed-off-by: NBharata B Rao <bharata@linux.vnet.ibm.com>
      Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      44f2e6c1
    • T
      target-ppc/fpu_helper: Fix efscmp* instructions handling · a575d9ab
      Talha Imran 提交于
      With specification at hand from the reference manual from Freescale
      http://cache.nxp.com/files/32bit/doc/ref_manual/SPEPEM.pdf , I have found a fix
      to efscmp* instructions handling in QEMU.
      
      efscmp* instructions in QEMU set crD (Condition Register nibble) values as
      (0b0100 << 2) = 0b10000 (consider the HELPER_SINGLE_SPE_CMP macro which left
      shifts the value returned by efscmp* handler by 2 bits). A value of 0b10000 is
      not correct according the to the reference manual.
      
      The reference manual expects efscmp* instructions to return a value of 0bx1xx.
      Please find attached a patch which disables left shifting in
      HELPER_SINGLE_SPE_CMP macro. This macro is used by efscmp* and efstst*
      instructions only. efstst* instruction handlers, in turn, call efscmp* handlers
      too.
      
      *Explanation:*
      Traditionally, each crD (condition register nibble) consist of 4 bits, which is
      set by comparisons as follows:
      crD = W X Y Z
      where
      W = Less than
      X = Greater than
      Y = Equal to
      
      However, efscmp* instructions being a special case return a binary result.
      (efscmpeq will set the crD = 0bx1xx iff when op1 == op2 and 0bx0xx otherwise;
      i.e. there is no notion of different crD values based on Less than, Greater
      than and Equal to).
      
      This effectively means that crD will store a "Greater than" comparison result
      iff efscmp* instruction comparison is TRUE. Compiler exploits this feature by
      checking for "Branch if Less than or Equal to" (ble instruction) OR "Branch if
      Greater than" (bgt instruction) for Branch if FALSE OR Branch if TRUE
      respectively after an efscmp* instruction. This can be seen in a assembly code
      snippet below:
      
      27          if (__real__ x != 3.0f || __imag__ x != 4.0f)
      10000498:   lwz r10,8(r31)
      1000049c:   lis r9,16448
      100004a0:   efscmpeq cr7,r10,r9
      100004a4:   ble- cr7,0x100004b8 <bar+60>  //jump to abort() call
      100004a8:   lwz r10,12(r31)
      100004ac:   lis r9,16512
      100004b0:   efscmpeq cr7,r10,r9
      100004b4:   bgt- cr7,0x100004bc <bar+64>  //skip abort() call
      28            abort ();
      100004b8:   bl 0x10000808 <abort>
      Signed-off-by: NTalha Imran <talha_imran@mentor.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      a575d9ab
    • P
      Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20160606-1' into staging · 76462405
      Peter Maydell 提交于
      target-arm queue:
       * support instruction syndrome info for data aborts from A64 to EL2
       * add HSTR_EL2 register
       * fix incorrect ESR IL bits in various syndrome register cases
       * virt: fix limit of 64-bit ACPI/ECAM PCI MMIO range
       * gicv2: RAZ/WI non-sec access to sec interrupts
       * i2c: add aspeed i2c controller
       * virt: Reject gic-version=host for non-KVM (don't segv on aarch64 host)
       * xlnx-zynqmp: Add a secure prop to en/disable ARM Security Extensions
       * xlnx-zynqmp: Support KVM on AArch64 hosts
       * ptimer: Various fixes for awkward corner cases
       * char: QOMify various ARM UART models
       * char: get rid of qemu_char_get_next_serial
       * target-arm: Fix TTBR selecting logic on AArch32 Stage 2 translation
       * zynqmp: Add the ZCU102 board
      
      # gpg: Signature made Mon 06 Jun 2016 17:01:11 BST
      # gpg:                using RSA key 0x3C2525ED14360CDE
      # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>"
      # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>"
      # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>"
      
      * remotes/pmaydell/tags/pull-target-arm-20160606-1: (25 commits)
        zynqmp: Add the ZCU102 board
        target-arm: Fix TTBR selecting logic on AArch32 Stage 2 translation
        char: get rid of qemu_char_get_next_serial
        hw/char: QOM'ify xilinx_uartlite model
        hw/char: QOM'ify stm32f2xx_usart model
        hw/char: QOM'ify digic-uart model
        hw/char: QOM'ify cadence_uart model
        hw/char: QOM'ify pl011 model
        hw/ptimer: Introduce ptimer_get_limit
        hw/ptimer: Support "on the fly" timer mode switch
        hw/ptimer: Update .delta on period/freq change
        hw/ptimer: Perform counter wrap around if timer already expired
        hw/ptimer: Fix issues caused by the adjusted timer limit value
        xlnx-zynqmp: Use the in kernel GIC model for KVM runs
        xlnx-zynqmp: Delay realization of GIC until post CPU realization
        xlnx-zynqmp: Make the RPU subsystem optional
        xlnx-zynqmp: Add a secure prop to en/disable ARM Security Extensions
        hw/arm/virt: Reject gic-version=host for non-KVM
        i2c: add aspeed i2c controller
        hw/intc/gic: RAZ/WI non-sec access to sec interrupts
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      76462405
  2. 06 6月, 2016 35 次提交