[PATCH for-9.0 0/4] target/riscv: add RVV CSRs

Daniel Henrique Barboza posted 4 patches 12 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20231130182748.1894790-1-dbarboza@ventanamicro.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Bin Meng <bin.meng@windriver.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>
There is a newer version of this series
include/standard-headers/drm/drm_fourcc.h     |   2 +
include/standard-headers/linux/pci_regs.h     |  24 ++-
include/standard-headers/linux/vhost_types.h  |   7 +
.../standard-headers/linux/virtio_config.h    |   5 +
include/standard-headers/linux/virtio_pci.h   |  11 ++
linux-headers/asm-arm64/kvm.h                 |  32 ++++
linux-headers/asm-generic/unistd.h            |  14 +-
linux-headers/asm-loongarch/bitsperlong.h     |   1 +
linux-headers/asm-loongarch/kvm.h             | 108 +++++++++++
linux-headers/asm-loongarch/mman.h            |   1 +
linux-headers/asm-loongarch/unistd.h          |   5 +
linux-headers/asm-mips/unistd_n32.h           |   4 +
linux-headers/asm-mips/unistd_n64.h           |   4 +
linux-headers/asm-mips/unistd_o32.h           |   4 +
linux-headers/asm-powerpc/unistd_32.h         |   4 +
linux-headers/asm-powerpc/unistd_64.h         |   4 +
linux-headers/asm-riscv/kvm.h                 |  12 ++
linux-headers/asm-riscv/ptrace.h              | 132 +++++++++++++
linux-headers/asm-s390/unistd_32.h            |   4 +
linux-headers/asm-s390/unistd_64.h            |   4 +
linux-headers/asm-x86/unistd_32.h             |   4 +
linux-headers/asm-x86/unistd_64.h             |   3 +
linux-headers/asm-x86/unistd_x32.h            |   3 +
linux-headers/linux/iommufd.h                 | 180 +++++++++++++++++-
linux-headers/linux/kvm.h                     |  11 ++
linux-headers/linux/psp-sev.h                 |   1 +
linux-headers/linux/stddef.h                  |   7 +
linux-headers/linux/userfaultfd.h             |   9 +-
linux-headers/linux/vfio.h                    |  47 +++--
linux-headers/linux/vhost.h                   |   8 +
scripts/update-linux-headers.sh               |   3 +
target/riscv/kvm/kvm-cpu.c                    | 103 ++++++++++
32 files changed, 735 insertions(+), 26 deletions(-)
create mode 100644 linux-headers/asm-loongarch/bitsperlong.h
create mode 100644 linux-headers/asm-loongarch/kvm.h
create mode 100644 linux-headers/asm-loongarch/mman.h
create mode 100644 linux-headers/asm-loongarch/unistd.h
create mode 100644 linux-headers/asm-riscv/ptrace.h
[PATCH for-9.0 0/4] target/riscv: add RVV CSRs
Posted by Daniel Henrique Barboza 12 months ago
Hi,

This series adds RVV, vstart, vl and vtype regs to the KVM driver.

But first we need a couple of things done. We need 'ptrace.h' RISC-V
linux-header to be able to read/write RVV CSRs. This is done in patch 2.
Patch 1 is the usual linux-header bump for all archs.

Patch 3 is adding a realize() callback for the KVM driver because we're
doing a prctl() to enable Vector support for the thread.

Patches are based on master. You'll need the following KVM fix to be
able to build:

[PATCH for-8.2] target/riscv/kvm: fix shadowing in kvm_riscv_(get|put)_regs_csr


Daniel Henrique Barboza (4):
  linux-headers: Update to Linux v6.7-rc3
  linux-headers: riscv: add ptrace.h
  target/riscv/kvm: do PR_RISCV_V_SET_CONTROL during realize()
  target/riscv/kvm: add RVV and Vector CSR regs

 include/standard-headers/drm/drm_fourcc.h     |   2 +
 include/standard-headers/linux/pci_regs.h     |  24 ++-
 include/standard-headers/linux/vhost_types.h  |   7 +
 .../standard-headers/linux/virtio_config.h    |   5 +
 include/standard-headers/linux/virtio_pci.h   |  11 ++
 linux-headers/asm-arm64/kvm.h                 |  32 ++++
 linux-headers/asm-generic/unistd.h            |  14 +-
 linux-headers/asm-loongarch/bitsperlong.h     |   1 +
 linux-headers/asm-loongarch/kvm.h             | 108 +++++++++++
 linux-headers/asm-loongarch/mman.h            |   1 +
 linux-headers/asm-loongarch/unistd.h          |   5 +
 linux-headers/asm-mips/unistd_n32.h           |   4 +
 linux-headers/asm-mips/unistd_n64.h           |   4 +
 linux-headers/asm-mips/unistd_o32.h           |   4 +
 linux-headers/asm-powerpc/unistd_32.h         |   4 +
 linux-headers/asm-powerpc/unistd_64.h         |   4 +
 linux-headers/asm-riscv/kvm.h                 |  12 ++
 linux-headers/asm-riscv/ptrace.h              | 132 +++++++++++++
 linux-headers/asm-s390/unistd_32.h            |   4 +
 linux-headers/asm-s390/unistd_64.h            |   4 +
 linux-headers/asm-x86/unistd_32.h             |   4 +
 linux-headers/asm-x86/unistd_64.h             |   3 +
 linux-headers/asm-x86/unistd_x32.h            |   3 +
 linux-headers/linux/iommufd.h                 | 180 +++++++++++++++++-
 linux-headers/linux/kvm.h                     |  11 ++
 linux-headers/linux/psp-sev.h                 |   1 +
 linux-headers/linux/stddef.h                  |   7 +
 linux-headers/linux/userfaultfd.h             |   9 +-
 linux-headers/linux/vfio.h                    |  47 +++--
 linux-headers/linux/vhost.h                   |   8 +
 scripts/update-linux-headers.sh               |   3 +
 target/riscv/kvm/kvm-cpu.c                    | 103 ++++++++++
 32 files changed, 735 insertions(+), 26 deletions(-)
 create mode 100644 linux-headers/asm-loongarch/bitsperlong.h
 create mode 100644 linux-headers/asm-loongarch/kvm.h
 create mode 100644 linux-headers/asm-loongarch/mman.h
 create mode 100644 linux-headers/asm-loongarch/unistd.h
 create mode 100644 linux-headers/asm-riscv/ptrace.h

