qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Simon Glass <sjg@chromium.org>,
	U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Bin Meng <bmeng.cn@gmail.com>,
	Andrew Goodbody <andrew.goodbody@linaro.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Angelo Dureghello <angelo@kernel-space.org>,
	Love Kumar <love.kumar@amd.com>,
	Mattijs Korpershoek <mkorpershoek@baylibre.com>,
	Philip Oberfichtner <pro@denx.de>,
	Stephen Warren <swarren@nvidia.com>,
	Stephen Warren <swarren@wwwdotorg.org>,
	qemu-devel@nongnu.org, Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH v2 00/28] x86: Improve operation under QEMU
Date: Sun, 16 Feb 2025 22:13:58 +0100	[thread overview]
Message-ID: <2af835ff-e93f-4674-a6ee-9e697109651c@redhat.com> (raw)
In-Reply-To: <20250216204421.3560012-1-sjg@chromium.org>

On 2/16/25 21:43, Simon Glass wrote:
> U-Boot can start and boot an OS in both qemu-x86 and qemu-x86_64 but it
> is not perfect.
> 
> With both builds, executing the VESA ROM causes an intermittent hang, at
> least on some AMD CPUs.
> 
> With qemu-x86_64 kvm cannot be used since the move to long mode (64-bit)
> is done in a way that works on real hardware but not with QEMU. This
> means that performance is 4-5x slower than it could be, at least on my
> CPU.

Do you have a reproducer for this?  It shouldn't happen... also, do you 
know if this is broken for both Intel and AMD CPUs?

Thanks,

Paolo

> We can work around the first problem by using Bochs, which is anyway a
> better choice than VESA for QEMU. The second can be addressed by using
> the same descriptor across the jump to long mode.
> 
> With an MTRR fix this allows booting into Ubuntu on qemu-x86_64
> 
> Changes in v2:
> - Redo commit message
> - Add new patch to rename the _D dirty flag
> - Add new patch to support CPU functions in long mode
> - Add new patch to tidy up address size in MTRR calculations
> - Add new patch with a 64-bit version of is_power_of_2()
> - Add new patch to set an MTRR for the RAM in QEMU
> - Add new patch with a helper to send characters
> - Add new patch to allow tests to be filtered by role
> - Add more patches to support booting with kvm
> - Add new patch with a test for booting Ubuntu 24.04
> 
> Simon Glass (28):
>    x86: Expand x86_64 early memory
>    x86: qemu: Switch to bochs display
>    x86: qemu: Enable dhrystone
>    x86: qemu: Avoid accessing BSS too early
>    x86: Drop mpspec from the SPL build
>    x86: Add some log categories
>    x86: Drop use of CONFIG_REALMODE_DEBUG
>    x86: Avoid clearing the VESA display
>    x86: Add 64-bit entries to the GDT
>    x86: Use defines for the cache flags
>    x86: spl: Drop duplicate CPU init
>    x86: Drop the message about features missing in 64-bit
>    x86: Include stdbool.h in interrupt header
>    x86: Tidy up the GDT size in start/16.S
>    x86: Disable paging before changing to long mode
>    x86: Use the same GDT when jumping to long mode
>    x86: Use a simple jump into long mode
>    x86: Rename the _D dirty flag
>    x86: Support CPU functions in long mode
>    x86: Tidy up address size in MTRR calculations
>    Add a 64-bit version of is_power_of_2()
>    x86: Support MTRRs of 4GB on 32-bit machines
>    x86: emulation: Set an MTRR for the RAM
>    scripts: Expand a few options
>    test/py: Add a helper to send characters
>    test/py: Allow tests to be filtered by role
>    RFC: test/py: Deal with timeouts
>    test: Add a test for booting Ubuntu 24.04
> 
>   .gitlab-ci.yml                   |  5 +++
>   arch/x86/cpu/cpu.c               | 24 +++++++++++++++
>   arch/x86/cpu/i386/call64.S       | 35 +++++++++------------
>   arch/x86/cpu/i386/cpu.c          | 41 +++++++++---------------
>   arch/x86/cpu/mtrr.c              | 12 +++++---
>   arch/x86/cpu/qemu/dram.c         | 15 +++++++++
>   arch/x86/cpu/qemu/qemu.c         | 20 ++++++++----
>   arch/x86/cpu/start.S             |  4 ++-
>   arch/x86/cpu/start16.S           |  3 +-
>   arch/x86/cpu/x86_64/cpu.c        |  5 ---
>   arch/x86/include/asm/cpu.h       | 35 ++++++++++++++++++---
>   arch/x86/include/asm/interrupt.h |  1 +
>   arch/x86/include/asm/processor.h |  5 ++-
>   arch/x86/lib/Makefile            |  2 ++
>   arch/x86/lib/bios.c              | 27 +++++++++-------
>   arch/x86/lib/bios_interrupts.c   |  8 ++---
>   arch/x86/lib/i8259.c             |  2 ++
>   arch/x86/lib/spl.c               |  4 +--
>   configs/qemu-x86_64_defconfig    | 10 +++---
>   configs/qemu-x86_defconfig       |  6 ++--
>   include/linux/log2.h             |  6 ++++
>   scripts/build-qemu.sh            |  4 +--
>   test/py/conftest.py              | 22 +++++++++++++
>   test/py/console_base.py          | 33 ++++++++++++--------
>   test/py/pytest.ini               |  1 +
>   test/py/tests/test_distro.py     | 53 ++++++++++++++++++++++++++++++++
>   test/py/tests/test_sleep.py      |  1 +
>   27 files changed, 273 insertions(+), 111 deletions(-)
>   create mode 100644 test/py/tests/test_distro.py
> 



  parent reply	other threads:[~2025-02-16 21:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-16 20:43 [PATCH v2 00/28] x86: Improve operation under QEMU Simon Glass
2025-02-16 20:43 ` [PATCH v2 02/28] x86: qemu: Switch to bochs display Simon Glass
2025-02-16 20:43 ` [PATCH v2 03/28] x86: qemu: Enable dhrystone Simon Glass
2025-02-16 20:43 ` [PATCH v2 04/28] x86: qemu: Avoid accessing BSS too early Simon Glass
2025-02-16 21:13 ` Paolo Bonzini [this message]
2025-02-17 13:16   ` [PATCH v2 00/28] x86: Improve operation under QEMU Simon Glass
2025-02-16 21:57 ` Tom Rini
2025-02-17 13:14   ` Simon Glass
2025-02-17 14:05     ` Tom Rini

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=2af835ff-e93f-4674-a6ee-9e697109651c@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=andrew.goodbody@linaro.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=angelo@kernel-space.org \
    --cc=bmeng.cn@gmail.com \
    --cc=love.kumar@amd.com \
    --cc=mkorpershoek@baylibre.com \
    --cc=pro@denx.de \
    --cc=qemu-devel@nongnu.org \
    --cc=sjg@chromium.org \
    --cc=swarren@nvidia.com \
    --cc=swarren@wwwdotorg.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).