Blame SOURCES/kvm-acpi-accept-byte-and-word-access-to-core-ACPI-regist.patch

dc7afb
From dcac680adb6b8624f14eda3e812521bddbe8ecea Mon Sep 17 00:00:00 2001
dc7afb
From: Jon Maloy <jmaloy@redhat.com>
dc7afb
Date: Wed, 21 Apr 2021 22:30:04 -0400
dc7afb
Subject: [PATCH 5/7] acpi: accept byte and word access to core ACPI registers
dc7afb
MIME-Version: 1.0
dc7afb
Content-Type: text/plain; charset=UTF-8
dc7afb
Content-Transfer-Encoding: 8bit
dc7afb
dc7afb
RH-Author: Jon Maloy <jmaloy@redhat.com>
dc7afb
Message-id: <20210421223006.19650-5-jmaloy@redhat.com>
dc7afb
Patchwork-id: 101482
dc7afb
O-Subject: [RHEL-8.5.0 qemu-kvm PATCH v2 4/6] acpi: accept byte and word access to core ACPI registers
dc7afb
Bugzilla: 1842478
dc7afb
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
dc7afb
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
dc7afb
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
dc7afb
dc7afb
From: Michael Tokarev <mjt@tls.msk.ru>
dc7afb
dc7afb
All ISA registers should be accessible as bytes, words or dwords
dc7afb
(if wide enough).  Fix the access constraints for acpi-pm-evt,
dc7afb
acpi-pm-tmr & acpi-cnt registers.
dc7afb
dc7afb
Fixes: 5d971f9e67 (memory: Revert "memory: accept mismatching sizes in memory_region_access_valid")
dc7afb
Fixes: afafe4bbe0 (apci: switch cnt to memory api)
dc7afb
Fixes: 77d58b1e47 (apci: switch timer to memory api)
dc7afb
Fixes: b5a7c024d2 (apci: switch evt to memory api)
dc7afb
Buglink: https://lore.kernel.org/xen-devel/20200630170913.123646-1-anthony.perard@citrix.com/T/
dc7afb
Buglink: https://bugs.debian.org/964793
dc7afb
BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964247
dc7afb
BugLink: https://bugs.launchpad.net/bugs/1886318
dc7afb
Reported-By: Simon John <git@the-jedi.co.uk>
dc7afb
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
dc7afb
Message-Id: <20200720160627.15491-1-mjt@msgid.tls.msk.ru>
dc7afb
Cc: qemu-stable@nongnu.org
dc7afb
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
dc7afb
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
dc7afb
dc7afb
(cherry picked from commit dba04c3488c4699f5afe96f66e448b1d447cf3fb)
dc7afb
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
dc7afb
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
dc7afb
---
dc7afb
 hw/acpi/core.c | 9 ++++++---
dc7afb
 1 file changed, 6 insertions(+), 3 deletions(-)
dc7afb
dc7afb
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
dc7afb
index 45cbed49ab..d85052c34a 100644
dc7afb
--- a/hw/acpi/core.c
dc7afb
+++ b/hw/acpi/core.c
dc7afb
@@ -461,7 +461,8 @@ static void acpi_pm_evt_write(void *opaque, hwaddr addr, uint64_t val,
dc7afb
 static const MemoryRegionOps acpi_pm_evt_ops = {
dc7afb
     .read = acpi_pm_evt_read,
dc7afb
     .write = acpi_pm_evt_write,
dc7afb
-    .valid.min_access_size = 2,
dc7afb
+    .impl.min_access_size = 2,
dc7afb
+    .valid.min_access_size = 1,
dc7afb
     .valid.max_access_size = 2,
dc7afb
     .endianness = DEVICE_LITTLE_ENDIAN,
dc7afb
 };
dc7afb
@@ -530,7 +531,8 @@ static void acpi_pm_tmr_write(void *opaque, hwaddr addr, uint64_t val,
dc7afb
 static const MemoryRegionOps acpi_pm_tmr_ops = {
dc7afb
     .read = acpi_pm_tmr_read,
dc7afb
     .write = acpi_pm_tmr_write,
dc7afb
-    .valid.min_access_size = 4,
dc7afb
+    .impl.min_access_size = 4,
dc7afb
+    .valid.min_access_size = 1,
dc7afb
     .valid.max_access_size = 4,
dc7afb
     .endianness = DEVICE_LITTLE_ENDIAN,
dc7afb
 };
dc7afb
@@ -602,7 +604,8 @@ static void acpi_pm_cnt_write(void *opaque, hwaddr addr, uint64_t val,
dc7afb
 static const MemoryRegionOps acpi_pm_cnt_ops = {
dc7afb
     .read = acpi_pm_cnt_read,
dc7afb
     .write = acpi_pm_cnt_write,
dc7afb
-    .valid.min_access_size = 2,
dc7afb
+    .impl.min_access_size = 2,
dc7afb
+    .valid.min_access_size = 1,
dc7afb
     .valid.max_access_size = 2,
dc7afb
     .endianness = DEVICE_LITTLE_ENDIAN,
dc7afb
 };
dc7afb
-- 
dc7afb
2.27.0
dc7afb