[tip:tools/kvm] kvm tools: Fast A20 gate emulation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  cfb8234face2dbd1edfa300ddb531db9c1bdeb3d
Gitweb:     http://git.kernel.org/tip/cfb8234face2dbd1edfa300ddb531db9c1bdeb3d
Author:     Pekka Enberg <penberg@xxxxxxxxxx>
AuthorDate: Fri, 24 Feb 2012 20:20:16 +0200
Committer:  Pekka Enberg <penberg@xxxxxxxxxx>
CommitDate: Mon, 5 Nov 2012 09:39:23 +0200

kvm tools: Fast A20 gate emulation

Add simple "fast A20 gate" PS/2 system control port emulation for
SeaBIOS that probes the port.  As A20 gate is always enabled under KVM,
ignore writes to the port and report back that the gate is enabled.

Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 tools/kvm/x86/ioport.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/tools/kvm/x86/ioport.c b/tools/kvm/x86/ioport.c
index e35d0ee..824ef25 100644
--- a/tools/kvm/x86/ioport.c
+++ b/tools/kvm/x86/ioport.c
@@ -46,6 +46,25 @@ static struct ioport_operations dummy_write_only_ioport_ops = {
 	.io_out		= dummy_io_out,
 };
 
+/*
+ * The "fast A20 gate"
+ */
+
+static bool ps2_control_a_io_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
+{
+	/*
+	 * A20 is always enabled.
+	 */
+	ioport__write8(data, 0x02);
+
+	return true;
+}
+
+static struct ioport_operations ps2_control_a_ops = {
+	.io_in		= ps2_control_a_io_in,
+	.io_out		= dummy_io_out,
+};
+
 void ioport__setup_arch(struct kvm *kvm)
 {
 	/* Legacy ioport setup */
@@ -56,6 +75,9 @@ void ioport__setup_arch(struct kvm *kvm)
 	/* PORT 0040-005F - PIT - PROGRAMMABLE INTERVAL TIMER (8253, 8254) */
 	ioport__register(kvm, 0x0040, &dummy_read_write_ioport_ops, 4, NULL);
 
+	/* 0092 - PS/2 system control port A */
+	ioport__register(kvm, 0x0092, &ps2_control_a_ops, 1, NULL);
+
 	/* 0x00A0 - 0x00AF - 8259A PIC 2 */
 	ioport__register(kvm, 0x00A0, &dummy_read_write_ioport_ops, 2, NULL);
 
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux