Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3091460rwb; Mon, 15 Aug 2022 17:55:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR5hdGvzWl9KQmm1CCSVJzva8Okv6E2U0yTsL6ZftlN5R2EKg9Jx0tc68TIW5BgVbnserHJG X-Received: by 2002:a50:ed82:0:b0:43d:5334:9d19 with SMTP id h2-20020a50ed82000000b0043d53349d19mr16478375edr.232.1660611208974; Mon, 15 Aug 2022 17:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611208; cv=none; d=google.com; s=arc-20160816; b=TkkkKgQMQP8vriJ38Zu36kxStyeAUn9ZXiEsQ+ZvEY4dC539yElCRW6V/4lTZf6YWV e90+uLj1pw+bzmfodB+JR0JliFzoKRbXr97IEPlVFyFAZ8hxSgvfoPobdWFoZYYdXMei jnyZ5FJy5qC5OsvNosQ5ZJeUxvdqbzif7x782x6qCF1n96i6hZXV9LvbztcI6rgWMO5D r+cR79OmD01sbVJ4TT7srk6PqUB4viO1wHbD2o7C1yzGqIVdqVN8ocdBdAPY07JyiAw9 VEeYbMSsYI2LzB/2yJ0tGPz7q3LHI4bDHhK3YutmuFpFR3LfS4JJQxrCWgvDXBJjIV5D qNjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WHRi0R50FXThd1DQ0Tds36+Cl6IXsK786wEYET9Y+DI=; b=ESwtAm9Gb+hDs8GsFcw+l67SulivskueCtOcnPbhzfBWAfuv/lx1sYUXkGAXFAHyWb SJGYhEWhqrUseeoZ0CSDoPzlf7ET3YVkqZurjs6WI1RXm60Dw3eey22MK32qUZ4FXT96 PKwfxBzaTd7m8gYa6hhlgI+pJZ28xlJwO0NnrD+HorTWcK4NW/eASJusfqXlf2zgG4c1 TDBVV8/azX/JfiSZE3k9cxdCQ7S58ESUZzkuxsXLYmPfRf5QO3CvV3pdpVi4JXqoilsr oKHY/OralcxKfzN4A4g5fKxkkqy2gdib+wAJrEi5lk+EytM4L59+fVWxgnKObIK0vvkd Nmmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Z3tSE//f"; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t20-20020aa7d714000000b0044320ea535fsi8221679edq.405.2022.08.15.17.53.03; Mon, 15 Aug 2022 17:53:28 -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=@linuxfoundation.org header.s=korg header.b="Z3tSE//f"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345779AbiHOXaP (ORCPT + 99 others); Mon, 15 Aug 2022 19:30:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244637AbiHOXYP (ORCPT ); Mon, 15 Aug 2022 19:24:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AD7F876B6; Mon, 15 Aug 2022 13:05:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DDA2B6068D; Mon, 15 Aug 2022 20:05:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D03EAC433D6; Mon, 15 Aug 2022 20:05:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593947; bh=kcuCtULqp2kPi5vMU4qtw7Ki1COObkUW6h4KdKchGMQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z3tSE//f4wVND0u8N9564HmSFHTwpmPtj/AS6191Eb732JJwYk83QBLtKfHQqXFaQ yQQlcK5Nvam3ho9xou4lISKcz7sfvUo72iJoXhD7qq639NCb84ogQBRm12OO0CaD6C DGfLBL4AxPa0SBggoB2Dh59+qCkDcr8fAAiULqnw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Artem Bityutskiy , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.18 1033/1095] intel_idle: make SPR C1 and C1E be independent Date: Mon, 15 Aug 2022 20:07:12 +0200 Message-Id: <20220815180511.794102365@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Artem Bityutskiy [ Upstream commit 1548fac47a114b42063def551eb152a536ed9697 ] This patch partially reverts the changes made by the following commit: da0e58c038e6 intel_idle: add 'preferred_cstates' module argument As that commit describes, on early Sapphire Rapids Xeon platforms the C1 and C1E states were mutually exclusive, so that users could only have either C1 and C6, or C1E and C6. However, Intel firmware engineers managed to remove this limitation and make C1 and C1E to be completely independent, just like on previous Xeon platforms. Therefore, this patch: * Removes commentary describing the old, and now non-existing SPR C1E limitation. * Marks SPR C1E as available by default. * Removes the 'preferred_cstates' parameter handling for SPR. Both C1 and C1E will be available regardless of 'preferred_cstates' value. We expect that all SPR systems are shipping with new firmware, which includes the C1/C1E improvement. Cc: v5.18+ # v5.18+ Signed-off-by: Artem Bityutskiy Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/idle/intel_idle.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index 907700d1e78e..9515a3146dc9 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c @@ -911,16 +911,6 @@ static struct cpuidle_state adl_l_cstates[] __initdata = { .enter = NULL } }; -/* - * On Sapphire Rapids Xeon C1 has to be disabled if C1E is enabled, and vice - * versa. On SPR C1E is enabled only if "C1E promotion" bit is set in - * MSR_IA32_POWER_CTL. But in this case there effectively no C1, because C1 - * requests are promoted to C1E. If the "C1E promotion" bit is cleared, then - * both C1 and C1E requests end up with C1, so there is effectively no C1E. - * - * By default we enable C1 and disable C1E by marking it with - * 'CPUIDLE_FLAG_UNUSABLE'. - */ static struct cpuidle_state spr_cstates[] __initdata = { { .name = "C1", @@ -933,8 +923,7 @@ static struct cpuidle_state spr_cstates[] __initdata = { { .name = "C1E", .desc = "MWAIT 0x01", - .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE | - CPUIDLE_FLAG_UNUSABLE, + .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE, .exit_latency = 2, .target_residency = 4, .enter = &intel_idle, @@ -1756,17 +1745,6 @@ static void __init spr_idle_state_table_update(void) { unsigned long long msr; - /* Check if user prefers C1E over C1. */ - if ((preferred_states_mask & BIT(2)) && - !(preferred_states_mask & BIT(1))) { - /* Disable C1 and enable C1E. */ - spr_cstates[0].flags |= CPUIDLE_FLAG_UNUSABLE; - spr_cstates[1].flags &= ~CPUIDLE_FLAG_UNUSABLE; - - /* Enable C1E using the "C1E promotion" bit. */ - c1e_promotion = C1E_PROMOTION_ENABLE; - } - /* * By default, the C6 state assumes the worst-case scenario of package * C6. However, if PC6 is disabled, we update the numbers to match -- 2.35.1