Skip to content
Snippets Groups Projects
  1. Jan 14, 2022
  2. Jan 13, 2022
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging · 67b6526c
      Peter Maydell authored
      
      * configure and meson cleanups
      * KVM_GET/SET_SREGS2 support for x86
      
      # gpg: Signature made Wed 12 Jan 2022 13:09:19 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-gitlab/tags/for-upstream:
        meson: reenable filemonitor-inotify compilation
        meson: build all modules by default
        configure: do not create roms/seabios/config.mak if SeaBIOS not present
        tests/tcg: Fix target-specific Makefile variables path for user-mode
        KVM: x86: ignore interrupt_bitmap field of KVM_GET/SET_SREGS
        KVM: use KVM_{GET|SET}_SREGS2 when supported.
        meson: add comments in the target-specific flags section
        configure, meson: move config-poison.h to meson
        meson: build contrib/ executables after generated headers
        configure: move non-command-line variables away from command-line parsing section
        configure: parse --enable/--disable-strip automatically, flip default
        configure, makefile: remove traces of really old files
        configure: do not set bsd_user/linux_user early
        configure: simplify creation of plugin symbol list
        block/file-posix: Simplify the XFS_IOC_DIOINFO handling
        meson: cleanup common-user/ build
        user: move common-user includes to a subdirectory of {bsd,linux}-user/
        meson: reuse common_user_inc when building files specific to user-mode emulators
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      67b6526c
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/legoater/tags/pull-ppc-20220112' into staging · f8d75e10
      Peter Maydell authored
      
      ppc 7.0 queue:
      
      * New SLOF for PPC970 and POWER5+ (Alexey)
      * Fixes for POWER5+ pseries (Cedric)
      * Updates of documentation (Leonardo and Thomas)
      * First step of exception model cleanup (Fabiano)
      * User created PHB3/PHB4 devices (Daniel and Cedric)
      
      # gpg: Signature made Wed 12 Jan 2022 10:43:21 GMT
      # gpg:                using RSA key A0F66548F04895EBFE6B0B6051A343C7CFFBECA1
      # gpg: Good signature from "Cédric Le Goater <clg@kaod.org>" [undefined]
      # gpg: WARNING: This key is not certified with a trusted signature!
      # gpg:          There is no indication that the signature belongs to the owner.
      # Primary key fingerprint: A0F6 6548 F048 95EB FE6B  0B60 51A3 43C7 CFFB ECA1
      
      * remotes/legoater/tags/pull-ppc-20220112: (34 commits)
        ppc/pnv: use stack->pci_regs[] in pnv_pec_stk_pci_xscom_write()
        ppc/pnv: turn pnv_phb4_update_regions() into static
        ppc/pnv: Introduce user creatable pnv-phb4 devices
        ppc/pnv: turn 'phb' into a pointer in struct PnvPhb4PecStack
        ppc/pnv: move PHB4 XSCOM init to phb4_realize()
        ppc/pnv: set phb4 properties in stk_realize()
        pnv_phb4_pec: use pnv_phb4_pec_get_phb_id() in pnv_pec_dt_xscom()
        pnv_phb4_pec.c: move pnv_pec_phb_offset() to pnv_phb4.c
        pnv_phb4.c: change TYPE_PNV_PHB4_ROOT_BUS name
        pnv_phb3.h: change TYPE_PNV_PHB3_ROOT_BUS name
        ppc/pnv: Move num_phbs under Pnv8Chip
        ppc/pnv: Complete user created PHB3 devices
        ppc/pnv: Reparent user created PHB3 devices to the PnvChip
        ppc/pnv: Introduce support for user created PHB3 devices
        pnv_phb4.c: check if root port exists in rc_config functions
        pnv_phb4.c: make pnv-phb4-root-port user creatable
        ppc/pnv: Attach PHB3 root port device when defaults are enabled
        pnv_phb4.c: add unique chassis and slot for pnv_phb4_root_port
        pnv_phb3.c: add unique chassis and slot for pnv_phb3_root_port
        target/ppc: Set the correct endianness for powernv memory dumps
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      f8d75e10
  3. Jan 12, 2022
    • Volker Rümelin's avatar
      meson: reenable filemonitor-inotify compilation · 9d30c78c
      Volker Rümelin authored
      Reenable util/filemonitor-inotify compilation. Compilation was
      disabled when commit a620fbe9 ("configure: convert compiler tests
      to meson, part 5") moved CONFIG_INOTIFY1 from config-host.mak to
      config-host.h.
      
      This fixes the usb-mtp device and reenables test-util-filemonitor.
      
      Fixes: a620fbe9 ("configure: convert compiler tests to meson, part 5")
      Resolves: https://gitlab.com/qemu-project/qemu/-/issues/800
      
      
      Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
      Message-Id: <20220107133514.7785-1-vr_qemu@t-online.de>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9d30c78c
    • Paolo Bonzini's avatar
      meson: build all modules by default · fb72176b
      Paolo Bonzini authored
      With more recent versions of Meson, the build.ninja file is more selective
      as to what is built by default, and not building the modules results in test
      failures.
      
      Mark the modules as built-by-default and, to make the dependencies more
      precise, also require them to be up-to-date before running tests.
      
      Resolves: https://gitlab.com/qemu-project/qemu/-/issues/801
      
      
      Tested-by: default avatarLi Zhang <lizhang@suse.de>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      fb72176b
    • Paolo Bonzini's avatar
      configure: do not create roms/seabios/config.mak if SeaBIOS not present · bb7cb3ad
      Paolo Bonzini authored
      
      If roms/seabios/Makefile is not present, the configure script
      is not creating the roms/seabios directory anymore (commit
      5dce7b8d, "configure: remove DIRS", 2021-12-18); thus, creating
      roms/seabios/config.mak fails.
      
      The easiest thing to do is to not create the file, since it will not
      be used.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      bb7cb3ad
    • Philippe Mathieu-Daudé's avatar
      tests/tcg: Fix target-specific Makefile variables path for user-mode · 533b0a1a
      Philippe Mathieu-Daudé authored
      
      Commit 812b31d3 refactor missed to update this path.
      
      Fixes: 812b31d3 ("configs: rename default-configs to configs and reorganise")
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20211226001541.3807919-1-f4bug@amsat.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      533b0a1a
    • Paolo Bonzini's avatar
      KVM: x86: ignore interrupt_bitmap field of KVM_GET/SET_SREGS · 1520f8bb
      Paolo Bonzini authored
      
      This is unnecessary, because the interrupt would be retrieved and queued
      anyway by KVM_GET_VCPU_EVENTS and KVM_SET_VCPU_EVENTS respectively,
      and it makes the flow more similar to the one for KVM_GET/SET_SREGS2.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      1520f8bb
    • Maxim Levitsky's avatar
      KVM: use KVM_{GET|SET}_SREGS2 when supported. · 8f515d38
      Maxim Levitsky authored
      
      This allows to make PDPTRs part of the migration
      stream and thus not reload them after migration which
      is against X86 spec.
      
      Signed-off-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
      Message-Id: <20211101132300.192584-2-mlevitsk@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      8f515d38
    • Paolo Bonzini's avatar
    • Paolo Bonzini's avatar
      configure, meson: move config-poison.h to meson · eed56e9a
      Paolo Bonzini authored
      
      This ensures that the file is regenerated properly whenever config-target.h
      or config-devices.h files change.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      eed56e9a
    • Paolo Bonzini's avatar
      meson: build contrib/ executables after generated headers · b962a1d5
      Paolo Bonzini authored
      
      This will be needed as soon as config-poison.h moves from configure to
      a meson custom_target (which is built at "ninja" time).
      
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b962a1d5
    • Paolo Bonzini's avatar
      configure: move non-command-line variables away from command-line parsing section · 3b0d8643
      Paolo Bonzini authored
      
      This makes it easier to identify candidates for moving to Meson.
      
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      3b0d8643
    • Paolo Bonzini's avatar
      configure: parse --enable/--disable-strip automatically, flip default · a70248db
      Paolo Bonzini authored
      
      Always include the STRIP variable in config-host.mak (it's only used
      by the s390-ccw firmware build, and it adds a default if configure
      omitted it), and use meson-buildoptions.sh to turn
      --enable/--disable-strip into -Dstrip.
      
      The default is now not to strip the binaries like for almost every other
      package that has a configure script.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      a70248db
    • Paolo Bonzini's avatar
      configure, makefile: remove traces of really old files · 9da9be2c
      Paolo Bonzini authored
      
      These files have been removed for more than year in the best
      case, or for more than ten years for some really old TCG files.
      Remove any traces of it.
      
      Acked-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9da9be2c
    • Paolo Bonzini's avatar
      configure: do not set bsd_user/linux_user early · b915a2f1
      Paolo Bonzini authored
      
      Similar to other optional features, leave the variables empty and compute
      the actual value later.  Use the existence of include or source directories
      to detect whether an OS or CPU supports respectively bsd-user and linux-user.
      
      For now, BSD user-mode emulation is buildable even on TCI-only
      architectures.  This probably will change once safe signals are
      brought over from linux-user.
      
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b915a2f1
    • Paolo Bonzini's avatar
      configure: simplify creation of plugin symbol list · 37650689
      Paolo Bonzini authored
      
      --dynamic-list is present on all supported ELF (not Windows or Darwin)
      platforms, since it dates back to 2006; -exported_symbols_list is
      likewise present on all supported versions of macOS.  Do not bother
      doing a functional test in configure.
      
      Remove the file creation from configure as well: for Darwin, move the
      the creation of the Darwin-formatted symbols to meson; for ELF, use the
      file in the source path directly and switch from -Wl, to -Xlinker to
      not break weird paths that include a comma.
      
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      37650689
    • Thomas Huth's avatar
      block/file-posix: Simplify the XFS_IOC_DIOINFO handling · a5730b8b
      Thomas Huth authored
      
      The handling for the XFS_IOC_DIOINFO ioctl is currently quite excessive:
      This is not a "real" feature like the other features that we provide with
      the "--enable-xxx" and "--disable-xxx" switches for the configure script,
      since this does not influence lots of code (it's only about one call to
      xfsctl() in file-posix.c), so people don't gain much with the ability to
      disable this with "--disable-xfsctl".
      It's also unfortunate that the ioctl will be disabled on Linux in case
      the user did not install the right xfsprogs-devel package before running
      configure. Thus let's simplify this by providing the ioctl definition
      on our own, so we can completely get rid of the header dependency and
      thus the related code in the configure script.
      
      Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <20211215125824.250091-1-thuth@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      a5730b8b
    • Paolo Bonzini's avatar
      meson: cleanup common-user/ build · 9d24fb73
      Paolo Bonzini authored
      
      It is not necessary to have a separate static_library just for common_user
      files; using the one that already covers the rest of common_ss is enough
      unless you need to reuse some source files between emulators and tests.
      Just place common files for all user-mode emulators in common_ss,
      similar to what is already done for softmmu_ss in full system emulators.
      
      The only disadvantage is that the include_directories under bsd-user/include/
      and linux-user/include/ are now enabled for all targets rather than only
      user mode emulators.  This however is not different from how include/sysemu/
      is available when building user mode emulators.
      
      Tested-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9d24fb73
    • Paolo Bonzini's avatar
      user: move common-user includes to a subdirectory of {bsd,linux}-user/ · 05a24871
      Paolo Bonzini authored
      
      Avoid polluting the compilation of common-user/ with local include files;
      making an include file available to common-user/ should be a deliberate
      decision in order to keep a clear interface that can be used by both
      bsd-user/ and linux-user/.
      
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      05a24871
    • Paolo Bonzini's avatar
    • Peter Maydell's avatar
      Merge remote-tracking branch... · 91f5f7a5
      Peter Maydell authored
      Merge remote-tracking branch 'remotes/lvivier-gitlab/tags/linux-user-for-7.0-pull-request' into staging
      
      linux-user pull request 20220111
      siginfo_t cleanup
      more prtctl() update
      target_struct.h cleanup
      
      # gpg: Signature made Tue 11 Jan 2022 19:52:20 GMT
      # gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
      # gpg:                issuer "laurent@vivier.eu"
      # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
      # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
      # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
      # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
      
      * remotes/lvivier-gitlab/tags/linux-user-for-7.0-pull-request: (30 commits)
        linux-user: Implement capability prctls
        linux-user: Implement PR_SET_PDEATHSIG
        linux-user: Map signal number in PR_GET_PDEATHSIG
        linux-user: Do not special-case NULL for PR_GET_PDEATHSIG
        linux-user: Move target_struct.h generic definitions to generic/
        linux-user/arm: Move target_oabi_flock64 out of target_structs.h
        linux-user/xtensa: Use force_sig_fault
        linux-user/sparc: Use force_sig_fault
        linux-user/sh4: Use force_sig_fault
        linux-user/s390x: Use force_sig_fault
        linux-user/riscv: Use force_sig_fault
        linux-user/ppc: Use force_sig_fault
        linux-user/openrisc: Use force_sig_fault
        target/mips: Extract trap code into env->error_code
        target/mips: Extract break code into env->error_code
        linux-user/mips: Use force_sig_fault
        linux-user/mips: Improve do_break
        linux-user/microblaze: Fix SIGFPE si_codes
        linux-user/microblaze: Use force_sig_fault
        linux-user/m68k: Use force_sig_fault
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      91f5f7a5
    • Daniel Henrique Barboza's avatar
      ppc/pnv: use stack->pci_regs[] in pnv_pec_stk_pci_xscom_write() · f83460bb
      Daniel Henrique Barboza authored
      
      pnv_pec_stk_pci_xscom_write() is pnv_pec_stk_pci_xscom_ops write
      callback. It writes values into regs in the stack->nest_regs[] array.
      The pnv_pec_stk_pci_xscom_read read callback, on the other hand, returns
      values of the stack->pci_regs[]. In fact, at this moment, the only use
      of stack->pci_regs[] is in pnv_pec_stk_pci_xscom_read(). There's no code
      that is written anything in stack->pci_regs[], which is suspicious.
      
      Considering that stack->nest_regs[] is widely used by the nested
      MemoryOps pnv_pec_stk_nest_xscom_ops, in both read and write callbacks,
      the conclusion is that we're writing the wrong array in
      pnv_pec_stk_pci_xscom_write(). This function should write stack->pci_regs[]
      instead.
      
      Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Reviewed-by: default avatarFrederic Barrat <fbarrat@linux.ibm.com>
      Message-Id: <20220111200132.633896-2-danielhb413@gmail.com>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      f83460bb
    • Daniel Henrique Barboza's avatar
      ppc/pnv: turn pnv_phb4_update_regions() into static · 7e1e0912
      Daniel Henrique Barboza authored
      
      Its only callers are inside pnv_phb4.c.
      
      Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
      Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Message-Id: <20220111131027.599784-6-danielhb413@gmail.com>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      7e1e0912
    • Daniel Henrique Barboza's avatar
      ppc/pnv: Introduce user creatable pnv-phb4 devices · 5bc67b05
      Daniel Henrique Barboza authored
      
      This patch introduces pnv-phb4 user creatable devices that are created
      in a similar manner as pnv-phb3 devices, allowing the user to interact
      with the PHBs directly instead of creating PCI Express Controllers that
      will create a certain amount of PHBs per controller index.
      
      We accomplish this by doing the following:
      
      - add a pnv_phb4_get_stack() helper to retrieve which stack an user
      created phb4 would occupy;
      
      - when dealing with an user created pnv-phb4 (detected by checking if
      phb->stack is NULL at the start of phb4_realize()), retrieve its stack
      and initialize its properties as done in stk_realize();
      
      - use 'defaults_enabled()' in stk_realize() to avoid creating and
      initializing a 'stack->phb' qdev that might be overwritten by an user
      created pnv-phb4 device. This process is wrapped into a new helper
      called pnv_pec_stk_default_phb_realize().
      
      Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
      Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Message-Id: <20220111131027.599784-5-danielhb413@gmail.com>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      5bc67b05
    • Daniel Henrique Barboza's avatar
      ppc/pnv: turn 'phb' into a pointer in struct PnvPhb4PecStack · dc8e2914
      Daniel Henrique Barboza authored
      
      At this moment, stack->phb is the plain PnvPHB4 device itself instead of
      a pointer to the device. This will present a problem when adding user
      creatable devices because we can't deal with this struct and the
      realize() callback from the user creatable device.
      
      We can't get rid of this attribute, similar to what we did when enabling
      pnv-phb3 user creatable devices, because pnv_phb4_update_regions() needs
      to access stack->phb to do its job. This function is called twice in
      pnv_pec_stk_update_map(), which is one of the nested xscom write
      callbacks (via pnv_pec_stk_nest_xscom_write()). In fact,
      pnv_pec_stk_update_map() code comment is explicit about how the order of
      the unmap/map operations relates with the PHB subregions.
      
      All of this indicates that this code is tied together in a way that we
      either go on a crusade, featuring lots of refactories and redesign and
      considerable pain, to decouple stack and phb mapping, or we allow stack
      update_map operations to access the associated PHB as it is today even
      after introducing pnv-phb4 user devices.
      
      This patch chooses the latter. Instead of getting rid of stack->phb,
      turn it into a PHB pointer. This will allow us to assign an user created
      PHB to an existing stack later. In this process,
      pnv_pec_stk_instance_init() is removed because stack->phb is being
      initialized in stk_realize() instead.
      
      Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
      Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Message-Id: <20220111131027.599784-4-danielhb413@gmail.com>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      dc8e2914
    • Daniel Henrique Barboza's avatar
      ppc/pnv: move PHB4 XSCOM init to phb4_realize() · 3d2adf17
      Daniel Henrique Barboza authored
      
      The 'stack->phb_regs_mr' PHB4 passthrough XSCOM initialization relies on
      'stack->phb' being not NULL. Moving 'stack->phb_regs_mr' region_init()
      and add_subregion() to phb4_realize() time is a natural thing to do
      since it's strictly PHB related.
      
      The remaining XSCOM initialization is also related to 'stack->phb' but
      in a different manner. For instance, 'stack->nest_regs_mr'
      MemoryRegionOps, 'pnv_pec_stk_nest_xscom_ops', uses
      pnv_pec_stk_nest_xscom_write() as a write callback. When trying to write
      the PEC_NEST_STK_BAR_EN reg, pnv_pec_stk_update_map() is called. Inside
      this function, pnv_phb4_update_regions() is called twice. This function
      uses 'stack->phb' to manipulate memory regions of the phb.
      
      This is not a problem now but, when enabling user creatable phb4s, a
      stack that doesn't have an associated phb (i.e. stack->phb = NULL) it
      will cause a SIGINT during boot in pnv_phb4_update_regions().
      
      All this can be avoided if all XSCOM realize is moved to phb4_realize(),
      when we have certainty about the existence of 'stack->phb'. A lot of
      code was moved from pnv_phb4_pec.c to pnv_phb4.c due to static constant
      and variables being used but the cleaner logic is worth the trouble.
      
      Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
      Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Message-Id: <20220111131027.599784-3-danielhb413@gmail.com>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      3d2adf17
    • Daniel Henrique Barboza's avatar
      ppc/pnv: set phb4 properties in stk_realize() · b580713a
      Daniel Henrique Barboza authored
      
      Moving all phb4 properties setup to stk_realize() keeps this logic in
      a single place instead of having it scattered between stk_realize() and
      pec_realize().
      
      'phb->index' can be retrieved using stack->stack_no and
      pnv_phb4_pec_get_phb_id(), deprecating the use of 'phb-id' alias that
      was being used for this purpose in pec_realize().
      
      Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
      Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Message-Id: <20220111131027.599784-2-danielhb413@gmail.com>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      b580713a
    • Daniel Henrique Barboza's avatar
      pnv_phb4_pec: use pnv_phb4_pec_get_phb_id() in pnv_pec_dt_xscom() · d22b0c94
      Daniel Henrique Barboza authored
      
      Relying on stack->phb to write the xscom DT of the PEC is something that
      we won't be able to do with user creatable pnv-phb4 devices.
      
      Hopefully, this can be done by using pnv_phb4_pec_get_phb_id(), which is
      already used by pnv_pec_realize() to set the phb-id of the stack. Use
      the same idea in pnv_pec_dt_xscom() to write ibm,phb-index without the
      need to accessing stack->phb, since stack->phb is not granted to be !=
      NULL when user creatable phbs are introduced.
      
      Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
      Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Message-Id: <20220110143346.455901-4-danielhb413@gmail.com>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      d22b0c94
    • Daniel Henrique Barboza's avatar
      pnv_phb4_pec.c: move pnv_pec_phb_offset() to pnv_phb4.c · 5032f5d7
      Daniel Henrique Barboza authored
      
      The logic inside pnv_pec_phb_offset() will be useful in the next patch
      to determine the stack that should contain a PHB4 device.
      
      Move the function to pnv_phb4.c and make it public since there's no
      pnv_phb4_pec.h header. While we're at it, add 'stack_index' as a
      parameter and make the function return 'phb-id' directly. And rename it
      to pnv_phb4_pec_get_phb_id() to be even clearer about the function
      intent.
      
      Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
      Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Message-Id: <20220110143346.455901-3-danielhb413@gmail.com>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      5032f5d7
    • Daniel Henrique Barboza's avatar
      pnv_phb4.c: change TYPE_PNV_PHB4_ROOT_BUS name · 45157581
      Daniel Henrique Barboza authored
      
      Similar to what was happening with pnv-phb3 buses,
      TYPE_PNV_PHB4_ROOT_BUS set to "pnv-phb4-root-bus" is a bit too long for
      a default root bus name. The usual default name for theses buses in QEMU
      are 'pcie', but we want to make a distinction between pnv-phb4 buses and
      other PCIE buses, at least as far as default name goes, because not all
      PCIE devices are attachable to a pnv-phb4 root-bus type.
      
      Changing the default to 'pnv-phb4-root' allow us to have a shorter name
      while making this bus distinct, and the user can always set its own bus
      naming via the "id" attribute anyway.
      
      This is the 'info qtree' output after this change, using a powernv9
      domain with 2 sockets and default settings enabled:
      
      qemu-system-ppc64 -m 4G -machine powernv9,accel=tcg \
           -smp 2,sockets=2,cores=1,threads=1
      
        dev: pnv-phb4, id ""
          index = 5 (0x5)
          chip-id = 1 (0x1)
          version = 704374636546 (0xa400000002)
          device-id = 1217 (0x4c1)
          x-config-reg-migration-enabled = true
          bypass-iommu = false
          bus: pnv-phb4-root.11
            type pnv-phb4-root
            dev: pnv-phb4-root-port, id ""
      (...)
        dev: pnv-phb4, id ""
          index = 0 (0x0)
          chip-id = 1 (0x1)
          version = 704374636546 (0xa400000002)
          device-id = 1217 (0x4c1)
          x-config-reg-migration-enabled = true
          bypass-iommu = false
          bus: pnv-phb4-root.6
            type pnv-phb4-root
            dev: pnv-phb4-root-port, id ""
      (..)
        dev: pnv-phb4, id ""
          index = 5 (0x5)
          chip-id = 0 (0x0)
          version = 704374636546 (0xa400000002)
          device-id = 1217 (0x4c1)
          x-config-reg-migration-enabled = true
          bypass-iommu = false
          bus: pnv-phb4-root.5
            type pnv-phb4-root
            dev: pnv-phb4-root-port, id ""
      (...)
        dev: pnv-phb4, id ""
          index = 0 (0x0)
          chip-id = 0 (0x0)
          version = 704374636546 (0xa400000002)
          device-id = 1217 (0x4c1)
          x-config-reg-migration-enabled = true
          bypass-iommu = false
          bus: pnv-phb4-root.0
            type pnv-phb4-root
            dev: pnv-phb4-root-port, id ""
      
      Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
      Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Message-Id: <20220110143346.455901-11-danielhb413@gmail.com>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      45157581
    • Daniel Henrique Barboza's avatar
      pnv_phb3.h: change TYPE_PNV_PHB3_ROOT_BUS name · 41cb8d31
      Daniel Henrique Barboza authored
      
      The TYPE_PNV_PHB3_ROOT_BUS name is used as the default bus name when
      the dev has no 'id'. However, pnv-phb3-root-bus is a bit too long to be
      used as a bus name.
      
      Most common QEMU buses and PCI controllers are named based on their bus
      type (e.g. pSeries spapr-pci-host-bridge is called 'pci'). The most
      common name for a PCIE bus controller in QEMU is 'pcie'. Naming it
      'pcie' would break the documented use of the pnv-phb3 device, since
      'pcie.0' would now refer to the root bus instead of the first root port.
      
      There's nothing particularly wrong with the 'root-bus' name used before,
      aside from the fact that 'root-bus' is being used for pnv-phb3 and
      pnv-phb4 created buses, which is not quite correct since these buses
      aren't implemented the same way in QEMU - you can't plug a
      pnv-phb4-root-port into a pnv-phb3 root bus, for example.
      
      This patch renames it as 'pnv-phb3-root', which is a compromise between
      the existing and the previously used name. Creating 3 phbs without ID
      will result in an "info qtree" output similar to this:
      
      bus: main-system-bus
        type System
        dev: pnv-phb3, id ""
          index = 2 (0x2)
          chip-id = 0 (0x0)
          x-config-reg-migration-enabled = true
          bypass-iommu = false
          bus: pnv-phb3-root.2
            type pnv-phb3-root
      (...)
        dev: pnv-phb3, id ""
          index = 1 (0x1)
          chip-id = 0 (0x0)
          x-config-reg-migration-enabled = true
          bypass-iommu = false
          bus: pnv-phb3-root.1
            type pnv-phb3-root
      (...)
        dev: pnv-phb3, id ""
          index = 0 (0x0)
          chip-id = 0 (0x0)
          x-config-reg-migration-enabled = true
          bypass-iommu = false
          bus: pnv-phb3-root.0
            type pnv-phb3-root
      
      Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Message-Id: <20220105212338.49899-11-danielhb413@gmail.com>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      41cb8d31
Loading