diff options
| author | Song Gao <gaosong@loongson.cn> | 2025-09-16 20:21:01 +0800 |
|---|---|---|
| committer | Song Gao <gaosong@loongson.cn> | 2025-09-28 17:31:04 +0800 |
| commit | 86f4c80ab4a0d7a76d000515425d025004d6cd8b (patch) | |
| tree | bcdf4cc019e034236b57f987ae01269d10b1264f /hw/loongarch/virt.c | |
| parent | 2002711e3dec0f0bb3eb86ee1e108ec9e95ed46f (diff) | |
| download | focaccia-qemu-86f4c80ab4a0d7a76d000515425d025004d6cd8b.tar.gz focaccia-qemu-86f4c80ab4a0d7a76d000515425d025004d6cd8b.zip | |
hw/loongarch: add misc register support dmsi
Add feature register and misc register for dmsi feature checking and setting Signed-off-by: Song Gao <gaosong@loongson.cn> Reviewed-by: Bibo Mao <maobibo@loongson.cn> Message-ID: <20250916122109.749813-4-gaosong@loongson.cn>
Diffstat (limited to 'hw/loongarch/virt.c')
| -rw-r--r-- | hw/loongarch/virt.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 256af63d73..a89d1a1ca1 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -564,6 +564,10 @@ static MemTxResult virt_iocsr_misc_write(void *opaque, hwaddr addr, return MEMTX_OK; } + if (virt_has_dmsi(lvms) && val & BIT_ULL(IOCSRM_DMSI_EN)) { + lvms->misc_status |= BIT_ULL(IOCSRM_DMSI_EN); + } + features = address_space_ldl(&lvms->as_iocsr, EXTIOI_VIRT_BASE + EXTIOI_VIRT_CONFIG, attrs, NULL); @@ -599,6 +603,9 @@ static MemTxResult virt_iocsr_misc_read(void *opaque, hwaddr addr, break; case FEATURE_REG: ret = BIT(IOCSRF_MSI) | BIT(IOCSRF_EXTIOI) | BIT(IOCSRF_CSRIPI); + if (virt_has_dmsi(lvms)) { + ret |= BIT(IOCSRF_DMSI); + } if (kvm_enabled()) { ret |= BIT(IOCSRF_VM); } @@ -628,6 +635,10 @@ static MemTxResult virt_iocsr_misc_read(void *opaque, hwaddr addr, if (features & BIT(EXTIOI_ENABLE_INT_ENCODE)) { ret |= BIT_ULL(IOCSRM_EXTIOI_INT_ENCODE); } + if (virt_has_dmsi(lvms) && + (lvms->misc_status & BIT_ULL(IOCSRM_DMSI_EN))) { + ret |= BIT_ULL(IOCSRM_DMSI_EN); + } break; default: g_assert_not_reached(); |