Skip to content
Snippets Groups Projects
  1. Aug 04, 2020
  2. Aug 03, 2020
    • Peter Maydell's avatar
      hw/intc/armv7m_nvic: Provide default "reset the system" behaviour for SYSRESETREQ · 9e60d759
      Peter Maydell authored
      
      The NVIC provides an outbound qemu_irq "SYSRESETREQ" which it signals
      when the guest sets the SYSRESETREQ bit in the AIRCR register.  This
      matches the hardware design (where the CPU has a signal of this name
      and it is up to the SoC to connect that up to an actual reset
      mechanism), but in QEMU it mostly results in duplicated code in SoC
      objects and bugs where SoC model implementors forget to wire up the
      SYSRESETREQ line.
      
      Provide a default behaviour for the case where SYSRESETREQ is not
      actually connected to anything: use qemu_system_reset_request() to
      perform a system reset.  This will allow us to remove the
      implementations of SYSRESETREQ handling from the boards where that's
      exactly what it does, and also fixes the bugs in the board models
      which forgot to wire up the signal:
      
       * microbit
       * mps2-an385
       * mps2-an505
       * mps2-an511
       * mps2-an521
       * musca-a
       * musca-b1
       * netduino
       * netduinoplus2
      
      We still allow the board to wire up the signal if it needs to, in case
      we need to model more complicated reset controller logic or to model
      buggy SoC hardware which forgot to wire up the line itself. But
      defaulting to "reset the system" is more often going to be correct
      than defaulting to "do nothing".
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-id: 20200728103744.6909-3-peter.maydell@linaro.org
      9e60d759
    • Peter Maydell's avatar
      include/hw/irq.h: New function qemu_irq_is_connected() · faf7c6de
      Peter Maydell authored
      
      Mostly devices don't need to care whether one of their output
      qemu_irq lines is connected, because functions like qemu_set_irq()
      silently do nothing if there is nothing on the other end.  However
      sometimes a device might want to implement default behaviour for the
      case where the machine hasn't wired the line up to anywhere.
      
      Provide a function qemu_irq_is_connected() that devices can use for
      this purpose.  (The test is trivial but encapsulating it in a
      function makes it easier to see where we're doing it in case we need
      to change the implementation later.)
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-id: 20200728103744.6909-2-peter.maydell@linaro.org
      faf7c6de
  3. Jul 27, 2020
    • Laurent Vivier's avatar
      virtio-pci: fix virtio_pci_queue_enabled() · 0c9753eb
      Laurent Vivier authored
      
      In legacy mode, virtio_pci_queue_enabled() falls back to
      virtio_queue_enabled() to know if the queue is enabled.
      
      But virtio_queue_enabled() calls again virtio_pci_queue_enabled()
      if k->queue_enabled is set. This ends in a crash after a stack
      overflow.
      
      The problem can be reproduced with
      "-device virtio-net-pci,disable-legacy=off,disable-modern=true
       -net tap,vhost=on"
      
      And a look to the backtrace is very explicit:
      
          ...
          #4  0x000000010029a438 in virtio_queue_enabled ()
          #5  0x0000000100497a9c in virtio_pci_queue_enabled ()
          ...
          #130902 0x000000010029a460 in virtio_queue_enabled ()
          #130903 0x0000000100497a9c in virtio_pci_queue_enabled ()
          #130904 0x000000010029a460 in virtio_queue_enabled ()
          #130905 0x0000000100454a20 in vhost_net_start ()
          ...
      
      This patch fixes the problem by introducing a new function
      for the legacy case and calls it from virtio_pci_queue_enabled().
      It also calls it from virtio_queue_enabled() to avoid code duplication.
      
      Fixes: f19bcdfe ("virtio-pci: implement queue_enabled method")
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Cindy Lu <lulu@redhat.com>
      CC: Michael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarLaurent Vivier <lvivier@redhat.com>
      Message-Id: <20200727153319.43716-1-lvivier@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      0c9753eb
    • Hogan Wang's avatar
      hw/pci-host: save/restore pci host config register · 2ebc2121
      Hogan Wang authored
      
      The pci host config register is used to save PCI address for
      read/write config data. If guest writes a value to config register,
      and then QEMU pauses the vcpu to migrate, after the migration, the guest
      will continue to write pci config data, and the write data will be ignored
      because of new qemu process losing the config register state.
      
      To trigger the bug:
      1. guest is booting in seabios.
      2. guest enables the SMRAM in seabios:piix4_apmc_smm_setup, and then
         expects to disable the SMRAM by pci_config_writeb.
      3. after guest writes the pci host config register, QEMU pauses vcpu
         to finish migration.
      4. guest write of config data(0x0A) fails to disable the SMRAM because
         the config register state is lost.
      5. guest continues to boot and crashes in ipxe option ROM due to SMRAM
         in enabled state.
      
      Example Reproducer:
      
      step 1. Make modifications to seabios and qemu for increase reproduction
      efficiency, write 0xf0 to 0x402 port notify qemu to stop vcpu after
      0x0cf8 port wrote i440 configure register. qemu stop vcpu when catch
      0x402 port wrote 0xf0.
      
      seabios:/src/hw/pci.c
      @@ -52,6 +52,11 @@ void pci_config_writeb(u16 bdf, u32 addr, u8 val)
               writeb(mmconfig_addr(bdf, addr), val);
           } else {
               outl(ioconfig_cmd(bdf, addr), PORT_PCI_CMD);
      +       if (bdf == 0 && addr == 0x72 && val == 0xa) {
      +            dprintf(1, "stop vcpu\n");
      +            outb(0xf0, 0x402); // notify qemu to stop vcpu
      +            dprintf(1, "resume vcpu\n");
      +        }
               outb(val, PORT_PCI_DATA + (addr & 3));
           }
       }
      
      qemu:hw/char/debugcon.c
      @@ -60,6 +61,9 @@ static void debugcon_ioport_write(void *opaque, hwaddr addr, uint64_t val,
           printf(" [debugcon: write addr=0x%04" HWADDR_PRIx " val=0x%02" PRIx64 "]\n", addr, val);
       #endif
      
      +    if (ch == 0xf0) {
      +        vm_stop(RUN_STATE_PAUSED);
      +    }
           /* XXX this blocks entire thread. Rewrite to use
            * qemu_chr_fe_write and background I/O callbacks */
           qemu_chr_fe_write_all(&s->chr, &ch, 1);
      
      step 2. start vm1 by the following command line, and then vm stopped.
      $ qemu-system-x86_64 -machine pc-i440fx-5.0,accel=kvm\
       -netdev tap,ifname=tap-test,id=hostnet0,vhost=on,downscript=no,script=no\
       -device virtio-net-pci,netdev=hostnet0,id=net0,bus=pci.0,addr=0x13,bootindex=3\
       -device cirrus-vga,id=video0,vgamem_mb=16,bus=pci.0,addr=0x2\
       -chardev file,id=seabios,path=/var/log/test.seabios,append=on\
       -device isa-debugcon,iobase=0x402,chardev=seabios\
       -monitor stdio
      
      step 3. start vm2 to accept vm1 state.
      $ qemu-system-x86_64 -machine pc-i440fx-5.0,accel=kvm\
       -netdev tap,ifname=tap-test1,id=hostnet0,vhost=on,downscript=no,script=no\
       -device virtio-net-pci,netdev=hostnet0,id=net0,bus=pci.0,addr=0x13,bootindex=3\
       -device cirrus-vga,id=video0,vgamem_mb=16,bus=pci.0,addr=0x2\
       -chardev file,id=seabios,path=/var/log/test.seabios,append=on\
       -device isa-debugcon,iobase=0x402,chardev=seabios\
       -monitor stdio \
       -incoming tcp:127.0.0.1:8000
      
      step 4. execute the following qmp command in vm1 to migrate.
      (qemu) migrate tcp:127.0.0.1:8000
      
      step 5. execute the following qmp command in vm2 to resume vcpu.
      (qemu) cont
      Before this patch, we get KVM "emulation failure" error on vm2.
      This patch fixes it.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarHogan Wang <hogan.wang@huawei.com>
      Message-Id: <20200727084621.3279-1-hogan.wang@huawei.com>
      Reported-by: default avatar"Dr. David Alan Gilbert" <dgilbert@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      2ebc2121
    • Alex Bennée's avatar
      linux-user: don't use MAP_FIXED in pgd_find_hole_fallback · 2667e069
      Alex Bennée authored
      
      Plain MAP_FIXED has the undesirable behaviour of splatting exiting
      maps so we don't actually achieve what we want when looking for gaps.
      We should be using MAP_FIXED_NOREPLACE. As this isn't always available
      we need to potentially check the returned address to see if the kernel
      gave us what we asked for.
      
      Fixes: ad592e37 ("linux-user: provide fallback pgd_find_hole for bare chroots")
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20200724064509.331-9-alex.bennee@linaro.org>
      2667e069
    • Laszlo Ersek's avatar
      target/i386: floatx80: avoid compound literals in static initializers · 163b3d1a
      Laszlo Ersek authored
      
      Quoting ISO C99 6.7.8p4, "All the expressions in an initializer for an
      object that has static storage duration shall be constant expressions or
      string literals".
      
      The compound literal produced by the make_floatx80() macro is not such a
      constant expression, per 6.6p7-9. (An implementation may accept it,
      according to 6.6p10, but is not required to.)
      
      Therefore using "floatx80_zero" and make_floatx80() for initializing
      "f2xm1_table" and "fpatan_table" is not portable. And gcc-4.8 in RHEL-7.6
      actually chokes on them:
      
      > target/i386/fpu_helper.c:871:5: error: initializer element is not constant
      >      { make_floatx80(0xbfff, 0x8000000000000000ULL),
      >      ^
      
      We've had the make_floatx80_init() macro for this purpose since commit
      3bf7e40a ("softfloat: fix for C99", 2012-03-17), so let's use that
      macro again.
      
      Fixes: eca30647 ("target/i386: reimplement f2xm1 using floatx80 operations")
      Fixes: ff57bb7b ("target/i386: reimplement fpatan using floatx80 operations")
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Joseph Myers <joseph@codesourcery.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Link: https://lists.gnu.org/archive/html/qemu-devel/2017-08/msg06566.html
      Link: https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg04714.html
      Message-Id: <20200716144251.23004-1-lersek@redhat.com>
      Message-Id: <20200724064509.331-8-alex.bennee@linaro.org>
      163b3d1a
    • Alex Bennée's avatar
      util: add qemu_get_host_physmem utility function · ad06ef0e
      Alex Bennée authored
      
      This will be used in a future patch. For POSIX systems _SC_PHYS_PAGES
      isn't standardised but at least appears in the man pages for
      Open/FreeBSD. The result is advisory so any users of it shouldn't just
      fail if we can't work it out.
      
      The win32 stub currently returns 0 until someone with a Windows system
      can develop and test a patch.
      
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Cc: BALATON Zoltan <balaton@eik.bme.hu>
      Cc: Christian Ehrhardt <christian.ehrhardt@canonical.com>
      Message-Id: <20200724064509.331-5-alex.bennee@linaro.org>
      ad06ef0e
  4. Jul 24, 2020
  5. Jul 22, 2020
  6. Jul 21, 2020
  7. Jul 20, 2020
  8. Jul 19, 2020
    • Reza Arbab's avatar
      spapr: Add a new level of NUMA for GPUs · a6030d7e
      Reza Arbab authored
      
      NUMA nodes corresponding to GPU memory currently have the same
      affinity/distance as normal memory nodes. Add a third NUMA associativity
      reference point enabling us to give GPU nodes more distance.
      
      This is guest visible information, which shouldn't change under a
      running guest across migration between different qemu versions, so make
      the change effective only in new (pseries > 5.0) machine types.
      
      Before, `numactl -H` output in a guest with 4 GPUs (nodes 2-5):
      
      node distances:
      node   0   1   2   3   4   5
        0:  10  40  40  40  40  40
        1:  40  10  40  40  40  40
        2:  40  40  10  40  40  40
        3:  40  40  40  10  40  40
        4:  40  40  40  40  10  40
        5:  40  40  40  40  40  10
      
      After:
      
      node distances:
      node   0   1   2   3   4   5
        0:  10  40  80  80  80  80
        1:  40  10  80  80  80  80
        2:  80  80  10  80  80  80
        3:  80  80  80  10  80  80
        4:  80  80  80  80  10  80
        5:  80  80  80  80  80  10
      
      These are the same distances as on the host, mirroring the change made
      to host firmware in skiboot commit f845a648b8cb ("numa/associativity:
      Add a new level of NUMA for GPU's").
      
      Signed-off-by: default avatarReza Arbab <arbab@linux.ibm.com>
      Message-Id: <20200716225655.24289-1-arbab@linux.ibm.com>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      a6030d7e
  9. Jul 16, 2020
  10. Jul 15, 2020
    • Laurent Vivier's avatar
      net: check if the file descriptor is valid before using it · 894022e6
      Laurent Vivier authored
      
      qemu_set_nonblock() checks that the file descriptor can be used and, if
      not, crashes QEMU. An assert() is used for that. The use of assert() is
      used to detect programming error and the coredump will allow to debug
      the problem.
      
      But in the case of the tap device, this assert() can be triggered by
      a misconfiguration by the user. At startup, it's not a real problem, but it
      can also happen during the hot-plug of a new device, and here it's a
      problem because we can crash a perfectly healthy system.
      
      For instance:
       # ip link add link virbr0 name macvtap0 type macvtap mode bridge
       # ip link set macvtap0 up
       # TAP=/dev/tap$(ip -o link show macvtap0 | cut -d: -f1)
       # qemu-system-x86_64 -machine q35 -device pcie-root-port,id=pcie-root-port-0 -monitor stdio 9<> $TAP
       (qemu) netdev_add type=tap,id=hostnet0,vhost=on,fd=9
       (qemu) device_add driver=virtio-net-pci,netdev=hostnet0,id=net0,bus=pcie-root-port-0
       (qemu) device_del net0
       (qemu) netdev_del hostnet0
       (qemu) netdev_add type=tap,id=hostnet1,vhost=on,fd=9
       qemu-system-x86_64: .../util/oslib-posix.c:247: qemu_set_nonblock: Assertion `f != -1' failed.
       Aborted (core dumped)
      
      To avoid that, add a function, qemu_try_set_nonblock(), that allows to report the
      problem without crashing.
      
      In the same way, we also update the function for vhostfd in net_init_tap_one() and
      for fd in net_init_socket() (both descriptors are provided by the user and can
      be wrong).
      
      Signed-off-by: default avatarLaurent Vivier <lvivier@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      894022e6
    • Alex Bennée's avatar
      cputlb: ensure we save the IOTLB data in case of reset · 2f3a57ee
      Alex Bennée authored
      
      Any write to a device might cause a re-arrangement of memory
      triggering a TLB flush and potential re-size of the TLB invalidating
      previous entries. This would cause users of qemu_plugin_get_hwaddr()
      to see the warning:
      
        invalid use of qemu_plugin_get_hwaddr
      
      because of the failed tlb_lookup which should always succeed. To
      prevent this we save the IOTLB data in case it is later needed by a
      plugin doing a lookup.
      
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20200713200415.26214-7-alex.bennee@linaro.org>
      2f3a57ee
  11. Jul 14, 2020
    • Eric Blake's avatar
      block: Add support to warn on backing file change without format · e54ee1b3
      Eric Blake authored
      
      For now, this is a mechanical addition; all callers pass false. But
      the next patch will use it to improve 'qemu-img rebase -u' when
      selecting a backing file with no format.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarPeter Krempa <pkrempa@redhat.com>
      Reviewed-by: default avatarJán Tomko <jtomko@redhat.com>
      Message-Id: <20200706203954.341758-10-eblake@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      e54ee1b3
    • Kevin Wolf's avatar
      file-posix: Mitigate file fragmentation with extent size hints · ffa244c8
      Kevin Wolf authored
      
      Especially when O_DIRECT is used with image files so that the page cache
      indirection can't cause a merge of allocating requests, the file will
      fragment on the file system layer, with a potentially very small
      fragment size (this depends on the requests the guest sent).
      
      On Linux, fragmentation can be reduced by setting an extent size hint
      when creating the file (at least on XFS, it can't be set any more after
      the first extent has been allocated), basically giving raw files a
      "cluster size" for allocation.
      
      This adds a create option to set the extent size hint, and changes the
      default from not setting a hint to setting it to 1 MB. The main reason
      why qcow2 defaults to smaller cluster sizes is that COW becomes more
      expensive, which is not an issue with raw files, so we can choose a
      larger size. The tradeoff here is only potentially wasted disk space.
      
      For qcow2 (or other image formats) over file-posix, the advantage should
      even be greater because they grow sequentially without leaving holes, so
      there won't be wasted space. Setting even larger extent size hints for
      such images may make sense. This can be done with the new option, but
      let's keep the default conservative for now.
      
      The effect is very visible with a test that intentionally creates a
      badly fragmented file with qemu-img bench (the time difference while
      creating the file is already remarkable) and then looks at the number of
      extents and the time a simple "qemu-img map" takes.
      
      Without an extent size hint:
      
          $ ./qemu-img create -f raw -o extent_size_hint=0 ~/tmp/test.raw 10G
          Formatting '/home/kwolf/tmp/test.raw', fmt=raw size=10737418240 extent_size_hint=0
          $ ./qemu-img bench -f raw -t none -n -w ~/tmp/test.raw -c 1000000 -S 8192 -o 0
          Sending 1000000 write requests, 4096 bytes each, 64 in parallel (starting at offset 0, step size 8192)
          Run completed in 25.848 seconds.
          $ ./qemu-img bench -f raw -t none -n -w ~/tmp/test.raw -c 1000000 -S 8192 -o 4096
          Sending 1000000 write requests, 4096 bytes each, 64 in parallel (starting at offset 4096, step size 8192)
          Run completed in 19.616 seconds.
          $ filefrag ~/tmp/test.raw
          /home/kwolf/tmp/test.raw: 2000000 extents found
          $ time ./qemu-img map ~/tmp/test.raw
          Offset          Length          Mapped to       File
          0               0x1e8480000     0               /home/kwolf/tmp/test.raw
      
          real    0m1,279s
          user    0m0,043s
          sys     0m1,226s
      
      With the new default extent size hint of 1 MB:
      
          $ ./qemu-img create -f raw -o extent_size_hint=1M ~/tmp/test.raw 10G
          Formatting '/home/kwolf/tmp/test.raw', fmt=raw size=10737418240 extent_size_hint=1048576
          $ ./qemu-img bench -f raw -t none -n -w ~/tmp/test.raw -c 1000000 -S 8192 -o 0
          Sending 1000000 write requests, 4096 bytes each, 64 in parallel (starting at offset 0, step size 8192)
          Run completed in 11.833 seconds.
          $ ./qemu-img bench -f raw -t none -n -w ~/tmp/test.raw -c 1000000 -S 8192 -o 4096
          Sending 1000000 write requests, 4096 bytes each, 64 in parallel (starting at offset 4096, step size 8192)
          Run completed in 10.155 seconds.
          $ filefrag ~/tmp/test.raw
          /home/kwolf/tmp/test.raw: 178 extents found
          $ time ./qemu-img map ~/tmp/test.raw
          Offset          Length          Mapped to       File
          0               0x1e8480000     0               /home/kwolf/tmp/test.raw
      
          real    0m0,061s
          user    0m0,040s
          sys     0m0,014s
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-Id: <20200707142329.48303-1-kwolf@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      ffa244c8
    • Alistair Francis's avatar
      hw/char: Convert the Ibex UART to use the registerfields API · 59093cc4
      Alistair Francis authored
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-id: 06372c9cdeec715077899e71c858d9f0a2a3395b.1594332223.git.alistair.francis@wdc.com
      Message-Id: <06372c9cdeec715077899e71c858d9f0a2a3395b.1594332223.git.alistair.francis@wdc.com>
      59093cc4
    • Alistair Francis's avatar
      hw/char: Convert the Ibex UART to use the qdev Clock model · 940aabb9
      Alistair Francis authored
      
      Conver the Ibex UART to use the recently added qdev-clock functions.
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-id: b0136fad870a29049959ec161c1217b967d7e19d.1594332223.git.alistair.francis@wdc.com
      Message-Id: <b0136fad870a29049959ec161c1217b967d7e19d.1594332223.git.alistair.francis@wdc.com>
      940aabb9
    • Atish Patra's avatar
      riscv: Add opensbi firmware dynamic support · dc144fe1
      Atish Patra authored
      
      OpenSBI is the default firmware in Qemu and has various firmware loading
      options. Currently, qemu loader uses fw_jump which has a compile time
      pre-defined address where fdt & kernel image must reside. This puts a
      constraint on image size of the Linux kernel depending on the fdt location
      and available memory. However, fw_dynamic allows the loader to specify
      the next stage location (i.e. Linux kernel/U-Boot) in memory and other
      configurable boot options available in OpenSBI.
      
      Add support for OpenSBI dynamic firmware loading support. This doesn't
      break existing setup and fw_jump will continue to work as it is. Any
      other firmware will continue to work without any issues as long as it
      doesn't expect anything specific from loader in "a2" register.
      
      Signed-off-by: default avatarAtish Patra <atish.patra@wdc.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Reviewed-by: default avatarBin Meng <bin.meng@windriver.com>
      Tested-by: default avatarBin Meng <bin.meng@windriver.com>
      Message-Id: <20200701183949.398134-4-atish.patra@wdc.com>
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      dc144fe1
    • Atish Patra's avatar
      RISC-V: Copy the fdt in dram instead of ROM · 66b1205b
      Atish Patra authored
      
      Currently, the fdt is copied to the ROM after the reset vector. The firmware
      has to copy it to DRAM. Instead of this, directly copy the device tree to a
      pre-computed dram address. The device tree load address should be as far as
      possible from kernel and initrd images. That's why it is kept at the end of
      the DRAM or 4GB whichever is lesser.
      
      Signed-off-by: default avatarAtish Patra <atish.patra@wdc.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Reviewed-by: default avatarBin Meng <bin.meng@windriver.com>
      Tested-by: default avatarBin Meng <bin.meng@windriver.com>
      Message-Id: <20200701183949.398134-3-atish.patra@wdc.com>
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      66b1205b
    • Atish Patra's avatar
      riscv: Unify Qemu's reset vector code path · 43cf723a
      Atish Patra authored
      
      Currently, all riscv machines except sifive_u have identical reset vector
      code implementations with memory addresses being different for all machines.
      They can be easily combined into a single function in common code.
      
      Move it to common function and let all the machines use the common function.
      
      Signed-off-by: default avatarAtish Patra <atish.patra@wdc.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Reviewed-by: default avatarBin Meng <bin.meng@windriver.com>
      Tested-by: default avatarBin Meng <bin.meng@windriver.com>
      Message-Id: <20200701183949.398134-2-atish.patra@wdc.com>
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      43cf723a
  12. Jul 13, 2020
Loading