qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 for-5.1] acpi-pm-tmr: allow any small-size reads


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 for-5.1] acpi-pm-tmr: allow any small-size reads
Date: Tue, 14 Jul 2020 13:08:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 7/14/20 12:51 PM, Michael Tokarev wrote:
> As found in LP#1886318, MacOS Catalina performs 2-byte reads
> on the acpi timer address space while the spec says it should
> be 4-byte. Allow any small reads.
> 

BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964247

> Reported-By: Simon John <git@the-jedi.co.uk>
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
>  hw/acpi/core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> v2: fixed bug#, use the right form of S-o-b, and allow up to 1 byte reads.
> 
> I'm applying this to debian qemu package, need the fix
> faster in order to release security updates for other
> branches.
> 
> diff --git a/hw/acpi/core.c b/hw/acpi/core.c
> --- a/hw/acpi/core.c
> +++ b/hw/acpi/core.c
> @@ -530,7 +530,10 @@ 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,
> +    .impl.min_access_size = 4,

This is correct.

> +     /* at least MacOS Catalina reads 2 bytes and fails if it doesn't work */
> +     /* allow 1-byte reads too */
> -    .valid.min_access_size = 4,
> +    .valid.min_access_size = 1,

This is a quick fix for 5.1, but I don't think this is the correct
long-term fix. See:
https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg04639.html

>      .valid.max_access_size = 4,
>      .endianness = DEVICE_LITTLE_ENDIAN,
>  };
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]