From patchwork Fri Oct 27 18:36:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 13439042 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C42D8C25B47 for ; Fri, 27 Oct 2023 18:37:32 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.624617.973198 (Exim 4.92) (envelope-from ) id 1qwRhj-0004n1-OF; Fri, 27 Oct 2023 18:37:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 624617.973198; Fri, 27 Oct 2023 18:37:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qwRhj-0004mu-KN; Fri, 27 Oct 2023 18:37:07 +0000 Received: by outflank-mailman (input) for mailman id 624617; Fri, 27 Oct 2023 18:37:05 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qwRhg-0004mX-Kn for xen-devel@lists.xenproject.org; Fri, 27 Oct 2023 18:37:05 +0000 Received: from casper.infradead.org (casper.infradead.org [2001:8b0:10b:1236::1]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d0a5ef47-74f7-11ee-9b0e-b553b5be7939; Fri, 27 Oct 2023 20:37:00 +0200 (CEST) Received: from [2001:8b0:10b:5:8f9a:f53a:1a74:1a12] (helo=u3832b3a9db3152.ant.amazon.com) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qwRhU-004wDA-1R; Fri, 27 Oct 2023 18:36:52 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d0a5ef47-74f7-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:Date:Cc:To: From:Subject:Message-ID:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=Vsp70uUjmZBYC/PeJqsr4c3tnhKpPArVAhfeb/JBx+4=; b=A+K0J8f5m4iW6/xEVFkF4+DfCi V9cXPdogqZrwnZutMQIItIsvL/d3R8H+2vyvRMei1SZuOHxhpny5bMDtN1T8Q/6ziIvJJ9V5hPSnX 5n6ohNV4mE8zkEC4BcJXuX84C7myQCpEplK0b6FROpc5aNmLN/N/zk8ThUkVZ0+B3dFg9BdUiJsWH KMxzKy+PGNs3LwVX+FyH8X2zlhrtHp5hjPhxzfPGJcMlM7/t9xau91SMFB9C2CxbsOVz8dap2vqw+ KEelc7Xm7oRK6iqapER+yAYGnNtszeXUjlU7brEgjTc5BhF+UoCUqMr6iCTLdrIJwxxk6QobZuJwL RPFoBhUg==; Message-ID: Subject: [PATCH] acpi_idle: use raw_safe_halt() from acpi_idle_play_dead() From: David Woodhouse To: linux-acpi , linux-kernel Cc: "Rafael J. Wysocki" , Len Brown , Juergen Gross , xen-devel , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng Date: Fri, 27 Oct 2023 19:36:51 +0100 User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html From: David Woodhouse Xen HVM guests were observed taking triple-faults when attempting to online a previously offlined vCPU. Investigation showed that the fault was coming from a failing call to lockdep_assert_irqs_disabled(), in load_current_idt() which was too early in the CPU bringup to actually catch the exception and report the failure cleanly. This was a false positive, caused by acpi_idle_play_dead() setting the per-cpu hardirqs_enabled flag by calling safe_halt(). Switch it to use raw_safe_halt() instead, which doesn't do so. Signed-off-by: David Woodhouse Acked-by: Peter Zijlstra (Intel) --- We might {also,instead} explicitly set the hardirqs_enabled flag to zero when bringing up an AP? drivers/acpi/processor_idle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 3a34a8c425fe..55437f5e0c3a 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -592,7 +592,7 @@ static int acpi_idle_play_dead(struct cpuidle_device *dev, int index) while (1) { if (cx->entry_method == ACPI_CSTATE_HALT) - safe_halt(); + raw_safe_halt(); else if (cx->entry_method == ACPI_CSTATE_SYSTEMIO) { io_idle(cx->address); } else