Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp10849594rwd; Thu, 22 Jun 2023 05:49:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4BugTtDc63MkbEe2mQtdFgKqg6Ka7gNhnK75HahzW/1pvj9+D9MAIqQgG/tFhUSPBEszBQ X-Received: by 2002:a05:6a21:6d96:b0:123:3ec2:361b with SMTP id wl22-20020a056a216d9600b001233ec2361bmr4808580pzb.56.1687438194249; Thu, 22 Jun 2023 05:49:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687438194; cv=none; d=google.com; s=arc-20160816; b=FD6Rr1iM9H7U1GrDkVEJz92ney4xh4HrK3WBJr0fpuoOez6QDdlHOevTbg+nI9DlAJ 3D05Dclb9DTMQa/e5fiWx0uw77/qERtcIgLtOJvsYBmAV8JTSMXdsGFAP4TMoCvxrRsd eSrvSuYuoTCnpCJYiY4O8KYTtpmOdkV/y6kz1IYWgm9HN0kQ3JVrjHMPSx5EgTuWH0dx JZU5DKQuVUgbPHOAUSWkZxNlclO9k4uBedNqyq5lrO+UZzoX06jm7Fl+78kdi30SZlqo KiFix1s1RfD05KP02DPwIjcTfruqx3tXLAg5Pe51jSffdiP7cnH3CTJ/evvgiElqcsIB oeNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=erLEJFFmN1Si57UTDFO+md6AnHLgrWd6t+5xkKTrdTo=; b=WfSKcFn2W9oY1yKKDEIM9oqMluxu6X8jPg7UUE7aB+NfPGdXO8vK0qMcwsS8a5CYQk eZMjMi10U9eS74L0QJQUPg1ji4WQ3v6cxpcznpQCNZFZQuJoct0e0rYjL1GxqZxflrhf HPCdVG6x4FAwdAMEbZJ62vXgn4Ieog7XaBjUO2NIEtTfvA/kVQIVqroveL0GetcdR6g7 G3oH3J+JFvpstPUAI2Ju5yRPlpKUsA19An0vf2twKNeecdwjrCdXL+hO3EMGxrgHaGRE Q/6Bz1gjfq9QlUal20i85ZjenZQfNzLxWYjn3gozOFVt0M6I0lhCg+Ifwi7uKe07Fb5V 83Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WjAEYcDd; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g130-20020a636b88000000b00553ced07d17si5959719pgc.123.2023.06.22.05.49.42; Thu, 22 Jun 2023 05:49:54 -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=@redhat.com header.s=mimecast20190719 header.b=WjAEYcDd; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230242AbjFVM2T (ORCPT + 99 others); Thu, 22 Jun 2023 08:28:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230400AbjFVM2D (ORCPT ); Thu, 22 Jun 2023 08:28:03 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DBFF199D for ; Thu, 22 Jun 2023 05:27:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687436840; 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=erLEJFFmN1Si57UTDFO+md6AnHLgrWd6t+5xkKTrdTo=; b=WjAEYcDddX2z0wcR9meFjGolps5fzbDl5zzg0qgO/+oPReM/XSSQhZlWlfnHl/OSJsfWec QD1tHe+9KMphF27z/U/HjXmKCmci6lwTLSTwwZrs2H3/eIrnL8QqHjz+ZGaKhWpx4Q7tO3 yzBDJY1bm2LE4CNqsjN18IedeYnvtGs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-21-guJMTKOAPz-lqf1ByoKNRw-1; Thu, 22 Jun 2023 08:27:15 -0400 X-MC-Unique: guJMTKOAPz-lqf1ByoKNRw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3692E83FC20; Thu, 22 Jun 2023 12:27:14 +0000 (UTC) Received: from [10.22.17.29] (unknown [10.22.17.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 663244087C70; Thu, 22 Jun 2023 12:27:13 +0000 (UTC) Message-ID: <921e1b98-af36-1f51-5abe-dea36425b706@redhat.com> Date: Thu, 22 Jun 2023 08:27:13 -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 v3 1/3] x86/idle: Disable IBRS when cpu is offline Content-Language: en-US To: Josh Poimboeuf Cc: Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Pawan Gupta , Jacob Pan , Len Brown , linux-kernel@vger.kernel.org, x86@kernel.org, linux-pm@vger.kernel.org, Robin Jarry , Joe Mario References: <20230622003603.1188364-1-longman@redhat.com> <20230622003603.1188364-2-longman@redhat.com> <20230622054053.uy577qezu5a65buc@treble> From: Waiman Long In-Reply-To: <20230622054053.uy577qezu5a65buc@treble> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On 6/22/23 01:40, Josh Poimboeuf wrote: > On Wed, Jun 21, 2023 at 08:36:01PM -0400, Waiman Long wrote: >> +/* >> + * naitve_play_dead() is essentially a __noreturn function, but it can't >> + * be marked as such as the compiler may complain about it. >> + */ > FWIW, we could in theory do so by marking the smp_ops.play_dead function > pointer as __noreturn, but it would be tricky to teach objtool how to > understand that. I added the comment here because I had taken out the MSR restoration code. We can always replace that later on if there is a better way to do that. > >> void native_play_dead(void) >> { >> + if (cpu_feature_enabled(X86_FEATURE_KERNEL_IBRS)) { >> + this_cpu_write(x86_spec_ctrl_current, 0); >> + native_wrmsrl(MSR_IA32_SPEC_CTRL, 0); >> + } > Can update_spec_ctrl() be used instead? Yes, the code is similar to what has been done in update_spec_ctrl(). Using it, however, will require exporting the function either by putting it into a public header or making it a global function. Cheers, Longman >