qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] NOTFORMERGE memory: Ensure AddressSpace physical base addres


From: Philippe Mathieu-Daudé
Subject: [PATCH 2/2] NOTFORMERGE memory: Ensure AddressSpace physical base address is zero
Date: Wed, 10 Mar 2021 20:12:55 +0100

AddressSpaces aren't suppose to have a physical base address.

Add an assertion to demostrate the problem:

  $ echo info mtree | qemu-system-mips64el -M magnum -S -monitor stdio
  QEMU 5.2.50 monitor - type 'help' for more information
  (qemu) info mtree
  address-space: memory
    0000000000000000-ffffffffffffffff (prio 0, i/o): system
      0000000000000000-0000000007ffffff (prio 0, ram): mips_jazz.ram
      000000001fc00000-000000001fc7dfff (prio 0, rom): mips_jazz.bios
      0000000040000000-00000000407fffff (prio 0, ram): vram
      0000000060000000-000000006007ffff (prio 0, rom): g364fb.rom
      0000000060080000-00000000601fffff (prio 0, i/o): ctrl
      0000000080000000-00000000800002ff (prio 0, i/o): rc4030.chipset
      0000000080001000-00000000800010ff (prio 0, i/o): dp8393x-regs
      0000000080002000-000000008000200f (prio 0, i/o): esp-regs
      0000000080003000-0000000080003007 (prio 0, i/o): fdc
      0000000080004000-0000000080004fff (prio 0, i/o): rtc
      0000000080005000-0000000080005fff (prio 0, i/o): i8042
      0000000080006000-0000000080006007 (prio 0, i/o): serial
      0000000080008000-0000000080008007 (prio 0, i/o): parallel
      0000000080009000-000000008000afff (prio 0, i/o): nvram
      000000008000b000-000000008000bfff (prio 0, rom): dp8393x-prom
      000000008000d000-000000008000dfff (prio 0, i/o): dummy_dma
      000000008000f000-000000008000f000 (prio 0, i/o): led
      0000000090000000-000000009000ffff (prio 0, i/o): io
        0000000090000000-0000000090000007 (prio 0, i/o): dma-chan
        0000000090000008-000000009000000f (prio 0, i/o): dma-cont
        0000000090000020-0000000090000021 (prio 0, i/o): pic
        0000000090000040-0000000090000043 (prio 0, i/o): pit
        0000000090000061-0000000090000061 (prio 0, i/o): pcspk
        0000000090000070-0000000090000071 (prio 0, i/o): rtc
          0000000090000070-0000000090000070 (prio 0, i/o): rtc-index
        0000000090000081-0000000090000083 (prio 0, i/o): dma-page
        0000000090000087-0000000090000087 (prio 0, i/o): dma-page
        0000000090000089-000000009000008b (prio 0, i/o): dma-page
        000000009000008f-000000009000008f (prio 0, i/o): dma-page
        00000000900000a0-00000000900000a1 (prio 0, i/o): pic
        00000000900000c0-00000000900000cf (prio 0, i/o): dma-chan
        00000000900000d0-00000000900000df (prio 0, i/o): dma-cont
        00000000900004d0-00000000900004d0 (prio 0, i/o): elcr
        00000000900004d1-00000000900004d1 (prio 0, i/o): elcr
      0000000091000000-0000000091ffffff (prio 0, i/o): isa-mem
      00000000f0000000-00000000f0000fff (prio 0, i/o): rc4030.jazzio
      00000000fff00000-00000000fff7dfff (prio 0, rom): alias mips_jazz.bios 
@mips_jazz.bios 0000000000000000-000000000007dfff

  address-space: I/O
    0000000090000000-000000009000ffff (prio 0, i/o): io
      0000000090000000-0000000090000007 (prio 0, i/o): dma-chan
      0000000090000008-000000009000000f (prio 0, i/o): dma-cont
      0000000090000020-0000000090000021 (prio 0, i/o): pic
      0000000090000040-0000000090000043 (prio 0, i/o): pit
      0000000090000061-0000000090000061 (prio 0, i/o): pcspk
      0000000090000070-0000000090000071 (prio 0, i/o): rtc
        0000000090000070-0000000090000070 (prio 0, i/o): rtc-index
      0000000090000081-0000000090000083 (prio 0, i/o): dma-page
      0000000090000087-0000000090000087 (prio 0, i/o): dma-page
      0000000090000089-000000009000008b (prio 0, i/o): dma-page
      000000009000008f-000000009000008f (prio 0, i/o): dma-page
      00000000900000a0-00000000900000a1 (prio 0, i/o): pic
      00000000900000c0-00000000900000cf (prio 0, i/o): dma-chan
      00000000900000d0-00000000900000df (prio 0, i/o): dma-cont
      00000000900004d0-00000000900004d0 (prio 0, i/o): elcr
      00000000900004d1-00000000900004d1 (prio 0, i/o): elcr

  qemu-system-mips64el: softmmu/memory.c:3193: mtree_info: Assertion 
`!as->root->addr' failed.
  Aborted (core dumped)

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 softmmu/memory.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/softmmu/memory.c b/softmmu/memory.c
index 874a8fccdee..164e7971e5b 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -3190,6 +3190,8 @@ void mtree_info(bool flatview, bool dispatch_tree, bool 
owner, bool disabled)
         qemu_printf("address-space: %s\n", as->name);
         mtree_print_mr(as->root, 1, 0, &ml_head, owner, disabled);
         qemu_printf("\n");
+        /* address spaces aren't suppose to have a physical base address */
+        assert(!as->root->addr);
     }
 
     /* print aliased regions */
-- 
2.26.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]