[PATCH 3/5] LoongArch: KVM: Add IRR and ISR register read emulation

Bibo Mao posted 5 patches 6 months ago
[PATCH 3/5] LoongArch: KVM: Add IRR and ISR register read emulation
Posted by Bibo Mao 6 months ago
With 7A1000 user manual, there is register PCH_PIC_INT_IRR_START
and PCH_PIC_INT_ISR_START, add read access emulation in function
loongarch_pch_pic_read() here.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
 arch/loongarch/kvm/intc/pch_pic.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/loongarch/kvm/intc/pch_pic.c b/arch/loongarch/kvm/intc/pch_pic.c
index 70b8cbeea869..2e2613c436f6 100644
--- a/arch/loongarch/kvm/intc/pch_pic.c
+++ b/arch/loongarch/kvm/intc/pch_pic.c
@@ -158,6 +158,12 @@ static int loongarch_pch_pic_read(struct loongarch_pch_pic *s, gpa_t addr, int l
 	case PCH_PIC_POLARITY_START ... PCH_PIC_POLARITY_END:
 		data = s->polarity;
 		break;
+	case PCH_PIC_INT_IRR_START:
+		data = s->irr;
+		break;
+	case PCH_PIC_INT_ISR_START:
+		data = s->isr;
+		break;
 	default:
 		ret = -EINVAL;
 	}
-- 
2.39.3