qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-5.1] acpi: accept byte and word access to core ACPI registers
@ 2020-07-20 16:06 Michael Tokarev
  2020-07-22 11:24 ` Michael S. Tsirkin
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Tokarev @ 2020-07-20 16:06 UTC (permalink / raw)
  To: qemu-devel, Michael S . Tsirkin; +Cc: Simon John, Michael Tokarev

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: 5d971f9e67 (memory: Revert "memory: accept mismatching sizes in memory_region_access_valid")
Fixes: afafe4bbe0 (apci: switch cnt to memory api)
Fixes: 77d58b1e47 (apci: switch timer to memory api)
Fixes: b5a7c024d2 (apci: switch evt to memory api)
Buglink: https://lore.kernel.org/xen-devel/20200630170913.123646-1-anthony.perard@citrix.com/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 <git@the-jedi.co.uk>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/acpi/core.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index f6d9ec4f13..ac06db3450 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -458,7 +458,8 @@ static void acpi_pm_evt_write(void *opaque, hwaddr addr, uint64_t val,
 static const MemoryRegionOps acpi_pm_evt_ops = {
     .read = acpi_pm_evt_read,
     .write = acpi_pm_evt_write,
-    .valid.min_access_size = 2,
+    .impl.min_access_size = 2,
+    .valid.min_access_size = 1,
     .valid.max_access_size = 2,
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
@@ -527,7 +528,8 @@ static void acpi_pm_tmr_write(void *opaque, hwaddr addr, uint64_t val,
 static const MemoryRegionOps acpi_pm_tmr_ops = {
     .read = acpi_pm_tmr_read,
     .write = acpi_pm_tmr_write,
-    .valid.min_access_size = 4,
+    .impl.min_access_size = 4,
+    .valid.min_access_size = 1,
     .valid.max_access_size = 4,
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
@@ -599,7 +601,8 @@ static void acpi_pm_cnt_write(void *opaque, hwaddr addr, uint64_t val,
 static const MemoryRegionOps acpi_pm_cnt_ops = {
     .read = acpi_pm_cnt_read,
     .write = acpi_pm_cnt_write,
-    .valid.min_access_size = 2,
+    .impl.min_access_size = 2,
+    .valid.min_access_size = 1,
     .valid.max_access_size = 2,
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
-- 
2.20.1



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

* Re: [PATCH for-5.1] acpi: accept byte and word access to core ACPI registers
  2020-07-20 16:06 [PATCH for-5.1] acpi: accept byte and word access to core ACPI registers Michael Tokarev
@ 2020-07-22 11:24 ` Michael S. Tsirkin
  2020-07-22 12:00   ` Michael Tokarev
  0 siblings, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2020-07-22 11:24 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: Simon John, qemu-devel

On Mon, Jul 20, 2020 at 07:06:27PM +0300, Michael Tokarev wrote:
> 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: 5d971f9e67 (memory: Revert "memory: accept mismatching sizes in memory_region_access_valid")
> Fixes: afafe4bbe0 (apci: switch cnt to memory api)
> Fixes: 77d58b1e47 (apci: switch timer to memory api)
> Fixes: b5a7c024d2 (apci: switch evt to memory api)
> Buglink: https://lore.kernel.org/xen-devel/20200630170913.123646-1-anthony.perard@citrix.com/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 <git@the-jedi.co.uk>
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

Queued, thanks!

> ---
>  hw/acpi/core.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/acpi/core.c b/hw/acpi/core.c
> index f6d9ec4f13..ac06db3450 100644
> --- a/hw/acpi/core.c
> +++ b/hw/acpi/core.c
> @@ -458,7 +458,8 @@ static void acpi_pm_evt_write(void *opaque, hwaddr addr, uint64_t val,
>  static const MemoryRegionOps acpi_pm_evt_ops = {
>      .read = acpi_pm_evt_read,
>      .write = acpi_pm_evt_write,
> -    .valid.min_access_size = 2,
> +    .impl.min_access_size = 2,
> +    .valid.min_access_size = 1,
>      .valid.max_access_size = 2,
>      .endianness = DEVICE_LITTLE_ENDIAN,
>  };
> @@ -527,7 +528,8 @@ static void acpi_pm_tmr_write(void *opaque, hwaddr addr, uint64_t val,
>  static const MemoryRegionOps acpi_pm_tmr_ops = {
>      .read = acpi_pm_tmr_read,
>      .write = acpi_pm_tmr_write,
> -    .valid.min_access_size = 4,
> +    .impl.min_access_size = 4,
> +    .valid.min_access_size = 1,
>      .valid.max_access_size = 4,
>      .endianness = DEVICE_LITTLE_ENDIAN,
>  };
> @@ -599,7 +601,8 @@ static void acpi_pm_cnt_write(void *opaque, hwaddr addr, uint64_t val,
>  static const MemoryRegionOps acpi_pm_cnt_ops = {
>      .read = acpi_pm_cnt_read,
>      .write = acpi_pm_cnt_write,
> -    .valid.min_access_size = 2,
> +    .impl.min_access_size = 2,
> +    .valid.min_access_size = 1,
>      .valid.max_access_size = 2,
>      .endianness = DEVICE_LITTLE_ENDIAN,
>  };
> -- 
> 2.20.1



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

* Re: [PATCH for-5.1] acpi: accept byte and word access to core ACPI registers
  2020-07-22 11:24 ` Michael S. Tsirkin
