1. 04 2月, 2020 12 次提交
  2. 03 2月, 2020 24 次提交
    • P
      Merge remote-tracking branch 'remotes/pmaydell/tags/pull-docs-20200203' into staging · f31160c7
      Peter Maydell 提交于
      docs:
       * Fix Makefile concurrency bug where we could run Sphinx twice
         in parallel on the same manual (which makes it crash)
       * Support handling hxtool doc fragments for rST manuals
       * Convert qemu-img docs to rST
       * Convert qemu-trace-stap docs to rST
       * Convert virtfs-proxy-helper docs to rST
      
      # gpg: Signature made Mon 03 Feb 2020 11:11:44 GMT
      # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
      # gpg:                issuer "peter.maydell@linaro.org"
      # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
      # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
      # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
      # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
      
      * remotes/pmaydell/tags/pull-docs-20200203:
        virtfs-proxy-helper: Convert documentation to rST
        scripts/qemu-trace-stap: Convert documentation to rST
        qemu-img-cmds.hx: Remove texinfo document fragments
        qemu-img: Convert invocation documentation to rST
        qemu-img-cmds.hx: Add rST documentation fragments
        docs/sphinx: Add new hxtool Sphinx extension
        hxtool: Support SRST/ERST directives
        Makefile: Ensure we don't run Sphinx in parallel for manpages
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      f31160c7
    • P
      virtfs-proxy-helper: Convert documentation to rST · 78813586
      Peter Maydell 提交于
      The virtfs-proxy-helper documentation is currently in
      fsdev/qemu-trace-stap.texi in Texinfo format, which we
      present to the user as:
       * a virtfs-proxy-helper manpage
       * but not (unusually for QEMU) part of the HTML docs
      
      Convert the documentation to rST format that lives in
      the docs/ subdirectory, and present it to the user as:
       * a virtfs-proxy-helper manpage
       * part of the interop/ Sphinx manual
      
      There are minor formatting changes to suit Sphinx, but no
      content changes. In particular I've split the -u and -g
      options into each having their own description text.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Acked-by: NGreg Kurz <groug@kaod.org>
      Message-id: 20200124162606.8787-9-peter.maydell@linaro.org
      78813586
    • P
      scripts/qemu-trace-stap: Convert documentation to rST · 605ffebb
      Peter Maydell 提交于
      The qemu-trace-stap documentation is currently in
      scripts/qemu-trace-stap.texi in Texinfo format, which we
      present to the user as:
       * a qemu-trace-stap manpage
       * but not (unusually for QEMU) part of the HTML docs
      
      Convert the documentation to rST format that lives in
      the docs/ subdirectory, and present it to the user as:
       * a qemu-trace-stap manpage
       * part of the interop/ Sphinx manual
      
      There are minor formatting changes to suit Sphinx, but no
      content changes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
      Tested-by: NAlex Bennée <alex.bennee@linaro.org>
      Message-id: 20200124162606.8787-8-peter.maydell@linaro.org
      605ffebb
    • P
      qemu-img-cmds.hx: Remove texinfo document fragments · 96ddefbc
      Peter Maydell 提交于
      Now the qemu-img documentation has been converted to rST, we can
      remove the texinfo document fragments from qemu-img-cmds.hx, as
      they are no longer used.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
      Message-id: 20200124162606.8787-7-peter.maydell@linaro.org
      96ddefbc
    • P
      qemu-img: Convert invocation documentation to rST · e13c59fa
      Peter Maydell 提交于
      The qemu-img documentation is currently in qemu-nbd.texi in Texinfo
      format, which we present to the user as:
       * a qemu-img manpage
       * a section of the main qemu-doc HTML documentation
      
      Convert the documentation to rST format, and present it to the user as:
       * a qemu-img manpage
       * part of the interop/ Sphinx manual
      
      The qemu-img rST document uses the new hxtool extension
      to handle pulling rST fragments out of qemu-img-cmds.hx.
      
      The documentation of the various options and commands is rather
      muddled, with some options being described inside the relevant
      command description and some in a more general section near the start
      of the manual.  All the command synopses are replicated in the .hx
      file and then again in the manual.  A lot of text is also duplicated
      in the qemu-img.c code for the help text.  I have not attempted to
      deal with any of this, but have simply transposed the existing
      structure into rST.
      
      As usual, there are some minor formatting changes but no
      textual changes, except that as with one or two other conversions
      I have dropped the 'see also' section since it's not very
      informative and looks odd in the HTML.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
      Tested-by: NAlex Bennée <alex.bennee@linaro.org>
      Message-id: 20200124162606.8787-6-peter.maydell@linaro.org
      e13c59fa
    • P
      qemu-img-cmds.hx: Add rST documentation fragments · 195b5109
      Peter Maydell 提交于
      Add the rST versions of the documentation fragments.
      Once we've converted qemu-img.texi to rST we can delete
      the texi fragments; for the moment we leave them in place.
      
      (Commit created with the aid of emacs query-replace-regexp
      from "@var{\([^}]*\)}" to "\,(upcase \1))".)
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20200124162606.8787-5-peter.maydell@linaro.org
      195b5109
    • P
      docs/sphinx: Add new hxtool Sphinx extension · 6803d6e9
      Peter Maydell 提交于
      Some of our documentation includes sections which are created
      by assembling fragments of texinfo from a .hx source file into
      a .texi file, which is then included from qemu-doc.texi or
      qemu-img.texi.
      
      For Sphinx, rather than creating a file to include, the most natural
      way to handle this is to have a small custom Sphinx extension which
      reads the .hx file and process it.  So instead of:
       * makefile produces foo.texi from foo.hx
       * qemu-doc.texi says '@include foo.texi'
      we have:
       * qemu-doc.rst says 'hxtool-doc:: foo.hx'
       * the Sphinx extension for hxtool has code that runs to handle that
         Sphinx directive which reads the .hx file and emits the appropriate
         documentation contents
      
      This is pretty much the same way the kerneldoc extension works right
      now. It also has the advantage that it should work for third-party
      services like readthedocs that expect to build the docs directly with
      sphinx rather than by invoking our makefiles.
      
      In this commit we implement the hxtool extension.
      
      Note that syntax errors in the rST fragments will be correctly
      reported to the user with the filename and line number within the
      hx file.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
      Tested-by: NAlex Bennée <alex.bennee@linaro.org>
      Message-id: 20200124162606.8787-4-peter.maydell@linaro.org
      6803d6e9
    • P
      hxtool: Support SRST/ERST directives · b0cecc0d
      Peter Maydell 提交于
      We want to add support for including rST document fragments
      in our .hx files, in the same way we currently have texinfo
      fragments. These will be delimited by SRST and ERST directives,
      in the same way the texinfo is delimited by STEXI/ETEXI.
      The rST fragments will not be extracted by the hxtool
      script, but by a different mechanism, so all we need to
      do in hxtool is have it ignore all the text inside a
      SRST/ERST section, with suitable error-checking for
      mismatched rST-vs-texi fragment delimiters.
      
      The resulting effective state machine has only three states:
       * flag = 0, rstflag = 0 : reading section for C output
       * flag = 1, rstflag = 0 : reading texi fragment
       * flag = 0, rstflag = 1 : reading rST fragment
      and flag = 1, rstflag = 1 is not possible. Using two
      variables makes the parallel between the rST handling and
      the texi handling clearer; in any case all this code will
      be deleted once we've converted entirely to rST.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-id: 20200124162606.8787-3-peter.maydell@linaro.org
      b0cecc0d
    • P
      Makefile: Ensure we don't run Sphinx in parallel for manpages · e0f3728d
      Peter Maydell 提交于
      Sphinx will corrupt its doctree cache if we run two copies
      of it in parallel. In commit 6bda415c we worked
      around this by having separate doctrees for 'html' vs 'manpage'
      runs. However now that we have more than one manpage produced
      from a single manual we can run into this again when trying
      to produce the two manpages.
      
      Use the trick described in 'Atomic Rules in GNU Make'
      https://www.cmcrossroads.com/article/atomic-rules-gnu-make
      to ensure that we only run the Sphinx manpage builder once
      for each manual, even if we're producing several manpages.
      This fixes doctree corruption in parallel builds and also
      avoids pointlessly running Sphinx more often than we need to.
      
      (In GNU Make 4.3 there is builtin support for this, via
      the "&:" syntax, but we can't wait for that to be available
      in all the distros we support...)
      
      The generic "one invocation for multiple output files"
      machinery is provided as a macro named 'atomic' in rules.mak;
      we then wrap this in a more specific macro for defining
      the rule and dependencies for the manpages in a Sphinx
      manual, to avoid excessive repetition.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
      Tested-by: NAlex Bennée <alex.bennee@linaro.org>
      Message-id: 20200124162606.8787-2-peter.maydell@linaro.org
      e0f3728d
    • P
      Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.0-20200203' into staging · 035b2197
      Peter Maydell 提交于
      ppc patch queue 2020-02093
      
      This pull request supersedes ppc-for-5.0-20200131.  The only changes
      are one extra patch to suppress some irritating warnings during tests
      under TCG, and an extra Tested-by in one of the other patches.
      
      Here's the next batch of patches for ppc and associated machine types.
      Highlights includes:
       * Remove the deprecated "prep" machine type and its OpenHackware
         firmware
       * Add TCG emulation of the msgsndp etc. supervisor privileged
         doorbell instructions
       * Allow "pnv" machine type to run Hostboot style firmwares
       * Add a virtual TPM device for spapr machines
       * Implement devices for POWER8 PHB3 and POWER9 PHB4 host bridges for
         the pnv machine type
       * Use faster Spectre mitigation by default for POWER9 DD2.3 machines
       * Introduce Firmware Assisted NMI dump facility for spapr machines
       * Fix a performance regression with load/store multiple instructions
         in TCG
      
      as well as some other assorted cleanups and fixes.
      
      # gpg: Signature made Mon 03 Feb 2020 03:30:24 GMT
      # gpg:                using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392
      # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" [full]
      # gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>" [full]
      # gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" [full]
      # gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>" [unknown]
      # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
      
      * remotes/dgibson/tags/ppc-for-5.0-20200203: (35 commits)
        tests: Silence various warnings with pseries
        target/ppc: Use probe_write for DCBZ
        target/ppc: Remove redundant mask in DCBZ
        target/ppc: Use probe_access for LMW, STMW
        target/ppc: Use probe_access for LSW, STSW
        ppc: spapr: Activate the FWNMI functionality
        migration: Include migration support for machine check handling
        ppc: spapr: Handle "ibm,nmi-register" and "ibm,nmi-interlock" RTAS calls
        target/ppc: Build rtas error log upon an MCE
        target/ppc: Handle NMI guest exit
        ppc: spapr: Introduce FWNMI capability
        Wrapper function to wait on condition for the main loop mutex
        target/ppc/cpu.h: Put macro parameter in parentheses
        spapr: Enable DD2.3 accelerated count cache flush in pseries-5.0 machine
        ppc/pnv: change the PowerNV machine devices to be non user creatable
        ppc/pnv: Add models for POWER8 PHB3 PCIe Host bridge
        ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge
        docs/specs/tpm: reST-ify TPM documentation
        hw/ppc/Kconfig: Enable TPM_SPAPR as part of PSERIES config
        tpm_spapr: Support suspend and resume
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      035b2197
    • G
      tests: Silence various warnings with pseries · 63d57c8f
      Greg Kurz 提交于
      Some default features of the pseries machine are only available with
      KVM. Warnings are printed when the pseries machine is used with another
      accelerator:
      
      qemu-system-ppc64: warning: TCG doesn't support requested feature,
      cap-ccf-assist=on
      qemu-system-ppc64: warning: Firmware Assisted Non-Maskable
      Interrupts(FWNMI) not supported in TCG
      qemu-system-ppc64: warning: TCG doesn't support requested feature,
      cap-ccf-assist=on
      qemu-system-ppc64: warning: Firmware Assisted Non-Maskable
      Interrupts(FWNMI) not supported in TCG
      qemu-system-ppc64: warning: TCG doesn't support requested feature,
      cap-ccf-assist=on
      qemu-system-ppc64: warning: Firmware Assisted Non-Maskable
      Interrupts(FWNMI) not supported in TCG
      
      This is annoying for CI since it usually runs without KVM. We already
      disable features that emit similar warnings thanks to properties of
      the pseries machine, but this is open-coded in various
      places. Consolidate the set of properties in a single place. Extend it
      to silence the above warnings. And use it in the various tests that
      start pseries machines.
      Reported-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Message-Id: <158059697130.1820292.7823434132030453110.stgit@bahia.lan>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      [dwg: Correct minor grammatical error]
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      63d57c8f
    • R
      target/ppc: Use probe_write for DCBZ · 4dcf078f
      Richard Henderson 提交于
      Using probe_write instead of tlb_vaddr_to_host means that we
      process watchpoints and notdirty pages more efficiently.
      Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20200129235040.24022-5-richard.henderson@linaro.org>
      Tested-by: NHoward Spoelstra <hsp.cat7@gmail.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      4dcf078f
    • R
      target/ppc: Remove redundant mask in DCBZ · 1cbddf6d
      Richard Henderson 提交于
      The value of addr has already been masked, just above.
      Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20200129235040.24022-4-richard.henderson@linaro.org>
      Tested-by: NHoward Spoelstra <hsp.cat7@gmail.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      1cbddf6d
    • R
      target/ppc: Use probe_access for LMW, STMW · 2ca2ef49
      Richard Henderson 提交于
      Use a minimum number of mmu lookups for the contiguous bytes
      that are accessed.  If the lookup succeeds, we can finish the
      operation with host addresses only.
      Reported-by: NHoward Spoelstra <hsp.cat7@gmail.com>
      Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20200129235040.24022-3-richard.henderson@linaro.org>
      Tested-by: NHoward Spoelstra <hsp.cat7@gmail.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      2ca2ef49
    • R
      target/ppc: Use probe_access for LSW, STSW · bb99b391
      Richard Henderson 提交于
      Use a minimum number of mmu lookups for the contiguous bytes
      that are accessed.  If the lookup succeeds, we can finish the
      operation with host addresses only.
      Reported-by: NHoward Spoelstra <hsp.cat7@gmail.com>
      Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20200129235040.24022-2-richard.henderson@linaro.org>
      Tested-by: NHoward Spoelstra <hsp.cat7@gmail.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      bb99b391
    • A
      ppc: spapr: Activate the FWNMI functionality · e0aeef7a
      Aravinda Prasad 提交于
      This patch sets the default value of SPAPR_CAP_FWNMI_MCE
      to SPAPR_CAP_ON for machine type 5.0.
      Signed-off-by: NAravinda Prasad <arawinda.p@gmail.com>
      Signed-off-by: NGanesh Goudar <ganeshgr@linux.ibm.com>
      Message-Id: <20200130184423.20519-8-ganeshgr@linux.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      e0aeef7a
    • A
      migration: Include migration support for machine check handling · 2500fb42
      Aravinda Prasad 提交于
      This patch includes migration support for machine check
      handling. Especially this patch blocks VM migration
      requests until the machine check error handling is
      complete as these errors are specific to the source
      hardware and is irrelevant on the target hardware.
      Signed-off-by: NAravinda Prasad <arawinda.p@gmail.com>
      [Do not set FWNMI cap in post_load, now its done in .apply hook]
      Signed-off-by: NGanesh Goudar <ganeshgr@linux.ibm.com>
      Message-Id: <20200130184423.20519-7-ganeshgr@linux.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      2500fb42
    • A
      ppc: spapr: Handle "ibm,nmi-register" and "ibm,nmi-interlock" RTAS calls · f03496bc
      Aravinda Prasad 提交于
      This patch adds support in QEMU to handle "ibm,nmi-register"
      and "ibm,nmi-interlock" RTAS calls.
      
      The machine check notification address is saved when the
      OS issues "ibm,nmi-register" RTAS call.
      
      This patch also handles the case when multiple processors
      experience machine check at or about the same time by
      handling "ibm,nmi-interlock" call. In such cases, as per
      PAPR, subsequent processors serialize waiting for the first
      processor to issue the "ibm,nmi-interlock" call. The second
      processor that also received a machine check error waits
      till the first processor is done reading the error log.
      The first processor issues "ibm,nmi-interlock" call
      when the error log is consumed.
      Signed-off-by: NAravinda Prasad <arawinda.p@gmail.com>
      [Register fwnmi RTAS calls in core_rtas_register_types()
       where other RTAS calls are registered]
      Signed-off-by: NGanesh Goudar <ganeshgr@linux.ibm.com>
      Message-Id: <20200130184423.20519-6-ganeshgr@linux.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      f03496bc
    • A
      target/ppc: Build rtas error log upon an MCE · 81fe70e4
      Aravinda Prasad 提交于
      Upon a machine check exception (MCE) in a guest address space,
      KVM causes a guest exit to enable QEMU to build and pass the
      error to the guest in the PAPR defined rtas error log format.
      
      This patch builds the rtas error log, copies it to the rtas_addr
      and then invokes the guest registered machine check handler. The
      handler in the guest takes suitable action(s) depending on the type
      and criticality of the error. For example, if an error is
      unrecoverable memory corruption in an application inside the
      guest, then the guest kernel sends a SIGBUS to the application.
      For recoverable errors, the guest performs recovery actions and
      logs the error.
      Signed-off-by: NAravinda Prasad <arawinda.p@gmail.com>
      [Assume SLOF has allocated enough room for rtas error log]
      Signed-off-by: NGanesh Goudar <ganeshgr@linux.ibm.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Message-Id: <20200130184423.20519-5-ganeshgr@linux.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      81fe70e4
    • A
      target/ppc: Handle NMI guest exit · 9ac703ac
      Aravinda Prasad 提交于
      Memory error such as bit flips that cannot be corrected
      by hardware are passed on to the kernel for handling.
      If the memory address in error belongs to guest then
      the guest kernel is responsible for taking suitable action.
      Patch [1] enhances KVM to exit guest with exit reason
      set to KVM_EXIT_NMI in such cases. This patch handles
      KVM_EXIT_NMI exit.
      
      [1] https://www.spinics.net/lists/kvm-ppc/msg12637.html
          (e20bbd3d and related commits)
      Signed-off-by: NAravinda Prasad <arawinda.p@gmail.com>
      Signed-off-by: NGanesh Goudar <ganeshgr@linux.ibm.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Message-Id: <20200130184423.20519-4-ganeshgr@linux.ibm.com>
      [dwg: #ifdefs to fix compile for 32-bit target]
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      9ac703ac
    • A
      ppc: spapr: Introduce FWNMI capability · 9d953ce4
      Aravinda Prasad 提交于
      Introduce fwnmi an spapr capability and add a helper function
      which tries to enable it, which would be used by following patch
      of the series. This patch by itself does not change the existing
      behavior.
      Signed-off-by: NAravinda Prasad <arawinda.p@gmail.com>
      [eliminate cap_ppc_fwnmi, add fwnmi cap to migration state
       and reprhase the commit message]
      Signed-off-by: NGanesh Goudar <ganeshgr@linux.ibm.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Message-Id: <20200130184423.20519-3-ganeshgr@linux.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      9d953ce4
    • A
      Wrapper function to wait on condition for the main loop mutex · 19e067e0
      Aravinda Prasad 提交于
      Introduce a wrapper function to wait on condition for
      the main loop mutex. This function atomically releases
      the main loop mutex and causes the calling thread to
      block on the condition. This wrapper is required because
      qemu_global_mutex is a static variable.
      Signed-off-by: NAravinda Prasad <arawinda.p@gmail.com>
      Signed-off-by: NGanesh Goudar <ganeshgr@linux.ibm.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Message-Id: <20200130184423.20519-2-ganeshgr@linux.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      19e067e0
    • B
      target/ppc/cpu.h: Put macro parameter in parentheses · 25458103
      BALATON Zoltan 提交于
      Fix PPC_INPUT macro to work with more complex expressions by
      protecting its argument with parentheses.
      Signed-off-by: NBALATON Zoltan <balaton@eik.bme.hu>
      Message-Id: <20200130021619.65FAB747871@zero.eik.bme.hu>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      25458103
    • D
      spapr: Enable DD2.3 accelerated count cache flush in pseries-5.0 machine · 37965dfe
      David Gibson 提交于
      For POWER9 DD2.2 cpus, the best current Spectre v2 indirect branch
      mitigation is "count cache disabled", which is configured with:
          -machine cap-ibs=fixed-ccd
      However, this option isn't available on DD2.3 CPUs with KVM, because they
      don't have the count cache disabled.
      
      For POWER9 DD2.3 cpus, it is "count cache flush with assist", configured
      with:
          -machine cap-ibs=workaround,cap-ccf-assist=on
      However this option isn't available on DD2.2 CPUs with KVM, because they
      don't have the special CCF assist instruction this relies on.
      
      On current machine types, we default to "count cache flush w/o assist",
      that is:
          -machine cap-ibs=workaround,cap-ccf-assist=off
      This runs, with mitigation on both DD2.2 and DD2.3 host cpus, but has a
      fairly significant performance impact.
      
      It turns out we can do better.  The special instruction that CCF assist
      uses to trigger a count cache flush is a no-op on earlier CPUs, rather than
      trapping or causing other badness.  It doesn't, of itself, implement the
      mitigation, but *if* we have count-cache-disabled, then the count cache
      flush is unnecessary, and so using the count cache flush mitigation is
      harmless.
      
      Therefore for the new pseries-5.0 machine type, enable cap-ccf-assist by
      default.  Along with that, suppress throwing an error if cap-ccf-assist
      is selected but KVM doesn't support it, as long as KVM *is* giving us
      count-cache-disabled.  To allow TCG to work out of the box, even though it
      doesn't implement the ccf flush assist, downgrade the error in that case to
      a warning.  This matches several Spectre mitigations where we allow TCG
      to operate for debugging, since we don't really make guarantees about TCG
      security properties anyway.
      
      While we're there, make the TCG warning for this case match that for other
      mitigations.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Tested-by: NMichael Ellerman <mpe@ellerman.id.au>
      37965dfe
  3. 02 2月, 2020 4 次提交
    • C
      ppc/pnv: change the PowerNV machine devices to be non user creatable · 23a782eb
      Cédric Le Goater 提交于
      The PowerNV machine emulates an OpenPOWER system and the PowerNV chip
      devices are models of the internal logic of the POWER processor. They
      can not be instantiated by the user on the QEMU command line.
      
      The PHB3/PHB4 devices could be an exception in the future after some
      rework on how the device tree is built. For the moment, exclude them
      also.
      Signed-off-by: NCédric Le Goater <clg@kaod.org>
      Message-Id: <20200129113720.7404-1-clg@kaod.org>
      Tested-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      23a782eb
    • C
      ppc/pnv: Add models for POWER8 PHB3 PCIe Host bridge · 9ae1329e
      Cédric Le Goater 提交于
      This is a model of the PCIe Host Bridge (PHB3) found on a POWER8
      processor. It includes the PowerBus logic interface (PBCQ), IOMMU
      support, a single PCIe Gen.3 Root Complex, and support for MSI and LSI
      interrupt sources as found on a POWER8 system using the XICS interrupt
      controller.
      
      The POWER8 processor comes in different flavors: Venice, Murano,
      Naple, each having a different number of PHBs. To make things simpler,
      the models provides 3 PHB3 per chip. Some platforms, like the
      Firestone, can also couple PHBs on the first chip to provide more
      bandwidth but this is too specific to model in QEMU.
      
      XICS requires some adjustment to support the PHB3 MSI. The changes are
      provided here but they could be decoupled in prereq patches.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NCédric Le Goater <clg@kaod.org>
      Message-Id: <20200127144506.11132-3-clg@kaod.org>
      [dwg: Use device_class_set_props()]
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      9ae1329e
    • B
      ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge · 4f9924c4
      Benjamin Herrenschmidt 提交于
      These changes introduces models for the PCIe Host Bridge (PHB4) of the
      POWER9 processor. It includes the PowerBus logic interface (PBCQ),
      IOMMU support, a single PCIe Gen.4 Root Complex, and support for MSI
      and LSI interrupt sources as found on a POWER9 system using the XIVE
      interrupt controller.
      
      POWER9 processor comes with 3 PHB4 PEC (PCI Express Controller) and
      each PEC can have several PHBs. By default,
      
        * PEC0 provides 1 PHB  (PHB0)
        * PEC1 provides 2 PHBs (PHB1 and PHB2)
        * PEC2 provides 3 PHBs (PHB3, PHB4 and PHB5)
      
      Each PEC has a set  "global" registers and some "per-stack" (per-PHB)
      registers. Those are organized in two XSCOM ranges, the "Nest" range
      and the "PCI" range, each range contains both some "PEC" registers and
      some "per-stack" registers.
      
      No default device layout is provided and PCI devices can be added on
      any of the available PCIe Root Port (pcie.0 .. 2 of a Power9 chip)
      with address 0x0 as the firwware (skiboot) only accepts a single
      device per root port. To run a simple system with a network and a
      storage adapters, use a command line options such as :
      
        -device e1000e,netdev=net0,mac=C0:FF:EE:00:00:02,bus=pcie.0,addr=0x0
        -netdev bridge,id=net0,helper=/usr/libexec/qemu-bridge-helper,br=virbr0,id=hostnet0
      
        -device megasas,id=scsi0,bus=pcie.1,addr=0x0
        -drive file=$disk,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none
        -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=2
      
      If more are needed, include a bridge.
      
      Multi chip is supported, each chip adding its set of PHB4 controllers
      and its PCI busses. The model doesn't emulate the EEH error handling.
      
      This model is not ready for hotplug yet.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      [ clg: - numerous cleanups
             - commit log
             - fix for broken LSI support
             - PHB pic printinfo
             - large QOM rework ]
      Signed-off-by: NCédric Le Goater <clg@kaod.org>
      Message-Id: <20200127144506.11132-2-clg@kaod.org>
      [dwg: Use device_class_set_props()]
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      4f9924c4
    • M
      docs/specs/tpm: reST-ify TPM documentation · 6e8a3ff6
      Marc-André Lureau 提交于
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: NStefan Berger <stefanb@linux.ibm.com>
      Message-Id: <20200121152935.649898-7-stefanb@linux.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      6e8a3ff6