1. 25 12月, 2013 6 次提交
    • I
      tests: Test QOM interface casting · 14389dbd
      Igor Mammedov 提交于
      Add basic regression testing for QOM Interface usage.
      Test checks casting to interface type/class for following cases:
        - interface implementation in leaf class
        - interface implementation in intermediate (parent) class
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      14389dbd
    • P
      qom: Do not register interface "types" in the type table and fix names · b061dc41
      Paolo Bonzini 提交于
      There should be no need to look up nor enumerate the interface "types",
      whose "classes" are really just vtables.  Just create the types and
      add them to the interface list of the parent type.
      
      Interfaces not registering their type anymore means that accessing
      superclass::interface by type name will fail when initializing
      subclass::interface.  Thus, we need to pre-initialize the subclass's
      parent_type field before calling type_initialize.  Apart from this, the
      interface "types" should never be used and thus it is harmless to leave
      them out of the hashtable.
      
      Further, the interface types had a bug with interfaces that are
      inherited from a superclass:  The implementation type name was wrong
      (for example it was subclass::superclass::interface rather than
      just subclass::interface).  This patch fixes this as well.
      Reported-by: NIgor Mammedov <imammedo@redhat.com>
      Tested-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      b061dc41
    • P
      qom: Split out object and class caches · 0ab4c94c
      Peter Crosthwaite 提交于
      The object-cast and class-cast caches cannot be shared because class
      caching is conditional on the target type not being an interface and
      object caching is unconditional. Leads to a bug when a class cast
      to an interface follows an object cast to the same interface type:
      
      FooObject = FOO(obj);
      FooClass = FOO_GET_CLASS(obj);
      
      Where TYPE_FOO is an interface. The first (object) cast will be
      successful and cache the casting result (i.e. TYPE_FOO will be cached).
      The second (class) cast will then check the shared cast cache
      and register a hit. The issue is, when a class cast hits in the cache
      it just returns a pointer cast of the input class (i.e. the concrete
      class).
      
      When casting to an interface, the cast itself must return the
      interface class, not the concrete class. The implementation of class
      cast caching already ensures that the returned cast result is only
      a pointer cast before caching. The object cast logic however does
      not have this check.
      
      Resolve by just splitting the object and class caches.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Tested-by: NNathan Rossi <nathan.rossi@xilinx.com>
      Reviewed-by: NEdgar E. Iglesias <edgar.iglesias@gmail.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      0ab4c94c
    • M
      qdev: Document that pointer properties kill device_add · c272758f
      Markus Armbruster 提交于
      Ask users of DEFINE_PROP_PTR() to set
      cannot_instantiate_with_device_add_yet, or explain why it's not
      needed.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      c272758f
    • M
      hw: cannot_instantiate_with_device_add_yet due to pointer props · 1b111dc1
      Markus Armbruster 提交于
      Pointer properties can be set only by code, not by device_add.  A
      device with a pointer property can work with device_add only when the
      property may remain null.
      
      This is the case for property "interrupt_vector" of device
      "etraxfs,pic".  Add a comment there.
      
      Set cannot_instantiate_with_device_add_yet for the other devices with
      pointer properties, with a comment explaining why.
      
      Juha Riihimäki and Peter Maydell deserve my thanks for making "pointer
      property must not remain null" blatantly obvious in the OMAP devices.
      
      Only device "smbus-eeprom" is actually changed.  The others are all
      sysbus devices, which get cannot_instantiate_with_device_add_yet set
      in their abstract base's class init function.  Setting it again in
      their class init function is technically redundant, but serves as
      insurance for when sysbus devices become available with device_add,
      and as documentation.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> (for ETRAX)
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      1b111dc1
    • M
      qdev-monitor: Avoid device_add crashing on non-device driver name · 061e84f7
      Markus Armbruster 提交于
      Watch this:
      
          $ upstream-qemu -nodefaults -S -display none -monitor stdio
          QEMU 1.7.50 monitor - type 'help' for more information
          (qemu) device_add rng-egd
          /work/armbru/qemu/qdev-monitor.c:491:qdev_device_add: Object 0x2089b00 is not an instance of type device
          Aborted (core dumped)
      
      Crashes because "rng-egd" exists, but isn't a subtype of TYPE_DEVICE.
      Broken in commit 18b6dade.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      061e84f7
  2. 23 12月, 2013 11 次提交
  3. 21 12月, 2013 4 次提交
  4. 20 12月, 2013 19 次提交
    • A
      Merge remote-tracking branch 'agraf/tags/signed-ppc-for-upstream' into staging · f8251db1
      Anthony Liguori 提交于
      Patch queue for ppc - 2013-12-20
      
      Alexander Graf (3):
            PPC: Use default pci bus name for grackle and heathrow
            roms: Flush icache when writing roms to guest memory
            PPC: Add VSX to hflags
      
      Alexey Kardashevskiy (5):
            powerpc: add PVR mask support
            target-ppc: move POWER7+ to a separate family
            spapr-rtas: replace return code constants with macros
            spapr-rtas: add ibm, (get|set)-system-parameter
            spapr: make sure RMA is in first mode of first memory node
      
      Greg Kurz (1):
            target-ppc: add stubs for KVM breakpoints
      
      Paolo Bonzini (1):
            spapr: tie spapr-nvram to -pflash
      
      Paul Mackerras (1):
            spapr: limit numa memory regions by ram size
      
      Peter Crosthwaite (2):
            device_tree: s/qemu_devtree/qemu_fdt globally
            device_tree: qemu_fdt_setprop: Rename val_array arg
      
      Tom Musta (19):
            Declare and Enable VSX
            Add MSR VSX and Associated Exception
            Add VSX Instruction Decoders
            Add VSR to Global Registers
            Add lxvd2x
            Add stxvd2x
            Add xxpermdi
            Add lxsdx
            Add lxvdsx
            Add lxvw4x
            Add stxsdx
            Add stxvw4x
            Add VSX Scalar Move Instructions
            Add VSX Vector Move Instructions
            Add Power7 VSX Logical Instructions
            Add xxmrgh/xxmrgl
            Add xxsel
            Add xxspltw
            Add xxsldwi
      
      * agraf/tags/signed-ppc-for-upstream: (32 commits)
        spapr: limit numa memory regions by ram size
        spapr: make sure RMA is in first mode of first memory node
        device_tree: qemu_fdt_setprop: Rename val_array arg
        device_tree: s/qemu_devtree/qemu_fdt globally
        PPC: Add VSX to hflags
        Add xxsldwi
        Add xxspltw
        Add xxsel
        Add xxmrgh/xxmrgl
        Add Power7 VSX Logical Instructions
        Add VSX Vector Move Instructions
        Add VSX Scalar Move Instructions
        roms: Flush icache when writing roms to guest memory
        spapr: tie spapr-nvram to -pflash
        PPC: Use default pci bus name for grackle and heathrow
        spapr-rtas: add ibm, (get|set)-system-parameter
        spapr-rtas: replace return code constants with macros
        target-ppc: move POWER7+ to a separate family
        Add stxvw4x
        Add stxsdx
        ...
      f8251db1
    • P
      spapr: limit numa memory regions by ram size · 5fe269b1
      Paul Mackerras 提交于
      This makes sure that all NUMA memory blocks reside within RAM or
      have zero length.
      Reviewed-by: NThomas Huth <thuth@linux.vnet.ibm.com>
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      5fe269b1
    • A
      spapr: make sure RMA is in first mode of first memory node · c4177479
      Alexey Kardashevskiy 提交于
      The SPAPR specification says that the RMA starts at the LPAR's logical
      address 0 and is the first logical memory block reported in
      the LPAR’s device tree.
      
      So SLOF only maps the first block and that block needs to span
      the full RMA.
      
      This makes sure that the RMA area is where SLOF expects it.
      Reviewed-by: NThomas Huth <thuth@linux.vnet.ibm.com>
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      c4177479
    • P
      device_tree: qemu_fdt_setprop: Rename val_array arg · be5907f2
      Peter Crosthwaite 提交于
      Looking at the implementation, this doesn't really have a lot to do
      with arrays. Its just a pointer to a buffer and is passed through
      to the wrapped fn (qemu_fdt_setprop) unchanged. So rename to make it
      consistent with libfdt, which in the wrapped function just calls it
      "val".
      Signed-off-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      be5907f2
    • P
      device_tree: s/qemu_devtree/qemu_fdt globally · 5a4348d1
      Peter Crosthwaite 提交于
      The qemu_devtree API is a wrapper around the fdt_ set of APIs.
      Rename accordingly.
      Signed-off-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
      [agraf: also convert hw/arm/virt.c]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      5a4348d1
    • A
      PPC: Add VSX to hflags · c2b63f03
      Alexander Graf 提交于
      We generate different code depending on whether MSR_VSX is set or
      clear, so it needs to be part of our hflags too which indicate whether
      we're still in the same translation block cache bucket.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      c2b63f03
    • T
      Add xxsldwi · acc42968
      Tom Musta 提交于
      This patch adds the VSX Shift Left Double by Word Immediate
      (xxsldwi) instruction.
      Signed-off-by: NTom Musta <tommusta@gmail.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      acc42968
    • T
      Add xxspltw · 76c15fe0
      Tom Musta 提交于
      This patch adds the VSX Splat Word (xxsplatw) instruction.
      
      This is the first instruction to use the UIM immediate field
      and consequently a decoder is also added.
      
      V2: reworked implementation per Richard Henderson's comments.
      Signed-off-by: NTom Musta <tommusta@gmail.com>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      76c15fe0
    • T
      Add xxsel · 551e3ef7
      Tom Musta 提交于
      This patch adds the VSX Select (xxsel) instruction.
      
      The xxsel instruction has four VSR operands.  Thus the xC
      instruction decoder is added.
      
      The xxsel instruction is massively overloaded in the opcode
      table since only bits 26 and 27 are opcode bits.  This
      overloading is done in matrix fashion with two macros
      (GEN_XXSEL_ROW and GEN_XX_SEL).
      
      V2: (1) eliminated unecessary XXSEL macro  (2) tighter implementation
      using tcg_gen_andc_i64.
      Signed-off-by: NTom Musta <tommusta@gmail.com>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      551e3ef7
    • T
      Add xxmrgh/xxmrgl · ce577d2e
      Tom Musta 提交于
      This patch adds the VSX Merge High Word and VSX Merge Low Word
      instructions.
      
      V2: Now implemented using deposit (per Richard Henderson's comment)
      Signed-off-by: NTom Musta <tommusta@gmail.com>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      ce577d2e
    • T
      Add Power7 VSX Logical Instructions · 79ca8a6a
      Tom Musta 提交于
      This patch adds the VSX logical instructions that are defined
      by the Version 2.06 Power ISA (aka Power7):
      
         - xxland
         - xxlandc
         - xxlor
         - xxlxor
         - xxlnor
      Signed-off-by: NTom Musta <tommusta@gmail.com>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      79ca8a6a
    • T
      Add VSX Vector Move Instructions · be574920
      Tom Musta 提交于
      This patch adds the vector move instructions:
      
        - xvabsdp - Vector Absolute Value Double-Precision
        - xvnabsdp - Vector Negative Absolute Value Double-Precision
        - xvnegdp - Vector Negate Double-Precision
        - xvcpsgndp - Vector Copy Sign Double-Precision
        - xvabssp - Vector Absolute Value Single-Precision
        - xvnabssp - Vector Negative Absolute Value Single-Precision
        - xvnegsp - Vector Negate Single-Precision
        - xvcpsgnsp - Vector Copy Sign Single-Precision
      
      V3: Per Paolo Bonzini's suggestion, used a temporary for the
      sign mask and andc.
      Signed-off-by: NTom Musta <tommusta@gmail.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      be574920
    • T
      Add VSX Scalar Move Instructions · df020ce0
      Tom Musta 提交于
      This patch adds the VSX scalar move instructions:
      
        - xsabsdp (Scalar Absolute Value Double-Precision)
        - xsnabspd (Scalar Negative Absolute Value Double-Precision)
        - xsnegdp (Scalar Negate Double-Precision)
        - xscpsgndp (Scalar Copy Sign Double-Precision)
      
      A common generator macro (VSX_SCALAR_MOVE) is added since these
      instructions vary only slightly from each other.
      
      Macros to support VSX XX2 and XX3 form opcodes are also added.
      These macros handle the overloading of "opcode 2" space (instruction
      bits 26:30) caused by AX and BX bits (29 and 30, respectively).
      
      V3: Per feedback from Paolo Bonzini, moved the sign mask into a
      temporary and used andc.
      Signed-off-by: NTom Musta <tommusta@gmail.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      df020ce0
    • A
      roms: Flush icache when writing roms to guest memory · 582b55a9
      Alexander Graf 提交于
      We use the rom infrastructure to write firmware and/or initial kernel
      blobs into guest address space. So we're basically emulating the cache
      off phase on very early system bootup.
      
      That phase is usually responsible for clearing the instruction cache for
      anything it writes into cachable memory, to ensure that after reboot we
      don't happen to execute stale bits from the instruction cache.
      
      So we need to invalidate the icache every time we write a rom into guest
      address space. We do not need to do this for every DMA since the guest
      expects it has to flush the icache manually in that case.
      
      This fixes random reboot issues on e5500 (booke ppc) for me.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      582b55a9
    • P
      spapr: tie spapr-nvram to -pflash · 3978b863
      Paolo Bonzini 提交于
      spapr-nvram's drive property is currently connected to a non-existent
      "-machine nvram=<drivename>" option.  Instead, tie it to -pflash like
      other non-volatile RAM devices.  This provides the following possibilities
      for adding a backend for the sPAPR non-volatile RAM:
      
      * -pflash filename
      
      * -drive if=pflash,file=filename,format=raw,...
      
      * -drive if=none,file=filename,format=raw,id=foo,... -global spapr-nvram.drive=foo
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      3978b863
    • A
      PPC: Use default pci bus name for grackle and heathrow · 8a0e1104
      Alexander Graf 提交于
      There's no good reason to call our bus "pci" rather than let the default
      bus name take over ("pci.0").
      
      The big downside to calling it different from anyone else is that tools
      that pass -device get confused. They are looking for a bus "pci.0" rather
      than "pci".
      
      To make life easier for everyone, let's just drop the name override.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      8a0e1104
    • A
      spapr-rtas: add ibm, (get|set)-system-parameter · 3ada6b11
      Alexey Kardashevskiy 提交于
      This adds very basic handlers for ibm,get-system-parameter and
      ibm,set-system-parameter RTAS calls.
      
      The only parameter handled at the moment is
      "platform-processor-diagnostics-run-mode" which is always disabled and
      does not support changing. This is expected to make
      "ppc64_cpu --run-mode=1" happy.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      [agraf: s/papameter/parameter/g]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      3ada6b11
    • A
      a64d325d
    • A
      target-ppc: move POWER7+ to a separate family · b650d6a2
      Alexey Kardashevskiy 提交于
      So far POWER7+ was a part of POWER7 family. However it has a different
      PVR base value so in order to support PVR masks, it needs a separate
      family class.
      
      This adds a new family class, PVR base and mask values and moves
      Power7+ v2.1 CPU to a new family. The class init function is copied
      from the POWER7 family.
      
      This defines a firmware name for the new family as "PowerPC,POWER7+"
      instead of previously used "PowerPC,POWER7" from the POWER7 family.
      The reason for that is that the Sapphire firmware (a h0st firmware)
      uses "PowerPC,POWER7+" already and since no specification defines
      exactly the CPU nodes naming in the device tree, we better stay
      in sync with the host firmware.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      b650d6a2