1. 29 3月, 2019 8 次提交
    • D
      exec: Only count mapped memory backends for qemu_getrampagesize() · 7d5489e6
      David Gibson 提交于
      qemu_getrampagesize() works out the minimum host page size backing any of
      guest RAM.  This is required in a few places, such as for POWER8 PAPR KVM
      guests, because limitations of the hardware virtualization mean the guest
      can't use pagesizes larger than the host pages backing its memory.
      
      However, it currently checks against *every* memory backend, whether or not
      it is actually mapped into guest memory at the moment.  This is incorrect.
      
      This can cause a problem attempting to add memory to a POWER8 pseries KVM
      guest which is configured to allow hugepages in the guest (e.g.
      -machine cap-hpt-max-page-size=16m).  If you attempt to add non-hugepage,
      you can (correctly) create a memory backend, however it (correctly) will
      throw an error when you attempt to map that memory into the guest by
      'device_add'ing a pc-dimm.
      
      What's not correct is that if you then reset the guest a startup check
      against qemu_getrampagesize() will cause a fatal error because of the new
      memory object, even though it's not mapped into the guest.
      
      This patch corrects the problem by adjusting find_max_supported_pagesize()
      (called from qemu_getrampagesize() via object_child_foreach) to exclude
      non-mapped memory backends.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Acked-by: NDavid Hildenbrand <david@redhat.com>
      7d5489e6
    • C
      spapr/irq: Add XIVE sanity checks on non-P9 machines · 273fef83
      Cédric Le Goater 提交于
      On non-P9 machines, the XIVE interrupt mode is not advertised, see
      spapr_dt_ov5_platform_support(). Add a couple of checks on the machine
      configuration to filter bogus setups and prevent OS failures :
      
                           Interrupt modes
      
        CPU/Compat      XICS    XIVE                dual
      
         P8/P8          OK      QEMU failure (1)    OK (3)
         P9/P8          OK      QEMU failure (2)    OK (3)
         P9/P9          OK      OK                  OK
      
        (1) CPU exception model is incompatible with XIVE and the presenters
            will fail to realize.
      
        (2) CPU exception model is compatible with XIVE, but the XIVE CAS
            advertisement is dropped when in POWER8 mode. So we could ended up
            booting with the XIVE DT properties but without the HCALLs. Avoid
            confusing Linux with such settings and fail under QEMU.
      
        (3) force XICS in machine init
      
      Remove the check on XIVE-only machines in spapr_machine_init(), which
      has now become redundant.
      Signed-off-by: NCédric Le Goater <clg@kaod.org>
      Message-Id: <20190328100044.11408-1-clg@kaod.org>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      273fef83
    • D
      spapr: Simplify handling of host-serial and host-model values · 0a794529
      David Gibson 提交于
      27461d69 "ppc: add host-serial and host-model machine attributes
      (CVE-2019-8934)" introduced 'host-serial' and 'host-model' machine
      properties for spapr to explicitly control the values advertised to the
      guest in device tree properties with the same names.
      
      The previous behaviour on KVM was to unconditionally populate the device
      tree with the real host serial number and model, which leaks possibly
      sensitive information about the host to the guest.
      
      To maintain compatibility for old machine types, we allowed those props
      to be set to "passthrough" to take the value from the host as before.  Or
      they could be set to "none" to explicitly omit the device tree items.
      
      Special casing specific values on what's otherwise a user supplied string
      is very ugly.  So, this patch simplifies things by implementing the
      backwards compatibility in a different way: we have a machine class flag
      set for the older machines, and we only load the host values into the
      device tree if A) they're not set by the user and B) we have that flag set.
      
      This does mean that the "passthrough" functionality is no longer available
      with the current machine type.  That's ok though: if a user or management
      layer really wants the information passed through they can read it
      themselves (OpenStack Nova already does something similar for x86).
      
      It also means the user can't explicitly ask for the values to be omitted
      on the old machine types.  I think that's an acceptable trade-off: if you
      care enough about not leaking the host information you can either move to
      the new machine type, or use a dummy value for the properties.
      
      For the new machine type, this also removes an odd inconsistency
      between running on a POWER and non-POWER (or non-Linux) hosts: if the
      host information couldn't be read from where we expect (in the host's
      device tree as exposed by Linux), we'd fallback to omitting the guest
      device tree items.
      
      While we're there, improve some poorly worded comments, and the help text
      for the properties.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Tested-by: NGreg Kurz <groug@kaod.org>
      0a794529
    • G
      target/ppc: Fix QEMU crash with stxsdx · 3e5365b7
      Greg Kurz 提交于
      I've been hitting several QEMU crashes while running a fedora29 ppc64le
      guest under TCG. Each time, this would occur several minutes after the
      guest reached login:
      
      Fedora 29 (Twenty Nine)
      Kernel 4.20.6-200.fc29.ppc64le on an ppc64le (hvc0)
      
      Web console: https://localhost:9090/
      
      localhost login:
      tcg/tcg.c:3211: tcg fatal error
      
      This happens because a bug crept up in the gen_stxsdx() helper when it
      was converted to use VSR register accessors by commit 8b3b2d75
      "target/ppc: introduce get_cpu_vsr{l,h}() and set_cpu_vsr{l,h}() helpers
      for VSR register access".
      
      The code creates a temporary, passes it directly to gen_qemu_st64_i64()
      and then to set_cpu_vrsh()... which looks like this was mistakenly
      coded as a load instead of a store.
      
      Reverse the logic: read the VSR to the temporary first and then store
      it to memory.
      
      Fixes: 8b3b2d75Signed-off-by: NGreg Kurz <groug@kaod.org>
      Message-Id: <155371035249.2038502.12364252604337688538.stgit@bahia.lan>
      Reviewed-by: NMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      3e5365b7
    • G
      target/ppc: Improve comment of bcctr used for spectre v2 mitigation · 15d68c5e
      Greg Kurz 提交于
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Message-Id: <155359567174.1794128.3183997593369465355.stgit@bahia.lan>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      15d68c5e
    • G
      target/ppc: Consolidate 64-bit server processor detection in a helper · d0db7cad
      Greg Kurz 提交于
      We use PPC_SEGMENT_64B in various places to guard code that is specific
      to 64-bit server processors compliant with arch 2.x. Consolidate the
      logic in a helper macro with an explicit name.
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Message-Id: <155327783157.1283071.3747129891004927299.stgit@bahia.lan>
      Tested-by: NSuraj Jitindar Singh <sjitindarsingh@gmail.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      d0db7cad
    • G
      target/ppc: Enable "decrement and test CTR" version of bcctr · fa200c95
      Greg Kurz 提交于
      Even if all ISAs up to v3 indeed mention:
      
          If the "decrement and test CTR" option is specified (BO2=0), the
          instruction form is invalid.
      
      The UMs of all existing 64-bit server class processors say:
      
          If BO[2] = 0, the contents of CTR (before any update) are used as the
          target address and for the test of the contents of CTR to resolve the
          branch. The contents of the CTR are then decremented and written back
          to the CTR.
      
      The linux kernel has spectre v2 mitigation code that relies on a
      BO[2] = 0 variant of bcctr, which is now activated by default on
      spapr, even with TCG. This causes linux guests to panic with
      the default machine type under TCG.
      
      Since any CPU model can provide its own behaviour for invalid forms,
      we could possibly introduce a new instruction flag to handle this.
      In practice, since the behaviour is shared by all 64-bit server
      processors starting with 970 up to POWER9, let's reuse the
      PPC_SEGMENT_64B flag. Caveat: this may have to be fixed later if
      POWER10 introduces a different behaviour.
      
      The existing behaviour of throwing a program interrupt is kept for
      all other CPU models.
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Message-Id: <155327782604.1283071.10640596307206921951.stgit@bahia.lan>
      Tested-by: NSuraj Jitindar Singh <sjitindarsingh@gmail.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      fa200c95
    • G
      target/ppc: Fix TCG temporary leaks in gen_bcond() · 9acc95cd
      Greg Kurz 提交于
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Message-Id: <155327782047.1283071.10234727692461848972.stgit@bahia.lan>
      Tested-by: NSuraj Jitindar Singh <sjitindarsingh@gmail.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      9acc95cd
  2. 28 3月, 2019 5 次提交
    • P
      Merge remote-tracking branch 'remotes/alistair/tags/pull-device-tree-20190327' into staging · a04d91c7
      Peter Maydell 提交于
      Device Tree Pull Request for 4.0
      
      A single patch updating the MAINTAINERS file for 4.0.
      
      # gpg: Signature made Wed 27 Mar 2019 17:02:00 GMT
      # gpg:                using RSA key F6C4AC46D4934868D3B8CE8F21E10D29DF977054
      # gpg: Good signature from "Alistair Francis <alistair@alistair23.me>" [full]
      # Primary key fingerprint: F6C4 AC46 D493 4868 D3B8  CE8F 21E1 0D29 DF97 7054
      
      * remotes/alistair/tags/pull-device-tree-20190327:
        MAINTAINERS: Update the device tree maintainers
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      a04d91c7
    • P
      Merge remote-tracking branch 'remotes/otubo/tags/pull-seccomp-20190327' into staging · 12f067cc
      Peter Maydell 提交于
      pull-seccomp-20190327
      
      # gpg: Signature made Wed 27 Mar 2019 12:12:39 GMT
      # gpg:                using RSA key DF32E7C0F0FFF9A2
      # gpg: Good signature from "Eduardo Otubo (Senior Software Engineer) <otubo@redhat.com>" [full]
      # Primary key fingerprint: D67E 1B50 9374 86B4 0723  DBAB DF32 E7C0 F0FF F9A2
      
      * remotes/otubo/tags/pull-seccomp-20190327:
        seccomp: report more useful errors from seccomp
        seccomp: don't kill process for resource control syscalls
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      12f067cc
    • P
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · 84bdc58c
      Peter Maydell 提交于
      * Kconfig improvements (msi_nonbroken, imply for default PCI devices)
      * intel-iommu: sharing passthrough FlatViews (Peter)
      * Fix for SEV with VFIO (Brijesh)
      * Allow compilation without CONFIG_PARALLEL (Thomas)
      
      # gpg: Signature made Thu 21 Mar 2019 16:42:24 GMT
      # gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
      # gpg:                issuer "pbonzini@redhat.com"
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
      # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
      #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
      
      * remotes/bonzini/tags/for-upstream: (23 commits)
        virtio-vga: only enable for specific boards
        config-all-devices.mak: rebuild on reconfigure
        minikconf: fix parser typo
        intel-iommu: optimize nodmar memory regions
        test-announce-self: convert to qgraph
        hw/alpha/Kconfig: DP264 hardware requires e1000 network card
        hw/hppa/Kconfig: Dino board requires e1000 network card
        hw/sh4/Kconfig: r2d machine requires the rtl8139 network card
        hw/ppc/Kconfig: e500 based machines require virtio-net-pci device
        hw/ppc/Kconfig: Bamboo machine requires e1000 network card
        hw/mips/Kconfig: Fulong 2e board requires ati-vga/rtl8139 PCI devices
        hw/mips/Kconfig: Malta machine requires the pcnet network card
        hw/i386/Kconfig: enable devices that can be created by default
        hw/isa/Kconfig: PIIX4 southbridge requires USB UHCI
        hw/isa/Kconfig: i82378 SuperIO requires PC speaker device
        prep: do not select I82374
        hw/i386/Kconfig: PC uses I8257, not I82374
        hw/char/parallel: Make it possible to compile also without CONFIG_PARALLEL
        target/i386: sev: Do not pin the ram device memory region
        memory: Fix the memory region type assignment order
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      
      # Conflicts:
      #	hw/rdma/Makefile.objs
      #	hw/riscv/sifive_plic.c
      84bdc58c
    • P
      Merge remote-tracking branch 'remotes/xtensa/tags/20190326-xtensa' into staging · 2fc8d6f8
      Peter Maydell 提交于
      target/xtensa fixes for v4.0:
      
      - fix translation of FLIX bundles with multiple references to the same
        register;
      - don't announce exit simcall;
      - clean up tests/tcg/xtensa.
      
      # gpg: Signature made Tue 26 Mar 2019 17:58:59 GMT
      # gpg:                using RSA key 2B67854B98E5327DCDEB17D851F9CC91F83FA044
      # gpg:                issuer "jcmvbkbc@gmail.com"
      # gpg: Good signature from "Max Filippov <filippov@cadence.com>" [unknown]
      # gpg:                 aka "Max Filippov <max.filippov@cogentembedded.com>" [full]
      # gpg:                 aka "Max Filippov <jcmvbkbc@gmail.com>" [full]
      # Primary key fingerprint: 2B67 854B 98E5 327D CDEB  17D8 51F9 CC91 F83F A044
      
      * remotes/xtensa/tags/20190326-xtensa:
        tests/tcg/xtensa: clean up test set
        target/xtensa: don't announce exit simcall
        target/xtensa: fix break_dependency for repeated resources
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      2fc8d6f8
    • A
      MAINTAINERS: Update the device tree maintainers · c3c962c1
      Alistair Francis 提交于
      Remove Alex as a Device Tree maintainer as requested by him. Add myself
      as a maintainer to avoid it being orphaned. Also add David as a
      Reviewer (R) as he is the libfdt and DTC maintainer.
      Signed-off-by: NAlistair Francis <alistair.francis@wdc.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NAlexander Graf <agraf@csgraf.de>
      Acked-by: NDavid Gibson <david@gibson.dropbear.id.au>
      c3c962c1
  3. 27 3月, 2019 3 次提交
  4. 26 3月, 2019 24 次提交