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

Re: [PATCH 1/4] x86/ACPI: fix mapping of FACS


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 29 Dec 2020 11:56:46 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yrmUNnfftmS9BgOhBfrMF5Enj/eNbFxeMNg97tCnSA8=; b=l0xVP73RkRwmyV5nKVCZgbfdxlai6clHEjtx73CZpUjoF/b+m4ZtR57MRHqNdaG6/dxSOodvbkJvvBJxkQKlMsjZTG+Pr+LG9MA9N+63tzUgk4P67iiyQ4rGYid25GS/FCD8SB12eqfdBUHR1bEIcit7XAyZQVVQPFnO6MEiSN3vjCUOQ9mNuKz01A0tagzfSAj8hGT5FGLMddqdKbQ136OLMDY3512Fc4YdVa0B3Uu1uP9yor1wQzJHWjX/iZYR+0pzEOQOjGpPwxq3fbaWO7pA+OeqYSByR02BzeSrbubIAXqfRGP2VE8HWLTr4SqeXrgWPaRTrwrbIa+7Db0wtg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RcmJM0t+CIL40bGA4UgxDtrbKxT56FeBHebqjCF5e4YhZtxG/5+Ce4Q27MkMEjNiNUUHU59hIiV+9qYccV/HLZfEAxFhhZMvMklV+/aypXw6HSYmrj6NGQuWIu7YA3HiGLqP3Rwe8lsc9rANjfX5WxbCIp30ggTEkGG+eZu2brf6l4Vtq+jqAxKVR+X8IIGEplZOgJo77z6zWpg0N2Z4UeMo9FPDUiP98oK7lrH0uUtgDzHWNbft+B1vvvC4yV7x38AGGSwBUkITNQrfcj/YM1vsG/k1CsuHgpMMDa7qBxI+vNQJwXcgLjfqxvoLb00478XTKAoPmRjlT05p1dOcuw==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Tue, 29 Dec 2020 10:57:06 +0000
  • Ironport-sdr: ZazKAYaVKAmYgmAF8kin7F/SJn/O3ZCInguW0qxZUIgde+6/GiKTwXXJ+xbmMgpWFSkbVxzx3x NnQ7nKpBkYsV3cmfJ0umwz/U2aShsFEuEonpzqgXiK1B7qMJstKUH+ob3b0R7L4s6iJtlqZbur zHqgrYnJxLPGQchU26AT0siinoOmCLKTkWS0Mqdg+7qIZshLaAMkIRyqmp1vl6eQ4scGVteYPW tqewdFl9zim5mGCwh+EvR4sX5TG5xu9dMUWPYeLZflfi3zNYJawP1gnhJo6yHd4VY8MladELzM jFs=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Nov 23, 2020 at 01:39:55PM +0100, Jan Beulich wrote:
> acpi_fadt_parse_sleep_info() runs when the system is already in
> SYS_STATE_boot. Hence its direct call to __acpi_map_table() won't work
> anymore. This call should probably have been replaced long ago already,
> as the layering violation hasn't been necessary for quite some time.
> 
> Fixes: 1c4aa69ca1e1 ("xen/acpi: Rework acpi_os_map_memory() and 
> acpi_os_unmap_memory()")
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> --- a/xen/arch/x86/acpi/boot.c
> +++ b/xen/arch/x86/acpi/boot.c
> @@ -422,8 +422,7 @@ acpi_fadt_parse_sleep_info(struct acpi_t
>       if (!facs_pa)
>               goto bad;
>  
> -     facs = (struct acpi_table_facs *)
> -             __acpi_map_table(facs_pa, sizeof(struct acpi_table_facs));
> +     facs = acpi_os_map_memory(facs_pa, sizeof(*facs));
>       if (!facs)
>               goto bad;
>  
> @@ -448,11 +447,16 @@ acpi_fadt_parse_sleep_info(struct acpi_t
>               offsetof(struct acpi_table_facs, firmware_waking_vector);
>       acpi_sinfo.vector_width = 32;
>  
> +     acpi_os_unmap_memory(facs, sizeof(*facs));

Nit: looking at this again, I think you could move the
acpi_os_unmap_memory further up, just after the last usage of facs
(ie: before setting the wakeup_vector field).

Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.