From nobody Thu Apr 25 09:04:15 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1578481343; cv=none; d=zohomail.com; s=zohoarc; b=VGJFZJtl6V4EKLZCTtIvwm2TiBQf8FHDaJ3e56RJGSmQSXGh8kS6rR8z4GyeED9YxZA9Ij60BVFp+mX5xdCtvvWfUsSX+rHC6M0bKUhATomyj8JUFlHPAm3yBgpuXuv4bKPdt25Gb2IUSK05ZIpiiRz9+5sxVgyfHJQlKuU8Ogk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578481343; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=f3IZENS3iEkN9Ek4QW3gEG2UD4nscsxLO5XYaNk0pFY=; b=k6u4+ovv7Y/PmlO6r0kwQr1rlAk4hSKHuVUEVrdmaNzoNGcf3iP8Z91KFuckAavL9DWpgu+cMcvNfM6HmzgQGXJhhw9c33Fvo1yfPWNEXeRNWowNCl1SAM/6MVZGa2s5CIJQDE4+yP2Mwy0cvE73waHtL8B9QhxxBptJ3LdP+y0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1578481343685258.79243223358526; Wed, 8 Jan 2020 03:02:23 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ip960-0002sM-Nz; Wed, 08 Jan 2020 11:01:52 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ip95z-0002sD-Gw for xen-devel@lists.xenproject.org; Wed, 08 Jan 2020 11:01:51 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 458fabf6-3206-11ea-b79d-12813bfff9fa; Wed, 08 Jan 2020 11:01:51 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 64582AD12; Wed, 8 Jan 2020 11:01:50 +0000 (UTC) X-Inumbo-ID: 458fabf6-3206-11ea-b79d-12813bfff9fa X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Wed, 8 Jan 2020 12:01:48 +0100 Message-Id: <20200108110148.18988-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [PATCH] xen/x86: clear per cpu stub page information in cpu_smpboot_free() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Andrew Cooper , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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. Signed-off-by: Juergen Gross Reviewed-by: Wei Liu --- 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 7e29704080..46c0729214 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -945,6 +945,8 @@ static void cpu_smpboot_free(unsigned int cpu, bool rem= ove) (per_cpu(stubs.addr, cpu) | ~PAGE_MASK) + 1); if ( i =3D=3D STUBS_PER_PAGE ) free_domheap_page(mfn_to_page(mfn)); + per_cpu(stubs.addr, cpu) =3D 0; + per_cpu(stubs.mfn, cpu) =3D 0; } =20 FREE_XENHEAP_PAGE(per_cpu(compat_gdt, cpu)); --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel