From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4599DEB64DC for ; Wed, 21 Jun 2023 15:43:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229882AbjFUPnx (ORCPT ); Wed, 21 Jun 2023 11:43:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233725AbjFUPn3 (ORCPT ); Wed, 21 Jun 2023 11:43:29 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02B85173F for ; Wed, 21 Jun 2023 08:42:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687362146; h=from:from: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=v3qZ6ovJeq5tWh1iDUXLwP6mu+mEkpr462zbbeksiXQ=; b=RzAiRfuSOxrQmeHhiVj7RlblR+OzEGJT8aNEAdbijlYI1/BQfKtMP11lYLHljXKp7OXSYC lQy0XO+yv/K/5NRcFXrJ6BJIMILK9ESiUFoKE6WPWJmtrMZqy1fTNdt0fGthtjH5wJkdHf DqHK7MuuNpQCWLIu9HcwBcTj27vgC94= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-92-BlHZtMNEOVibyvZpBmsRGw-1; Wed, 21 Jun 2023 11:42:24 -0400 X-MC-Unique: BlHZtMNEOVibyvZpBmsRGw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 28C99280BC80; Wed, 21 Jun 2023 15:42:21 +0000 (UTC) Received: from [10.22.17.140] (unknown [10.22.17.140]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76EB0492B02; Wed, 21 Jun 2023 15:42:20 +0000 (UTC) Message-ID: <184ee986-340d-95f2-72c7-f63bcb703530@redhat.com> Date: Wed, 21 Jun 2023 11:42:20 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v2 2/5] x86/idle: Disable IBRS when cpu is offline Content-Language: en-US To: Peter Zijlstra Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Josh Poimboeuf , Pawan Gupta , Jacob Pan , Len Brown , linux-kernel@vger.kernel.org, x86@kernel.org, linux-pm@vger.kernel.org, Robin Jarry , Joe Mario References: <20230620140625.1001886-1-longman@redhat.com> <20230620140625.1001886-3-longman@redhat.com> <20230621072313.GA2046280@hirez.programming.kicks-ass.net> <7f2424df-1846-6c38-e446-b3d5aa693ecd@redhat.com> <20230621143602.GI2053369@hirez.programming.kicks-ass.net> <5cb81f3b-45a0-d566-3d63-569b5706e9fe@redhat.com> <20230621144848.GJ2053369@hirez.programming.kicks-ass.net> <309d15f5-0dd8-aee8-14a6-621a071bc363@redhat.com> <20230621145436.GK2053369@hirez.programming.kicks-ass.net> From: Waiman Long In-Reply-To: <20230621145436.GK2053369@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/21/23 10:54, Peter Zijlstra wrote: > On Wed, Jun 21, 2023 at 10:51:33AM -0400, Waiman Long wrote: >> On 6/21/23 10:48, Peter Zijlstra wrote: >>> On Wed, Jun 21, 2023 at 10:44:23AM -0400, Waiman Long wrote: >>> >>>> Well, hlt_play_dead() is only called if cpuidle_play_dead() returns an error >>>> which is not the typical case. My testing does confirm that this patch is >>>> able to keep the IBRS bit off when a CPU is offline via its online sysfs >>>> file. >>> The point is; your re-enable IBRS hunk at the end is dead-code. It >>> should never ever run and having it is confusing. >> What I meant is that hlt_play_dead() should never be called unless there is >> some serious problem with the system and native_play_dead() does return in >> normal usage. > This is all through arch_cpu_idle_dead() which is __noreturn. And no, > none of this must ever return. > > If you want an offline CPU to come back, you re-init. Yes, you are right. I thought it will return. I will update the patch accordingly. Thanks, Longman