From: BALATON Zoltan <balaton@eik.bme.hu>
To: qemu-devel@nongnu.org
Cc: Igor Mammedov <imammedo@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: [PATCH] hw/acpi: Set memory regions to native endian as a work around
Date: Mon, 08 Nov 2021 14:05:42 +0100 [thread overview]
Message-ID: <20211108130934.59B48748F52@zero.eik.bme.hu> (raw)
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
next reply other threads:[~2021-11-08 13:11 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-08 13:05 BALATON Zoltan [this message]
2021-11-08 13:32 ` [PATCH] hw/acpi: Set memory regions to native endian as a work around 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
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=20211108130934.59B48748F52@zero.eik.bme.hu \
--to=balaton@eik.bme.hu \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.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 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.