@ 2020-07-22 12:00   ` Michael Tokarev
  2020-07-22 12:02     ` Michael S. Tsirkin
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Tokarev @ 2020-07-22 12:00 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: qemu-devel

22.07.2020 14:24, Michael S. Tsirkin wrote:
> On Mon, Jul 20, 2020 at 07:06:27PM +0300, Michael Tokarev wrote:
>> 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: 5d971f9e67 (memory: Revert "memory: accept mismatching sizes in memory_region_access_valid")
>> Fixes: afafe4bbe0 (apci: switch cnt to memory api)
>> Fixes: 77d58b1e47 (apci: switch timer to memory api)
>> Fixes: b5a7c024d2 (apci: switch evt to memory api)
>> Buglink: https://lore.kernel.org/xen-devel/20200630170913.123646-1-anthony.perard@citrix.com/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 <git@the-jedi.co.uk>
>> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> 
> Queued, thanks!

Michael, please add Cc: stable@ for this. Many people suffered due to
this already, it's enough of that ;)

Thanks,

/mjt


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

* Re: [PATCH for-5.1] acpi: accept byte and word access to core ACPI registers
  2020-07-22 12:00   ` Michael Tokarev
@ 2020-07-22 12:02     ` Michael S. Tsirkin
  0 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2020-07-22 12:02 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: qemu-devel

On Wed, Jul 22, 2020 at 03:00:15PM +0300, Michael Tokarev wrote:
> 22.07.2020 14:24, Michael S. Tsirkin wrote:
> > On Mon, Jul 20, 2020 at 07:06:27PM +0300, Michael Tokarev wrote:
> >> 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: 5d971f9e67 (memory: Revert "memory: accept mismatching sizes in memory_region_access_valid")
> >> Fixes: afafe4bbe0 (apci: switch cnt to memory api)
> >> Fixes: 77d58b1e47 (apci: switch timer to memory api)
> >> Fixes: b5a7c024d2 (apci: switch evt to memory api)
> >> Buglink: https://lore.kernel.org/xen-devel/20200630170913.123646-1-anthony.perard@citrix.com/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 <git@the-jedi.co.uk>
> >> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> > 
> > Queued, thanks!
> 
> Michael, please add Cc: stable@ for this. Many people suffered due to
> this already, it's enough of that ;)
> 
> Thanks,
> 
> /mjt

I did that, thanks!




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

end of thread, other threads:[~2020-07-22 12:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 16:06 [PATCH for-5.1] acpi: accept byte and word access to core ACPI registers Michael Tokarev
2020-07-22 11:24 ` Michael S. Tsirkin
2020-07-22 12:00   ` Michael Tokarev
2020-07-22 12:02     ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).