From patchwork Thu Jan 20 14:02:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12718694 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 4046AC433F5 for ; Thu, 20 Jan 2022 14:03:08 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.259074.446824 (Exim 4.92) (envelope-from ) id 1nAY1d-0006t4-K5; Thu, 20 Jan 2022 14:02:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 259074.446824; Thu, 20 Jan 2022 14:02:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nAY1d-0006sv-Gx; Thu, 20 Jan 2022 14:02:53 +0000 Received: by outflank-mailman (input) for mailman id 259074; Thu, 20 Jan 2022 14:02:52 +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 1nAY1c-0006sb-Sn for xen-devel@lists.xenproject.org; Thu, 20 Jan 2022 14:02:52 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a83948a9-79f9-11ec-bc18-3156f6d857e4; Thu, 20 Jan 2022 15:02:51 +0100 (CET) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02lp2059.outbound.protection.outlook.com [104.47.5.59]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-8-qm3J6sdGM0y_EV224iY3CQ-1; Thu, 20 Jan 2022 15:02:50 +0100 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by DBBPR04MB7643.eurprd04.prod.outlook.com (2603:10a6:10:203::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Thu, 20 Jan 2022 14:02:48 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::5951:a489:1cf0:19fe]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::5951:a489:1cf0:19fe%6]) with mapi id 15.20.4909.010; Thu, 20 Jan 2022 14:02:48 +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: a83948a9-79f9-11ec-bc18-3156f6d857e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1642687371; 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=nv7AY2ipZylSfprvqAq1EN3qHGjDUPWKZzBPAIOB3I8=; b=V2bI0FlLwCY8HPOxR6x2KmqO5j46BPnOfBNQiFE7xffU9h0GBg1ei9AgIRv6lGrF+8fldH lnEcyMPwHqolyFmsEs7XRJN1cl5RacmU6+iG0lqnsXglV2HReZQGTTWVubgM80O2L9dqVQ /w4LWvmX8wTeHL+QAONK7xmuUA1z140= X-MC-Unique: qm3J6sdGM0y_EV224iY3CQ-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mkysnr5Js6PCWKd2z2YvxKt4eRn3J3fOpIBERZUhJE+71+yUD0hirGfR/qFF+j62VBspFJwtMukXm+d+Anfa45YB9/Xu/LdM+MAAt8n9QZya8Uk3Mj2pWwbksVM7R+75davFmxgqO75j8TT2SRqaXkBLDeHmuHv9/rOEcjuRDN1laPvnhCe3eqrxtFZRQ+fVvstysslPfOwc4ZodzM3E5/KEhBMFJurgmbKh0QnVwN0CwwLYNiG8V/gO/MBntysw8SBkvgLNqHRciaWg7E6DgRS73y+j0hpckxCG198ubRXY+CbPRk4PGZyQXz0s9dUbwo/Ui6InM7rQGnv3/fkixw== 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=f4Wc9t+1vhwqA/dFF3ORfoGoLxLZ4aHX6+/gI+XOdLE=; b=E3YyI2S2SaxUtK67tX7kroeS1FSbFb4g9e1hsWOeC/uK3vFFoQluyB0Dl6/mZdWwgVjZgSyngQlfW6iaMdtfNzk89VtnShBuCWIyzElJE09wquMICsUWc4Zc439Xr6GZX4JPwOT/nEfabg+M8VJ6kzXbcPqZnQLg7ErQgY2ahdmGAI9bva+gZTemV44QcqPWZ3MhDNJER597Sxic+WC8hVHSMy+jFrm6Q6YNIR4fDq++fBBhthZGSn7iFi2HxfCoebDXhbHIgLDYpS97Yn+BRKXyzUEA2c7EwtOs+DFkDytPQqZrfuYzKUbksFoqNj5XVvDgUScCsbEb2Xhny0t2+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: Date: Thu, 20 Jan 2022 15:02:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: [PATCH v2 3/5] x86/mwait-idle: add SnowRidge C-state table Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" CC: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= References: <568cb6dc-127a-9c8f-0073-2df173d4677b@suse.com> In-Reply-To: <568cb6dc-127a-9c8f-0073-2df173d4677b@suse.com> X-ClientProxiedBy: AM5PR1001CA0036.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:2::49) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ebb1a70-b48f-44e1-b91b-08d9dc1d8a7d X-MS-TrafficTypeDiagnostic: DBBPR04MB7643:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qa1meuUfO3vodwYUKCoUKSsjF2JkOGIFbdkrR9VjOEu+gH9PEwNDJvJqdK0ZqvGB5u+LpdtlMGdvOvFMSBUqKKrd3kdZb/lqeAWDtfqQNlEvA3l6tFtZIa0BnSx4pFG6jcvCb+SRZgA0KvTp/ZwmaEnPkCjH7idPq0v5AmdoFPUZ92nt2KfPlwha3xEICsWcRphUygeFPBYGzaIESk2q6aNrqaU/+uqJ4/Vxm51B95UFACjFVzSlTAw/mMCFH3540qGcl/eLVyx3e/3824uboGkD5KjtuNDulf7W2oikuVgJyzQxeayGP5JiNmdHlfzxIM5Y49VqBf2NDhqqlcc4n35Hqw4MqzWz9HCHCTA0D35v2ONUXSArsr9MI80yjAskAKLekdglw8Eq1R+gosLikoFDKdGs8alDbqNXVEip8cbRr/cMS9h0gW99APRbriz1yaXnMLu3vbarScDmoIIrLnm3BPgFQ7Q0su10qDZwUt+vGPhIKRI2lUzrd5+f+bg8whyeAr7Z9lblzuFVTwGRPbJ83iQ32NRw5D9IfzbZFX35+4kobiBUkOS97rpwjZa9eqW5ReuJWE2Bzt0hZiYSI4cgLAVVVPn3YgchV+Y88W/WKXfCEYXPvIhKT75vKIZnx+YcKOewJYBa3MvAlTmIrj89/UrAikJvRON1nE9fD16s9m5yFBlJh2pnzl0j3TGnKy+SXm4J/bmckdXyVYl1pS9iq05h/ySURlBXDGmkM/B5hvvT/jBftesG5ITV3TK1 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(6506007)(31686004)(36756003)(66476007)(508600001)(8676002)(31696002)(8936002)(38100700002)(6486002)(86362001)(186003)(2616005)(6916009)(66556008)(66946007)(316002)(2906002)(5660300002)(26005)(6512007)(54906003)(4326008)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1hDG/Lid7PYDtZYTC7FwSN7AVmLqyURoV6IOxPxTRku7Ph5OtHL8PEt6XzUad/D1OAgIlWrM9/IveTOT3GNtej+cKWPQTay+ZERt/8EEfgE5pmIA0eIHZIrRhoE+VaHavxkctgn7h+KEz75Wnf/sWKCfhHDd0SaZsq7MwDDoYSg9A5myBKsncC428HOhsLkCkqndiFWLEpOZy6mrfhqqGO+na6fUtH+7KEzZkZAt1U+oQOw+lb0v7NjmfjGBlBZ9KssBMGF7nqZ1VhUsME1yCnQnD4vWYOJaWRwO/1cJoUp7LU9yPtxWC6AJgRFdZrsOUtPsWZmkZR+1J8LtE+9G4rhfX6+ELHkyO7u1XUcmM5yPee8qZboGVZ7wIdpSt5LP4WZE2FJ1+QNpCmWHwszhcjKeIYCY6eLtaX+ImMmtxzD6OYCWT252aHDSp/ra6Iygaa8443IMDH/TAsg8iE2gxW3zLMGMyL+5rT4WX5K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oDb2dWjOr1ewkFO0p8L2EocqbAeGSvZBJiiyoGAunTs2ZCtR3oLFrZVrAKWW0XEI= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ebb1a70-b48f-44e1-b91b-08d9dc1d8a7d X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2022 14:02:48.6612 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1JRZhf2yy62qZ+I9XzKXK3vZP1RDS8fQJpBMoGKRXBt0kuMLU2humFQlS02l5fPq1tjR/KMSBgk/vkw2sTIk0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7643 From: Artem Bityutskiy Add C-state table for the SnowRidge SoC which is found on Intel Jacobsville platforms. The following has been changed. 1. C1E latency changed from 10us to 15us. It was measured using the open source "wult" tool (the "nic" method, 15us is the 99.99th percentile). 2. C1E power break even changed from 20us to 25us, which may result in less C1E residency in some workloads. 3. C6 latency changed from 50us to 130us. Measured the same way as C1E. The C6 C-state is supported only by some SnowRidge revisions, so add a C-state table commentary about this. On SnowRidge, C6 support is enumerated via the usual mechanism: "mwait" leaf of the "cpuid" instruction. The 'intel_idle' driver does check this leaf, so even though C6 is present in the table, the driver will only use it if the CPU does support it. Signed-off-by: Artem Bityutskiy Signed-off-by: Rafael J. Wysocki [Linux commit: 9cf93f056f783f986c19f40d5304d1bcffa0fc0d] Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné --- a/xen/arch/x86/cpu/mwait-idle.c +++ b/xen/arch/x86/cpu/mwait-idle.c @@ -742,6 +742,32 @@ static const struct cpuidle_state dnv_cs {} }; +/* + * Note, depending on HW and FW revision, SnowRidge SoC may or may not support + * C6, and this is indicated in the CPUID mwait leaf. + */ +static const struct cpuidle_state snr_cstates[] = { + { + .name = "C1", + .flags = MWAIT2flg(0x00), + .exit_latency = 2, + .target_residency = 2, + }, + { + .name = "C1E", + .flags = MWAIT2flg(0x01), + .exit_latency = 15, + .target_residency = 25, + }, + { + .name = "C6", + .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, + .exit_latency = 130, + .target_residency = 500, + }, + {} +}; + static void mwait_idle(void) { unsigned int cpu = smp_processor_id(); @@ -954,6 +980,11 @@ static const struct idle_cpu idle_cpu_dn .disable_promotion_to_c1e = true, }; +static const struct idle_cpu idle_cpu_snr = { + .state_table = snr_cstates, + .disable_promotion_to_c1e = true, +}; + #define ICPU(model, cpu) \ { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ALWAYS, &idle_cpu_##cpu} @@ -996,7 +1027,7 @@ static const struct x86_cpu_id intel_idl ICPU(0x5c, bxt), ICPU(0x7a, bxt), ICPU(0x5f, dnv), - ICPU(0x86, dnv), + ICPU(0x86, snr), {} };