mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
RISC-V PR for 9.0
* Make vector whole-register move (vmv) depend on vtype register * Fix th.dcache.cval1 priviledge check * Don't allow write mstatus_vs without RVV * Use hwaddr instead of target_ulong for RV32 * Fix machine IDs QOM getters\ * Fix KVM reg id sizes * ACPI: Enable AIA, PLIC and update RHCT * Fix the interrupts-extended property format of PLIC * Add support for Zacas extension * Add amocas.[w,d,q] instructions * Document acpi parameter of virt machine * RVA22 profiles support * Remove group setting of KVM AIA if the machine only has 1 socket * Add RVV CSRs to KVM * sifive_u: Update S-mode U-Boot image build instructions * Upgrade OpenSBI from v1.3.1 to v1.4 * pmp: Ignore writes when RW=01 and MML=0 * Assert that the CSR numbers will be correct * Don't adjust vscause for exceptions * Ensure mideleg is set correctly on reset -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEaukCtqfKh31tZZKWr3yVEwxTgBMFAmWeW8kACgkQr3yVEwxT gBMB3BAAtpb7dC/NqDOjo/LjGf81wYUnF0KcfJUIbuHEM9S03mKJEvngV/sUhg+A fzsoJazijQZk2+Y02WLT/o+ppRDegb4P6n54Nn13xr024Dn2jf45+EKDLI+vtU5y lhwp/LH3SEo2MM/Qr0njl8+jJ7W9adhZeK6x+NFaLaQJ291xupbcwEnScdv2bPAo gvbM6yrfUoZ25MsQKIDGssozdGRwOD/keAT0q8C0gKDamqXBDrI80BOVhRms+uLm R33DXsAegPKluJTa9gfaWFI0eK34WHXRvSIjE36nZlGNNgqLAVdM2/QozMVz4cKA Ymz1nzqB9HeSn1pM4KCK/Y3LH89qLGWtyHYgldiDXA/wSyKajwkbXSWFOT9gPDqV i+5BRDvU0zIeMIt+ROqNKgx1Hry6U2aycMNsdHTmygJbGEpiTaXuES5tt+LKsyHe w/7a6wPd/kh9LQhXYQ4qbn7L534tWvn8zWyvKLZLxmYPcOn6SdjFbKWmk5ARky2W sx9ojn9ANlYaLfzQ3TMRcIhWD6n8Si3KFNiQ3353E8xkRkyfu0WHyXAy8/kIc5UT nScO2YD68XkdkcLF6uLUKuGiVZXFWXRY1Ttz9tvEmBckVsg6TIkoMONHeUWNP7ly A0bJwN5qEOk6XIYKHWwX5UzvkcfUpOb5VmuLuv3gRoNX0A7/+fc= =5K9J -----END PGP SIGNATURE----- Merge tag 'pull-riscv-to-apply-20240110' of https://github.com/alistair23/qemu into staging RISC-V PR for 9.0 * Make vector whole-register move (vmv) depend on vtype register * Fix th.dcache.cval1 priviledge check * Don't allow write mstatus_vs without RVV * Use hwaddr instead of target_ulong for RV32 * Fix machine IDs QOM getters\ * Fix KVM reg id sizes * ACPI: Enable AIA, PLIC and update RHCT * Fix the interrupts-extended property format of PLIC * Add support for Zacas extension * Add amocas.[w,d,q] instructions * Document acpi parameter of virt machine * RVA22 profiles support * Remove group setting of KVM AIA if the machine only has 1 socket * Add RVV CSRs to KVM * sifive_u: Update S-mode U-Boot image build instructions * Upgrade OpenSBI from v1.3.1 to v1.4 * pmp: Ignore writes when RW=01 and MML=0 * Assert that the CSR numbers will be correct * Don't adjust vscause for exceptions * Ensure mideleg is set correctly on reset # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEEaukCtqfKh31tZZKWr3yVEwxTgBMFAmWeW8kACgkQr3yVEwxT # gBMB3BAAtpb7dC/NqDOjo/LjGf81wYUnF0KcfJUIbuHEM9S03mKJEvngV/sUhg+A # fzsoJazijQZk2+Y02WLT/o+ppRDegb4P6n54Nn13xr024Dn2jf45+EKDLI+vtU5y # lhwp/LH3SEo2MM/Qr0njl8+jJ7W9adhZeK6x+NFaLaQJ291xupbcwEnScdv2bPAo # gvbM6yrfUoZ25MsQKIDGssozdGRwOD/keAT0q8C0gKDamqXBDrI80BOVhRms+uLm # R33DXsAegPKluJTa9gfaWFI0eK34WHXRvSIjE36nZlGNNgqLAVdM2/QozMVz4cKA # Ymz1nzqB9HeSn1pM4KCK/Y3LH89qLGWtyHYgldiDXA/wSyKajwkbXSWFOT9gPDqV # i+5BRDvU0zIeMIt+ROqNKgx1Hry6U2aycMNsdHTmygJbGEpiTaXuES5tt+LKsyHe # w/7a6wPd/kh9LQhXYQ4qbn7L534tWvn8zWyvKLZLxmYPcOn6SdjFbKWmk5ARky2W # sx9ojn9ANlYaLfzQ3TMRcIhWD6n8Si3KFNiQ3353E8xkRkyfu0WHyXAy8/kIc5UT # nScO2YD68XkdkcLF6uLUKuGiVZXFWXRY1Ttz9tvEmBckVsg6TIkoMONHeUWNP7ly # A0bJwN5qEOk6XIYKHWwX5UzvkcfUpOb5VmuLuv3gRoNX0A7/+fc= # =5K9J # -----END PGP SIGNATURE----- # gpg: Signature made Wed 10 Jan 2024 08:56:41 GMT # gpg: using RSA key 6AE902B6A7CA877D6D659296AF7C95130C538013 # gpg: Good signature from "Alistair Francis <alistair@alistair23.me>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6AE9 02B6 A7CA 877D 6D65 9296 AF7C 9513 0C53 8013 * tag 'pull-riscv-to-apply-20240110' of https://github.com/alistair23/qemu: (65 commits) target/riscv: Ensure mideleg is set correctly on reset target/riscv: Don't adjust vscause for exceptions target/riscv: Assert that the CSR numbers will be correct target/riscv: pmp: Ignore writes when RW=01 and MML=0 roms/opensbi: Upgrade from v1.3.1 to v1.4 docs/system/riscv: sifive_u: Update S-mode U-Boot image build instructions target/riscv/kvm: add RVV and Vector CSR regs target/riscv/kvm: do PR_RISCV_V_SET_CONTROL during realize() linux-headers: riscv: add ptrace.h linux-headers: Update to Linux v6.7-rc5 target/riscv/kvm.c: remove group setting of KVM AIA if the machine only has 1 socket target/riscv: add rva22s64 cpu target/riscv: add RVA22S64 profile target/riscv: add 'parent' in profile description target/riscv: add satp_mode profile support target/riscv/cpu.c: add riscv_cpu_is_32bit() target/riscv/cpu.c: finalize satp_mode earlier target/riscv: add priv ver restriction to profiles target/riscv: implement svade target/riscv: add 'rva22u64' CPU ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
34eac35f89
68 changed files with 2248 additions and 360 deletions
15
include/hw/nvram/fw_cfg_acpi.h
Normal file
15
include/hw/nvram/fw_cfg_acpi.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* ACPI support for fw_cfg
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef FW_CFG_ACPI_H
|
||||
#define FW_CFG_ACPI_H
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "exec/hwaddr.h"
|
||||
|
||||
void fw_cfg_acpi_dsdt_add(Aml *scope, const MemMapEntry *fw_cfg_memmap);
|
||||
|
||||
#endif
|
|
@ -40,6 +40,15 @@ struct GPEXRootState {
|
|||
/*< public >*/
|
||||
};
|
||||
|
||||
struct GPEXConfig {
|
||||
MemMapEntry ecam;
|
||||
MemMapEntry mmio32;
|
||||
MemMapEntry mmio64;
|
||||
MemMapEntry pio;
|
||||
int irq;
|
||||
PCIBus *bus;
|
||||
};
|
||||
|
||||
struct GPEXHost {
|
||||
/*< private >*/
|
||||
PCIExpressHost parent_obj;
|
||||
|
@ -55,19 +64,22 @@ struct GPEXHost {
|
|||
int irq_num[GPEX_NUM_IRQS];
|
||||
|
||||
bool allow_unmapped_accesses;
|
||||
};
|
||||
|
||||
struct GPEXConfig {
|
||||
MemMapEntry ecam;
|
||||
MemMapEntry mmio32;
|
||||
MemMapEntry mmio64;
|
||||
MemMapEntry pio;
|
||||
int irq;
|
||||
PCIBus *bus;
|
||||
struct GPEXConfig gpex_cfg;
|
||||
};
|
||||
|
||||
int gpex_set_irq_num(GPEXHost *s, int index, int gsi);
|
||||
|
||||
void acpi_dsdt_add_gpex(Aml *scope, struct GPEXConfig *cfg);
|
||||
void acpi_dsdt_add_gpex_host(Aml *scope, uint32_t irq);
|
||||
|
||||
#define PCI_HOST_PIO_BASE "x-pio-base"
|
||||
#define PCI_HOST_PIO_SIZE "x-pio-size"
|
||||
#define PCI_HOST_ECAM_BASE "x-ecam-base"
|
||||
#define PCI_HOST_ECAM_SIZE "x-ecam-size"
|
||||
#define PCI_HOST_BELOW_4G_MMIO_BASE "x-below-4g-mmio-base"
|
||||
#define PCI_HOST_BELOW_4G_MMIO_SIZE "x-below-4g-mmio-size"
|
||||
#define PCI_HOST_ABOVE_4G_MMIO_BASE "x-above-4g-mmio-base"
|
||||
#define PCI_HOST_ABOVE_4G_MMIO_SIZE "x-above-4g-mmio-size"
|
||||
|
||||
#endif /* HW_GPEX_H */
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "hw/riscv/riscv_hart.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "hw/block/flash.h"
|
||||
#include "hw/intc/riscv_imsic.h"
|
||||
|
||||
#define VIRT_CPUS_MAX_BITS 9
|
||||
#define VIRT_CPUS_MAX (1 << VIRT_CPUS_MAX_BITS)
|
||||
|
@ -60,6 +61,7 @@ struct RISCVVirtState {
|
|||
char *oem_table_id;
|
||||
OnOffAuto acpi;
|
||||
const MemMapEntry *memmap;
|
||||
struct GPEXHost *gpex_host;
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -127,4 +129,28 @@ enum {
|
|||
|
||||
bool virt_is_acpi_enabled(RISCVVirtState *s);
|
||||
void virt_acpi_setup(RISCVVirtState *vms);
|
||||
uint32_t imsic_num_bits(uint32_t count);
|
||||
|
||||
/*
|
||||
* The virt machine physical address space used by some of the devices
|
||||
* namely ACLINT, PLIC, APLIC, and IMSIC depend on number of Sockets,
|
||||
* number of CPUs, and number of IMSIC guest files.
|
||||
*
|
||||
* Various limits defined by VIRT_SOCKETS_MAX_BITS, VIRT_CPUS_MAX_BITS,
|
||||
* and VIRT_IRQCHIP_MAX_GUESTS_BITS are tuned for maximum utilization
|
||||
* of virt machine physical address space.
|
||||
*/
|
||||
|
||||
#define VIRT_IMSIC_GROUP_MAX_SIZE (1U << IMSIC_MMIO_GROUP_MIN_SHIFT)
|
||||
#if VIRT_IMSIC_GROUP_MAX_SIZE < \
|
||||
IMSIC_GROUP_SIZE(VIRT_CPUS_MAX_BITS, VIRT_IRQCHIP_MAX_GUESTS_BITS)
|
||||
#error "Can't accomodate single IMSIC group in address space"
|
||||
#endif
|
||||
|
||||
#define VIRT_IMSIC_MAX_SIZE (VIRT_SOCKETS_MAX * \
|
||||
VIRT_IMSIC_GROUP_MAX_SIZE)
|
||||
#if 0x4000000 < VIRT_IMSIC_MAX_SIZE
|
||||
#error "Can't accomodate all IMSIC groups in address space"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
16
include/hw/virtio/virtio-acpi.h
Normal file
16
include/hw/virtio/virtio-acpi.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* ACPI support for virtio
|
||||
*/
|
||||
|
||||
#ifndef VIRTIO_ACPI_H
|
||||
#define VIRTIO_ACPI_H
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "exec/hwaddr.h"
|
||||
|
||||
void virtio_acpi_dsdt_add(Aml *scope, const hwaddr virtio_mmio_base,
|
||||
const hwaddr virtio_mmio_size, uint32_t mmio_irq,
|
||||
long int start_index, int num);
|
||||
|
||||
#endif
|
|
@ -322,6 +322,8 @@ extern "C" {
|
|||
* index 1 = Cr:Cb plane, [39:0] Cr1:Cb1:Cr0:Cb0 little endian
|
||||
*/
|
||||
#define DRM_FORMAT_NV15 fourcc_code('N', 'V', '1', '5') /* 2x2 subsampled Cr:Cb plane */
|
||||
#define DRM_FORMAT_NV20 fourcc_code('N', 'V', '2', '0') /* 2x1 subsampled Cr:Cb plane */
|
||||
#define DRM_FORMAT_NV30 fourcc_code('N', 'V', '3', '0') /* non-subsampled Cr:Cb plane */
|
||||
|
||||
/*
|
||||
* 2 plane YCbCr MSB aligned
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
#define PCI_HEADER_TYPE_NORMAL 0
|
||||
#define PCI_HEADER_TYPE_BRIDGE 1
|
||||
#define PCI_HEADER_TYPE_CARDBUS 2
|
||||
#define PCI_HEADER_TYPE_MFD 0x80 /* Multi-Function Device (possible) */
|
||||
|
||||
#define PCI_BIST 0x0f /* 8 bits */
|
||||
#define PCI_BIST_CODE_MASK 0x0f /* Return result */
|
||||
|
@ -637,6 +638,7 @@
|
|||
#define PCI_EXP_RTCAP 0x1e /* Root Capabilities */
|
||||
#define PCI_EXP_RTCAP_CRSVIS 0x0001 /* CRS Software Visibility capability */
|
||||
#define PCI_EXP_RTSTA 0x20 /* Root Status */
|
||||
#define PCI_EXP_RTSTA_PME_RQ_ID 0x0000ffff /* PME Requester ID */
|
||||
#define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */
|
||||
#define PCI_EXP_RTSTA_PENDING 0x00020000 /* PME pending */
|
||||
/*
|
||||
|
@ -930,12 +932,13 @@
|
|||
|
||||
/* Process Address Space ID */
|
||||
#define PCI_PASID_CAP 0x04 /* PASID feature register */
|
||||
#define PCI_PASID_CAP_EXEC 0x02 /* Exec permissions Supported */
|
||||
#define PCI_PASID_CAP_PRIV 0x04 /* Privilege Mode Supported */
|
||||
#define PCI_PASID_CAP_EXEC 0x0002 /* Exec permissions Supported */
|
||||
#define PCI_PASID_CAP_PRIV 0x0004 /* Privilege Mode Supported */
|
||||
#define PCI_PASID_CAP_WIDTH 0x1f00
|
||||
#define PCI_PASID_CTRL 0x06 /* PASID control register */
|
||||
#define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */
|
||||
#define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */
|
||||
#define PCI_PASID_CTRL_PRIV 0x04 /* Privilege Mode Enable */
|
||||
#define PCI_PASID_CTRL_ENABLE 0x0001 /* Enable bit */
|
||||
#define PCI_PASID_CTRL_EXEC 0x0002 /* Exec permissions Enable */
|
||||
#define PCI_PASID_CTRL_PRIV 0x0004 /* Privilege Mode Enable */
|
||||
#define PCI_EXT_CAP_PASID_SIZEOF 8
|
||||
|
||||
/* Single Root I/O Virtualization */
|
||||
|
@ -975,6 +978,8 @@
|
|||
#define PCI_LTR_VALUE_MASK 0x000003ff
|
||||
#define PCI_LTR_SCALE_MASK 0x00001c00
|
||||
#define PCI_LTR_SCALE_SHIFT 10
|
||||
#define PCI_LTR_NOSNOOP_VALUE 0x03ff0000 /* Max No-Snoop Latency Value */
|
||||
#define PCI_LTR_NOSNOOP_SCALE 0x1c000000 /* Scale for Max Value */
|
||||
#define PCI_EXT_CAP_LTR_SIZEOF 8
|
||||
|
||||
/* Access Control Service */
|
||||
|
@ -1042,9 +1047,16 @@
|
|||
#define PCI_EXP_DPC_STATUS 0x08 /* DPC Status */
|
||||
#define PCI_EXP_DPC_STATUS_TRIGGER 0x0001 /* Trigger Status */
|
||||
#define PCI_EXP_DPC_STATUS_TRIGGER_RSN 0x0006 /* Trigger Reason */
|
||||
#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_UNCOR 0x0000 /* Uncorrectable error */
|
||||
#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_NFE 0x0002 /* Rcvd ERR_NONFATAL */
|
||||
#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_FE 0x0004 /* Rcvd ERR_FATAL */
|
||||
#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_IN_EXT 0x0006 /* Reason in Trig Reason Extension field */
|
||||
#define PCI_EXP_DPC_STATUS_INTERRUPT 0x0008 /* Interrupt Status */
|
||||
#define PCI_EXP_DPC_RP_BUSY 0x0010 /* Root Port Busy */
|
||||
#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_EXT 0x0060 /* Trig Reason Extension */
|
||||
#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_RP_PIO 0x0000 /* RP PIO error */
|
||||
#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_SW_TRIGGER 0x0020 /* DPC SW Trigger bit */
|
||||
#define PCI_EXP_DPC_RP_PIO_FEP 0x1f00 /* RP PIO First Err Ptr */
|
||||
|
||||
#define PCI_EXP_DPC_SOURCE_ID 0x0A /* DPC Source Identifier */
|
||||
|
||||
|
@ -1088,6 +1100,8 @@
|
|||
#define PCI_L1SS_CTL1_LTR_L12_TH_VALUE 0x03ff0000 /* LTR_L1.2_THRESHOLD_Value */
|
||||
#define PCI_L1SS_CTL1_LTR_L12_TH_SCALE 0xe0000000 /* LTR_L1.2_THRESHOLD_Scale */
|
||||
#define PCI_L1SS_CTL2 0x0c /* Control 2 Register */
|
||||
#define PCI_L1SS_CTL2_T_PWR_ON_SCALE 0x00000003 /* T_POWER_ON Scale */
|
||||
#define PCI_L1SS_CTL2_T_PWR_ON_VALUE 0x000000f8 /* T_POWER_ON Value */
|
||||
|
||||
/* Designated Vendor-Specific (DVSEC, PCI_EXT_CAP_ID_DVSEC) */
|
||||
#define PCI_DVSEC_HEADER1 0x4 /* Designated Vendor-Specific Header1 */
|
||||
|
|
|
@ -185,5 +185,12 @@ struct vhost_vdpa_iova_range {
|
|||
* DRIVER_OK
|
||||
*/
|
||||
#define VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK 0x6
|
||||
/* Device may expose the virtqueue's descriptor area, driver area and
|
||||
* device area to a different group for ASID binding than where its
|
||||
* buffers may reside. Requires VHOST_BACKEND_F_IOTLB_ASID.
|
||||
*/
|
||||
#define VHOST_BACKEND_F_DESC_ASID 0x7
|
||||
/* IOTLB don't flush memory mapping across device reset */
|
||||
#define VHOST_BACKEND_F_IOTLB_PERSIST 0x8
|
||||
|
||||
#endif
|
||||
|
|
|
@ -103,6 +103,11 @@
|
|||
*/
|
||||
#define VIRTIO_F_NOTIFICATION_DATA 38
|
||||
|
||||
/* This feature indicates that the driver uses the data provided by the device
|
||||
* as a virtqueue identifier in available buffer notifications.
|
||||
*/
|
||||
#define VIRTIO_F_NOTIF_CONFIG_DATA 39
|
||||
|
||||
/*
|
||||
* This feature indicates that the driver can reset a queue individually.
|
||||
*/
|
||||
|
|
|
@ -166,6 +166,17 @@ struct virtio_pci_common_cfg {
|
|||
uint32_t queue_used_hi; /* read-write */
|
||||
};
|
||||
|
||||
/*
|
||||
* Warning: do not use sizeof on this: use offsetofend for
|
||||
* specific fields you need.
|
||||
*/
|
||||
struct virtio_pci_modern_common_cfg {
|
||||
struct virtio_pci_common_cfg cfg;
|
||||
|
||||
uint16_t queue_notify_data; /* read-write */
|
||||
uint16_t queue_reset; /* read-write */
|
||||
};
|
||||
|
||||
/* Fields in VIRTIO_PCI_CAP_PCI_CFG: */
|
||||
struct virtio_pci_cfg_cap {
|
||||
struct virtio_pci_cap cap;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue