Blame 0007-fw_cfg_mem-flip-ctl_mem_ops-and-data_mem_ops-to-DEVI.patch

391fb8
From 172d29b5a320c8d656072db24e94ea21d1a5ed75 Mon Sep 17 00:00:00 2001
391fb8
From: Laszlo Ersek <lersek@redhat.com>
391fb8
Date: Mon, 22 Dec 2014 13:11:38 +0100
391fb8
Subject: [PATCH 07/15] fw_cfg_mem: flip ctl_mem_ops and data_mem_ops to
391fb8
 DEVICE_BIG_ENDIAN
391fb8
391fb8
The standalone selector port (fw_cfg_ctl_mem_ops) is only used by big
391fb8
endian guests to date (*), hence this change doesn't regress them. Paolo
391fb8
and Alex have suggested / requested an explicit DEVICE_BIG_ENDIAN setting
391fb8
here, for clarity.
391fb8
391fb8
(*) git grep -l fw_cfg_init_mem
391fb8
391fb8
    hw/nvram/fw_cfg.c
391fb8
    hw/ppc/mac_newworld.c
391fb8
    hw/ppc/mac_oldworld.c
391fb8
    hw/sparc/sun4m.c
391fb8
    include/hw/nvram/fw_cfg.h
391fb8
391fb8
The standalone data port (fw_cfg_data_mem_ops) has max_access_size 1 (for
391fb8
now), hence changing its endianness doesn't change behavior for existing
391fb8
guest code.
391fb8
391fb8
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
391fb8
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
391fb8
Message-id: 1419250305-31062-5-git-send-email-pbonzini@redhat.com
391fb8
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
391fb8
(cherry picked from commit d789c84547abaaf82828b20998aee618b9327261)
391fb8
---
391fb8
 hw/nvram/fw_cfg.c | 4 ++--
391fb8
 1 file changed, 2 insertions(+), 2 deletions(-)
391fb8
391fb8
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
391fb8
index 8deb860..910ae14 100644
391fb8
--- a/hw/nvram/fw_cfg.c
391fb8
+++ b/hw/nvram/fw_cfg.c
391fb8
@@ -332,14 +332,14 @@ static bool fw_cfg_comb_valid(void *opaque, hwaddr addr,
391fb8
 
391fb8
 static const MemoryRegionOps fw_cfg_ctl_mem_ops = {
391fb8
     .write = fw_cfg_ctl_mem_write,
391fb8
-    .endianness = DEVICE_NATIVE_ENDIAN,
391fb8
+    .endianness = DEVICE_BIG_ENDIAN,
391fb8
     .valid.accepts = fw_cfg_ctl_mem_valid,
391fb8
 };
391fb8
 
391fb8
 static const MemoryRegionOps fw_cfg_data_mem_ops = {
391fb8
     .read = fw_cfg_data_mem_read,
391fb8
     .write = fw_cfg_data_mem_write,
391fb8
-    .endianness = DEVICE_NATIVE_ENDIAN,
391fb8
+    .endianness = DEVICE_BIG_ENDIAN,
391fb8
     .valid = {
391fb8
         .min_access_size = 1,
391fb8
         .max_access_size = 1,
391fb8
-- 
391fb8
2.1.0
391fb8