From: Dhiru Kholia <dhiru.kholia@gmail.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>,
Pankaj Gupta <pagupta@redhat.com>, Gabriel Somlo <somlo@cmu.edu>,
qemu-devel@nongnu.org, Phil Dennis-Jordan <lists@philjordan.eu>,
BALATON Zoltan <balaton@eik.bme.hu>,
Programmingkid <programmingkidx@gmail.com>
Subject: Re: [Qemu-devel] [PATCH] pc/acpi: Fix booting of macOS with Clover EFI bootloader
Date: Sun, 6 Aug 2017 13:08:36 +0530 [thread overview]
Message-ID: <20170806073836.GA23008@lonestar> (raw)
In-Reply-To: <b0a52980-bb3a-e1f2-c6d8-9832cd2df9da@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3835 bytes --]
On Sat, Aug 05, 2017 at 10:05:09PM +0200, Laszlo Ersek wrote:
> On 08/05/17 13:46, Dhiru Kholia wrote:
> > On Sat, Aug 5, 2017 at 2:00 PM, Dhiru Kholia <dhiru.kholia@gmail.com> wrote:
> >> I ran git bisect on OVMF repository [5] to find the commit that broke
> >> booting of macOS + Clover combination in QEMU/KVM.
> >>
> >> It seems that commit 805762252733bb is problematic for some reason.
> >> Reverting this commit fixes the macOS booting problem.
> >>
> >> In summary, I am able to boot macOS 10.12.5 + Clover combination with
> >> latest OVMF (commit 1fceaddb12b with 805762252733bb reverted) +
> >> updated QEMU (commit aaaec6acad7c with patch from this thread
> >> applied).
> >
> > After some more testing,
> >
> > I am also able to boot macOS 10.12.5 + Clover combination with latest
> > OVMF (commit 1fceaddb12b with 805762252733bb reverted) + updated QEMU
> > (commit ac44ed2afb7c60 *without* my patch from this thread).
>
> I don't know how edk2 commit 805762252733 ("OvmfPkg/AcpiPlatformDxe:
> save fw_cfg boot script with QemuFwCfgS3Lib", 2017-02-23) can cause your
> symptoms.
>
> (snipped)
Hi Laszlo,
Thanks a lot for your detailed answers, and great tips.
For all of the following results, I have used OVMF commit 1fceaddb12b59,
without any patches reverted.
> You could try the following:
>
> (1) Disable S3 support on the QEMU command line. OVMF will recognize
> that, and skip all the S3 opcode recording (and memory reservation).
> IIRC OSX requires Q35, so I'll give you the command line option for Q35:
>
> -global ICH9-LPC.disable_s3=1
-machine pc-q35-2.4 -global ICH9-LPC.disable_s3=1
This combination works fine. I was able to boot macOS 10.12.5 + Clover with
it.
> (2) Set "PcdDebugPrintErrorLevel" in "OvmfPkg/OvmfPkgX64.dsc" to
> 0x8040004F, then rebuild OVMF. Additionally, append the following to the
> QEMU command line:
>
> -debugcon file:ovmf.debug.log -global isa-debugcon.iobase=0x402
>
> We can then look at the OVMF debug log.
I have attached the compressed logs to this email.
q35-2.4-ovmf.debug.log.tar.gz is for "pc-q35-2.4" machine type and
q35-2.5-ovmf.debug.log.tar.gz is for "pc-q35-2.5".
The "pc-q35-2.4" machine doesn't boot but "pc-q35-2.5" works fine.
I did not use the "ICH9-LPC.disable_s3=1" option for these results.
> (3) Hm... are you perhaps using the pc-q35-2.4 machine type? If so, can
> you try pc-q35-2.5 or later?
>
> ... Yes, you are using pc-q35-2.4:
> https://github.com/kholia/OSX-KVM/blob/master/boot-clover.sh
> https://github.com/kholia/OSX-KVM/blob/master/boot-macOS.sh
The "pc-q35-2.5" machine type works great without any extra options with
pristine latest QEMU and OVMF sources! I will update my macOS boot
script to use this (or higher) machine type.
> Sigh, I see now what it is. It's indeed an OVMF bug, introduced in
> commit 805762252733.
>
> Basically what I think I messed up in 805762252733 is that if you have
> S3 enabled, OvmfPkg/AcpiPlatformDxe will incorrectly / indirectly insist
> that you also have the DMA feature for fw_cfg, even if you have zero
> WRITE_POINTER commands. pc-q35-2.4 has no DMA for fw_cfg, and S3 is
> enabled by default in upstream QEMU and libvirt. OvmfPkg/AcpiPlatformDxe
> incorrectly thinks this is bad and rolls back all the ACPI linker/loader
> stuff -- you end up with the built-in (very outdated) fallback ACPI tables.
>
> I'll try to send out a patch next week and CC you for testing. Please
> subscribe to edk2-devel at
> <https://lists.01.org/mailman/listinfo/edk2-devel> first, otherwise the
> list will drop your messages.
>
> Just to confirm my suspicion, can you please do all three steps / checks
> above?
I have subscribed to the edk2-devel list now. I would be happy to test
your upcoming patch.
I believe that you have already figured out this whole thing :-)
Thanks,
Dhiru
[-- Attachment #2: q35-2.4-ovmf.debug.log.tar.gz --]
[-- Type: application/gzip, Size: 25822 bytes --]
[-- Attachment #3: q35-2.5-ovmf.debug.log.tar.gz --]
[-- Type: application/gzip, Size: 25717 bytes --]
next prev parent reply other threads:[~2017-08-06 7:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-04 6:45 [Qemu-devel] [PATCH] pc/acpi: Fix booting of macOS with Clover EFI bootloader Dhiru Kholia
2017-08-04 9:05 ` Igor Mammedov
2017-08-04 10:47 ` Dhiru Kholia
2017-08-04 15:14 ` Igor Mammedov
2017-08-05 8:30 ` Dhiru Kholia
2017-08-05 11:46 ` Dhiru Kholia
2017-08-05 20:05 ` Laszlo Ersek
2017-08-06 7:38 ` Dhiru Kholia [this message]
2017-08-06 9:35 ` Laszlo Ersek
[not found] <mailman.88520.1501838500.22740.qemu-devel@nongnu.org>
2017-08-04 15:00 ` Programmingkid
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170806073836.GA23008@lonestar \
--to=dhiru.kholia@gmail.com \
--cc=balaton@eik.bme.hu \
--cc=imammedo@redhat.com \
--cc=lersek@redhat.com \
--cc=lists@philjordan.eu \
--cc=pagupta@redhat.com \
--cc=programmingkidx@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=somlo@cmu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.