summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2014-10-01 23:15:23 +0000
committergrehan <grehan@FreeBSD.org>2014-10-01 23:15:23 +0000
commitd19a0d5cecb063295c29d7613ae47b2c368c7709 (patch)
treede084450df3be27bee586f436c6b19d4695add6b /sys/amd64
parent5f63f50572936527c79a35d2d2b866a59ce277ec (diff)
downloadFreeBSD-src-d19a0d5cecb063295c29d7613ae47b2c368c7709.zip
FreeBSD-src-d19a0d5cecb063295c29d7613ae47b2c368c7709.tar.gz
MFC r272193
Allow the PIC's IMR register to be read before ICW initialisation. As of git submit e179f6914152eca9, the Linux kernel does a simple probe of the PIC by writing a pattern to the IMR and then reading it back, prior to the init sequence of ICW words. The bhyve PIC emulation wasn't allowing the IMR to be read until the ICW sequence was complete. This limitation isn't required so relax the test. With this change, Linux kernels 3.15-rc2 and later won't hang on boot when calibrating the local APIC. Approved by: re (gjb)
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/vmm/io/vatpic.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/sys/amd64/vmm/io/vatpic.c b/sys/amd64/vmm/io/vatpic.c
index 38fc458..15620d5 100644
--- a/sys/amd64/vmm/io/vatpic.c
+++ b/sys/amd64/vmm/io/vatpic.c
@@ -600,20 +600,19 @@ vatpic_write(struct vatpic *vatpic, struct atpic *atpic, bool in, int port,
VATPIC_LOCK(vatpic);
if (port & ICU_IMR_OFFSET) {
- if (atpic->ready) {
+ switch (atpic->icw_num) {
+ case 2:
+ error = vatpic_icw2(vatpic, atpic, val);
+ break;
+ case 3:
+ error = vatpic_icw3(vatpic, atpic, val);
+ break;
+ case 4:
+ error = vatpic_icw4(vatpic, atpic, val);
+ break;
+ default:
error = vatpic_ocw1(vatpic, atpic, val);
- } else {
- switch (atpic->icw_num) {
- case 2:
- error = vatpic_icw2(vatpic, atpic, val);
- break;
- case 3:
- error = vatpic_icw3(vatpic, atpic, val);
- break;
- case 4:
- error = vatpic_icw4(vatpic, atpic, val);
- break;
- }
+ break;
}
} else {
if (val & (1 << 4))
OpenPOWER on IntegriCloud