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

[xen staging] x86/ACPI: fix mapping of FACS



commit 8b6d55c1261820bb9db8d867ce9ee77397d05203
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Nov 24 11:26:02 2020 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Nov 24 11:26:02 2020 +0100

    x86/ACPI: fix mapping of FACS
    
    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>
    Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/acpi/boot.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
index ed40ce56b4..cecb414681 100644
--- 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_table_fadt *fadt)
        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_table_fadt *fadt)
                offsetof(struct acpi_table_facs, firmware_waking_vector);
        acpi_sinfo.vector_width = 32;
 
+       acpi_os_unmap_memory(facs, sizeof(*facs));
+
        printk(KERN_INFO PREFIX
               "            wakeup_vec[%"PRIx64"], vec_size[%x]\n",
               acpi_sinfo.wakeup_vector, acpi_sinfo.vector_width);
        return;
-bad:
+
+ bad:
+       if (facs)
+               acpi_os_unmap_memory(facs, sizeof(*facs));
        memset(&acpi_sinfo, 0,
               offsetof(struct acpi_sleep_info, sleep_control));
        memset(&acpi_sinfo.sleep_status + 1, 0,
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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