Skip to content

Commit 974b857

Browse files
Michael Tokarevmdroth
Michael Tokarev
authored andcommitted
acpi: accept byte and word access to core ACPI registers
All ISA registers should be accessible as bytes, words or dwords (if wide enough). Fix the access constraints for acpi-pm-evt, acpi-pm-tmr & acpi-cnt registers. Fixes: 5d971f9 (memory: Revert "memory: accept mismatching sizes in memory_region_access_valid") Fixes: afafe4b (apci: switch cnt to memory api) Fixes: 77d58b1 (apci: switch timer to memory api) Fixes: b5a7c02 (apci: switch evt to memory api) Buglink: https://lore.kernel.org/xen-devel/[email protected]/T/ Buglink: https://bugs.debian.org/964793 BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964247 BugLink: https://bugs.launchpad.net/bugs/1886318 Reported-By: Simon John <[email protected]> Signed-off-by: Michael Tokarev <[email protected]> Message-Id: <[email protected]> Cc: [email protected] Reviewed-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> (cherry picked from commit dba04c3) Signed-off-by: Michael Roth <[email protected]>
1 parent 782e941 commit 974b857

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

hw/acpi/core.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,8 @@ static void acpi_pm_evt_write(void *opaque, hwaddr addr, uint64_t val,
461461
static const MemoryRegionOps acpi_pm_evt_ops = {
462462
.read = acpi_pm_evt_read,
463463
.write = acpi_pm_evt_write,
464-
.valid.min_access_size = 2,
464+
.impl.min_access_size = 2,
465+
.valid.min_access_size = 1,
465466
.valid.max_access_size = 2,
466467
.endianness = DEVICE_LITTLE_ENDIAN,
467468
};
@@ -530,7 +531,8 @@ static void acpi_pm_tmr_write(void *opaque, hwaddr addr, uint64_t val,
530531
static const MemoryRegionOps acpi_pm_tmr_ops = {
531532
.read = acpi_pm_tmr_read,
532533
.write = acpi_pm_tmr_write,
533-
.valid.min_access_size = 4,
534+
.impl.min_access_size = 4,
535+
.valid.min_access_size = 1,
534536
.valid.max_access_size = 4,
535537
.endianness = DEVICE_LITTLE_ENDIAN,
536538
};
@@ -602,7 +604,8 @@ static void acpi_pm_cnt_write(void *opaque, hwaddr addr, uint64_t val,
602604
static const MemoryRegionOps acpi_pm_cnt_ops = {
603605
.read = acpi_pm_cnt_read,
604606
.write = acpi_pm_cnt_write,
605-
.valid.min_access_size = 2,
607+
.impl.min_access_size = 2,
608+
.valid.min_access_size = 1,
606609
.valid.max_access_size = 2,
607610
.endianness = DEVICE_LITTLE_ENDIAN,
608611
};

0 commit comments

Comments
 (0)