Skip to contentSkip to conversation

qemu: fix iotlb_to_section() for different AddressSpace

PATCH In review [email protected] 2 participants 3 messages May 11 – May 20

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu: fix iotlb_to_section() for different AddressSpace

From: Quan Sun <[email protected]>

Backport upstream commit 854cd16e318e ("accel/tcg: Fix iotlb_to_section() for different AddressSpace") to qemu 10.2.0.

The bug causes incorrect memory load/store when CPU access goes through an IOMMUMemoryRegion that returns a different target AddressSpace, and the fix replaces the section_index lookup with a direct MemoryRegionSection pointer stored in CPUTLBEntryFull.

Note that the fix primarily targets ARM/RISC-V, but since it eliminates iotlb_to_section() and performs the lookup based on CPUTLBEntryFull, it may also help address some currently observed QEMU boot issues on x86, e.g. the https://bugzilla.yoctoproject.org/show_bug.cgi?id=16259.

AI-Generated: kiro-cli

---
 meta/recipes-devtools/qemu/qemu.inc           |   1 +
 ...tlb_to_section-for-different-Address.patch | 274 ++++++++++++++++++
 2 files changed, 275 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/0001-accel-tcg-Fix-iotlb_to_section-for-different-Address.patch
meta/recipes-devtools/qemu/qemu.inc +1 -0
index 7aa593bc5d..a8b4a1a541 100644
@@ -33,6 +33,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
            file://0010-configure-lookup-meson-exutable-from-PATH.patch \
            file://0011-qemu-Ensure-pip-and-the-python-venv-aren-t-used-for-.patch \
            file://0001-linux-user-elfload.c-Correction-to-HWCAP2-accessor.patch \
+           file://0001-accel-tcg-Fix-iotlb_to_section-for-different-Address.patch \
            file://qemu-guest-agent.init \
            file://qemu-guest-agent.udev \
            "
meta/recipes-devtools/qemu/qemu/0001-accel-tcg-Fix-iotlb_to_section-for-different-Address.patch new file +274 -0

274 lines not on this page · raw message

Signature · 1 line
2.49.0
#1 lore raw
Quoted 15 lines · Quan Sun via lists.openembedded.org

From: Quan Sun <[email protected]>

Backport upstream commit 854cd16e318e ("accel/tcg: Fix iotlb_to_section() for different AddressSpace") to qemu 10.2.0.

The bug causes incorrect memory load/store when CPU access goes through an IOMMUMemoryRegion that returns a different target AddressSpace, and the fix replaces the section_index lookup with a direct MemoryRegionSection pointer stored in CPUTLBEntryFull.

Note that the fix primarily targets ARM/RISC-V, but since it eliminates iotlb_to_section() and performs the lookup based on CPUTLBEntryFull, it may also help address some currently observed QEMU boot issues on x86, e.g. the https://bugzilla.yoctoproject.org/show_bug.cgi?id=16259.

Quoted 8 lines

AI-Generated: kiro-cli

---
 meta/recipes-devtools/qemu/qemu.inc           |   1 + ...tlb_to_section-for-different-Address.patch | 274 ++++++++++++++++++

 2 files changed, 275 insertions(+)

 create mode 100644 meta/recipes-devtools/qemu/qemu/0001-accel-tcg-Fix-iotlb_to_section-for-different-Address.patch

I noticed this failure on one of my current builds:

https://autobuilder.yoctoproject.org/valkyrie/#/builders/80/builds/3615

which looks a bit like some of the errors we were hoping this fixed?

Cheers,

Richard

author
#2 lore raw
Quoted 27 lines · Richard Purdie

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Quoted 15 lines · Quan Sun via lists.openembedded.org

From: Quan Sun <[email protected]>

Backport upstream commit 854cd16e318e ("accel/tcg: Fix iotlb_to_section() for different AddressSpace") to qemu 10.2.0.

The bug causes incorrect memory load/store when CPU access goes through an IOMMUMemoryRegion that returns a different target AddressSpace, and the fix replaces the section_index lookup with a direct MemoryRegionSection pointer stored in CPUTLBEntryFull.

Note that the fix primarily targets ARM/RISC-V, but since it eliminates iotlb_to_section() and performs the lookup based on CPUTLBEntryFull, it may also help address some currently observed QEMU boot issues on x86, e.g. the https://bugzilla.yoctoproject.org/show_bug.cgi?id=16259.

Quoted 8 lines

AI-Generated: kiro-cli

---
  meta/recipes-devtools/qemu/qemu.inc           |   1 +
  ...tlb_to_section-for-different-Address.patch | 274 ++++++++++++++++++
  2 files changed, 275 insertions(+)

create mode 100644 meta/recipes-devtools/qemu/qemu/0001-accel-tcg-Fix-iotlb_to_section-for-different-Address.patch

Quoted 6 lines

I noticed this failure on one of my current builds:

https://autobuilder.yoctoproject.org/valkyrie/#/builders/80/builds/3615

which looks a bit like some of the errors we were hoping this fixed?

This looks like a graphics-related issue (I remember earlier we had similar one). The last kernel message is about the PL110 display controller and deferred probes. The Sato image starts X11/Sato desktop which requires the framebuffer to be functional. If the display device doesn't complete  initialization, X11 startup blocks, which blocks the init sequence, which prevents the login prompt from appearing. It's possible this issue may still exist even with QEMU upgraded to 11.0.0.

Thanks,

Quan