All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hw/acpi: Set memory regions to native endian as a work around
@ 2021-11-08 13:05 BALATON Zoltan
  2021-11-08 13:32 ` Michael S. Tsirkin
  2021-11-08 14:30 ` Paolo Bonzini
  0 siblings, 2 replies; 34+ messages in thread
From: BALATON Zoltan @ 2021-11-08 13:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Igor Mammedov, Paolo Bonzini, Michael S. Tsirkin

When using ACPI on big endian machine (such as ppc/pegasos2 which has
a VT8231 south bridge with ACPI) writes to ACPI registers come out
byte swapped. This may be caused by a bug in memory subsystem but
until that is fixed setting the ACPI memory regions to native endian
makes it usable for big endian machines. This fixes ACPI shutdown with
pegasos2 when using the board firmware for now.
This could be reverted when the memory layer is fixed.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
 hw/acpi/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index 1e004d0078..543e4a7875 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -461,7 +461,7 @@ static const MemoryRegionOps acpi_pm_evt_ops = {
     .impl.min_access_size = 2,
     .valid.min_access_size = 1,
     .valid.max_access_size = 2,
-    .endianness = DEVICE_LITTLE_ENDIAN,
+    .endianness = DEVICE_NATIVE_ENDIAN,
 };
 
 void acpi_pm1_evt_init(ACPIREGS *ar, acpi_update_sci_fn update_sci,
@@ -531,7 +531,7 @@ static const MemoryRegionOps acpi_pm_tmr_ops = {
     .impl.min_access_size = 4,
     .valid.min_access_size = 1,
     .valid.max_access_size = 4,
-    .endianness = DEVICE_LITTLE_ENDIAN,
+    .endianness = DEVICE_NATIVE_ENDIAN,
 };
 
 void acpi_pm_tmr_init(ACPIREGS *ar, acpi_update_sci_fn update_sci,
@@ -608,7 +608,7 @@ static const MemoryRegionOps acpi_pm_cnt_ops = {
     .impl.min_access_size = 2,
     .valid.min_access_size = 1,
     .valid.max_access_size = 2,
-    .endianness = DEVICE_LITTLE_ENDIAN,
+    .endianness = DEVICE_NATIVE_ENDIAN,
 };
 
 void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent,
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2023-04-30 23:28 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 13:05 [PATCH] hw/acpi: Set memory regions to native endian as a work around BALATON Zoltan
2021-11-08 13:32 ` Michael S. Tsirkin
2021-11-08 15:22   ` BALATON Zoltan
2021-12-16 10:27   ` Michael S. Tsirkin
2021-11-08 14:30 ` Paolo Bonzini
2021-11-08 15:04   ` Paolo Bonzini
2021-11-08 15:16     ` BALATON Zoltan
2021-11-13 18:47       ` BALATON Zoltan
2022-01-19  9:19         ` Michael S. Tsirkin
2022-02-22 14:40           ` Michael S. Tsirkin
2023-02-20 18:24             ` BALATON Zoltan
2023-02-20 22:33               ` Michael S. Tsirkin
2023-02-20 23:25                 ` BALATON Zoltan
2023-02-21  8:30                   ` Paolo Bonzini
2023-02-21 12:48                     ` BALATON Zoltan
2023-02-21 12:55                       ` BALATON Zoltan
2023-03-06 22:56                         ` Paolo Bonzini
2023-03-06 23:11                           ` BALATON Zoltan
2023-03-06 23:36                           ` Paolo Bonzini
2023-03-07  0:06                             ` BALATON Zoltan
2023-03-07  5:58                               ` Paolo Bonzini
2023-03-07 10:01                                 ` BALATON Zoltan
2023-03-07 11:26                                   ` Paolo Bonzini
2023-03-07 12:54                                     ` BALATON Zoltan
2023-03-07 15:14                                       ` Paolo Bonzini
2023-03-07 15:21                                         ` BALATON Zoltan
2023-03-07 16:48                                           ` Paolo Bonzini
2023-04-30 23:10                                     ` BALATON Zoltan
2023-04-30 23:26                                       ` BALATON Zoltan
2023-02-21 14:02                       ` Paolo Bonzini
2023-03-02 13:42                         ` BALATON Zoltan
2023-03-06 18:34                           ` Michael S. Tsirkin
2023-03-03  8:22                         ` Michael S. Tsirkin
2023-03-11 20:59                     ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.