diff options
author | grehan <grehan@FreeBSD.org> | 2014-09-27 01:15:24 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2014-09-27 01:15:24 +0000 |
commit | 8be950fc2cca8428691019cd550d3d3e5e94ed2b (patch) | |
tree | f1751fad1554781c445d461c7065092ffbb51527 /sys | |
parent | 43fb052c698e39d971e6a05c76456b7f880444e4 (diff) | |
download | FreeBSD-src-8be950fc2cca8428691019cd550d3d3e5e94ed2b.zip FreeBSD-src-8be950fc2cca8428691019cd550d3d3e5e94ed2b.tar.gz |
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.
Reviewed by: tychon
MFC after: 3 days
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/vmm/io/vatpic.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/sys/amd64/vmm/io/vatpic.c b/sys/amd64/vmm/io/vatpic.c index d8ccebd..b710a84 100644 --- a/sys/amd64/vmm/io/vatpic.c +++ b/sys/amd64/vmm/io/vatpic.c @@ -606,20 +606,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)) |