Skip to content
Snippets Groups Projects
  1. Feb 09, 2022
  2. Feb 08, 2022
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20220208' into staging · 0a301624
      Peter Maydell authored
      
      target-arm queue:
       * Fix handling of SVE ZCR_LEN when using VHE
       * xlnx-zynqmp: 'Or' the QSPI / QSPI DMA IRQs
       * Don't ever enable PSCI when booting guest in EL3
       * Adhere to SMCCC 1.3 section 5.2
       * highbank: Fix issues with booting SMP
       * midway: Fix issues booting at all
       * boot: Drop existing dtb /psci node rather than retaining it
       * versal-virt: Always call arm_load_kernel()
       * force flag recalculation when messing with DAIF
       * hw/timer/armv7m_systick: Update clock source before enabling timer
       * hw/arm/smmuv3: Fix device reset
       * hw/intc/arm_gicv3_its: refactorings and minor bug fixes
       * hw/sensor: Add lsm303dlhc magnetometer device
      
      # gpg: Signature made Tue 08 Feb 2022 11:39:15 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-target-arm-20220208: (39 commits)
        hw/sensor: Add lsm303dlhc magnetometer device
        hw/intc/arm_gicv3_its: Split error checks
        hw/intc/arm_gicv3_its: Don't allow intid 1023 in MAPI/MAPTI
        hw/intc/arm_gicv3_its: In MAPC with V=0, don't check rdbase field
        hw/intc/arm_gicv3_its: Drop TableDesc and CmdQDesc valid fields
        hw/intc/arm_gicv3_its: Make update_ite() use ITEntry
        hw/intc/arm_gicv3_its: Pass ITE values back from get_ite() via a struct
        hw/intc/arm_gicv3_its: Avoid nested ifs in get_ite()
        hw/intc/arm_gicv3_its: Fix address calculation in get_ite() and update_ite()
        hw/intc/arm_gicv3_its: Pass CTEntry to update_cte()
        hw/intc/arm_gicv3_its: Keep CTEs as a struct, not a raw uint64_t
        hw/intc/arm_gicv3_its: Pass DTEntry to update_dte()
        hw/intc/arm_gicv3_its: Keep DTEs as a struct, not a raw uint64_t
        hw/intc/arm_gicv3_its: Use address_space_map() to access command queue packets
        hw/arm/smmuv3: Fix device reset
        hw/timer/armv7m_systick: Update clock source before enabling timer
        arm: force flag recalculation when messing with DAIF
        hw/arm: versal-virt: Always call arm_load_kernel()
        hw/arm/boot: Drop existing dtb /psci node rather than retaining it
        hw/arm/boot: Drop nb_cpus field from arm_boot_info
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      0a301624
    • Kevin Townsend's avatar
      hw/sensor: Add lsm303dlhc magnetometer device · 4fd1ebb1
      Kevin Townsend authored
      
      This commit adds emulation of the magnetometer on the LSM303DLHC.
      It allows the magnetometer's X, Y and Z outputs to be set via the
      mag-x, mag-y and mag-z properties, as well as the 12-bit
      temperature output via the temperature property. Sensor can be
      enabled with 'CONFIG_LSM303DLHC_MAG=y'.
      
      Signed-off-by: default avatarKevin Townsend <kevin.townsend@linaro.org>
      Message-id: 20220130095032.35392-1-kevin.townsend@linaro.org
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      4fd1ebb1
    • Peter Maydell's avatar
      hw/intc/arm_gicv3_its: Split error checks · d7d359c4
      Peter Maydell authored
      
      In most of the ITS command processing, we check different error
      possibilities one at a time and log them appropriately. In
      process_mapti() and process_mapd() we have code which checks
      multiple error cases at once, which means the logging is less
      specific than it could be. Split those cases up.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220201193207.2771604-14-peter.maydell@linaro.org
      d7d359c4
    • Peter Maydell's avatar
      hw/intc/arm_gicv3_its: Don't allow intid 1023 in MAPI/MAPTI · 33302414
      Peter Maydell authored
      
      When handling MAPI/MAPTI, we allow the supplied interrupt ID to be
      either 1023 or something in the valid LPI range.  This is a mistake:
      only a real valid LPI is allowed.  (The general behaviour of the ITS
      is that most interrupt ID fields require a value in the LPI range;
      the exception is that fields specifying a doorbell value, which are
      all in GICv4 commands, allow also 1023 to mean "no doorbell".)
      Remove the condition that incorrectly allows 1023 here.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220201193207.2771604-13-peter.maydell@linaro.org
      33302414
    • Peter Maydell's avatar
      hw/intc/arm_gicv3_its: In MAPC with V=0, don't check rdbase field · 84d43d2e
      Peter Maydell authored
      
      In the MAPC command, if V=0 this is a request to delete a collection
      table entry and the rdbase field of the command packet will not be
      used.  In particular, the specification says that the "UNPREDICTABLE
      if rdbase is not valid" only applies for V=1.
      
      We were doing a check-and-log-guest-error on rdbase regardless of
      whether the V bit was set, and also (harmlessly but confusingly)
      storing the contents of the rdbase field into the updated collection
      table entry.  Update the code so that if V=0 we don't check or use
      the rdbase field value.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220201193207.2771604-12-peter.maydell@linaro.org
      84d43d2e
    • Peter Maydell's avatar
      hw/intc/arm_gicv3_its: Drop TableDesc and CmdQDesc valid fields · da4680ce
      Peter Maydell authored
      
      Currently we track in the TableDesc and CmdQDesc structs the state of
      the GITS_BASER<n> and GITS_CBASER Valid bits.  However we aren't very
      consistent abut checking the valid field: we test it in update_cte()
      and update_dte(), but not anywhere else we look things up in tables.
      
      The GIC specification says that it is UNPREDICTABLE if a guest fails
      to set any of these Valid bits before enabling the ITS via
      GITS_CTLR.Enabled.  So we can choose to handle Valid == 0 as
      equivalent to a zero-length table.  This is in fact how we're already
      catching this case in most of the table-access paths: when Valid is 0
      we leave the num_entries fields in TableDesc or CmdQDesc set to zero,
      and then the out-of-bounds check "index >= num_entries" that we have
      to do anyway before doing any of these table lookups will always be
      true, catching the no-valid-table case without any extra code.
      
      So we can remove the checks on the valid field from update_cte()
      and update_dte(): since these happen after the bounds check there
      was never any case when the test could fail. That means the valid
      fields would be entirely unused, so just remove them.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220201193207.2771604-11-peter.maydell@linaro.org
      da4680ce
    • Peter Maydell's avatar
      hw/intc/arm_gicv3_its: Make update_ite() use ITEntry · 7eb54267
      Peter Maydell authored
      
      Make the update_ite() struct use the new ITEntry struct, so that
      callers don't need to assemble the in-memory ITE data themselves, and
      only get_ite() and update_ite() need to care about that in-memory
      layout.  We can then drop the no-longer-used IteEntry struct
      definition.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220201193207.2771604-10-peter.maydell@linaro.org
      7eb54267
    • Peter Maydell's avatar
      hw/intc/arm_gicv3_its: Pass ITE values back from get_ite() via a struct · 244194fe
      Peter Maydell authored
      
      In get_ite() we currently return the caller some of the fields of an
      Interrupt Table Entry via a set of pointer arguments, and validate
      some of them internally (interrupt type and valid bit) to return a
      simple true/false 'valid' indication. Define a new ITEntry struct
      which has all the fields that the in-memory ITE has, and bring the
      get_ite() function in to line with get_dte() and get_cte().
      
      This paves the way for handling virtual interrupts, which will want
      a different subset of the fields in the ITE. Handling them under
      the old "lots of pointer arguments" scheme would have meant a
      confusingly large set of arguments for this function.
      
      The new struct ITEntry is obviously confusably similar to the
      existing IteEntry struct, whose fields are the raw 12 bytes
      of the in-memory ITE. In the next commit we will make update_ite()
      use ITEntry instead of IteEntry, which will allow us to delete
      the IteEntry struct and remove the confusion.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220201193207.2771604-9-peter.maydell@linaro.org
      244194fe
    • Peter Maydell's avatar
      hw/intc/arm_gicv3_its: Avoid nested ifs in get_ite() · 2954b93f
      Peter Maydell authored
      
      The get_ite() code has some awkward nested if statements; clean
      them up by returning early if the memory accesses fail.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220201193207.2771604-8-peter.maydell@linaro.org
      2954b93f
    • Peter Maydell's avatar
      hw/intc/arm_gicv3_its: Fix address calculation in get_ite() and update_ite() · a1ce993d
      Peter Maydell authored
      
      In get_ite() and update_ite() we work with a 12-byte in-guest-memory
      table entry, which we intend to handle as an 8-byte value followed by
      a 4-byte value.  Unfortunately the calculation of the address of the
      4-byte value is wrong, because we write it as:
      
       table_base_address + (index * entrysize) + 4
      (obfuscated by the way the expression has been written)
      
      when it should be + 8.  This bug meant that we overwrote the top
      bytes of the 8-byte value with the 4-byte value.  There are no
      guest-visible effects because the top half of the 8-byte value
      contains only the doorbell interrupt field, which is used only in
      GICv4, and the two bugs in the "write ITE" and "read ITE" codepaths
      cancel each other out.
      
      We can't simply change the calculation, because this would break
      migration of a (TCG) guest from the old version of QEMU which had
      in-guest-memory interrupt tables written using the buggy version of
      update_ite().  We must also at the same time change the layout of the
      fields within the ITE_L and ITE_H values so that the in-memory
      locations of the fields we care about (VALID, INTTYPE, INTID and
      ICID) stay the same.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220201193207.2771604-7-peter.maydell@linaro.org
      a1ce993d
    • Peter Maydell's avatar
      hw/intc/arm_gicv3_its: Pass CTEntry to update_cte() · 06985cc3
      Peter Maydell authored
      
      Make update_cte() take a CTEntry struct rather than all the fields
      of the new CTE as separate arguments.
      
      This brings it into line with the update_dte() API.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220201193207.2771604-6-peter.maydell@linaro.org
      06985cc3
    • Peter Maydell's avatar
      hw/intc/arm_gicv3_its: Keep CTEs as a struct, not a raw uint64_t · d37cf49b
      Peter Maydell authored
      
      In the ITS, a CTE is an entry in the collection table, which contains
      multiple fields. Currently the function get_cte() which reads one
      entry from the device table returns a success/failure boolean and
      passes back the raw 64-bit integer CTE value via a pointer argument.
      We then extract fields from the CTE as we need them.
      
      Create a real C struct with the same fields as the CTE, and
      populate it in get_cte(), so that that function and update_cte()
      are the only ones which need to care about the in-guest-memory
      format of the CTE.
      
      This brings get_cte()'s API into line with get_dte().
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220201193207.2771604-5-peter.maydell@linaro.org
      d37cf49b
    • Peter Maydell's avatar
      hw/intc/arm_gicv3_its: Pass DTEntry to update_dte() · 22d62b08
      Peter Maydell authored
      
      Make update_dte() take a DTEntry struct rather than all the fields of
      the new DTE as separate arguments.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220201193207.2771604-4-peter.maydell@linaro.org
      22d62b08
    • Peter Maydell's avatar
      hw/intc/arm_gicv3_its: Keep DTEs as a struct, not a raw uint64_t · 4acf93e1
      Peter Maydell authored
      
      In the ITS, a DTE is an entry in the device table, which contains
      multiple fields. Currently the function get_dte() which reads one
      entry from the device table returns it as a raw 64-bit integer,
      which we then pass around in that form, only extracting fields
      from it as we need them.
      
      Create a real C struct with the same fields as the DTE, and
      populate it in get_dte(), so that that function and update_dte()
      are the only ones that need to care about the in-guest-memory
      format of the DTE.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220201193207.2771604-3-peter.maydell@linaro.org
      4acf93e1
    • Peter Maydell's avatar
      hw/intc/arm_gicv3_its: Use address_space_map() to access command queue packets · b6f96009
      Peter Maydell authored
      
      Currently the ITS accesses each 8-byte doubleword in a 4-doubleword
      command packet with a separate address_space_ldq_le() call.  This is
      awkward because the individual command processing functions have
      ended up with code to handle "load more doublewords out of the
      packet", which is both unwieldy and also a potential source of bugs
      because it's not obvious when looking at a line that pulls a field
      out of the 'value' variable which of the 4 doublewords that variable
      currently holds.
      
      Switch to using address_space_map() to map the whole command packet
      at once and fish the four doublewords out of it.  Then each process_*
      function can start with a few lines of code that extract the fields
      it cares about.
      
      This requires us to split out the guts of process_its_cmd() into a
      new do_process_its_cmd(), because we were previously overloading the
      value and offset arguments as a backdoor way to directly pass the
      devid and eventid from a write to GITS_TRANSLATER.  The new
      do_process_its_cmd() takes those arguments directly, and
      process_its_cmd() is just a wrapper that does the "read fields from
      command packet" part.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220201193207.2771604-2-peter.maydell@linaro.org
      b6f96009
    • Eric Auger's avatar
      hw/arm/smmuv3: Fix device reset · 43530095
      Eric Auger authored
      
      We currently miss a bunch of register resets in the device reset
      function. This sometimes prevents the guest from rebooting after
      a system_reset (with virtio-blk-pci). For instance, we may get
      the following errors:
      
      invalid STE
      smmuv3-iommu-memory-region-0-0 translation failed for iova=0x13a9d2000(SMMU_EVT_C_BAD_STE)
      Invalid read at addr 0x13A9D2000, size 2, region '(null)', reason: rejected
      invalid STE
      smmuv3-iommu-memory-region-0-0 translation failed for iova=0x13a9d2000(SMMU_EVT_C_BAD_STE)
      Invalid write at addr 0x13A9D2000, size 2, region '(null)', reason: rejected
      invalid STE
      
      Signed-off-by: default avatarEric Auger <eric.auger@redhat.com>
      Message-id: 20220202111602.627429-1-eric.auger@redhat.com
      Fixes: 10a83cb9 ("hw/arm/smmuv3: Skeleton")
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      43530095
    • Richard Petri's avatar
      hw/timer/armv7m_systick: Update clock source before enabling timer · 77cd9971
      Richard Petri authored
      
      Starting the SysTick timer and changing the clock source a the same time
      will result in an error, if the previous clock period was zero. For exmaple,
      on the mps2-tz platforms, no refclk is present. Right after reset, the
      configured ptimer period is zero, and trying to enabling it will turn it off
      right away. E.g., code running on the platform setting
      
          SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk;
      
      should change the clock source and enable the timer on real hardware, but
      resulted in an error in qemu.
      
      Signed-off-by: default avatarRichard Petri <git@rpls.de>
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 20220201192650.289584-1-git@rpls.de
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      77cd9971
    • Alex Bennée's avatar
      arm: force flag recalculation when messing with DAIF · c737d868
      Alex Bennée authored
      
      The recently introduced debug tests in kvm-unit-tests exposed an error
      in our handling of singlestep cause by stale hflags. This is caught by
      --enable-debug-tcg when running the tests.
      
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reported-by: default avatarAndrew Jones <drjones@redhat.com>
      Tested-by: default avatarAndrew Jones <drjones@redhat.com>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220202122353.457084-1-alex.bennee@linaro.org
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      c737d868
    • Edgar E. Iglesias's avatar
      hw/arm: versal-virt: Always call arm_load_kernel() · 40874a38
      Edgar E. Iglesias authored
      
      Always call arm_load_kernel() regardless of kernel_filename being
      set. This is needed because arm_load_kernel() sets up reset for
      the CPUs.
      
      Fixes: 6f16da53 (hw/arm: versal: Add a virtual Xilinx Versal board)
      Reported-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarEdgar E. Iglesias <edgar.iglesias@xilinx.com>
      Message-id: 20220130110313.4045351-2-edgar.iglesias@gmail.com
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      40874a38
    • Peter Maydell's avatar
      hw/arm/boot: Drop existing dtb /psci node rather than retaining it · e4b0bb80
      Peter Maydell authored
      
      If we're using PSCI emulation, we add a /psci node to the device tree
      we pass to the guest.  At the moment, if the dtb already has a /psci
      node in it, we retain it, rather than replacing it. (This behaviour
      was added in commit c39770cd in 2018.)
      
      This is a problem if the existing node doesn't match our PSCI
      emulation.  In particular, it might specify the wrong method (HVC vs
      SMC), or wrong function IDs for cpu_suspend/cpu_off/etc, in which
      case the guest will not get the behaviour it wants when it makes PSCI
      calls.
      
      An example of this is trying to boot the highbank or midway board
      models using the device tree supplied in the kernel sources: this
      device tree includes a /psci node that specifies function IDs that
      don't match the (PSCI 0.2 compliant) IDs that QEMU uses.  The dtb
      cpu_suspend function ID happens to match the PSCI 0.2 cpu_off ID, so
      the guest hangs after booting when the kernel tries to idle the CPU
      and instead it gets turned off.
      
      Instead of retaining an existing /psci node, delete it entirely
      and replace it with a node whose properties match QEMU's PSCI
      emulation behaviour. This matches the way we handle /memory nodes,
      where we also delete any existing nodes and write in ones that
      match the way QEMU is going to behave.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: default avatarNiek Linnenbank <nieklinnenbank@gmail.com>
      Tested-by: default avatarEdgar E. Iglesias <edgar.iglesias@xilinx.com>
      Tested-by: default avatarCédric Le Goater <clg@kaod.org>
      Tested-by: default avatarNiek Linnenbank <nieklinnenbank@gmail.com>
      Message-id: 20220127154639.2090164-17-peter.maydell@linaro.org
      e4b0bb80
    • Peter Maydell's avatar
      hw/arm/boot: Drop nb_cpus field from arm_boot_info · d6dc926e
      Peter Maydell authored
      
      We use the arm_boot_info::nb_cpus field in only one place, and that
      place can easily get the number of CPUs locally rather than relying
      on the board code to have set the field correctly.  (At least one
      board, xlnx-versal-virt, does not set the field despite having more
      than one CPU.)
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: default avatarNiek Linnenbank <nieklinnenbank@gmail.com>
      Tested-by: default avatarCédric Le Goater <clg@kaod.org>
      Tested-by: default avatarNiek Linnenbank <nieklinnenbank@gmail.com>
      Message-id: 20220127154639.2090164-16-peter.maydell@linaro.org
      d6dc926e
    • Peter Maydell's avatar
      hw/arm/highbank: Drop unused secondary boot stub code · 45dd668f
      Peter Maydell authored
      
      The highbank and midway board code includes boot-stub code for
      handling secondary CPU boot which keeps the secondaries in a pen
      until the primary writes to a known location with the address they
      should jump to.
      
      This code is never used, because the boards enable QEMU's PSCI
      emulation, so secondary CPUs are kept powered off until the PSCI call
      which turns them on, and then start execution from the address given
      by the guest in that PSCI call.  Delete the unreachable code.
      
      (The code was wrong for midway in any case -- on the Cortex-A15 the
      GIC CPU interface registers are at a different offset from PERIPHBASE
      compared to the Cortex-A9, and the code baked-in the offsets for
      highbank's A9.)
      
      Note that this commit implicitly depends on the preceding "Don't
      write secondary boot stub if using PSCI" commit -- the default
      secondary-boot stub code overlaps with one of the highbank-specific
      bootcode rom blobs, so we must suppress the secondary-boot
      stub code entirely, not merely replace the highbank-specific
      version with the default.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: default avatarNiek Linnenbank <nieklinnenbank@gmail.com>
      Tested-by: default avatarCédric Le Goater <clg@kaod.org>
      Tested-by: default avatarNiek Linnenbank <nieklinnenbank@gmail.com>
      Message-id: 20220127154639.2090164-15-peter.maydell@linaro.org
      45dd668f
    • Peter Maydell's avatar
      hw/arm/boot: Don't write secondary boot stub if using PSCI · d4a29ed6
      Peter Maydell authored
      
      If we're using PSCI emulation to start secondary CPUs, there is no
      point in writing the "secondary boot" stub code, because it will
      never be used -- secondary CPUs start powered-off, and when powered
      on are set to begin execution at the address specified by the guest's
      power-on PSCI call, not at the stub.
      
      Move the call to the hook that writes the secondary boot stub code so
      that we can do it only if we're starting a Linux kernel and not using
      PSCI.
      
      (None of the users of the hook care about the ordering of its call
      relative to anything else: they only use it to write a rom blob to
      guest memory.)
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: default avatarNiek Linnenbank <nieklinnenbank@gmail.com>
      Tested-by: default avatarCédric Le Goater <clg@kaod.org>
      Tested-by: default avatarNiek Linnenbank <nieklinnenbank@gmail.com>
      Message-id: 20220127154639.2090164-14-peter.maydell@linaro.org
      d4a29ed6
Loading