]> git.proxmox.com Git - mirror_qemu.git/commit
hw/audio/intel-hda: Use memory region alias to reduce .rodata by 4.34MB
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Thu, 5 Mar 2020 12:45:19 +0000 (13:45 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Mar 2020 22:02:25 +0000 (23:02 +0100)
commita9d8ba2be58e067bdfbff830eb9ff438d8db7f10
tree4ac47a15c261771677420b74950d784766565eff
parent2eea51bd018fa48a952010e9bb7480e9d6390ba3
hw/audio/intel-hda: Use memory region alias to reduce .rodata by 4.34MB

The intel-hda model uses an array of register indexed by the
register address. This array also contains a pair of aliased
registers at offset 0x2000. This creates a huge hole in the
array, which ends up eating 4.6MiB of .rodata (size reported
on x86_64 host, building with --extra-cflags=-Os).

By using a memory region alias, we reduce this array to 132kB.

Before:

  (qemu) info mtree
    00000000febd4000-00000000febd7fff (prio 1, i/o): intel-hda

After:

  (qemu) info mtree
    00000000febd4000-00000000febd7fff (prio 1, i/o): intel-hda
    00000000febd4000-00000000febd7fff (prio 1, i/o): intel-hda-container
      00000000febd4000-00000000febd5fff (prio 0, i/o): intel-hda
      00000000febd6000-00000000febd7fff (prio 0, i/o): alias intel-hda-alias @intel-hda 0000000000000000-0000000000001fff

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/audio/intel-hda.c