Skip to content
Snippets Groups Projects
  1. Oct 30, 2021
  2. Oct 29, 2021
    • Richard Henderson's avatar
      Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging · a856cce3
      Richard Henderson authored
      
      x86 queue, 2021-10-29
      
      Bug fixes:
      * Remove core-capability in Snowridge CPU model
      
      # gpg: Signature made Fri 29 Oct 2021 12:05:14 PM PDT
      # gpg:                using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6
      # gpg:                issuer "ehabkost@redhat.com"
      # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full]
      
      * remotes/ehabkost/tags/x86-next-pull-request:
        target/i386: Remove core-capability in Snowridge CPU model
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      a856cce3
    • Markus Armbruster's avatar
      qapi: Extend -compat to set policy for unstable interfaces · 57df0dff
      Markus Armbruster authored
      
      New option parameters unstable-input and unstable-output set policy
      for unstable interfaces just like deprecated-input and
      deprecated-output set policy for deprecated interfaces (see commit
      6dd75472 "qemu-options: New -compat to set policy for deprecated
      interfaces").  This is intended for testing users of the management
      interfaces.  It is experimental.
      
      For now, this covers only syntactic aspects of QMP, i.e. stuff tagged
      with feature 'unstable'.  We may want to extend it to cover semantic
      aspects, or the command line.
      
      Note that there is no good way for management application to detect
      presence of these new option parameters: they are not visible output
      of query-qmp-schema or query-command-line-options.  Tolerable, because
      it's meant for testing.  If running with -compat fails, skip the test.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Acked-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20211028102520.747396-10-armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      [Doc comments fixed up]
      57df0dff
    • Markus Armbruster's avatar
      qapi: Factor out compat_policy_input_ok() · 7ce5fc63
      Markus Armbruster authored
      
      The code to check policy for handling deprecated input is triplicated.
      Factor it out into compat_policy_input_ok() before I mess with it in
      the next commit.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20211028102520.747396-9-armbru@redhat.com>
      [Policy code moved from qmp-dispatch.c to qapi-util.c to make visitors
      link without qmp-dispatch.o]
      7ce5fc63
    • Chenyi Qiang's avatar
      target/i386: Remove core-capability in Snowridge CPU model · 07db29f2
      Chenyi Qiang authored
      
      Because core-capability releated features are model-specific and KVM
      won't support it, remove the core-capability in CPU model to avoid the
      warning message.
      
      Signed-off-by: default avatarChenyi Qiang <chenyi.qiang@intel.com>
      Message-Id: <20210827064818.4698-3-chenyi.qiang@intel.com>
      Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      07db29f2
    • Richard Henderson's avatar
      Merge remote-tracking branch 'remotes/alistair23/tags/pull-riscv-to-apply-20211029-1' into staging · 6450ce56
      Richard Henderson authored
      
      Fifth RISC-V PR for QEMU 6.2
      
       - Use a shared PLIC config helper function
       - Fixup the OpenTitan PLIC configuration
       - Add support for the experimental J extension
       - Update the fmin/fmax handling
       - Fixup VS interrupt forwarding
      
      # gpg: Signature made Fri 29 Oct 2021 12:03:47 AM PDT
      # gpg:                using RSA key F6C4AC46D4934868D3B8CE8F21E10D29DF977054
      # gpg: Good signature from "Alistair Francis <alistair@alistair23.me>" [full]
      
      * remotes/alistair23/tags/pull-riscv-to-apply-20211029-1:
        target/riscv: change the api for RVF/RVD fmin/fmax
        softfloat: add APIs to handle alternative sNaN propagation for fmax/fmin
        target/riscv: remove force HS exception
        target/riscv: fix VS interrupts forwarding to HS
        target/riscv: Allow experimental J-ext to be turned on
        target/riscv: Implement address masking functions required for RISC-V Pointer Masking extension
        target/riscv: Support pointer masking for RISC-V for i/c/f/d/a types of instructions
        target/riscv: Print new PM CSRs in QEMU logs
        target/riscv: Add J extension state description
        target/riscv: Support CSRs required for RISC-V PM extension except for the h-mode
        target/riscv: Add CSR defines for RISC-V PM extension
        target/riscv: Add J-extension into RISC-V
        hw/riscv: opentitan: Fixup the PLIC context addresses
        hw/riscv: virt: Use the PLIC config helper function
        hw/riscv: microchip_pfsoc: Use the PLIC config helper function
        hw/riscv: sifive_u: Use the PLIC config helper function
        hw/riscv: boot: Add a PLIC config string function
        hw/riscv: virt: Don't use a macro for the PLIC configuration
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      6450ce56
    • Markus Armbruster's avatar
      qapi: Generalize enum member policy checking · c8688760
      Markus Armbruster authored
      
      The code to check enumeration value policy can see special feature
      flag 'deprecated' in QEnumLookup member flags[value].  I want to make
      feature flag 'unstable' visible there as well, so I can add policy for
      it.
      
      Instead of extending flags[], replace it by @special_features (a
      bitset of QapiSpecialFeature), because that's how special features get
      passed around elsewhere.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Acked-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20211028102520.747396-8-armbru@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      c8688760
    • Markus Armbruster's avatar
      qapi: Generalize command policy checking · 6604e475
      Markus Armbruster authored
      
      The code to check command policy can see special feature flag
      'deprecated' as command flag QCO_DEPRECATED.  I want to make feature
      flag 'unstable' visible there as well, so I can add policy for it.
      
      To let me make it visible, add member @special_features (a bitset of
      QapiSpecialFeature) to QmpCommand, and adjust the generator to pass it
      through qmp_register_command().  Then replace "QCO_DEPRECATED in
      @flags" by QAPI_DEPRECATED in @special_features", and drop
      QCO_DEPRECATED.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Acked-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20211028102520.747396-7-armbru@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      6604e475
    • Markus Armbruster's avatar
      qapi: Generalize struct member policy checking · a1307285
      Markus Armbruster authored
      
      The generated visitor functions call visit_deprecated_accept() and
      visit_deprecated() when visiting a struct member with special feature
      flag 'deprecated'.  This makes the feature flag visible to the actual
      visitors.  I want to make feature flag 'unstable' visible there as
      well, so I can add policy for it.
      
      To let me make it visible, replace these functions by
      visit_policy_reject() and visit_policy_skip(), which take the member's
      special features as an argument.  Note that the new functions have the
      opposite sense, i.e. the return value flips.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20211028102520.747396-6-armbru@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      [Unbreak forward visitor]
      a1307285
    • Richard Henderson's avatar
      Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20211028' into staging · a92cecba
      Richard Henderson authored
      
      Improvements to qemu/int128
      Fixes for 128/64 division.
      Cleanup tcg/optimize.c
      Optimize redundant sign extensions
      
      # gpg: Signature made Thu 28 Oct 2021 09:06:00 PM PDT
      # gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
      # gpg:                issuer "richard.henderson@linaro.org"
      # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [ultimate]
      
      * remotes/rth/tags/pull-tcg-20211028: (60 commits)
        softmmu: fix for "after access" watchpoints
        softmmu: remove useless condition in watchpoint check
        softmmu: fix watchpoint processing in icount mode
        tcg/optimize: Propagate sign info for shifting
        tcg/optimize: Propagate sign info for bit counting
        tcg/optimize: Propagate sign info for setcond
        tcg/optimize: Propagate sign info for logical operations
        tcg/optimize: Optimize sign extensions
        tcg/optimize: Use fold_xx_to_i for rem
        tcg/optimize: Use fold_xi_to_x for div
        tcg/optimize: Use fold_xi_to_x for mul
        tcg/optimize: Use fold_xx_to_i for orc
        tcg/optimize: Stop forcing z_mask to "garbage" for 32-bit values
        tcg: Extend call args using the correct opcodes
        tcg/optimize: Sink commutative operand swapping into fold functions
        tcg/optimize: Expand fold_addsub2_i32 to 64-bit ops
        tcg/optimize: Expand fold_mulu2_i32 to all 4-arg multiplies
        tcg/optimize: Split out fold_masks
        tcg/optimize: Split out fold_ix_to_i
        tcg/optimize: Split out fold_xi_to_x
        ...
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      a92cecba
    • Markus Armbruster's avatar
      qapi: Tools for sets of special feature flags in generated code · c67db1ed
      Markus Armbruster authored
      
      New enum QapiSpecialFeature enumerates the special feature flags.
      
      New helper gen_special_features() returns code to represent a
      collection of special feature flags as a bitset.
      
      The next few commits will put them to use.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20211028102520.747396-5-armbru@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      c67db1ed
    • Markus Armbruster's avatar
      qapi: Eliminate QCO_NO_OPTIONS for a slight simplification · 9bafe07b
      Markus Armbruster authored
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Reviewed-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20211028102520.747396-4-armbru@redhat.com>
      9bafe07b
    • Markus Armbruster's avatar
      qapi: Mark unstable QMP parts with feature 'unstable' · 9fb49daa
      Markus Armbruster authored
      
      Add special feature 'unstable' everywhere the name starts with 'x-',
      except for InputBarrierProperties member x-origin and
      MemoryBackendProperties member x-use-canonical-path-for-ramblock-id,
      because these two are actually stable.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Acked-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20211028102520.747396-3-armbru@redhat.com>
      9fb49daa
    • Markus Armbruster's avatar
      qapi: New special feature flag "unstable" · a3c45b3e
      Markus Armbruster authored
      
      By convention, names starting with "x-" are experimental.  The parts
      of external interfaces so named may be withdrawn or changed
      incompatibly in future releases.
      
      The naming convention makes unstable interfaces easy to recognize.
      Promoting something from experimental to stable involves a name
      change.  Client code needs to be updated.  Occasionally bothersome.
      
      Worse, the convention is not universally observed:
      
      * QOM type "input-barrier" has properties "x-origin", "y-origin".
        Looks accidental, but it's ABI since 4.2.
      
      * QOM types "memory-backend-file", "memory-backend-memfd",
        "memory-backend-ram", and "memory-backend-epc" have a property
        "x-use-canonical-path-for-ramblock-id" that is documented to be
        stable despite its name.
      
      We could document these exceptions, but documentation helps only
      humans.  We want to recognize "unstable" in code, like "deprecated".
      
      So support recognizing it the same way: introduce new special feature
      flag "unstable".  It will be treated specially by the QAPI generator,
      like the existing feature flag "deprecated", and unlike regular
      feature flags.
      
      This commit updates documentation and prepares tests.  The next commit
      updates the QAPI schema.  The remaining patches update the QAPI
      generator and wire up -compat policy checking.
      
      Management applications can then use query-qmp-schema and -compat to
      manage or guard against use of unstable interfaces the same way as for
      deprecated interfaces.
      
      docs/devel/qapi-code-gen.txt no longer mandates the naming convention.
      Using it anyway might help writers of programs that aren't
      full-fledged management applications.  Not using it can save us
      bothersome renames.  We'll see how that shakes out.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Reviewed-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20211028102520.747396-2-armbru@redhat.com>
      a3c45b3e
    • Chih-Min Chao's avatar
      target/riscv: change the api for RVF/RVD fmin/fmax · 15161e42
      Chih-Min Chao authored
      The sNaN propagation behavior has been changed since cd20cee7 in
      https://github.com/riscv/riscv-isa-manual
      
      .
      
      In Priv spec v1.10, RVF is v2.0. fmin.s and fmax.s are implemented with
      IEEE 754-2008 minNum and maxNum operations.
      
      In Priv spec v1.11, RVF is v2.2. fmin.s and fmax.s are amended to
      implement IEEE 754-2019 minimumNumber and maximumNumber operations.
      
      Therefore, to prevent the risk of having too many version variables.
      Instead of introducing an extra *fext_ver* variable, we tie RVF version
      to Priv version. Though it's not completely accurate but is close enough.
      
      Signed-off-by: default avatarChih-Min Chao <chihmin.chao@sifive.com>
      Signed-off-by: default avatarFrank Chang <frank.chang@sifive.com>
      Acked-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <20211021160847.2748577-3-frank.chang@sifive.com>
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      15161e42
    • Chih-Min Chao's avatar
      softfloat: add APIs to handle alternative sNaN propagation for fmax/fmin · 0e903037
      Chih-Min Chao authored
      
      For "fmax/fmin ft0, ft1, ft2" and if one of the inputs is sNaN,
      
        The original logic:
          Return NaN and set invalid flag if ft1 == sNaN || ft2 == sNan.
      
        The alternative path:
          Set invalid flag if ft1 == sNaN || ft2 == sNaN.
          Return NaN only if ft1 == NaN && ft2 == NaN.
      
      The IEEE 754 spec allows both implementation and some architecture such
      as riscv choose different defintions in two spec versions.
      (riscv-spec-v2.2 use original version, riscv-spec-20191213 changes to
       alternative)
      
      Signed-off-by: default avatarChih-Min Chao <chihmin.chao@sifive.com>
      Signed-off-by: default avatarFrank Chang <frank.chang@sifive.com>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20211021160847.2748577-2-frank.chang@sifive.com>
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      0e903037
    • Jose Martins's avatar
      target/riscv: remove force HS exception · 50d16087
      Jose Martins authored
      
      There is no need to "force an hs exception" as the current privilege
      level, the state of the global ie and of the delegation registers should
      be enough to route the interrupt to the appropriate privilege level in
      riscv_cpu_do_interrupt. The is true for both asynchronous and
      synchronous exceptions, specifically, guest page faults which must be
      hardwired to zero hedeleg. As such the hs_force_except mechanism can be
      removed.
      
      Signed-off-by: default avatarJose Martins <josemartins90@gmail.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-id: 20211026145126.11025-3-josemartins90@gmail.com
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      50d16087
    • Jose Martins's avatar
      target/riscv: fix VS interrupts forwarding to HS · 487a9955
      Jose Martins authored
      
      VS interrupts (2, 6, 10) were not correctly forwarded to hs-mode when
      not delegated in hideleg (which was not being taken into account). This
      was mainly because hs level sie was not always considered enabled when
      it should. The spec states that "Interrupts for higher-privilege modes,
      y>x, are always globally enabled regardless of the setting of the global
      yIE bit for the higher-privilege mode." and also "For purposes of
      interrupt global enables, HS-mode is considered more privileged than
      VS-mode, and VS-mode is considered more privileged than VU-mode". Also,
      vs-level interrupts were not being taken into account unless V=1, but
      should be unless delegated.
      
      Finally, there is no need for a special case for to handle vs interrupts
      as the current privilege level, the state of the global ie and of the
      delegation registers should be enough to route all interrupts to the
      appropriate privilege level in riscv_cpu_do_interrupt.
      
      Signed-off-by: default avatarJose Martins <josemartins90@gmail.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-id: 20211026145126.11025-2-josemartins90@gmail.com
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      487a9955
    • Richard Henderson's avatar
      Merge remote-tracking branch 'remotes/quic/tags/pull-hex-20211028' into staging · edf044c5
      Richard Henderson authored
      
      Followup to replace more tcg_const_* with tcg_constant_tl*
      Fix bug to delay writes to USR until packet commit
      
      # gpg: Signature made Thu 28 Oct 2021 08:59:24 PM PDT
      # gpg:                using RSA key 7B0244FB12DE4422
      # gpg: Good signature from "Taylor Simpson (Rock on) <tsimpson@quicinc.com>" [marginal]
      # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
      # gpg:          It is not certain that the signature belongs to the owner.
      # Primary key fingerprint: 3635 C788 CE62 B91F D4C5  9AB4 7B02 44FB 12DE 4422
      
      * remotes/quic/tags/pull-hex-20211028:
        Hexagon (target/hexagon) put writes to USR into temp until commit
        Hexagon (target/hexagon) more tcg_constant_*
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      edf044c5
Loading