qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Christian Schoenebeck" <qemu_oss@crudebyte.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	qemu-block@nongnu.org, qemu-trivial@nongnu.org,
	"Helge Deller" <deller@gmx.de>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Stefano Garzarella" <sgarzare@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	"Alistair Francis" <alistair@alistair23.me>,
	"Greg Kurz" <groug@kaod.org>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	qemu-arm@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"John Snow" <jsnow@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Igor Mitsyanko" <i.mitsyanko@gmail.com>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Max Reitz" <mreitz@redhat.com>,
	"Aleksandar Markovic" <amarkovic@wavecomp.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [PULL 06/33] hw/net/e1000: Move macreg[] arrays to .rodata to save 1MiB of .data
Date: Mon,  9 Mar 2020 16:08:10 +0100	[thread overview]
Message-ID: <20200309150837.3193387-7-laurent@vivier.eu> (raw)
In-Reply-To: <20200309150837.3193387-1-laurent@vivier.eu>

From: Philippe Mathieu-Daudé <philmd@redhat.com>

Each array consumes 256KiB of .data. As we do not reassign entries,
we can move it to the .rodata section, and save a total of 1MiB of
.data (size reported on x86_64 host).

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Dmitry Fleytman <dmitry.fleytman@gmail.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20200305010446.17029-3-philmd@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/net/e1000.c       | 4 ++--
 hw/net/e1000e_core.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index 972d9b508399..9233248c9af0 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -1151,7 +1151,7 @@ set_ims(E1000State *s, int index, uint32_t val)
 
 #define getreg(x)    [x] = mac_readreg
 typedef uint32_t (*readops)(E1000State *, int);
