1. 08 3月, 2016 9 次提交
  2. 07 3月, 2016 14 次提交
  3. 06 3月, 2016 1 次提交
    • P
      Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2016-03-04' into staging · 1464ad45
      Peter Maydell 提交于
      QAPI patches for 2016-03-04
      
      # gpg: Signature made Sat 05 Mar 2016 09:47:19 GMT using RSA key ID EB918653
      # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
      # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
      
      * remotes/armbru/tags/pull-qapi-2016-03-04:
        qapi: Drop useless 'data' member of unions
        chardev: Drop useless ChardevDummy type
        qapi: Avoid use of 'data' member of QAPI unions
        ui: Shorten references into InputEvent
        util: Shorten references into SocketAddress
        chardev: Shorten references into ChardevBackend
        qapi: Update docs to match recent generator changes
        qapi-visit: Expose visit_type_FOO_members()
        qapi: Rename 'fields' to 'members' in generated C code
        qapi: Rename 'fields' to 'members' in generator
        qapi-dealloc: Reduce use outside of generated code
        qmp-shell: fix pretty printing of JSON responses
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      1464ad45
  4. 05 3月, 2016 12 次提交
    • E
      qapi: Drop useless 'data' member of unions · 48eb62a7
      Eric Blake 提交于
      We started moving away from the use of the 'void *data' member
      in the C union corresponding to a QAPI union back in commit
      544a3731; recent commits have gotten rid of other uses.  Now
      that it is completely unused, we can remove the member itself
      as well as the FIXME comment.  Update the testsuite to drop the
      negative test union-clash-data.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1457021813-10704-11-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      48eb62a7
    • E
      chardev: Drop useless ChardevDummy type · b1918fbb
      Eric Blake 提交于
      Commit d0d7708b made ChardevDummy be an empty wrapper type around
      ChardevCommon.  But there is no technical reason for this indirection,
      so simplify the code by directly using the base type.
      
      Also change the fallback assignment to assign u.null rather than
      u.data, since a future patch will remove the data member of the C
      struct generated for QAPI unions.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1457106160-23614-1-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      b1918fbb
    • E
      qapi: Avoid use of 'data' member of QAPI unions · 10f75907
      Eric Blake 提交于
      QAPI code generators currently create a 'void *data' member as
      part of the anonymous union embedded in the C struct corresponding
      to a QAPI union.  However, directly assigning to this member of
      the union feels a bit fishy, when we can assign to another member
      of the struct instead.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1457021813-10704-9-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      10f75907
    • E
      ui: Shorten references into InputEvent · b5a1b443
      Eric Blake 提交于
      An upcoming patch will alter how simple unions, like InputEvent, are
      laid out, which will impact all lines of the form 'evt->u.XXX'
      (expanding it to the longer 'evt->u.XXX.data').  For better
      legibility in that patch, and less need for line wrapping, it's better
      to use a temporary variable to reduce the effect of a layout change to
      just the variable initializations, rather than every reference within
      an InputEvent.
      
      There was one instance in hid.c:hid_pointer_event() where the code
      was referring to evt->u.rel inside the case label where evt->u.abs
      is the correct name; thankfully, both members of the union have the
      same type, so it happened to work, but it is now cleaner.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1457021813-10704-8-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      b5a1b443
    • E
      util: Shorten references into SocketAddress · 0399293e
      Eric Blake 提交于
      An upcoming patch will alter how simple unions, like SocketAddress,
      are laid out, which will impact all lines of the form 'addr->u.XXX'
      (expanding it to the longer 'addr->u.XXX.data').  For better
      legibility in that patch, and less need for line wrapping, it's better
      to use a temporary variable to reduce the effect of a layout change to
      just the variable initializations, rather than every reference within
      a SocketAddress.  Also, take advantage of some C99 initialization where
      it makes sense (simplifying g_new0() to g_new()).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1457021813-10704-7-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      0399293e
    • E
      chardev: Shorten references into ChardevBackend · f194a1ae
      Eric Blake 提交于
      An upcoming patch will alter how simple unions, like ChardevBackend,
      are laid out, which will impact all lines of the form 'backend->u.XXX'
      (expanding it to the longer 'backend->u.XXX.data').  For better
      legibility in that patch, and less need for line wrapping, it's better
      to use a temporary variable to reduce the effect of a layout change to
      just the variable initializations, rather than every reference within
      a ChardevBackend.  It doesn't hurt that this also makes the code more
      consistent: some clients touched here already had a temporary variable
      but weren't using it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-By: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1457021813-10704-6-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      f194a1ae
    • E
      qapi: Update docs to match recent generator changes · 9ee86b85
      Eric Blake 提交于
      Several commits have been changing the generator, but not updating
      the docs to match:
      - The implicit tag member is named "type", not "kind".  Screwed up in
      commit 39a18158.
      - Commit 9f08c8ec made list types lazy, and thereby dropped
      UserDefOneList if nothing explicitly uses the list type.
      - Commit 51e72bc1 switched the parameter order with 'name' occurring
      earlier.
      - Commit e65d89bf changed the layout of UserDefOneList.
      - Prefer the term 'member' over 'field'.
      - We now expose visit_type_FOO_members() for objects.
      - etc.
      
      Rework the examples to show slightly more output (we don't want to
      show too much; that's what the testsuite is for), and regenerate the
      output to match all recent changes.  Also, rearrange output to show
      .h files before .c (understanding the interface first often makes
      the implementation easier to follow).
      Reported-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1457021813-10704-5-git-send-email-eblake@redhat.com>
      9ee86b85
    • E
      qapi-visit: Expose visit_type_FOO_members() · 4d91e911
      Eric Blake 提交于
      Dan Berrange reported a case where he needs to work with a
      QCryptoBlockOptions union type using the OptsVisitor, but only
      visit one of the branches of that type (the discriminator is not
      visited directly, but learned externally).  When things were
      boxed, it was easy: just visit the variant directly, which took
      care of both allocating the variant and visiting its members, then
      store that pointer in the union type.  But now that things are
      unboxed, we need a way to visit the members without allocation,
      done by exposing visit_type_FOO_members() to the user.
      
      Before the patch, we had quite a bit of code associated with
      object_members_seen to make sure that a declaration of the helper
      was in scope before any use of the function.  But now that the
      helper is public and declared in the header, the .c file no
      longer needs to worry about topological sorting (the helper is
      always in scope), which leads to some nice cleanups.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1457021813-10704-4-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      4d91e911
    • E
      qapi: Rename 'fields' to 'members' in generated C code · c81200b0
      Eric Blake 提交于
      C types and JSON objects don't have fields, but members.  We
      shouldn't gratuitously invent terminology.  This patch is a
      strict renaming of static genarated functions, plus the naming
      of the dummy filler member for empty structs, before the next
      patch exposes some of that naming to the rest of the code base.
      Suggested-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1457021813-10704-3-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      c81200b0
    • E
      qapi: Rename 'fields' to 'members' in generator · 14f00c6c
      Eric Blake 提交于
      C types and JSON objects don't have fields, but members.  We
      shouldn't gratuitously invent terminology.  This patch is a
      strict renaming of generator code internals (including testsuite
      comments), before later patches rename C interfaces.
      
      No change to generated code with this patch.
      Suggested-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1457021813-10704-2-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      14f00c6c
    • E
      qapi-dealloc: Reduce use outside of generated code · 96a1616c
      Eric Blake 提交于
      No need to roll our own use of the dealloc visitors when we can
      just directly use the qapi_free_FOO() functions that do what we
      want in one line.
      
      In net.c, inline net_visit() into its remaining lone caller.
      
      After this patch, test-visitor-serialization.c is the only
      non-generated file that needs to use a dealloc visitor, because
      it is testing low level aspects of the visitor interface.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1456262075-3311-2-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      96a1616c
    • D
      qmp-shell: fix pretty printing of JSON responses · e55250c6
      Daniel P. Berrange 提交于
      Pretty printing of JSON responses is important to be able to understand
      large responses from query commands in particular. Unfortunately this
      was broken during the addition of the verbose flag in
      
        commit 1ceca07e
        Author: John Snow <jsnow@redhat.com>
        Date:   Wed Apr 29 15:14:04 2015 -0400
      
          scripts: qmp-shell: Add verbose flag
      
      This is because that change turned the python data structure into a
      formatted JSON string before the pretty print was given it. So we're
      just pretty printing a string, which is a no-op.
      
      The original pretty printer would output python objects.
      
      (QEMU) query-chardev
      {   u'return': [   {   u'filename': u'vc',
                             u'frontend-open': False,
                             u'label': u'parallel0'},
                         {   u'filename': u'vc',
                             u'frontend-open': True,
                             u'label': u'serial0'},
                         {   u'filename': u'unix:/tmp/qemp,server',
                             u'frontend-open': True,
                             u'label': u'compat_monitor0'}]}
      
      This fixes the problem by switching to outputting pretty formatted JSON
      text instead. This has the added benefit that the pretty printed output
      is now valid JSON text. Due to the way the verbose flag was handled, the
      pretty printing now applies to the command sent, as well as its response:
      
      (QEMU) query-chardev
      {
          "execute": "query-chardev",
          "arguments": {}
      }
      {
          "return": [
              {
                  "frontend-open": false,
                  "label": "parallel0",
                  "filename": "vc"
              },
              {
                  "frontend-open": true,
                  "label": "serial0",
                  "filename": "vc"
              },
              {
                  "frontend-open": true,
                  "label": "compat_monitor0",
                  "filename": "unix:/tmp/qmp,server"
              }
          ]
      }
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1456224706-1591-1-git-send-email-berrange@redhat.com>
      Tested-by: NKashyap Chamarthy <kchamart@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      [Bonus fix: multiple -p now work]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      e55250c6
  5. 04 3月, 2016 4 次提交
    • P
      Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20160304' into staging · 3c0f12df
      Peter Maydell 提交于
      target-arm queue:
       * Correct handling of writes to CPSR from gdbstub in user mode
       * virt: lift maximum RAM limit to 255GB
       * sdhci: implement reset
       * virt: if booting in Secure mode, provide secure-only RAM, make first
         flash device secure-only, and assume the EL3 boot rom will handle PSCI
       * bcm2835: use explicit endianness accessors rather than ldl/stl_phys
       * support big-endian in system mode for ARM
       * implement SETEND instruction
       * arm_gic: implement the GICv2 GICC_DIR register
       * fix SRS bug: only trap from S-EL1 to EL3 if specified mode is Mon
      
      # gpg: Signature made Fri 04 Mar 2016 11:38:53 GMT using RSA key ID 14360CDE
      # 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-20160304: (30 commits)
        target-arm: Only trap SRS from S-EL1 if specified mode is MON
        hw/intc/arm_gic.c: Implement GICv2 GICC_DIR
        arm: boot: Support big-endian elfs
        loader: Add data swap option to load-elf
        loader: load_elf(): Add doc comment
        loader: add API to load elf header
        target-arm: implement BE32 mode in system emulation
        target-arm: implement setend
        target-arm: introduce tbflag for endianness
        target-arm: a64: Add endianness support
        target-arm: introduce disas flag for endianness
        target-arm: pass DisasContext to gen_aa32_ld*/st*
        target-arm: implement SCTLR.EE
        linux-user: arm: handle CPSR.E correctly in strex emulation
        linux-user: arm: set CPSR.E/SCTLR.E0E correctly for BE mode
        arm: cpu: handle BE32 user-mode as BE
        target-arm: cpu: Move cpu_is_big_endian to header
        target-arm: implement SCTLR.B, drop bswap_code
        linux-user: arm: pass env to get_user_code_*
        linux-user: arm: fix coding style for some linux-user signal functions
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      3c0f12df
    • R
      target-arm: Only trap SRS from S-EL1 if specified mode is MON · ba63cf47
      Ralf-Philipp Weinmann 提交于
      Commit cbc0326b caused SRS instructions executed from Secure
      EL1 to trap to EL3 even if the specified mode was not monitor mode.
      
      According to the ARMv8 Architecture reference manual [F6.1.203], ALL
      of the following conditions need to be met for SRS to trap to EL3:
      * It is executed at Secure PL1.
      * The specified mode is monitor mode.
      * EL3 is using AArch64.
      
      Correct the condition governing the trap to EL3 to check the
      specified mode.
      Signed-off-by: NRalf-Philipp Weinmann <ralf+devel@comsecuris.com>
      Message-id: 20160222224251.GA11654@beta.comsecuris.com
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      [PMM: tweaked comment text to read 'specified mode'; edited
       commit message]
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      ba63cf47
    • P
      hw/intc/arm_gic.c: Implement GICv2 GICC_DIR · a55c910e
      Peter Maydell 提交于
      The GICv2 introduces a new CPU interface register GICC_DIR, which
      allows an OS to split the "priority drop" and "deactivate interrupt"
      parts of interrupt completion. Implement this register.
      (Note that the register is at offset 0x1000 in the CPU interface,
      which means it is on a different 4K page from all the other registers.)
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NSergey Fedorov <serge.fdrv@gmail.com>
      Message-id: 1456854176-7813-1-git-send-email-peter.maydell@linaro.org
      a55c910e
    • P
      arm: boot: Support big-endian elfs · 9776f636
      Peter Crosthwaite 提交于
      Support ARM big-endian ELF files in system-mode emulation. When loading
      an elf, determine the endianness mode expected by the elf, and set the
      relevant CPU state accordingly.
      
      With this, big-endian modes are now fully supported via system-mode LE,
      so there is no need to restrict the elf loading to the TARGET
      endianness so the ifdeffery on TARGET_WORDS_BIGENDIAN goes away.
      Signed-off-by: NPeter Crosthwaite <crosthwaite.peter@gmail.com>
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      [PMM: fix typo in comments]
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      9776f636