diff options
author | Bibo Mao <maobibo@loongson.cn> | 2025-06-06 14:35:23 +0800 |
---|---|---|
committer | Song Gao <gaosong@loongson.cn> | 2025-06-19 15:54:30 +0800 |
commit | 17fb88a0fa0a13b0e2976a2fe04756337d95fe1f (patch) | |
tree | 3d88e679c4b20c1c54686b2c69733362e95386b3 | |
parent | 74586a2482575776fff5f5f75e0657524c60719d (diff) | |
download | qemu-17fb88a0fa0a13b0e2976a2fe04756337d95fe1f.zip qemu-17fb88a0fa0a13b0e2976a2fe04756337d95fe1f.tar.gz qemu-17fb88a0fa0a13b0e2976a2fe04756337d95fe1f.tar.bz2 |
hw/loongarch/virt: Disable emulation with IOCSR misc register
Register IOCSR MISC_FUNC_REG is to enable features about EXTIOI
irqchip. If EXTIOI is emulated in kernel, MISC_FUNC_REG register
should be emulated in kernel also.
Reviewed-by: Song Gao <gaosong@loongson.cn>
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Message-ID: <20250606063523.2557513-1-maobibo@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
-rw-r--r-- | hw/loongarch/virt.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 34dfbd1..e5468b6 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -522,6 +522,10 @@ static MemTxResult virt_iocsr_misc_write(void *opaque, hwaddr addr, switch (addr) { case MISC_FUNC_REG: + if (kvm_irqchip_in_kernel()) { + return MEMTX_OK; + } + if (!virt_is_veiointc_enabled(lvms)) { return MEMTX_OK; } @@ -572,6 +576,10 @@ static MemTxResult virt_iocsr_misc_read(void *opaque, hwaddr addr, ret = 0x303030354133ULL; /* "3A5000" */ break; case MISC_FUNC_REG: + if (kvm_irqchip_in_kernel()) { + return MEMTX_OK; + } + if (!virt_is_veiointc_enabled(lvms)) { ret |= BIT_ULL(IOCSRM_EXTIOI_EN); break; |