[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/17] ide_ioport_read: Return lower octet of data register instea
From: |
Paolo Bonzini |
Subject: |
[PULL 11/17] ide_ioport_read: Return lower octet of data register instead of 0xFF |
Date: |
Wed, 25 May 2022 21:28:46 +0200 |
From: Lev Kujawski <lkujaw@member.fsf.org>
Prior to this patch, the pre-GRUB Solaris x86 bootloader would fail to
load on QEMU with the following screen output:
SunOS Secondary Boot version 3.00
prom_panic: Could not mount filesystem.
Entering boot debugger:
[136419]: _
This occurs because the bootloader issues an ATA IDENTIFY DEVICE
command, and then reads the resulting 256 words of parameter
information using inb rather than the correct inw. As the previous
behavior of QEMU was to return 0xFF and not advance the drive's sector
buffer, DRQ would never be cleared and the bootloader would be blocked
from selecting a secondary ATA device, such as an optical drive.
Resolves:
* [Bug 1639394] Unable to boot Solaris 8/9 x86 under Fedora 24
Signed-off-by: Lev Kujawski <lkujaw@member.fsf.org>
Message-Id: <20220520235200.1138450-1-lkujaw@member.fsf.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/ide/core.c | 6 +++++-
hw/ide/macio.c | 4 +++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 3a5afff5d7..c2caa54285 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2166,7 +2166,11 @@ uint32_t ide_ioport_read(void *opaque, uint32_t addr)
hob = bus->cmd & (IDE_CTRL_HOB);
switch (reg_num) {
case ATA_IOPORT_RR_DATA:
- ret = 0xff;
+ /*
+ * The pre-GRUB Solaris x86 bootloader relies upon inb
+ * consuming a word from the drive's sector buffer.
+ */
+ ret = ide_data_readw(bus, addr) & 0xff;
break;
case ATA_IOPORT_RR_ERROR:
if ((!bus->ifs[0].blk && !bus->ifs[1].blk) ||
diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index f08318cf97..1c15c37ec5 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -267,7 +267,9 @@ static uint64_t pmac_ide_read(void *opaque, hwaddr addr,
unsigned size)
switch (reg) {
case 0x0:
- if (size == 2) {
+ if (size == 1) {
+ retval = ide_data_readw(&d->bus, 0) & 0xFF;
+ } else if (size == 2) {
retval = ide_data_readw(&d->bus, 0);
} else if (size == 4) {
retval = ide_data_readl(&d->bus, 0);
--
2.36.1
- [PULL 01/17] target/i386: Remove LBREn bit check when access Arch LBR MSRs, (continued)
- [PULL 01/17] target/i386: Remove LBREn bit check when access Arch LBR MSRs, Paolo Bonzini, 2022/05/25
- [PULL 02/17] hostmem: default the amount of prealloc-threads to smp-cpus, Paolo Bonzini, 2022/05/25
- [PULL 03/17] thread-pool: optimize scheduling of completion bottom half, Paolo Bonzini, 2022/05/25
- [PULL 04/17] thread-pool: replace semaphore with condition variable, Paolo Bonzini, 2022/05/25
- [PULL 05/17] thread-pool: remove stopping variable, Paolo Bonzini, 2022/05/25
- [PULL 06/17] contrib/elf2dmp: add ELF dump header checking, Paolo Bonzini, 2022/05/25
- [PULL 08/17] hw/audio/ac97: Remove unimplemented reset functions, Paolo Bonzini, 2022/05/25
- [PULL 07/17] hw/audio/ac97: Coding style fixes to avoid checkpatch errors, Paolo Bonzini, 2022/05/25
- [PULL 09/17] hw/audio/ac97: Remove unneeded local variables, Paolo Bonzini, 2022/05/25
- [PULL 10/17] target/i386/kvm: Fix disabling MPX on "-cpu host" with MPX-capable host, Paolo Bonzini, 2022/05/25
- [PULL 11/17] ide_ioport_read: Return lower octet of data register instead of 0xFF,
Paolo Bonzini <=
- [PULL 12/17] i386: Use hv_build_cpuid_leaf() for HV_CPUID_NESTED_FEATURES, Paolo Bonzini, 2022/05/25
- [PULL 14/17] i386: Hyper-V XMM fast hypercall input feature, Paolo Bonzini, 2022/05/25
- [PULL 15/17] i386: Hyper-V Support extended GVA ranges for TLB flush hypercalls, Paolo Bonzini, 2022/05/25
- [PULL 13/17] i386: Hyper-V Enlightened MSR bitmap feature, Paolo Bonzini, 2022/05/25
- [PULL 16/17] i386: Hyper-V Direct TLB flush hypercall, Paolo Bonzini, 2022/05/25
- [PULL 17/17] i386: docs: Convert hyperv.txt to rST, Paolo Bonzini, 2022/05/25
- Re: [PULL 00/17] Misc patches for 2022-05-25, Richard Henderson, 2022/05/25