Skip to content
Snippets Groups Projects
  1. Aug 24, 2020
  2. Aug 23, 2020
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.2-pull-request' into staging · 8367a77c
      Peter Maydell authored
      
      Add clock_getres_time64, timer_gettime64, timer_settime64,
          timerfd_gettime64, timerfd_settime64
      Some fixes (page protection, print_fdset, timerspec, itimerspec)
      
      # gpg: Signature made Sun 23 Aug 2020 15:58:53 BST
      # 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/vivier2/tags/linux-user-for-5.2-pull-request:
        linux-user: Fix 'utimensat()' implementation
        linux-user: Add support for a group of 2038 safe syscalls
        linux-user: Modify 'target_to_host/host_to_target_itimerspec()'
        linux-user: Adjust guest page protection for the host
        linux-user: Validate mmap/mprotect prot value
        linux-user: Fix "print_fdset()" in "strace.c" to not print ", " after last value
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      8367a77c
    • Filip Bozuta's avatar
      linux-user: Fix 'utimensat()' implementation · b3a3af70
      Filip Bozuta authored
      
      Implementation of syscall 'utimensat()' in 'syscall.c' uses functions
      target_to_host/host_to_target_timespec() to convert values of
      'struct timespec' between host and target. However, the implementation
      doesn't check whether the conversion succeeds and thus can cause an
      inappropriate error or succeed unappropriately instead of setting errno
      EFAULT ('Bad address') which is supposed to be set in these cases.
      
      This was confirmed with the LTP test for utimensat ('testcases/utimensat')
      which fails for test cases when the errno EFAULT is expected. After changes
      from this patch, the test passes for all test cases.
      
      Signed-off-by: default avatarFilip Bozuta <Filip.Bozuta@syrmia.com>
      Reviewed-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Message-Id: <20200811113101.6636-1-Filip.Bozuta@syrmia.com>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      b3a3af70
    • Filip Bozuta's avatar
      linux-user: Add support for a group of 2038 safe syscalls · 828cb3a1
      Filip Bozuta authored
      This patch implements functionality for following time64 syscalls:
      
      *clock_getres_time64
      
           This a year 2038 safe variant of syscall:
      
           int clock_getres(clockid_t clockid, struct timespec *res)
           --finding the resoultion of a specified clock--
           man page: https://man7.org/linux/man-pages/man2/clock_getres.2.html
      
      *timer_gettime64
      *timer_settime64
      
           These are year 2038 safe variants of syscalls:
      
           int timer_settime(timer_t timerid, int flags,
                             const struct itimerspec *new_value,
                             struct itimerspec *old_value)
           int timer_gettime(timer_t timerid, struct itimerspec *curr_value)
           --arming/dissarming and fetching state of POSIX per-process timer--
           man page: https://man7.org/linux/man-pages/man2/timer_settime.2.html
      
      *timerfd_gettime64
      *timerfd_settime64
      
           These are year 2038 safe variants of syscalls:
      
           int timerfd_settime(int fd, int flags,
                               const struct itimerspec *new_value,
                               struct itimerspec *old_value)
           int timerfd_gettime(int fd, struct itimerspec *curr_value)
           --timers that notify via file descriptor--
           man page: https://man7.org/linux/man-pages/man2/timerfd_settime.2.html
      
      
      
      Implementation notes:
      
           Syscall 'clock_getres_time64' was implemented similarly to 'clock_getres()'.
           The only difference was that for the conversion of 'struct timespec' from
           host to target, function 'host_to_target_timespec64()' was used instead of
           'host_to_target_timespec()'.
      
           For other syscalls, new functions 'host_to_target_itimerspec64()' and
           'target_to_host_itimerspec64()' were added to convert the value of the
           'struct itimerspec' from host to target and vice versa. A new type
           'struct target__kernel_itimerspec' was added in 'syscall_defs.h'. This
           type was defined with fields which are of the already defined type
           'struct target_timespec'. This new 'struct target__kernel_itimerspec'
           type is used in these new converting functions. These new functions were
           defined similarly to 'host_to_target_itimerspec()' and 'target_to_host_itimerspec()'
           the only difference being that 'target_to_host_timespec64()' and
           'host_to_target_timespec64()' were used.
      
      Signed-off-by: default avatarFilip Bozuta <Filip.Bozuta@syrmia.com>
      Reviewed-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Message-Id: <20200722153421.295411-3-Filip.Bozuta@syrmia.com>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      828cb3a1
    • Filip Bozuta's avatar
      linux-user: Modify 'target_to_host/host_to_target_itimerspec()' · 2c86c90f
      Filip Bozuta authored
      
      Functions 'target_to_host_itimerspec()' and 'host_to_target_itimerspec()'
      are used to convert values of type 'struct itimerspec' between target and
      host. This type has 'struct timespec' as its fields. That is the reason
      why this patch introduces a little modification to the converting functions
      to be implemented using already existing functions that convert 'struct timespec':
      'target_to_host_timespec()' and 'host_to_target_timespec()'. This makes the
      code of 'target_to_host_itimerspec()' and 'host_to_target_itimerspec()' more
      clean and readable.
      
      Signed-off-by: default avatarFilip Bozuta <Filip.Bozuta@syrmia.com>
      Reviewed-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Message-Id: <20200722153421.295411-2-Filip.Bozuta@syrmia.com>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      2c86c90f
    • Richard Henderson's avatar
      linux-user: Adjust guest page protection for the host · 4eaa960d
      Richard Henderson authored
      
      Executable guest pages are never directly executed by
      the host, but do need to be readable for translation.
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-Id: <20200519185645.3915-3-richard.henderson@linaro.org>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      4eaa960d
    • Richard Henderson's avatar
      linux-user: Validate mmap/mprotect prot value · 9dba3ca5
      Richard Henderson authored
      
      The kernel will return -EINVAL for bits set in the prot argument
      that are unknown or invalid.  Previously we were simply cropping
      out the bits that we care about.
      
      Introduce validate_prot_to_pageflags to perform this check in a
      single place between the two syscalls.  Differentiate between
      the target and host versions of prot.  Compute the qemu internal
      page_flags value at the same time.
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-Id: <20200519185645.3915-2-richard.henderson@linaro.org>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      9dba3ca5
    • Filip Bozuta's avatar
      linux-user: Fix "print_fdset()" in "strace.c" to not print ", " after last value · 664441ea
      Filip Bozuta authored
      
      Function "print_fdset()" in "strace.c" is used to print the file descriptor
      values in "print__newselect()" which prints arguments of syscall _newselect().
      Until changes from this patch, this function was printing "," even after the
      last value of the fd_set argument. This was changed in this patch by removing
      this unnecessary "," after the last fd value and thus improving the estetics of
      the _newselect() "-strace" print.
      
      Implementation notes:
      
         The printing fix was made possible by using an existing function "get_comma()"
         which returns a "," or an empty string "" based on its argument (0 for "," and
         other for "").
      
      Signed-off-by: default avatarFilip Bozuta <Filip.Bozuta@syrmia.com>
      Reviewed-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Message-Id: <20200702160915.9517-1-Filip.Bozuta@syrmia.com>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      664441ea
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200821-1' into staging · 152be6de
      Peter Maydell authored
      
      The first RISC-V PR for the 5.2 window.
      
      This includes:
       - NaNBox fixes
       - Vector extension improvements
       - a L2 cache controller
       - PMP fixes
       - Upgrade to OpenSBI v0.8 and the generic platform
       - Fixes for the Ibex PLIC
      
      # gpg: Signature made Sat 22 Aug 2020 06:38:18 BST
      # 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-riscv-to-apply-20200821-1:
        hw/intc: ibex_plic: Honour source priorities
        hw/intc: ibex_plic: Don't allow repeat interrupts on claimed lines
        hw/intc: ibex_plic: Update the pending irqs
        target/riscv: Change the TLB page size depends on PMP entries.
        target/riscv: Fix the translation of physical address
        gitlab-ci/opensbi: Update GitLab CI to build generic platform
        hw/riscv: spike: Change the default bios to use generic platform image
        hw/riscv: Use pre-built bios image of generic platform for virt & sifive_u
        roms/Makefile: Build the generic platform for RISC-V OpenSBI firmware
        roms/opensbi: Upgrade from v0.7 to v0.8
        configure: Create symbolic links for pc-bios/*.elf files
        riscv: Fix bug in setting pmpcfg CSR for RISCV64
        hw/riscv: sifive_u: Add a dummy L2 cache controller device
        target/riscv: check before allocating TCG temps
        target/riscv: Clean up fmv.w.x
        target/riscv: Check nanboxed inputs in trans_rvf.inc.c
        target/riscv: Check nanboxed inputs to fp helpers
        target/riscv: Generate nanboxed results from trans_rvf.inc.c
        target/riscv: Generalize gen_nanbox_fpr to gen_nanbox_s
        target/riscv: Generate nanboxed results from fp helpers
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      152be6de
  3. Aug 22, 2020
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/philmd-gitlab/tags/sd-next-20200821' into staging · d7df0cee
      Peter Maydell authored
      SD/MMC patches
      
      - Convert legacy SD host controller to the SDBus API
      - Move legacy API to a separate "sdcard_legacy.h" header
      - Introduce methods to access multiple bytes on SDBus data lines
      - Fix 'switch function' group location
      - Fix SDSC maximum card size (2GB)
      
      CI jobs result:
        https://gitlab.com/philmd/qemu/-/pipelines/180605963
      
      
      
      # gpg: Signature made Fri 21 Aug 2020 18:27:50 BST
      # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
      # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
      # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
      
      * remotes/philmd-gitlab/tags/sd-next-20200821: (23 commits)
        hw/sd: Correct the maximum size of a Standard Capacity SD Memory Card
        hw/sd: Fix incorrect populated function switch status data structure
        hw/sd: Use sdbus_read_data() instead of sdbus_read_byte() when possible
        hw/sd: Add sdbus_read_data() to read multiples bytes on the data line
        hw/sd: Use sdbus_write_data() instead of sdbus_write_byte when possible
        hw/sd: Add sdbus_write_data() to write multiples bytes on the data line
        hw/sd: Rename sdbus_read_data() as sdbus_read_byte()
        hw/sd: Rename sdbus_write_data() as sdbus_write_byte()
        hw/sd: Rename read/write_data() as read/write_byte()
        hw/sd: Move sdcard legacy API to 'hw/sd/sdcard_legacy.h'
        hw/sd/sdcard: Make sd_data_ready() static
        hw/sd/pl181: Replace disabled fprintf()s by trace events
        hw/sd/pl181: Do not create SD card within the SD host controller
        hw/sd/pl181: Expose a SDBus and connect the SDCard to it
        hw/sd/pl181: Use named GPIOs
        hw/sd/pl181: Add TODO to use Fifo32 API
        hw/sd/pl181: Rename pl181_send_command() as pl181_do_command()
        hw/sd/pl181: Replace fprintf(stderr, "*\n") with error_report()
        hw/sd/milkymist: Do not create SD card within the SD host controller
        hw/sd/milkymist: Create the SDBus at init()
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      d7df0cee
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging · 3a52b42c
      Peter Maydell authored
      
      meson fixes:
      
      * --disable-tools --enable-system build
      * s390 no-TCG build
      * fdmon-io_uring
      * 'shift' error message in version_ge()
      
      # gpg: Signature made Fri 21 Aug 2020 22:12:29 BST
      # 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:
        keymaps: update
        meson: Fix --disable-tools --enable-system builds
        meson: convert pc-bios/keymaps/Makefile
        configure: silence 'shift' error message in version_ge()
        util/meson.build: fix fdmon-io_uring build
        target/s390x: fix meson.build issue
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      3a52b42c
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-08-21' into staging · 66e01f1c
      Peter Maydell authored
      
      bitmaps patches for 2020-08-21
      
      - Andrey Shinkevich: Enhance qcow2.py for iotest inspection of qcow2 images
      - Max Reitz: Add block-bitmap-mapping migration parameter
      
      # gpg: Signature made Fri 21 Aug 2020 15:05:07 BST
      # gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
      # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
      # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
      # gpg:                 aka "[jpeg image of size 6874]" [full]
      # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
      
      * remotes/ericb/tags/pull-bitmaps-2020-08-21:
        iotests: Test node/bitmap aliases during migration
        iotests.py: Let wait_migration() return on failure
        migration: Add block-bitmap-mapping parameter
        iotests: dump QCOW2 header in JSON in #303
        qcow2_format.py: support dumping metadata in JSON format
        qcow2_format.py: collect fields to dump in JSON format
        qcow2.py: Introduce '-j' key to dump in JSON format
        qcow2_format.py: Dump bitmap table serialized entries
        qcow2_format.py: pass cluster size to substructures
        qcow2_format.py: Dump bitmap directory information
        qcow2_format.py: dump bitmap flags in human readable way.
        qcow2_format.py: change Qcow2BitmapExt initialization method
        qcow2_format.py: make printable data an extension class member
        iotests: add test for QCOW2 header dump
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      66e01f1c
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging · ca489cd0
      Peter Maydell authored
      
      Machine queue 2020-08-19
      
      Regular post-release changes:
      * hw: add compat machines for 5.2 (Cornelia Huck)
      
      Features:
      * qmp: Expose MachineClass::default_ram_id
        (Michal Privoznik)
      
      Cleanups:
      * qdev: Document qdev_prop_set_drive_err() return value
        (Philippe Mathieu-Daudé)
      
      # gpg: Signature made Wed 19 Aug 2020 16:21:55 BST
      # gpg:                using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6
      # gpg:                issuer "ehabkost@redhat.com"
      # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full]
      # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6
      
      * remotes/ehabkost/tags/machine-next-pull-request:
        hw: add compat machines for 5.2
        qmp: Expose MachineClass::default_ram_id
        qdev: Document qdev_prop_set_drive_err() return value
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      ca489cd0
    • Alistair Francis's avatar
      hw/intc: ibex_plic: Honour source priorities · 01c41d15
      Alistair Francis authored
      
      This patch follows what commit aa4d30f6 "riscv: plic: Honour source
      priorities" does and ensures that the highest priority interrupt will be
      serviced first.
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Cc: Jessica Clarke <jrtc27@jrtc27.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <a697ca8a31eff8eb18a88e09a28206063cf85d48.1595655188.git.alistair.francis@wdc.com>
      01c41d15
    • Alistair Francis's avatar
      hw/intc: ibex_plic: Don't allow repeat interrupts on claimed lines · 22491406
      Alistair Francis authored
      
      Once an interrupt has been claimed, but before it has been compelted we
      shouldn't receive any more pending interrupts. This patche keeps track
      of this to ensure that we don't see any more interrupts until it is
      completed.
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <394c3f070615ff2b4fab61a1cf9cb48c122913b7.1595655188.git.alistair.francis@wdc.com>
      22491406
    • Alistair Francis's avatar
      hw/intc: ibex_plic: Update the pending irqs · c43388bb
      Alistair Francis authored
      
      After a claim or a priority change we need to update the pending
      interrupts. This is based on the same patch for the SiFive PLIC:
      55765822 "riscv: plic: Add a couple of mising
      sifive_plic_update calls"
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Cc: Jessica Clarke <jrtc27@jrtc27.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <0693aa700a4c67c49b3f1c973a82b257fdb7198d.1595655188.git.alistair.francis@wdc.com>
      c43388bb
    • Zong Li's avatar
      target/riscv: Change the TLB page size depends on PMP entries. · af3fc195
      Zong Li authored
      
      The minimum granularity of PMP is 4 bytes, it is small than 4KB page
      size, therefore, the pmp checking would be ignored if its range doesn't
      start from the alignment of one page. This patch detects the pmp entries
      and sets the small page size to TLB if there is a PMP entry which cover
      the page size.
      
      Signed-off-by: default avatarZong Li <zong.li@sifive.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <6b0bf48662ef26ab4c15381a08e78a74ebd7ca79.1595924470.git.zong.li@sifive.com>
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      af3fc195
    • Zong Li's avatar
      target/riscv: Fix the translation of physical address · 9ef82119
      Zong Li authored
      
      The real physical address should add the 12 bits page offset. It also
      causes the PMP wrong checking due to the minimum granularity of PMP is
      4 byte, but we always get the physical address which is 4KB alignment,
      that means, we always use the start address of the page to check PMP for
      all addresses which in the same page.
      
      Signed-off-by: default avatarZong Li <zong.li@sifive.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <370a983d0f9e8a9a927b9bb8af5e7bc84b1bf9b1.1595924470.git.zong.li@sifive.com>
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      9ef82119
    • Bin Meng's avatar
      gitlab-ci/opensbi: Update GitLab CI to build generic platform · a52ea3e7
      Bin Meng authored
      
      This updates the GitLab CI opensbi job to build opensbi bios images
      for the generic platform.
      
      Signed-off-by: default avatarBin Meng <bin.meng@windriver.com>
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <1596439832-29238-7-git-send-email-bmeng.cn@gmail.com>
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      a52ea3e7
    • Bin Meng's avatar
      hw/riscv: spike: Change the default bios to use generic platform image · fad14439
      Bin Meng authored
      
      To keep sync with other RISC-V machines, change the default bios to
      use generic platform fw_dynamic.elf image.
      
      While we are here, add some comments to mention that using ELF files
      for the Spike machine was intentional.
      
      Signed-off-by: default avatarBin Meng <bin.meng@windriver.com>
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <1596439832-29238-6-git-send-email-bmeng.cn@gmail.com>
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      fad14439
    • Bin Meng's avatar
      hw/riscv: Use pre-built bios image of generic platform for virt & sifive_u · 2cacd841
      Bin Meng authored
      Update virt and sifive_u machines to use the opensbi fw_dynamic bios
      image built for the generic FDT platform.
      
      Remove the out-of-date no longer used bios images.
      
      Note:
      
      1. To test 32-bit Linux kernel on QEMU 'sifive_u' 32-bit machine,
         the following patch is needed:
         http://lists.infradead.org/pipermail/linux-riscv/2020-July/001213.html
      
      
      
      2. To test 64-bit Linux 5.3 kernel on QEMU 'virt' or 'sifive_u' 64-bit
         machines, the following commit should be cherry-picked to 5.3:
      
         commit 922b0375fc93fb1a20c5617e37c389c26bbccb70
         Author: Albert Ou <aou@eecs.berkeley.edu>
         Date:   Fri Sep 27 16:14:18 2019 -0700
      
             riscv: Fix memblock reservation for device tree blob
      
         Linux 5.4 or above already contains this commit/fix.
      
      Signed-off-by: default avatarBin Meng <bin.meng@windriver.com>
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <1596439832-29238-5-git-send-email-bmeng.cn@gmail.com>
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      2cacd841
    • Bin Meng's avatar
      roms/Makefile: Build the generic platform for RISC-V OpenSBI firmware · 00db05fb
      Bin Meng authored
      
      The RISC-V generic platform is a flattened device tree (FDT) based
      platform where all platform specific functionality is provided based
      on FDT passed by previous booting stage. The support was added in
      the upstream OpenSBI v0.8 release recently.
      
      Update our Makefile to build the generic platform instead of building
      virt and sifive_u separately for RISC-V OpenSBI firmware, and change
      to use fw_dynamic type images as well.
      
      Signed-off-by: default avatarBin Meng <bin.meng@windriver.com>
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <1596439832-29238-4-git-send-email-bmeng.cn@gmail.com>
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      00db05fb
    • Bin Meng's avatar
      roms/opensbi: Upgrade from v0.7 to v0.8 · 8ebde786
      Bin Meng authored
      
      Upgrade OpenSBI from v0.7 to v0.8.
      
      The v0.8 release includes the following commits:
      
      1bb00ab lib: No need to provide default PMP region using platform callbacks
      a9eac67 include: sbi_platform: Combine reboot and shutdown into one callback
      6585fab lib: utils: Add SiFive test device
      4781545 platform: Add Nuclei UX600 platform
      3a326af scripts: adapt binary archive script for Nuclei UX600
      5bdf022 firmware: fw_base: Remove CSR_MTVEC update check
      e6c1345 lib: utils/serial: Skip baudrate config if input frequency is zero
      01a8c8e lib: utils: Improve fdt_parse_uart8250() API
      0a0093b lib: utils: Add fdt_parse_uart8250_node() function
      243b0d0 lib: utils: Remove redundant clint_ipi_sync() declaration
      e3ad7c1 lib: utils: Rename fdt_parse_clint() to fdt_parse_compat_addr()
      a39cd6f lib: utils: Add FDT match table based node lookup
      dd33b9e lib: utils: Make fdt_get_node_addr_size() public function
      66185b3 lib: utils: Add fdt_parse_sifive_uart_node() function
      19e966b lib: utils: Add fdt_parse_hart_id() function
      44dd7be lib: utils: Add fdt_parse_max_hart_id() API
      f0eb503 lib: utils: Add fdt_parse_plic_node() function
      1ac794c include: Add array_size() macro
      8ff2b94 lib: utils: Add simple FDT timer framework
      76f0f81 lib: utils: Add simple FDT ipi framework
      75322a6 lib: utils: Add simple FDT irqchip framework
      76a8940 lib: utils: Add simple FDT serial framework
      7cc6fa4 lib: utils: Add simple FDT reset framework
      4d06353 firmware: fw_base: Introduce optional fw_platform_init()
      f1aa9e5 platform: Add generic FDT based platform support
      1f21b99 lib: sbi: Print platform hart count at boot time
      2ba7087 scripts: Add generic platform to create-binary-archive.sh
      4f18c6e platform: generic: Add Sifive FU540 TLB flush range limit override
      13717a8 platform: Remove qemu/virt directory
      65c06b0 platform: Remove spike directory
      d626037 docs: Add missing links in platform.md
      7993ca2 include: sbi: Remove redundant page table related defines
      5338679 lib: sbi_tlb: Fix remote TLB HFENCE VVMA implementation
      dc38929 lib: sbi: Improve misa_string() implementation
      433bac7 docs: platform/generic: Add details about stdout-path DT property
      b4efa70 docs: platform/generic: Add details about IPI and timer expectations
      dfd9dd6 docs: Add platform requirements document
      c2286b6 docs: Fix ordering of pages in table of contents
      7be75f5 docs: Don't use italic text in page title
      63a513e lib: Rename unprivileged trap handler
      aef9a60 lib: Add csr detect support
      13ca20d lib: Create a separate math helper function file
      79d0fad lib: utils: Update reserved memory fdt node even if PMP is not present
      6a053f6 lib: Add support for hart specific features
      b2df751 platform: Move platform features to hart
      4938024 platform: fpga: Remove redundant platform specific features
      ec0d2a7 lib: timer: Provide a hart based timer feature
      1f235ec lib: Add platform features in boot time print
      22c4334 lib: Add hart features in boot time print
      36833ab lib: Optimize inline assembly for unprivilege access functions
      38a4b54 firmware: Correct spelling mistakes
      28b4052 lib: sbi: detect features before everything else in sbi_hart_init()
      4984183 lib: sbi: Improve get_feature_str() implementation and usage
      3aa1036 lib: sbi: Remove extra spaces from boot time prints
      3a8fc81 lib: sbi: Print platform HART count just before boot HART id
      63b0f5f include: sbi: Use scratch pointer as parmeter in HART feature APIs
      2966510 lib: sbi: Few cosmetic improvements to HART feature detection
      a38bea9 lib: sbi_hart: Detect number of supported PMP regions
      89ba634 include: sbi: Add firmware extension constants
      73d6ef3 lib: utils: Remove redundant parameters from PLIC init functions
      446a9c6 lib: utils: Allow PLIC functions to be used for multiple PLICs
      2c685c2 lib: utils: Extend fdt_find_match() Implementation
      d30bb68 lib: utils/irqchip: Initialize all matching irqchip DT nodes
      a9a9751 lib: utils: Allow CLINT functions to be used for multiple CLINTs
      569dd64 lib: utils: Add fdt_parse_clint_node() function
      6956e83 lib: utils/ipi: Initialize all matching ipi DT nodes
      a63f05f lib: utils/timer: Initialize all matching timer DT nodes
      30b6040 Makefile: Fix builtin DTB compilation for out-of-tree platforms
      64f1408 firmware: fw_base: Make builtin DTB available to fw_platform_init()
      4ce6b7a firmware: fw_base: Don't OR forced FW_OPTIONS
      86ec534 firmware: Allow fw_platform_init() to return updated FDT location
      c6c65ee Makefile: Preprocess builtin DTS
      4e3876d Makefile: Add mechanism for platforms to have multiple builtin DTBs
      72019ee platform: kendryte/k210: Use new mechanism of builtin DTB
      51f0e4a firmware: Remove FW_PAYLOAD_FDT and related documentation
      1b8c012 lib: Add RISC-V hypervisor v0.6.1 support
      79bfd67 docs: Use doxygen config to mark the main page
      106b888 docs: Remove redundant documentation about combined payload use case
      9802906 platform: Add AE350 platform specific SBI handler
      32f87e5 platform: Add AE350 cache control SBIs
      e2c3f01 lib: Fix __sbi_hfence_gvma_vmid_gpa() and __sbi_hfence_vvma_asid_va()
      6966ad0 platform/lib: Allow the OS to map the regions that are protected by PMP
      518e85c platform: Update Nuclei ux600 platform support
      d5725c2 lib: Don't print delegation CSRs if there is no S-Mode
      637b348 lib: Fix the SBI_HART_HAS_MCOUNTEREN feature check
      db56ef3 platform: Add support for Shakti C-class SoC from IIT-M
      9bd5f8f lib: sbi: Fix 32/64 bits variable compatibility
      2314101 lib: Don't return any invalid error from SBI ecall
      a98258d include: Bump-up version to 0.8
      
      Signed-off-by: default avatarBin Meng <bin.meng@windriver.com>
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <1596439832-29238-3-git-send-email-bmeng.cn@gmail.com>
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      8ebde786
    • Bin Meng's avatar
      configure: Create symbolic links for pc-bios/*.elf files · 3a631b8e
      Bin Meng authored
      
      Now we need to ship the OpenSBI fw_dynamic.elf image for the
      RISC-V Spike machine, it requires us to create symbolic links
      for pc-bios/*.elf files.
      
      Signed-off-by: default avatarBin Meng <bin.meng@windriver.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <1596439832-29238-2-git-send-email-bmeng.cn@gmail.com>
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      3a631b8e
    • Hou Weiying's avatar
      riscv: Fix bug in setting pmpcfg CSR for RISCV64 · fdd33b86
      Hou Weiying authored
      
      First, sizeof(target_ulong) equals to 4 on riscv32, so this change
      does not change the function on riscv32. Second, sizeof(target_ulong)
      equals to 8 on riscv64, and 'reg_index * 8 + i' is not a legal
      pmp_index (we will explain later), which should be 'reg_index * 4 + i'.
      
      If the parameter reg_index equals to 2 (means that we will change the
      value of pmpcfg2, or the second pmpcfg on riscv64), then
      pmpcfg_csr_write(env, 2, val) will map write tasks to
      pmp_write_cfg(env, 2 * 8 + [0...7], val). However, no cfg csr is indexed
      by value 16 or 23 on riscv64, so we consider it as a bug.
      
      We are looking for constant (e.g., define a new constant named
      RISCV_WORD_SIZE) in QEMU to help others understand code better,
      but none was found. A possible good explanation of this literal is it is
      the minimum word length on riscv is 4 bytes (32 bit).
      
      Signed-off-by: default avatarHongzheng-Li <Ethan.Lee.QNL@gmail.com>
      Signed-off-by: default avatarHou Weiying <weiying_hou@outlook.com>
      Signed-off-by: default avatarMyriad-Dreamin <camiyoru@gmail.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <SG2PR02MB263420036254AC8841F66CE393460@SG2PR02MB2634.apcprd02.prod.outlook.com>
      Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      fdd33b86
Loading