Skip to content

fix address space size issue

Marcel Apfelbaum qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest8 patches 12 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8exec: declare TARGET_PHYS_ADDR_SPACE_MAX to limit memory regions rendered by execinclude/exec/address-spaces.h+4 -05 replies
2/8hw/alpha: limit iommu-typhoon memory sizehw/alpha/typhoon.c+1 -10 replies
3/8hw/ppc: limit iommu-spapr memory sizehw/ppc/spapr_iommu.c+1 -10 replies
4/8exec: don't ignore high address bits on lookupexec.c+7 -00 replies
5/8pci: fix address space size for bridgehw/pci/pci_bridge.c+1 -10 replies
6/8exec: don't ignore high address bits on setexec.c+11 -00 replies
7/8pc: s/INT64_MAX/UINT64_MAX/hw/i386/pc_piix.c hw/i386/pc_q35.c+2 -22 replies
8/8spapr_pci: s/INT64_MAX/UINT64_MAX/hw/ppc/spapr_pci.c+1 -10 replies

Reviews trailers per patch

1 of 8 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchLuiz CapitulinoMichael S. TsirkinAlexander Graf
SeriesA-b
1/8
2/8
3/8
4/8
5/8
6/8
7/8T-b R-b
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH for-1.7 v2 0/8] fix address space size issue

A bug reported by Luiz Capitulino let us to find several bugs in memory address space setup.

One issue is that gdb stub can give us arbitrary addresses and we'll try to access them.
Since our lookup ignored high bits in the address, we hit a wrong section and got a crash.
In fact, PCI devices can access arbitrary addresses too, so we should just make lookup robust against this case.

Another issue has to do with size of regions. memory API uses UINT64_MAX so say "all 64 bit" but some devices mistakenly used INT64_MAX.

It should not affect most systems in practice as everything should be limited by address space size, but it's an API misuse that we should not keep around, and it will become a problem if a system with 64 bit target address hits this path.

Patch 1 introduces TARGET_PHYS_ADDR_SPACE_MAX that is
the max size for memory regions rendered by exec.
Patches 2-3 limits the size of memory regions used by exec.c. Patch 4 fixes an actual bug.
The rest of patches make code cleaner and more robust.

Marcel Apfelbaum (3):
exec: declare TARGET_PHYS_ADDR_SPACE_MAX to limit memory regions
rendered by exec
hw/alpha: limit iommu-typhoon memory size
hw/ppc: limit iommu-spapr memory size

Michael S. Tsirkin (4):
exec: don't ignore high address bits on lookup
pci: fix address space size for bridge
exec: don't ignore high address bits on set
spapr_pci: s/INT64_MAX/UINT64_MAX/

Paolo Bonzini (1):
pc: s/INT64_MAX/UINT64_MAX/

 exec.c                        | 18 ++++++++++++++++++
 hw/alpha/typhoon.c            |  2 +-
 hw/i386/pc_piix.c             |  2 +-
 hw/i386/pc_q35.c              |  2 +-
 hw/pci/pci_bridge.c           |  2 +-
 hw/ppc/spapr_iommu.c          |  2 +-
 hw/ppc/spapr_pci.c            |  2 +-
 include/exec/address-spaces.h |  4 ++++
 8 files changed, 28 insertions(+), 6 deletions(-)
Signature · 1 line
1.8.3.1