-static readops macreg_readops[] = {
+static const readops macreg_readops[] = {
     getreg(PBA),      getreg(RCTL),     getreg(TDH),      getreg(TXDCTL),
     getreg(WUFC),     getreg(TDT),      getreg(CTRL),     getreg(LEDCTL),
     getreg(MANC),     getreg(MDIC),     getreg(SWSM),     getreg(STATUS),
@@ -1207,7 +1207,7 @@ enum { NREADOPS = ARRAY_SIZE(macreg_readops) };
 
 #define putreg(x)    [x] = mac_writereg
 typedef void (*writeops)(E1000State *, int, uint32_t);
-static writeops macreg_writeops[] = {
+static const writeops macreg_writeops[] = {
     putreg(PBA),      putreg(EERD),     putreg(SWSM),     putreg(WUFC),
     putreg(TDBAL),    putreg(TDBAH),    putreg(TXDCTL),   putreg(RDBAH),
     putreg(RDBAL),    putreg(LEDCTL),   putreg(VET),      putreg(FCRUC),
diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index 38bdb90114c6..df957e0c1a09 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -2856,7 +2856,7 @@ e1000e_set_gcr(E1000ECore *core, int index, uint32_t val)
 
 #define e1000e_getreg(x)    [x] = e1000e_mac_readreg
 typedef uint32_t (*readops)(E1000ECore *, int);
-static readops e1000e_macreg_readops[] = {
+static const readops e1000e_macreg_readops[] = {
     e1000e_getreg(PBA),
     e1000e_getreg(WUFC),
     e1000e_getreg(MANC),
@@ -3063,7 +3063,7 @@ enum { E1000E_NREADOPS = ARRAY_SIZE(e1000e_macreg_readops) };
 
 #define e1000e_putreg(x)    [x] = e1000e_mac_writereg
 typedef void (*writeops)(E1000ECore *, int, uint32_t);
-static writeops e1000e_macreg_writeops[] = {
+static const writeops e1000e_macreg_writeops[] = {
     e1000e_putreg(PBA),
     e1000e_putreg(SWSM),
     e1000e_putreg(WUFC),
-- 
2.24.1



  parent reply	other threads:[~2020-03-09 15:15 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-09 15:08 [PULL 00/33] Trivial branch patches Laurent Vivier
2020-03-09 15:08 ` [PULL 01/33] dp8393x: Mask EOL bit from descriptor addresses, take 2 Laurent Vivier
2020-03-09 15:08 ` [PULL 02/33] maint: Include top-level *.rst files early in git diff Laurent Vivier
2020-03-09 15:08 ` [PULL 03/33] build-sys: Move the print-variable rule to rules.mak Laurent Vivier
2020-03-09 15:08 ` [PULL 04/33] hw/audio/fmopl: Fix a typo twice Laurent Vivier
2020-03-09 15:08 ` [PULL 05/33] hw/net/e1000: Add readops/writeops typedefs Laurent Vivier
2020-03-09 15:08 ` Laurent Vivier [this message]
2020-03-09 15:08 ` [PULL 07/33] virtfs-proxy-helper: Make the helper_opts[] array const Laurent Vivier
2020-03-09 15:08 ` [PULL 08/33] vl: Add missing "hw/boards.h" include Laurent Vivier
2020-03-09 15:08 ` [PULL 09/33] hw/southbridge/ich9: Removed unused headers Laurent Vivier
2020-03-09 15:08 ` [PULL 10/33] hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header Laurent Vivier
2020-03-09 15:08 ` [PULL 11/33] hw/timer: Remove unused "ui/console.h" header Laurent Vivier
2020-03-09 15:08 ` [PULL 12/33] hw/usb/dev-storage: " Laurent Vivier
2020-03-09 15:08 ` [PULL 13/33] hw/i386/intel_iommu: Remove unused includes Laurent Vivier
2020-03-09 15:08 ` [PULL 14/33] hw/alpha/alpha_sys: Remove unused "hw/ide.h" header Laurent Vivier
2020-03-09 15:08 ` [PULL 15/33] hw/alpha/dp264: Include "net/net.h" Laurent Vivier
2020-03-09 15:08 ` [PULL 16/33] hw/hppa/machine: " Laurent Vivier
2020-03-09 15:08 ` [PULL 17/33] hw/acpi/cpu_hotplug: Include "hw/pci/pci.h" Laurent Vivier
2020-03-09 15:08 ` [PULL 18/33] hw/timer/hpet: Include "exec/address-spaces.h" Laurent Vivier
2020-03-09 15:08 ` [PULL 19/33] hw/pci-host/q35: Include "qemu/range.h" Laurent Vivier
2020-03-09 15:08 ` [PULL 20/33] hw/i2c/smbus_ich9: " Laurent Vivier
2020-03-09 15:08 ` [PULL 21/33] hw/pci-host/piix: " Laurent Vivier
2020-03-09 15:08 ` [PULL 22/33] hw/acpi: Include "hw/mem/nvdimm.h" Laurent Vivier
2020-03-09 15:08 ` [PULL 23/33] hw/i386: " Laurent Vivier
2020-03-09 15:08 ` [PULL 24/33] hw/pci-host/q35: Remove unused includes Laurent Vivier
2020-03-09 15:08 ` [PULL 25/33] hw/i386/pc: Clean up includes Laurent Vivier
2020-03-09 15:08 ` [PULL 26/33] core/qdev: fix memleak in qdev_get_gpio_out_connector() Laurent Vivier
2020-03-09 15:08 ` [PULL 27/33] block/stream: Remove redundant statement in stream_run() Laurent Vivier
2020-03-09 15:08 ` [PULL 28/33] block/file-posix: Remove redundant statement in raw_handle_perm_lock() Laurent Vivier
2020-03-09 15:08 ` [PULL 29/33] dma/xlnx-zdma: Remove redundant statement in zdma_write_dst() Laurent Vivier
2020-03-09 15:08 ` [PULL 30/33] scsi/scsi-disk: Remove redundant statement in scsi_disk_emulate_command() Laurent Vivier
2020-03-09 15:08 ` [PULL 31/33] display/pxa2xx_lcd: Remove redundant statement in pxa2xx_palette_parse() Laurent Vivier
2020-03-09 15:08 ` [PULL 32/33] display/exynos4210_fimd: Remove redundant statement in exynos4210_fimd_update() Laurent Vivier
2020-03-09 15:08 ` [PULL 33/33] monitor/hmp-cmds: Remove redundant statement in hmp_rocker_of_dpa_groups() Laurent Vivier
2020-03-09 16:31 ` [PULL 00/33] Trivial branch patches no-reply
2020-03-09 16:44 ` Peter Maydell
2020-03-09 19:17 ` Michael S. Tsirkin
2020-03-09 19:30   ` Philippe Mathieu-Daudé
2020-03-10  8:02     ` Laurent Vivier
2020-03-10 11:45       ` Kevin Wolf
2020-03-10 12:00         ` Philippe Mathieu-Daudé
2020-03-10 12:11           ` Daniel P. Berrangé
2020-03-10 12:13           ` Kevin Wolf
2020-03-10 12:31             ` Philippe Mathieu-Daudé
2020-03-10 12:34             ` Laurent Vivier

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=20200309150837.3193387-7-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=alistair@alistair23.me \
    --cc=amarkovic@wavecomp.com \
    --cc=aurelien@aurel32.net \
    --cc=berrange@redhat.com \
    --cc=deller@gmx.de \
    --cc=dgilbert@redhat.com \
    --cc=dmitry.fleytman@gmail.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=fam@euphon.net \
    --cc=groug@kaod.org \
    --cc=i.mitsyanko@gmail.com \
    --cc=imammedo@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=mreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=qemu_oss@crudebyte.com \
    --cc=rth@twiddle.net \
    --cc=sgarzare@redhat.com \
    /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).