[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230418104743.842683-2-alexjlzheng@tencent.com>
Date: Tue, 18 Apr 2023 18:47:44 +0800
From: alexjlzheng@...il.com
To: seanjc@...gle.com
Cc: pbonzini@...hat.com, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
hpa@...or.com, kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
Jinliang Zheng <alexjlzheng@...cent.com>
Subject: [PATCH 1/2] KVM: x86: Fix poll command
From: Jinliang Zheng <alexjlzheng@...cent.com>
According to the hardware manual, when the Poll command is issued, the
byte returned by the I/O read is 1 in Bit 7 when there is an interrupt,
and the highest priority binary code in Bits 2:0. The current pic
simulation code is not implemented strictly according to the above
expression.
Fix the implementation of pic_poll_read(), set Bit 7 when there is an
interrupt.
Signed-off-by: Jinliang Zheng <alexjlzheng@...cent.com>
---
arch/x86/kvm/i8259.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
index 4756bcb5724f..861872e2641a 100644
--- a/arch/x86/kvm/i8259.c
+++ b/arch/x86/kvm/i8259.c
@@ -411,6 +411,8 @@ static u32 pic_poll_read(struct kvm_kpic_state *s, u32 addr1)
pic_clear_isr(s, ret);
if (addr1 >> 7 || ret != 2)
pic_update_irq(s->pics_state);
+ /* Bit 7 is 1, means there's an interrupt */
+ ret |= 0x80;
} else {
ret = 0x07;
pic_update_irq(s->pics_state);
--
2.31.1
Powered by blists - more mailing lists