From patchwork Tue May 16 09:09:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 94569 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp284702vqo; Tue, 16 May 2023 02:13:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ctWYC+RxXR+Szl5+wjvViMftwr+G6YCOhKSO05uT5NNLzAVbufQ/Zx5x8ZSE022AeEsmv X-Received: by 2002:a17:903:41d0:b0:1ad:55e6:16fe with SMTP id u16-20020a17090341d000b001ad55e616femr25716829ple.15.1684228427030; Tue, 16 May 2023 02:13:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684228427; cv=none; d=google.com; s=arc-20160816; b=Kbhlt7WEPnKgcmWp9Tg4PQMCL4m9pm7hXVvtQvgsHti4rfAqE7dx9+guOj6aYJXsKP nrM8YDR1hCE1c2rrYDauxcLBaqoPaD4Sse4MwQGzMZsUobcTa4H+lLtFZoFKcQR67gHW D2fbKucUemMw1DwtdhcZe+oHytp1/iRb3fK+IBOwELiUqTj9USbNUA4adIEgqBOjP7rd 1nr96qxns90cfqOJbB1bFFdN489AuVWjkijTjgVAFb0RwQyZGQ42jxX3EiU1umfy7rBZ 6YxsiKLurPgRf7saOlfYYMOMnIxeFngxu1kVT2N9No2WxUr+Jk0w3Hsxb7wtEKoHX5x2 ywQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=5Dz97XQ5meyngqjRIFPYPmInwSGxHK9PFZi+D8liCts=; b=XIyQ8N8nMiibUSl0C+V26DPRM/gRloezZGaIhsga5u58NpRy+0H+lWhdrRGiWU50Xc z/PvENiDFcu+s5JiG/32q1niLl+2VD1RDW+Tc2p7y4CBW08jA4U6qUY0zcuI3/gGWbJG 9dvKUnkgM/X7CKWQLDBQY/qfHraNxVk3qS86eTJgd07ZZ+8sLZUIVWyMG3aFWRveQyu1 l4mjqTWVzGnu5v1XsXumuqCncsszo0VB0EA7ci/DH9IjmU+VJp7PZO9kLtzK5QxTVh+v aLt+vELZQf65U/0Uk+4S7pZTDOgz8OhlMMH4/R5NhlB8wCU3db6Ko9ulQcLCZnDnRZ+Z n/jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=nOO10I37; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o4-20020a170902d4c400b001a0039e3597si19198833plg.316.2023.05.16.02.13.31; Tue, 16 May 2023 02:13:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=nOO10I37; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231824AbjEPJLG (ORCPT + 99 others); Tue, 16 May 2023 05:11:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231794AbjEPJKG (ORCPT ); Tue, 16 May 2023 05:10:06 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57FE02D53; Tue, 16 May 2023 02:10:04 -0700 (PDT) Date: Tue, 16 May 2023 09:09:58 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684228199; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5Dz97XQ5meyngqjRIFPYPmInwSGxHK9PFZi+D8liCts=; b=nOO10I37aXxk1FFG76fYu7Q43IDEhTKJ/gM/e66DNuJBhOC45ZmeMx4P+K7IE0BVjineZo ARpBzNoRMbXrw71wMLwoh/8oJsDAVIWSN8vGxZBiIK2nFu7bAqLBBo9imndvq1aX8Q5BgK 7KxEQxFJCM//iJhQvBAFChheAvdsRkFo8yZmAActgwQyEFFBpoyeUBJQHUMZgRiHAfFSTZ 3vNpBPX6wSUQB9tTV3k+vxWAH7lJSjRqSbZjTM1mmxTEh4DVlHpobFWNk723knS8aMBqlz fpscwW6DW1+83tcVfwxvBcglckx9QrtdkE4IWxR/ulXhwldxIS3Jn1YgS/HyPw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684228199; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5Dz97XQ5meyngqjRIFPYPmInwSGxHK9PFZi+D8liCts=; b=o4ty2sWqQiQ/1JbpLIY8Du3+gJJcROiyCxFY1zrUJPGjgPuQqX/hx6vYruBMmktGNBs7oV wHS6bVA+SEv75kAg== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: smp/core] x86/xen/hvm: Get rid of DEAD_FROZEN handling Cc: Thomas Gleixner , "Peter Zijlstra (Intel)" , Michael Kelley , Oleksandr Natalenko , Helge Deller , "Guilherme G. Piccoli" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230512205256.423407127@linutronix.de> References: <20230512205256.423407127@linutronix.de> MIME-Version: 1.0 Message-ID: <168422819895.404.9292905514858665876.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765724677482280190?= X-GMAIL-MSGID: =?utf-8?q?1766041507291685995?= The following commit has been merged into the smp/core branch of tip: Commit-ID: ab24eb9abb9c60c45119370731735b79ed79f36c Gitweb: https://git.kernel.org/tip/ab24eb9abb9c60c45119370731735b79ed79f36c Author: Thomas Gleixner AuthorDate: Fri, 12 May 2023 23:07:25 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 15 May 2023 13:44:55 +02:00 x86/xen/hvm: Get rid of DEAD_FROZEN handling No point in this conditional voodoo. Un-initializing the lock mechanism is safe to be called unconditionally even if it was already invoked when the CPU died. Remove the invocation of xen_smp_intr_free() as that has been already cleaned up in xen_cpu_dead_hvm(). Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.423407127@linutronix.de --- arch/x86/xen/enlighten_hvm.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c index c1cd28e..a6820ca 100644 --- a/arch/x86/xen/enlighten_hvm.c +++ b/arch/x86/xen/enlighten_hvm.c @@ -161,13 +161,12 @@ static int xen_cpu_up_prepare_hvm(unsigned int cpu) int rc = 0; /* - * This can happen if CPU was offlined earlier and - * offlining timed out in common_cpu_die(). + * If a CPU was offlined earlier and offlining timed out then the + * lock mechanism is still initialized. Uninit it unconditionally + * as it's safe to call even if already uninited. Interrupts and + * timer have already been handled in xen_cpu_dead_hvm(). */ - if (cpu_report_state(cpu) == CPU_DEAD_FROZEN) { - xen_smp_intr_free(cpu); - xen_uninit_lock_cpu(cpu); - } + xen_uninit_lock_cpu(cpu); if (cpu_acpi_id(cpu) != U32_MAX) per_cpu(xen_vcpu_id, cpu) = cpu_acpi_id(cpu);