]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/loongarch/virt: Disable emulation with IOCSR misc register
authorBibo Mao <maobibo@loongson.cn>
Fri, 6 Jun 2025 06:35:23 +0000 (14:35 +0800)
committerSong Gao <gaosong@loongson.cn>
Thu, 19 Jun 2025 07:54:30 +0000 (15:54 +0800)
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>
hw/loongarch/virt.c

index 34dfbd13e5c56efda66575f95adb6140b06229ec..e5468b6af900b6a87025187104ed0e6f5c4585aa 100644 (file)
@@ -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;