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

[Xen-changelog] [xen staging-4.12] x86: clear per cpu stub page information in cpu_smpboot_free()



commit 7ee6e17a77d81d142898a2eb2a85c1c860261d4a
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Thu Mar 5 11:13:21 2020 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Mar 5 11:13:21 2020 +0100

    x86: clear per cpu stub page information in cpu_smpboot_free()
    
    cpu_smpboot_free() removes the stubs for the cpu going offline, but it
    isn't clearing the related percpu variables. This will result in
    crashes when a stub page is released due to all related cpus gone
    offline and one of those cpus going online later.
    
    Fix that by clearing stubs.addr and stubs.mfn in order to allocate a
    new stub page when needed, irrespective of whether the CPU gets parked
    or removed.
    
    Fixes: 2e6c8f182c9c50 ("x86: distinguish CPU offlining from CPU removal")
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Reviewed-by: Wei Liu <wl@xxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Tested-by: Tao Xu <tao3.xu@xxxxxxxxx>
    master commit: 774901788c5614798931a1cb2e20dd8b885f97ab
    master date: 2020-01-09 11:07:38 +0100
---
 xen/arch/x86/smpboot.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 0f5c549898..699e21bfb7 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -953,6 +953,8 @@ static void cpu_smpboot_free(unsigned int cpu, bool remove)
         unmap_domain_page(stub_page);
         destroy_xen_mappings(per_cpu(stubs.addr, cpu) & PAGE_MASK,
                              (per_cpu(stubs.addr, cpu) | ~PAGE_MASK) + 1);
+        per_cpu(stubs.addr, cpu) = 0;
+        per_cpu(stubs.mfn, cpu) = 0;
         if ( i == STUBS_PER_PAGE )
             free_domheap_page(mfn_to_page(mfn));
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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