qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	xen-devel@lists.xenproject.org,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Bastian Koppelmann" <kbastian@mail.uni-paderborn.de>,
	"Anthony PERARD" <anthony@xenproject.org>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Thomas Huth" <huth@tuxfamily.org>, "Jia Liu" <proljc@gmail.com>,
	"Stafford Horne" <shorne@gmail.com>,
	"Paul Durrant" <paul@xen.org>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 1/5] hw/i386: Mark devices as little-endian
Date: Wed,  6 Nov 2024 18:46:08 +0000	[thread overview]
Message-ID: <20241106184612.71897-2-philmd@linaro.org> (raw)
In-Reply-To: <20241106184612.71897-1-philmd@linaro.org>

These devices are only used by the X86 targets, which are only
built as little-endian. Therefore the DEVICE_NATIVE_ENDIAN
definition expand to DEVICE_LITTLE_ENDIAN (besides, the
DEVICE_BIG_ENDIAN case isn't tested). Simplify directly using
DEVICE_LITTLE_ENDIAN.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/i386/kvm/apic.c         | 2 +-
 hw/i386/pc.c               | 4 ++--
 hw/i386/vapic.c            | 2 +-
 hw/i386/xen/xen_apic.c     | 2 +-
 hw/i386/xen/xen_platform.c | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/hw/i386/kvm/apic.c b/hw/i386/kvm/apic.c
index a72c28e8a7..3a5d69e8d0 100644
--- a/hw/i386/kvm/apic.c
+++ b/hw/i386/kvm/apic.c
@@ -214,7 +214,7 @@ static void kvm_apic_mem_write(void *opaque, hwaddr addr,
 static const MemoryRegionOps kvm_apic_io_ops = {
     .read = kvm_apic_mem_read,
     .write = kvm_apic_mem_write,
-    .endianness = DEVICE_NATIVE_ENDIAN,
+    .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
 static void kvm_apic_reset(APICCommonState *s)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 830614d930..2259589e0d 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1064,7 +1064,7 @@ DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus)
 static const MemoryRegionOps ioport80_io_ops = {
     .write = ioport80_write,
     .read = ioport80_read,
-    .endianness = DEVICE_NATIVE_ENDIAN,
+    .endianness = DEVICE_LITTLE_ENDIAN,
     .impl = {
         .min_access_size = 1,
         .max_access_size = 1,
@@ -1074,7 +1074,7 @@ static const MemoryRegionOps ioport80_io_ops = {
 static const MemoryRegionOps ioportF0_io_ops = {
     .write = ioportF0_write,
     .read = ioportF0_read,
-    .endianness = DEVICE_NATIVE_ENDIAN,
+    .endianness = DEVICE_LITTLE_ENDIAN,
     .impl = {
         .min_access_size = 1,
         .max_access_size = 1,
diff --git a/hw/i386/vapic.c b/hw/i386/vapic.c
index ef7f8b967f..fd906fdf78 100644
--- a/hw/i386/vapic.c
+++ b/hw/i386/vapic.c
@@ -718,7 +718,7 @@ static uint64_t vapic_read(void *opaque, hwaddr addr, unsigned size)
 static const MemoryRegionOps vapic_ops = {
     .write = vapic_write,
     .read = vapic_read,
-    .endianness = DEVICE_NATIVE_ENDIAN,
+    .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
 static void vapic_realize(DeviceState *dev, Error **errp)
diff --git a/hw/i386/xen/xen_apic.c b/hw/i386/xen/xen_apic.c
index 101e16a766..a94e9005cb 100644
--- a/hw/i386/xen/xen_apic.c
+++ b/hw/i386/xen/xen_apic.c
@@ -36,7 +36,7 @@ static void xen_apic_mem_write(void *opaque, hwaddr addr,
 static const MemoryRegionOps xen_apic_io_ops = {
     .read = xen_apic_mem_read,
     .write = xen_apic_mem_write,
-    .endianness = DEVICE_NATIVE_ENDIAN,
+    .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
 static void xen_apic_realize(DeviceState *dev, Error **errp)
diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
index ec0e536e85..3b3e745822 100644
--- a/hw/i386/xen/xen_platform.c
+++ b/hw/i386/xen/xen_platform.c
@@ -514,7 +514,7 @@ static void platform_mmio_write(void *opaque, hwaddr addr,
 static const MemoryRegionOps platform_mmio_handler = {
     .read = &platform_mmio_read,
     .write = &platform_mmio_write,
-    .endianness = DEVICE_NATIVE_ENDIAN,
+    .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
 static void platform_mmio_setup(PCIXenPlatformState *d)
-- 
2.45.2



  reply	other threads:[~2024-11-06 18:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-06 18:46 [PATCH 0/5] hw: Mark architecture specific devices with specific endianness Philippe Mathieu-Daudé
2024-11-06 18:46 ` Philippe Mathieu-Daudé [this message]
2024-11-07  9:59   ` [PATCH 1/5] hw/i386: Mark devices as little-endian Richard Henderson
2024-11-09  6:39   ` Thomas Huth
2024-11-06 18:46 ` [PATCH 2/5] hw/tricore: " Philippe Mathieu-Daudé
2024-11-07 10:01   ` Richard Henderson
2024-11-09  6:38   ` Thomas Huth
2024-11-06 18:46 ` [PATCH 3/5] hw/m68k: Mark devices as big-endian Philippe Mathieu-Daudé
2024-11-07 10:02   ` Richard Henderson
2024-11-09  6:28   ` Thomas Huth
2024-11-06 18:46 ` [PATCH 4/5] hw/openrisc: " Philippe Mathieu-Daudé
2024-11-07 10:03   ` Richard Henderson
2024-11-09  6:42   ` Thomas Huth
2024-11-09 15:58     ` Philippe Mathieu-Daudé
2024-11-09 18:08       ` Richard Henderson
2024-11-09 18:40         ` Thomas Huth
2024-11-06 18:46 ` [PATCH 5/5] hw/sparc: " Philippe Mathieu-Daudé
2024-11-06 22:56   ` Mark Cave-Ayland
2024-11-07 10:04   ` Richard Henderson
2024-12-30 16:42 ` [PATCH 0/5] hw: Mark architecture specific devices with specific endianness Philippe Mathieu-Daudé

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=20241106184612.71897-2-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=anthony@xenproject.org \
    --cc=atar4qemu@gmail.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=eduardo@habkost.net \
    --cc=huth@tuxfamily.org \
    --cc=kbastian@mail.uni-paderborn.de \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mst@redhat.com \
    --cc=paul@xen.org \
    --cc=pbonzini@redhat.com \
    --cc=proljc@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=shorne@gmail.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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).