-- 
2.41.0
Re: [PATCH for-9.0 0/4] target/riscv: add RVV CSRs
Posted by Alistair Francis 11 months, 2 weeks ago
On Fri, Dec 1, 2023 at 4:29 AM Daniel Henrique Barboza
<dbarboza@ventanamicro.com> wrote:
>
> Hi,
>
> This series adds RVV, vstart, vl and vtype regs to the KVM driver.
>
> But first we need a couple of things done. We need 'ptrace.h' RISC-V
> linux-header to be able to read/write RVV CSRs. This is done in patch 2.
> Patch 1 is the usual linux-header bump for all archs.
>
> Patch 3 is adding a realize() callback for the KVM driver because we're
> doing a prctl() to enable Vector support for the thread.
>
> Patches are based on master. You'll need the following KVM fix to be
> able to build:
>
> [PATCH for-8.2] target/riscv/kvm: fix shadowing in kvm_riscv_(get|put)_regs_csr
>
>
> Daniel Henrique Barboza (4):
>   linux-headers: Update to Linux v6.7-rc3
>   linux-headers: riscv: add ptrace.h
>   target/riscv/kvm: do PR_RISCV_V_SET_CONTROL during realize()
>   target/riscv/kvm: add RVV and Vector CSR regs

Do you mind rebasing this on
https://github.com/alistair23/qemu/tree/riscv-to-apply.next

Alistair

>
>  include/standard-headers/drm/drm_fourcc.h     |   2 +
>  include/standard-headers/linux/pci_regs.h     |  24 ++-
>  include/standard-headers/linux/vhost_types.h  |   7 +
>  .../standard-headers/linux/virtio_config.h    |   5 +
>  include/standard-headers/linux/virtio_pci.h   |  11 ++
>  linux-headers/asm-arm64/kvm.h                 |  32 ++++
>  linux-headers/asm-generic/unistd.h            |  14 +-
>  linux-headers/asm-loongarch/bitsperlong.h     |   1 +
>  linux-headers/asm-loongarch/kvm.h             | 108 +++++++++++
>  linux-headers/asm-loongarch/mman.h            |   1 +
>  linux-headers/asm-loongarch/unistd.h          |   5 +
>  linux-headers/asm-mips/unistd_n32.h           |   4 +
>  linux-headers/asm-mips/unistd_n64.h           |   4 +
>  linux-headers/asm-mips/unistd_o32.h           |   4 +
>  linux-headers/asm-powerpc/unistd_32.h         |   4 +
>  linux-headers/asm-powerpc/unistd_64.h         |   4 +
>  linux-headers/asm-riscv/kvm.h                 |  12 ++
>  linux-headers/asm-riscv/ptrace.h              | 132 +++++++++++++
>  linux-headers/asm-s390/unistd_32.h            |   4 +
>  linux-headers/asm-s390/unistd_64.h            |   4 +
>  linux-headers/asm-x86/unistd_32.h             |   4 +
>  linux-headers/asm-x86/unistd_64.h             |   3 +
>  linux-headers/asm-x86/unistd_x32.h            |   3 +
>  linux-headers/linux/iommufd.h                 | 180 +++++++++++++++++-
>  linux-headers/linux/kvm.h                     |  11 ++
>  linux-headers/linux/psp-sev.h                 |   1 +
>  linux-headers/linux/stddef.h                  |   7 +
>  linux-headers/linux/userfaultfd.h             |   9 +-
>  linux-headers/linux/vfio.h                    |  47 +++--
>  linux-headers/linux/vhost.h                   |   8 +
>  scripts/update-linux-headers.sh               |   3 +
>  target/riscv/kvm/kvm-cpu.c                    | 103 ++++++++++
>  32 files changed, 735 insertions(+), 26 deletions(-)
>  create mode 100644 linux-headers/asm-loongarch/bitsperlong.h
>  create mode 100644 linux-headers/asm-loongarch/kvm.h
>  create mode 100644 linux-headers/asm-loongarch/mman.h
>  create mode 100644 linux-headers/asm-loongarch/unistd.h
>  create mode 100644 linux-headers/asm-riscv/ptrace.h
>
> --
> 2.41.0
>
>