[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v3 5/5] x86/mwait-idle: make SPR C1 and C1E be independent


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 18 Aug 2022 15:05:19 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CVrB88mfrrp+goXNrmifXuSnpLqlyJcpZNv/ZM+AtB8=; b=ewzK4xKMaH+p906fWLPVCqwRkZ2fpiRDpEMdBpy3ZUh6Haem7ckNVWHQE3eKSXjpryOp0oBrdoKMulb48aVflDSDNvc9gWRvuyaQRu5dLiTMPOamTxRFtSY0Nldpab+x91JTIUJ30C/vMm22ShK9y0LwHY/XdVmncmqmShRdT+W2wWV6Fyaawv4DCmm3hMeC564eZxcQb0FY388DEY+swJpbGxJa+fUHfmiJKzDFGPaRxnFEiVpVLOYKTQmAQpzyUG4PI6dXPCmmajPi90NGSE8FTPFJzvV6kbhXH7ta8sdlbmcISPocEr0tWZ9EC2X1bZodazTjh+Hn7DfA8PdWuw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h9H9F4F9zoKkTENlCjJ964chkTTVRTkUR1S2pOPBcSuY1fPvKaXteK5eT1D8FWTJe8r8v4DZqQJERokiR5zghNZHHJaFbrpBoWe7c83ln4naFlHTSYrgGphh7AF0GD/gOjWUkb8vXWZCrszWNJJjbpE8NbrqXvKSpdysNBADxQsocJf/AhDfiT6zSGCRrB74DT8cIVwI2AEwXcK2/kQqUhCEd3TZh4FzqUFbOHe9dzm1biaVj5lIAX1+R6WT/BlsFNOr4JRu1meq67ejT1fGVjCX82H7ralZ3VhJTdOu1qm8l6P9LvSyE5iSRAs5vj/fSo2OF9Ps+mqYER8mXCOXJg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 18 Aug 2022 13:09:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

From: Artem Bityutskiy <artem.bityutskiy@xxxxxxxxxxxxxxx>

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.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@xxxxxxxxxxxxxxx>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
1548fac47a11
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
v3: New.

--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -689,16 +689,6 @@ static struct cpuidle_state __read_mostl
        {}
 };
 
-/*
- * 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_DISABLED'.
- */
 static struct cpuidle_state __read_mostly spr_cstates[] = {
        {
                .name = "C1",
@@ -708,7 +698,7 @@ static struct cpuidle_state __read_mostl
        },
        {
                .name = "C1E",
-               .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_DISABLED,
+               .flags = MWAIT2flg(0x01),
                .exit_latency = 2,
                .target_residency = 4,
        },
@@ -1401,17 +1391,6 @@ static void __init spr_idle_state_table_
 {
        uint64_t msr;
 
-       /* Check if user prefers C1E over C1. */
-       if ((preferred_states_mask & BIT(2, U)) &&
-           !(preferred_states_mask & BIT(1, U))) {
-               /* Disable C1 and enable C1E. */
-               spr_cstates[0].flags |= CPUIDLE_FLAG_DISABLED;
-               spr_cstates[1].flags &= ~CPUIDLE_FLAG_DISABLED;
-
-               /* Request enabling C1E using the "C1E promotion" bit. */
-               idle_cpu_spr.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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.