[tip:tools/kvm] kvmtool, seabios: Ignore BIOS POST legacy registers

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

 



Commit-ID:  712b3e2a97ddfffb0f22daecac0774fb848ebf67
Gitweb:     http://git.kernel.org/tip/712b3e2a97ddfffb0f22daecac0774fb848ebf67
Author:     Pekka Enberg <penberg@xxxxxxxxxx>
AuthorDate: Fri, 24 Feb 2012 20:20:16 +0200
Committer:  Pekka Enberg <penberg@xxxxxxxxxx>
CommitDate: Thu, 11 Jul 2013 10:09:48 +0300

kvmtool, seabios: Ignore BIOS POST legacy registers

This makes SeaBIOS limp along all the way to boot menu:

  [penberg@tux kvm]$ ./vm run --firmware /usr/share/seabios/bios.bin
    # lkvm run -k ../../arch/x86/boot/bzImage -m 448 -c 4 --name guest-11658
  Start bios (version 0.6.0)
  Unable to unlock ram - bridge not found
  Ram Size=0x00100000 (0x0000000000000000 high)
  CPU Mhz=13
  Found 1 cpu(s) max supported 1 cpu(s)
  PCI: bus=0 devfn=0x08: vendor_id=0x1af4 device_id=0x1009
  PCI: bus=0 devfn=0x10: vendor_id=0x1af4 device_id=0x1009
  PCI: bus=0 devfn=0x18: vendor_id=0x1af4 device_id=0x1000
  region 0: 0x00000000
  region 1: 0x00000000
  WARNING - Unable to allocate resource at mptable_init:26!
  WARNING - Unable to allocate resource at smbios_init:381!
  Scan for VGA option rom
  WARNING - Timeout at i8042_wait_read:35!
  Found 2 lpt ports
  Found 4 serial ports
  Scan for option roms
  Press F12 for boot menu.

Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 tools/kvm/hw/i8042.c   |  8 ++++++++
 tools/kvm/x86/ioport.c | 15 +++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/tools/kvm/hw/i8042.c b/tools/kvm/hw/i8042.c
index 9035732..4a12ee7 100644
--- a/tools/kvm/hw/i8042.c
+++ b/tools/kvm/hw/i8042.c
@@ -19,6 +19,7 @@
  * Registers
  */
 #define I8042_DATA_REG		0x60
+#define I8042_PORT_B_REG	0x61
 #define I8042_COMMAND_REG	0x64
 
 /*
@@ -307,6 +308,10 @@ static bool kbd_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data,
 		ioport__write32(data, value);
 		break;
 	}
+	case I8042_PORT_B_REG: {
+		ioport__write8(data, 0x20);
+		break;
+	}
 	default:
 		return false;
 	}
@@ -327,6 +332,9 @@ static bool kbd_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data
 		kbd_write_data(value);
 		break;
 	}
+	case I8042_PORT_B_REG: {
+		break;
+	}
 	default:
 		return false;
 	}
diff --git a/tools/kvm/x86/ioport.c b/tools/kvm/x86/ioport.c
index 03a1286..11a1592 100644
--- a/tools/kvm/x86/ioport.c
+++ b/tools/kvm/x86/ioport.c
@@ -73,6 +73,9 @@ void ioport__setup_arch(struct kvm *kvm)
 {
 	/* Legacy ioport setup */
 
+	/* 0000 - 001F - DMA1 controller */
+	ioport__register(kvm, 0x0000, &dummy_read_write_ioport_ops, 32, NULL);
+
 	/* 0x0020 - 0x003F - 8259A PIC 1 */
 	ioport__register(kvm, 0x0020, &dummy_read_write_ioport_ops, 2, NULL);
 
@@ -85,6 +88,9 @@ void ioport__setup_arch(struct kvm *kvm)
 	/* 0x00A0 - 0x00AF - 8259A PIC 2 */
 	ioport__register(kvm, 0x00A0, &dummy_read_write_ioport_ops, 2, NULL);
 
+	/* 00C0 - 001F - DMA2 controller */
+	ioport__register(kvm, 0x00C0, &dummy_read_write_ioport_ops, 32, NULL);
+
 	/* PORT 00E0-00EF are 'motherboard specific' so we use them for our
 	   internal debugging purposes.  */
 	ioport__register(kvm, IOPORT_DBG, &debug_ops, 1, NULL);
@@ -95,9 +101,18 @@ void ioport__setup_arch(struct kvm *kvm)
 	/* 0x00F0 - 0x00FF - Math co-processor */
 	ioport__register(kvm, 0x00F0, &dummy_write_only_ioport_ops, 2, NULL);
 
+	/* PORT 0278-027A - PARALLEL PRINTER PORT (usually LPT1, sometimes LPT2) */
+	ioport__register(kvm, 0x0278, &dummy_read_write_ioport_ops, 3, NULL);
+
+	/* PORT 0378-037A - PARALLEL PRINTER PORT (usually LPT2, sometimes LPT3) */
+	ioport__register(kvm, 0x0378, &dummy_read_write_ioport_ops, 3, NULL);
+
 	/* PORT 03D4-03D5 - COLOR VIDEO - CRT CONTROL REGISTERS */
 	ioport__register(kvm, 0x03D4, &dummy_read_write_ioport_ops, 1, NULL);
 	ioport__register(kvm, 0x03D5, &dummy_write_only_ioport_ops, 1, NULL);
 
 	ioport__register(kvm, 0x402, &seabios_debug_ops, 1, NULL);
+
+	/* 0510 - QEMU BIOS configuration register */
+	ioport__register(kvm, 0x510, &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