瀏覽代碼

KVM: PIT: control word is write-only

PIT control word (address 0x43) is write-only, reads are undefined.

Cc: stable@kernel.org
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Marcelo Tosatti 15 年之前
父節點
當前提交
ee73f656a6
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      arch/x86/kvm/i8254.c

+ 3 - 0
arch/x86/kvm/i8254.c

@@ -467,6 +467,9 @@ static int pit_ioport_read(struct kvm_io_device *this,
 		return -EOPNOTSUPP;
 
 	addr &= KVM_PIT_CHANNEL_MASK;
+	if (addr == 3)
+		return 0;
+
 	s = &pit_state->channels[addr];
 
 	mutex_lock(&pit_state->lock);