mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge tag 'pull-riscv-to-apply-20241107' of https://github.com/alistair23/qemu into staging
RISC-V PR for 9.2 * Fix broken SiFive UART on big endian hosts * Fix IOMMU Coverity issues * Improve the performance of vector unit-stride/whole register ld/st instructions * Update kvm exts to Linux v6.11 * Convert the RV32-on-RV64 riscv test # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEEaukCtqfKh31tZZKWr3yVEwxTgBMFAmcsPXsACgkQr3yVEwxT # gBOMjBAAm91x1C+mMLehRo4ESquziP1fGTPO0EyZmv/16Ze2AuKlfs/zPwbypmMY # VuUAsl2+/+XfiIQ+p7XN6YMrI9ixVluEHu6/o0FXObPyMOBE+5fLF+rqWfqmvbin # ifFmh8U7nkQ6Y9fxa7KOph8G5C+I4nDZRi4D6DS01+gljIBbNwxHz07YwAShoJiF # IlqwaiUmZAzA8thR5+WskpYLNOAdfR/0Z67QRc7xw7y3xcRUCsbwyUKCZMC7lWbJ # yvQeWPaOfFetbu7JFUZMlMwwNF1AGe6rigCaqT6Xjt0uBoeJLyXb6IOEOG8BN5aB # o+EeFK4gvn18qqegY1R7YNwS9p3XVvPnlw7AxF6YfkgOEb0qgAYhWabXG0CGizoH # A9prIg1Vft+qvOkAknq7v2knrv2mZ8VJsH4f+gBkKWWRnwpwE3S+jdhbbbw7af6W # AqkKgf96Klncikf/tYtnwUqG/42/yueUPg4Qfp2hUaxgy3M/ichze3FPF/DatS7B # ti/nlb+rXwheKaHUXFG8HpB7S4VNYToOeX+o79lXuV4XJAOVWEUVkE/LFV0B8hKT # O1NpLiF8Ql5MI0ylnUZ+kd/QFNMROrnzDJClOuNKEgBO+wMwZ+f2AKo/FWsCR9gD # 8i07SDj9GE+EmDpHtOgWMzp7KcpdqLNmQMBrezpLex/Z3390sQ4= # =dYLw # -----END PGP SIGNATURE----- # gpg: Signature made Thu 07 Nov 2024 04:09:31 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-20241107' of https://github.com/alistair23/qemu: tests/functional: Convert the RV32-on-RV64 riscv test target/riscv/kvm: Update kvm exts to Linux v6.11 target/riscv: Inline unit-stride ld/st and corresponding functions for performance target/riscv: rvv: Provide group continuous ld/st flow for unit-stride ld/st instructions target/riscv: rvv: Provide a fast path using direct access to host ram for unit-stride load-only-first load instructions target/riscv: rvv: Provide a fast path using direct access to host ram for unit-stride whole register load/store target/riscv: rvv: Provide a fast path using direct access to host ram for unmasked unit-stride load/store target/riscv: rvv: Replace VSTART_CHECK_EARLY_EXIT in vext_ldst_us target/riscv: Set vdata.vm field for vector load/store whole register instructions hw/riscv/riscv-iommu: fix riscv_iommu_validate_process_ctx() check hw/riscv/riscv-iommu: change 'depth' to int hw/char/sifive_uart: Fix broken UART on big endian hosts Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -174,10 +174,11 @@ sifive_uart_write(void *opaque, hwaddr addr,
|
||||
{
|
||||
SiFiveUARTState *s = opaque;
|
||||
uint32_t value = val64;
|
||||
uint8_t ch = value;
|
||||
|
||||
switch (addr) {
|
||||
case SIFIVE_UART_TXFIFO:
|
||||
sifive_uart_write_tx_fifo(s, (uint8_t *) &value, 1);
|
||||
sifive_uart_write_tx_fifo(s, &ch, 1);
|
||||
return;
|
||||
case SIFIVE_UART_IE:
|
||||
s->ie = val64;
|
||||
|
||||
@@ -820,7 +820,7 @@ static bool riscv_iommu_validate_process_ctx(RISCVIOMMUState *s,
|
||||
}
|
||||
|
||||
if (ctx->tc & RISCV_IOMMU_DC_TC_SXL) {
|
||||
if (mode == RISCV_IOMMU_CAP_SV32 &&
|
||||
if (mode == RISCV_IOMMU_DC_FSC_IOSATP_MODE_SV32 &&
|
||||
!(s->cap & RISCV_IOMMU_CAP_SV32)) {
|
||||
return false;
|
||||
}
|
||||
@@ -863,7 +863,7 @@ static int riscv_iommu_ctx_fetch(RISCVIOMMUState *s, RISCVIOMMUContext *ctx)
|
||||
/* Device Context format: 0: extended (64 bytes) | 1: base (32 bytes) */
|
||||
const int dc_fmt = !s->enable_msi;
|
||||
const size_t dc_len = sizeof(dc) >> dc_fmt;
|
||||
unsigned depth;
|
||||
int depth;
|
||||
uint64_t de;
|
||||
|
||||
switch (mode) {
|
||||
|
||||
@@ -770,6 +770,7 @@ static bool ld_us_mask_op(DisasContext *s, arg_vlm_v *a, uint8_t eew)
|
||||
/* Mask destination register are always tail-agnostic */
|
||||
data = FIELD_DP32(data, VDATA, VTA, s->cfg_vta_all_1s);
|
||||
data = FIELD_DP32(data, VDATA, VMA, s->vma);
|
||||
data = FIELD_DP32(data, VDATA, VM, 1);
|
||||
return ldst_us_trans(a->rd, a->rs1, data, fn, s, false);
|
||||
}
|
||||
|
||||
@@ -787,6 +788,7 @@ static bool st_us_mask_op(DisasContext *s, arg_vsm_v *a, uint8_t eew)
|
||||
/* EMUL = 1, NFIELDS = 1 */
|
||||
data = FIELD_DP32(data, VDATA, LMUL, 0);
|
||||
data = FIELD_DP32(data, VDATA, NF, 1);
|
||||
data = FIELD_DP32(data, VDATA, VM, 1);
|
||||
return ldst_us_trans(a->rd, a->rs1, data, fn, s, true);
|
||||
}
|
||||
|
||||
@@ -1106,6 +1108,7 @@ static bool ldst_whole_trans(uint32_t vd, uint32_t rs1, uint32_t nf,
|
||||
TCGv_i32 desc;
|
||||
|
||||
uint32_t data = FIELD_DP32(0, VDATA, NF, nf);
|
||||
data = FIELD_DP32(data, VDATA, VM, 1);
|
||||
dest = tcg_temp_new_ptr();
|
||||
desc = tcg_constant_i32(simd_desc(s->cfg_ptr->vlenb,
|
||||
s->cfg_ptr->vlenb, data));
|
||||
|
||||
@@ -281,7 +281,10 @@ static KVMCPUConfig kvm_multi_ext_cfgs[] = {
|
||||
KVM_EXT_CFG("zihintntl", ext_zihintntl, KVM_RISCV_ISA_EXT_ZIHINTNTL),
|
||||
KVM_EXT_CFG("zihintpause", ext_zihintpause, KVM_RISCV_ISA_EXT_ZIHINTPAUSE),
|
||||
KVM_EXT_CFG("zihpm", ext_zihpm, KVM_RISCV_ISA_EXT_ZIHPM),
|
||||
KVM_EXT_CFG("zimop", ext_zimop, KVM_RISCV_ISA_EXT_ZIMOP),
|
||||
KVM_EXT_CFG("zcmop", ext_zcmop, KVM_RISCV_ISA_EXT_ZCMOP),
|
||||
KVM_EXT_CFG("zacas", ext_zacas, KVM_RISCV_ISA_EXT_ZACAS),
|
||||
KVM_EXT_CFG("zawrs", ext_zawrs, KVM_RISCV_ISA_EXT_ZAWRS),
|
||||
KVM_EXT_CFG("zfa", ext_zfa, KVM_RISCV_ISA_EXT_ZFA),
|
||||
KVM_EXT_CFG("zfh", ext_zfh, KVM_RISCV_ISA_EXT_ZFH),
|
||||
KVM_EXT_CFG("zfhmin", ext_zfhmin, KVM_RISCV_ISA_EXT_ZFHMIN),
|
||||
@@ -292,6 +295,10 @@ static KVMCPUConfig kvm_multi_ext_cfgs[] = {
|
||||
KVM_EXT_CFG("zbkc", ext_zbkc, KVM_RISCV_ISA_EXT_ZBKC),
|
||||
KVM_EXT_CFG("zbkx", ext_zbkx, KVM_RISCV_ISA_EXT_ZBKX),
|
||||
KVM_EXT_CFG("zbs", ext_zbs, KVM_RISCV_ISA_EXT_ZBS),
|
||||
KVM_EXT_CFG("zca", ext_zca, KVM_RISCV_ISA_EXT_ZCA),
|
||||
KVM_EXT_CFG("zcb", ext_zcb, KVM_RISCV_ISA_EXT_ZCB),
|
||||
KVM_EXT_CFG("zcd", ext_zcd, KVM_RISCV_ISA_EXT_ZCD),
|
||||
KVM_EXT_CFG("zcf", ext_zcf, KVM_RISCV_ISA_EXT_ZCF),
|
||||
KVM_EXT_CFG("zknd", ext_zknd, KVM_RISCV_ISA_EXT_ZKND),
|
||||
KVM_EXT_CFG("zkne", ext_zkne, KVM_RISCV_ISA_EXT_ZKNE),
|
||||
KVM_EXT_CFG("zknh", ext_zknh, KVM_RISCV_ISA_EXT_ZKNH),
|
||||
|
||||
+395
-199
File diff suppressed because it is too large
Load Diff
@@ -222,19 +222,3 @@ class TuxRunBaselineTest(QemuSystemTest):
|
||||
"rootfs.ext4.zst" :
|
||||
"e6ffd8813c8a335bc15728f2835f90539c84be7f8f5f691a8b01451b47fb4bd7"}
|
||||
self.common_tuxrun(csums=sums)
|
||||
|
||||
def test_riscv64_rv32(self):
|
||||
"""
|
||||
:avocado: tags=arch:riscv64
|
||||
:avocado: tags=machine:virt
|
||||
:avocado: tags=tuxboot:riscv32
|
||||
:avocado: tags=cpu:rv32
|
||||
"""
|
||||
sums = { "Image" :
|
||||
"89599407d7334de629a40e7ad6503c73670359eb5f5ae9d686353a3d6deccbd5",
|
||||
"fw_jump.elf" :
|
||||
"f2ef28a0b77826f79d085d3e4aa686f1159b315eff9099a37046b18936676985",
|
||||
"rootfs.ext4.zst" :
|
||||
"7168d296d0283238ea73cd5a775b3dd608e55e04c7b92b76ecce31bb13108cba" }
|
||||
|
||||
self.common_tuxrun(csums=sums)
|
||||
|
||||
@@ -23,6 +23,13 @@ class TuxRunRiscV64Test(TuxRunBaselineTest):
|
||||
'https://storage.tuxboot.com/20230331/riscv64/rootfs.ext4.zst',
|
||||
'b18e3a3bdf27be03da0b285e84cb71bf09eca071c3a087b42884b6982ed679eb')
|
||||
|
||||
ASSET_RISCV32_KERNEL = Asset(
|
||||
'https://storage.tuxboot.com/20230331/riscv32/Image',
|
||||
'89599407d7334de629a40e7ad6503c73670359eb5f5ae9d686353a3d6deccbd5')
|
||||
ASSET_RISCV32_ROOTFS = Asset(
|
||||
'https://storage.tuxboot.com/20230331/riscv32/rootfs.ext4.zst',
|
||||
'7168d296d0283238ea73cd5a775b3dd608e55e04c7b92b76ecce31bb13108cba')
|
||||
|
||||
def test_riscv64(self):
|
||||
self.set_machine('virt')
|
||||
self.common_tuxrun(kernel_asset=self.ASSET_RISCV64_KERNEL,
|
||||
@@ -34,5 +41,11 @@ class TuxRunRiscV64Test(TuxRunBaselineTest):
|
||||
self.common_tuxrun(kernel_asset=self.ASSET_RISCV64_KERNEL,
|
||||
rootfs_asset=self.ASSET_RISCV64_ROOTFS)
|
||||
|
||||
def test_riscv64_rv32(self):
|
||||
self.set_machine('virt')
|
||||
self.cpu='rv32'
|
||||
self.common_tuxrun(kernel_asset=self.ASSET_RISCV32_KERNEL,
|
||||
rootfs_asset=self.ASSET_RISCV32_ROOTFS)
|
||||
|
||||
if __name__ == '__main__':
|
||||
TuxRunBaselineTest.main()
|
||||
|
||||
Reference in New Issue
Block a user