From patchwork Thu Jan 20 14:01:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12718692 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 C20FEC433F5 for ; Thu, 20 Jan 2022 14:02:07 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.259069.446802 (Exim 4.92) (envelope-from ) id 1nAY0f-0005iC-SM; Thu, 20 Jan 2022 14:01:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 259069.446802; Thu, 20 Jan 2022 14:01: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 1nAY0f-0005i5-PH; Thu, 20 Jan 2022 14:01:53 +0000 Received: by outflank-mailman (input) for mailman id 259069; Thu, 20 Jan 2022 14:01:52 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nAY0e-0005h6-2w for xen-devel@lists.xenproject.org; Thu, 20 Jan 2022 14:01:52 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 83ab6f8f-79f9-11ec-8fa7-f31e035a9116; Thu, 20 Jan 2022 15:01:50 +0100 (CET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2105.outbound.protection.outlook.com [104.47.17.105]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-13-SYN7Nkm2PJWCzfBHQO-EaA-1; Thu, 20 Jan 2022 15:01:49 +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:01:47 +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:01:47 +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: 83ab6f8f-79f9-11ec-8fa7-f31e035a9116 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1642687310; 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=m0YsKdV6uZ18YqS08UEoyfFYI3+Qi3Lvp81hkT8LibU=; b=WFhDGRAMcvfJ/k9c+fCHm06a9jgHgeHoM1b2eRTz4Pc49S9f0DXkj7sgnAL1jxOA+gpy8I 6j3Km/XbSda98HnSF05ZL76Disd26nqEFAcfzSLAOdPILuK5ZdvdJuavXL+vuciokAaPpn q4Tyn23HDLkUDX1oX1s2hHiS1ayXwB0= X-MC-Unique: SYN7Nkm2PJWCzfBHQO-EaA-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kJkIRTDdr9yTKKlRy4+aMI71fgNTuGzMQoypgdp+uaC8+BzWJldx15BwnoX1S3wnU16X0h+a8fbNWHWDjIU3hoDbTGQ2p3HUUddZTE9SMNGXQ4N4fELshJuVudV3e7JaaxoIkKTfh3QOtvQIQX/2L41uTHmD6fT5lGeyn96N54k9WxrqXRdxzoj2tgK2TzorwzHUVGz9fL7Wt81hhY8SFr2L/eXssjPomEsC/Q4uXo6nWStqxi/fC2Ql7UOvPHH+TebuMNNs728NF542ftJqXWhMJWzwGod1KsgPfxJAdH1RQDjb9dkwAxWPtEyFUIC1X+dYE/kpS0m+FQzfh/3d8Q== 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=PBVJF/blL7ivJrHo/Fn27+e07AgCpQ/eYBa2em1lgw8=; b=OuLJECBNq5s1nKFUzJuNvntvOFyltXQsJhfWQJtwSfYvYf+o87PtC2RF6yY5E4YGUTpvOR7NoGG/eT12MksJbnJMWmkiaHV6afAtK2xS73D+lBGB+eepZH39POTDPEfRa6bv8AUBdfDWcw1dIfyQoVh1gaQRwMeloFN0atmqKk4AWYkIh7+rjQy6wZkXLGh2BPC8gsPJ+Dqnn1mBjrqHHR0/JLK7bhwpBRBOUFbBYohZWSjXY+a5P0d++w6wug980AmAGFKErlwlFGluDiWhuwfRfQFUHClA/WbIUtaDYgI1yO2s9DUqaFFnCxTSJyBblOTrxvHvOiQ7dYIlJ8C4kw== 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: <39f83895-e01a-bfd8-708b-eedbb145d5fb@suse.com> Date: Thu, 20 Jan 2022 15:01:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: [PATCH v2 1/5] x86/mwait-idle: stop exposing platform acronyms 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: AS8P189CA0021.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:31f::25) 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: bd3d7a9b-d959-426c-e598-08d9dc1d65d8 X-MS-TrafficTypeDiagnostic: DBBPR04MB7643:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:529; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EMnrL4LdkpRLnz7pxv/BOLzv95JsWGAQA2tfWERhhwW7k/32hA9Wkrmm8GKFN4RLRgh/STisCDNWXxhkpi3P7SZTR7YoC0tsz7RKsYoPEz4fiG8JXCzHEyC3whT3QY7RtxiGVAKJq8A/JwA2TlJV0Rt0Uu3WwtdzCQdrm/5B6cDzKgLks3LH9EM1zAgJy4xZU2bjLom2XrVq3nabLQ6sEP9cKCXsE4WHa2ZpgAAhsy2heOcoDuwaSI4l3IHim0DsqGx6KcgkkOiBpRuCfL6asAXNQ3HoGPmnRz/cz/yrtBg0ABdzLJr/rliV8Y2q1Fuj1dmDakUzTjfE1P69UNpCraB3P3KbWdENJjhbXh4nVTeTTMzGlnPw+ZbOw/L//rlxA9ppj27lIuVL9hHhyosw71OKNJmXELtIEqflYRSGy6f8FpiCRT+YYVZZBTVl06drE8u3hSbmkJNbYc8SRSQGIIW9O6/YhvaI7TBEuVXdCRU6NSvT5IlgzEtd8gg9UAk9PmPS7MwQCuKBRtcNUTLvpN2eeg61q6ru1WX+VhFgQB/tBqDa5mzHbIT2nlofzJ36awgQcHLXct138Vatwcnz9xOlBDiRjJNZ1VbE1I1rsJsV6jy0PTSlGiB2uQkujhyaOU56oD3402DKeOJpZyceCPDMYT7bNbhWY4/u/3PrxBgaO5KqrlpEH9Oh3eKMQL6HjnKfz0g5itOh3Jaj2+QyHrGDoWC5mafp0LEb4T+YhX0= 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)(30864003)(66476007)(508600001)(8676002)(31696002)(8936002)(38100700002)(6486002)(86362001)(186003)(2616005)(83380400001)(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: l0+1Nf18YJRU2ATFHY/NPiYGcUmLYFlsLwK7g9f24wUF9xJWSX6iyanuqtneU7ljTS7cM7uo72noHg1CQwMSS0WCNvXVC/D5K+jUj7Y8ds8Dgdh4aHclR8dJka24AWokO6ttIxpC64Ye41/+/vJ3atLXVZCkRVxbtyN/gAPQmecWwAETZPXl7RhOM7zRTGMyg2SPQeuTPGZ5zqCBwOPx3GRvP7pwK0MriUwW5/W3KUEwYuJWG2yxiylMuraaq6kAA4qHGI9BSNF3+bpK0urUeZmN8SAOpdEbfWhham0Wk7MLJ5vxl79GPFISRbLqLWkcS2RmI3dfx8oUwSnJUsuRAimsKXlskieluAfCmBQv9OwgZ/ZfYpmzWYU3D08Hy4xd0DvqnIoUzTvmX5pLHqZUIskfF1morp6kVe1FENOckHrPTcOEGw/OZPFpyZF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2TcS3AkNBX8e9uAP1gBjLE0ojlsHFslzwzVdAIss0vNtfY+X35Kwx9AsxIk01oR8Fl+1s6vkaC6RBT4Txnj1DUQxuKZdDJkcIVd6ysln7Hk0my9Y= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd3d7a9b-d959-426c-e598-08d9dc1d65d8 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:01:47.1990 (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: sFe1zjVDv13gpXjix8+osDLCj9Jgin8nhoIw+ROZFxOXTQ97A3rXx2GlEYFjcCDs3B5TJsUcJaXvrAHV7ZrGFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7643 This follows Linux commit de09cdd09fa1 ("intel_idle: stop exposing platform acronyms in sysfs"), but their main justifications (sysfs exposure and similarity with acpi-idle) don't apply to us. The field is only used in a single printk() right now, but having the platform tags there isn't useful either. Requested-by: Roger Pau Monné Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné --- v2: New. --- a/xen/arch/x86/cpu/mwait-idle.c +++ b/xen/arch/x86/cpu/mwait-idle.c @@ -134,25 +134,25 @@ static const struct cpuidle_state { */ static const struct cpuidle_state nehalem_cstates[] = { { - .name = "C1-NHM", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 3, .target_residency = 6, }, { - .name = "C1E-NHM", + .name = "C1E", .flags = MWAIT2flg(0x01), .exit_latency = 10, .target_residency = 20, }, { - .name = "C3-NHM", + .name = "C3", .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 20, .target_residency = 80, }, { - .name = "C6-NHM", + .name = "C6", .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 200, .target_residency = 800, @@ -162,31 +162,31 @@ static const struct cpuidle_state nehale static const struct cpuidle_state snb_cstates[] = { { - .name = "C1-SNB", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 2, .target_residency = 2, }, { - .name = "C1E-SNB", + .name = "C1E", .flags = MWAIT2flg(0x01), .exit_latency = 10, .target_residency = 20, }, { - .name = "C3-SNB", + .name = "C3", .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 80, .target_residency = 211, }, { - .name = "C6-SNB", + .name = "C6", .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 104, .target_residency = 345, }, { - .name = "C7-SNB", + .name = "C7", .flags = MWAIT2flg(0x30) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 109, .target_residency = 345, @@ -196,31 +196,31 @@ static const struct cpuidle_state snb_cs static const struct cpuidle_state byt_cstates[] = { { - .name = "C1-BYT", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 1, .target_residency = 1, }, { - .name = "C6N-BYT", + .name = "C6N", .flags = MWAIT2flg(0x58) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 300, .target_residency = 275, }, { - .name = "C6S-BYT", + .name = "C6S", .flags = MWAIT2flg(0x52) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 500, .target_residency = 560, }, { - .name = "C7-BYT", + .name = "C7", .flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 1200, .target_residency = 4000, }, { - .name = "C7S-BYT", + .name = "C7S", .flags = MWAIT2flg(0x64) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 10000, .target_residency = 20000, @@ -230,31 +230,31 @@ static const struct cpuidle_state byt_cs static const struct cpuidle_state cht_cstates[] = { { - .name = "C1-CHT", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 1, .target_residency = 1, }, { - .name = "C6N-CHT", + .name = "C6N", .flags = MWAIT2flg(0x58) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 80, .target_residency = 275, }, { - .name = "C6S-CHT", + .name = "C6S", .flags = MWAIT2flg(0x52) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 200, .target_residency = 560, }, { - .name = "C7-CHT", + .name = "C7", .flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 1200, .target_residency = 4000, }, { - .name = "C7S-CHT", + .name = "C7S", .flags = MWAIT2flg(0x64) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 10000, .target_residency = 20000, @@ -264,31 +264,31 @@ static const struct cpuidle_state cht_cs static const struct cpuidle_state ivb_cstates[] = { { - .name = "C1-IVB", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 1, .target_residency = 1, }, { - .name = "C1E-IVB", + .name = "C1E", .flags = MWAIT2flg(0x01), .exit_latency = 10, .target_residency = 20, }, { - .name = "C3-IVB", + .name = "C3", .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 59, .target_residency = 156, }, { - .name = "C6-IVB", + .name = "C6", .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 80, .target_residency = 300, }, { - .name = "C7-IVB", + .name = "C7", .flags = MWAIT2flg(0x30) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 87, .target_residency = 300, @@ -298,25 +298,25 @@ static const struct cpuidle_state ivb_cs static const struct cpuidle_state ivt_cstates[] = { { - .name = "C1-IVT", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 1, .target_residency = 1, }, { - .name = "C1E-IVT", + .name = "C1E", .flags = MWAIT2flg(0x01), .exit_latency = 10, .target_residency = 80, }, { - .name = "C3-IVT", + .name = "C3", .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 59, .target_residency = 156, }, { - .name = "C6-IVT", + .name = "C6", .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 82, .target_residency = 300, @@ -326,25 +326,25 @@ static const struct cpuidle_state ivt_cs static const struct cpuidle_state ivt_cstates_4s[] = { { - .name = "C1-IVT-4S", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 1, .target_residency = 1, }, { - .name = "C1E-IVT-4S", + .name = "C1E", .flags = MWAIT2flg(0x01), .exit_latency = 10, .target_residency = 250, }, { - .name = "C3-IVT-4S", + .name = "C3", .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 59, .target_residency = 300, }, { - .name = "C6-IVT-4S", + .name = "C6", .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 84, .target_residency = 400, @@ -354,25 +354,25 @@ static const struct cpuidle_state ivt_cs static const struct cpuidle_state ivt_cstates_8s[] = { { - .name = "C1-IVT-8S", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 1, .target_residency = 1, }, { - .name = "C1E-IVT-8S", + .name = "C1E", .flags = MWAIT2flg(0x01), .exit_latency = 10, .target_residency = 500, }, { - .name = "C3-IVT-8S", + .name = "C3", .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 59, .target_residency = 600, }, { - .name = "C6-IVT-8S", + .name = "C6", .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 88, .target_residency = 700, @@ -382,49 +382,49 @@ static const struct cpuidle_state ivt_cs static const struct cpuidle_state hsw_cstates[] = { { - .name = "C1-HSW", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 2, .target_residency = 2, }, { - .name = "C1E-HSW", + .name = "C1E", .flags = MWAIT2flg(0x01), .exit_latency = 10, .target_residency = 20, }, { - .name = "C3-HSW", + .name = "C3", .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 33, .target_residency = 100, }, { - .name = "C6-HSW", + .name = "C6", .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 133, .target_residency = 400, }, { - .name = "C7s-HSW", + .name = "C7s", .flags = MWAIT2flg(0x32) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 166, .target_residency = 500, }, { - .name = "C8-HSW", + .name = "C8", .flags = MWAIT2flg(0x40) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 300, .target_residency = 900, }, { - .name = "C9-HSW", + .name = "C9", .flags = MWAIT2flg(0x50) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 600, .target_residency = 1800, }, { - .name = "C10-HSW", + .name = "C10", .flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 2600, .target_residency = 7700, @@ -434,49 +434,49 @@ static const struct cpuidle_state hsw_cs static const struct cpuidle_state bdw_cstates[] = { { - .name = "C1-BDW", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 2, .target_residency = 2, }, { - .name = "C1E-BDW", + .name = "C1E", .flags = MWAIT2flg(0x01), .exit_latency = 10, .target_residency = 20, }, { - .name = "C3-BDW", + .name = "C3", .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 40, .target_residency = 100, }, { - .name = "C6-BDW", + .name = "C6", .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 133, .target_residency = 400, }, { - .name = "C7s-BDW", + .name = "C7s", .flags = MWAIT2flg(0x32) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 166, .target_residency = 500, }, { - .name = "C8-BDW", + .name = "C8", .flags = MWAIT2flg(0x40) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 300, .target_residency = 900, }, { - .name = "C9-BDW", + .name = "C9", .flags = MWAIT2flg(0x50) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 600, .target_residency = 1800, }, { - .name = "C10-BDW", + .name = "C10", .flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 2600, .target_residency = 7700, @@ -486,49 +486,49 @@ static const struct cpuidle_state bdw_cs static struct cpuidle_state __read_mostly skl_cstates[] = { { - .name = "C1-SKL", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 2, .target_residency = 2, }, { - .name = "C1E-SKL", + .name = "C1E", .flags = MWAIT2flg(0x01), .exit_latency = 10, .target_residency = 20, }, { - .name = "C3-SKL", + .name = "C3", .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 70, .target_residency = 100, }, { - .name = "C6-SKL", + .name = "C6", .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 85, .target_residency = 200, }, { - .name = "C7s-SKL", + .name = "C7s", .flags = MWAIT2flg(0x33) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 124, .target_residency = 800, }, { - .name = "C8-SKL", + .name = "C8", .flags = MWAIT2flg(0x40) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 200, .target_residency = 800, }, { - .name = "C9-SKL", + .name = "C9", .flags = MWAIT2flg(0x50) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 480, .target_residency = 5000, }, { - .name = "C10-SKL", + .name = "C10", .flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 890, .target_residency = 5000, @@ -538,19 +538,19 @@ static struct cpuidle_state __read_mostl static struct cpuidle_state __read_mostly skx_cstates[] = { { - .name = "C1-SKX", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 2, .target_residency = 2, }, { - .name = "C1E-SKX", + .name = "C1E", .flags = MWAIT2flg(0x01), .exit_latency = 10, .target_residency = 20, }, { - .name = "C6-SKX", + .name = "C6", .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 133, .target_residency = 600, @@ -560,19 +560,19 @@ static struct cpuidle_state __read_mostl static const struct cpuidle_state icx_cstates[] = { { - .name = "C1-ICX", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 1, .target_residency = 1, }, { - .name = "C1E-ICX", + .name = "C1E", .flags = MWAIT2flg(0x01), .exit_latency = 4, .target_residency = 4, }, { - .name = "C6-ICX", + .name = "C6", .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 170, .target_residency = 600, @@ -582,25 +582,25 @@ static const struct cpuidle_state icx_cs static const struct cpuidle_state atom_cstates[] = { { - .name = "C1E-ATM", + .name = "C1E", .flags = MWAIT2flg(0x00), .exit_latency = 10, .target_residency = 20, }, { - .name = "C2-ATM", + .name = "C2", .flags = MWAIT2flg(0x10), .exit_latency = 20, .target_residency = 80, }, { - .name = "C4-ATM", + .name = "C4", .flags = MWAIT2flg(0x30) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 100, .target_residency = 400, }, { - .name = "C6-ATM", + .name = "C6", .flags = MWAIT2flg(0x52) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 140, .target_residency = 560, @@ -610,31 +610,31 @@ static const struct cpuidle_state atom_c static const struct cpuidle_state tangier_cstates[] = { { - .name = "C1-TNG", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 1, .target_residency = 4, }, { - .name = "C4-TNG", + .name = "C4", .flags = MWAIT2flg(0x30) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 100, .target_residency = 400, }, { - .name = "C6-TNG", + .name = "C6", .flags = MWAIT2flg(0x52) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 140, .target_residency = 560, }, { - .name = "C7-TNG", + .name = "C7", .flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 1200, .target_residency = 4000, }, { - .name = "C9-TNG", + .name = "C9", .flags = MWAIT2flg(0x64) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 10000, .target_residency = 20000, @@ -644,13 +644,13 @@ static const struct cpuidle_state tangie static const struct cpuidle_state avn_cstates[] = { { - .name = "C1-AVN", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 2, .target_residency = 2, }, { - .name = "C6-AVN", + .name = "C6", .flags = MWAIT2flg(0x51) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 15, .target_residency = 45, @@ -660,13 +660,13 @@ static const struct cpuidle_state avn_cs static const struct cpuidle_state knl_cstates[] = { { - .name = "C1-KNL", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 1, .target_residency = 2, }, { - .name = "C6-KNL", + .name = "C6", .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 120, .target_residency = 500, @@ -676,43 +676,43 @@ static const struct cpuidle_state knl_cs static struct cpuidle_state __read_mostly bxt_cstates[] = { { - .name = "C1-BXT", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 2, .target_residency = 2, }, { - .name = "C1E-BXT", + .name = "C1E", .flags = MWAIT2flg(0x01), .exit_latency = 10, .target_residency = 20, }, { - .name = "C6-BXT", + .name = "C6", .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 133, .target_residency = 133, }, { - .name = "C7s-BXT", + .name = "C7s", .flags = MWAIT2flg(0x31) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 155, .target_residency = 155, }, { - .name = "C8-BXT", + .name = "C8", .flags = MWAIT2flg(0x40) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 1000, .target_residency = 1000, }, { - .name = "C9-BXT", + .name = "C9", .flags = MWAIT2flg(0x50) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 2000, .target_residency = 2000, }, { - .name = "C10-BXT", + .name = "C10", .flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 10000, .target_residency = 10000, @@ -722,19 +722,19 @@ static struct cpuidle_state __read_mostl static const struct cpuidle_state dnv_cstates[] = { { - .name = "C1-DNV", + .name = "C1", .flags = MWAIT2flg(0x00), .exit_latency = 2, .target_residency = 2, }, { - .name = "C1E-DNV", + .name = "C1E", .flags = MWAIT2flg(0x01), .exit_latency = 10, .target_residency = 20, }, { - .name = "C6-DNV", + .name = "C6", .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, .exit_latency = 50, .target_residency = 500, From patchwork Thu Jan 20 14:02:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12718693 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 13FEEC433F5 for ; Thu, 20 Jan 2022 14:02:32 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.259071.446813 (Exim 4.92) (envelope-from ) id 1nAY17-0006BF-6M; Thu, 20 Jan 2022 14:02:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 259071.446813; Thu, 20 Jan 2022 14:02:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nAY17-0006B8-2z; Thu, 20 Jan 2022 14:02:21 +0000 Received: by outflank-mailman (input) for mailman id 259071; Thu, 20 Jan 2022 14:02:20 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nAY15-0005h6-SX for xen-devel@lists.xenproject.org; Thu, 20 Jan 2022 14:02:20 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 94a19109-79f9-11ec-8fa7-f31e035a9116; Thu, 20 Jan 2022 15:02:19 +0100 (CET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2107.outbound.protection.outlook.com [104.47.17.107]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-33-6OTQ2TJyMLO0E_q5aSKY6A-1; Thu, 20 Jan 2022 15:02:17 +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:16 +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:16 +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: 94a19109-79f9-11ec-8fa7-f31e035a9116 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1642687338; 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=ERHBkt0ZLZoh+unVkYGz4LgaW/QtEiIYQdXID6w202Y=; b=bBg3DlgSPxV21OpqcUekAdxCbE0Bo/nJcDHeoDW9BaYS+jYcgjVsCaFvK2XPpnjgysuRS5 NeOMeCDI8C5LwpYy36DPoxy3itDH0rCk8FD88i+11uBXNtO8UCcMeDVPevWTIxToqoy5lL WinD2m94CTtnMF4bUR30S9RFbbuhTfo= X-MC-Unique: 6OTQ2TJyMLO0E_q5aSKY6A-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RhqqiMfKMvP5JEbddtHnMpKpi7u7yULYVdr6pRptnTLqsPpQ9tmU2cOVs6uFOrk4vKOSQ2uOw40kPgB2sASGmXc846UPbAjB4mMCWIzJqPQ4+hjD6mCfH1o3l5QiSH92Ht8VEalPkjEhxHxOFihH5MI1FwGmaYHlGpCSs87dwbMWT+kIU6NilB4cekY9T2FdxKnI21SEfwz46aJvYJYLQMUPlCdWvdh50MzYfbRhDvCm5tBDqIMRWu9QjwdDugvwImDNm907MgevkBX9Rq1gDkUJ3xL9lb5SI8ESkXD+DP4bXHJ9fwawNnW1+Ayg0ppsOO4jSkp/2/LjGcR8JS7yig== 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=sIqEnurXfCEWFhZMdoHlOkaoI1CmFSGgajePTq0Qfsw=; b=ilrUll0zzybhPXH8f+FlgeD81ONCub+J1hKyjUfmlzPkJjKdwY4/zZZbKVKmFera2/0ntsmFlui2MEKYFbG9OeFRvS/ii/pGKdzNig3m9zgmzozDHVtBf5TazkTEo2b1PHOpjYqPhflU8zWpGh6K+LmshWiX89Y7z7yBJroRaRJiGHFzwVy/g24o89L5rWmigBUUaKyj0RJrWfp0qINdpZXK8XKulNQysGXyB6RrE5ghQdylguD2ccT8yDDsJs9c7eD/JIg4U6c98d8qEO1GquaYRXJbwNLwdcMohJeDhxq9QNPW6yPDtq7gv4ILBr36RC/ZNBPAVLWbJ9gE9uqfbw== 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: <79cc9a46-15b1-b2ce-e462-7c46848a86fe@suse.com> Date: Thu, 20 Jan 2022 15:02:14 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: [PATCH v2 2/5] x86/mwait-idle: switch to using bool 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: AS8P189CA0028.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:31f::13) 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: 04258d86-03f2-4e27-830b-08d9dc1d7754 X-MS-TrafficTypeDiagnostic: DBBPR04MB7643:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2512; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5AeZi0jbvQXMoy3WYdM3Q24Xmp50vxqiIwZjVTRmxABz0a8bC56CkpP3c+AOP8mI3cvRX396K8VkAGHomEE4SqWPWViAXS49DVUhH7A4SKVjUntM3L+dIwoZbAUIAfeQFYnPhJa/e40tIWadvTp9ldFdnJUkfhyM6NZ4byawc6HgjPEH/4ckNbRCcNzKtTjGOCeodKU7Rh7KQldqYViyX+Y+rpw5iPwzF4lUdlzsjEgeoMAiaPyhIyRPSn53DruLOn/FANW4hvlQ1VdQXq1J6eP69sbocljTJ4PQ4FcvH7onQSCxVg6F+UyWIdAwavbK5lPXN8St2hVZef54Dy+im9FpXmc1/lzS8Xmu8wssQ2iS+Zlkddkddcky32FMn1QcPagPzIXnO88f6kYEkNqO662i1Vlx5ja0yTNZ4y0cK55vmB2u7otkIMzklPtrTMgiR64bAsVgA9pnJPWiNq9S7QRRkvsUdq2O/gXCWCd4KKPNPGb1CwiESNT2pVv5XVhyYtfrgyMz4dafNzAAxhDvTPi6pI5xlyNGuG8smA5jnRZQD2hH/S3gMAm5nR2YF2Y8S6KnikbpoEgGuU1/vCD+eY8Fy2iR8UiEo2Aa5LqIwIoHQsBRuHc0r+b6sYRUym302oRpSfn7p76vH1zrPZMXnAP1kFL/SpRVld0zAIjMv+1ZK9wfvcGoWuesE2FUrbTLpNHSkOXwm/ar71QFZD3KjS+2F5ng6mYSLqRxHbxx2s2mmOYZj49UkfrJH+9Nu/T8 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)(83380400001)(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: 6CkeJo2G72z/dybhkKi2xfPW8ozbariL4IYNDUrAtQzKuzJdZfygPbjKDGAcHmVvKxlxhMSt+j5BhQGTmkX4r57c8072nJey4hxzdmNFznFW0f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2myOFcmhPClqAvHjJG8PSW5EqXmpr2jdiwFMh64wQTmCtf+ijnguJ/dG8K0QoaEWqHoNsmBy2GhNr0+MOpi/u9x6Mb70iTIL0yUffCTKalE9hHlXgHVqYKRdj5joXrFEBM1aWmKyFV3IQbCE2SopEpEDIiXWJPbWag+HL3fsFEqRHCBvmLVLOycEMHfzdEwvUa4Uq1wKO50sO0o32KoVlQPcJ/rPf56TbiO/sBFMBL8+TLrp3oq5tGv52BIZ62nowVyq4iowj0L2d/75Nz6CEJrNcLze3J+pt/ecpDDMqxlai0FU1nMl9BtO4k2hIcwBEslGPR6yS57kBhjcZ+JKjuJ7cAGy4R8sE6q4trQPJXMJhC+cMbB+BZIt/jXpZoGMETKf38f1+X1raAgOakHaSyC2z17X6WHH6uf/a6vltkiCQA7+owYDckv0K9X4R6npPthLK5RuHIXs= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 04258d86-03f2-4e27-830b-08d9dc1d7754 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:16.5304 (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: sVJMlcdzOTwjlBuzGRK0kuM3jDVzhArcNAlftzrcDgHVTGmDj6rD6MUzhbDq2nJVIEtmTxGTTYIg79zzhNW+9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7643 When the driver was first ported, we didn't have "bool" yet, so conversion to bool_t / 0 / 1 was necessary. Undo that conversion, easing ports of newer changes as well as tidying things up. Requested-by: Roger Pau Monné Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné --- v2: New. --- a/xen/arch/x86/cpu/mwait-idle.c +++ b/xen/arch/x86/cpu/mwait-idle.c @@ -76,7 +76,7 @@ # define pr_debug(fmt...) #endif -static __initdata bool_t opt_mwait_idle = 1; +static __initdata bool opt_mwait_idle = true; boolean_param("mwait-idle", opt_mwait_idle); static unsigned int mwait_substates; @@ -93,8 +93,8 @@ struct idle_cpu { * Indicate which enable bits to clear here. */ unsigned long auto_demotion_disable_flags; - bool_t byt_auto_demotion_disable_flag; - bool_t disable_promotion_to_c1e; + bool byt_auto_demotion_disable_flag; + bool disable_promotion_to_c1e; }; static const struct idle_cpu *icpu; @@ -867,7 +867,7 @@ static void c1e_promotion_disable(void * static const struct idle_cpu idle_cpu_nehalem = { .state_table = nehalem_cstates, .auto_demotion_disable_flags = NHM_C1_AUTO_DEMOTE | NHM_C3_AUTO_DEMOTE, - .disable_promotion_to_c1e = 1, + .disable_promotion_to_c1e = true, }; static const struct idle_cpu idle_cpu_atom = { @@ -885,59 +885,59 @@ static const struct idle_cpu idle_cpu_li static const struct idle_cpu idle_cpu_snb = { .state_table = snb_cstates, - .disable_promotion_to_c1e = 1, + .disable_promotion_to_c1e = true, }; static const struct idle_cpu idle_cpu_byt = { .state_table = byt_cstates, - .disable_promotion_to_c1e = 1, - .byt_auto_demotion_disable_flag = 1, + .disable_promotion_to_c1e = true, + .byt_auto_demotion_disable_flag = true, }; static const struct idle_cpu idle_cpu_cht = { .state_table = cht_cstates, - .disable_promotion_to_c1e = 1, - .byt_auto_demotion_disable_flag = 1, + .disable_promotion_to_c1e = true, + .byt_auto_demotion_disable_flag = true, }; static const struct idle_cpu idle_cpu_ivb = { .state_table = ivb_cstates, - .disable_promotion_to_c1e = 1, + .disable_promotion_to_c1e = true, }; static const struct idle_cpu idle_cpu_ivt = { .state_table = ivt_cstates, - .disable_promotion_to_c1e = 1, + .disable_promotion_to_c1e = true, }; static const struct idle_cpu idle_cpu_hsw = { .state_table = hsw_cstates, - .disable_promotion_to_c1e = 1, + .disable_promotion_to_c1e = true, }; static const struct idle_cpu idle_cpu_bdw = { .state_table = bdw_cstates, - .disable_promotion_to_c1e = 1, + .disable_promotion_to_c1e = true, }; static const struct idle_cpu idle_cpu_skl = { .state_table = skl_cstates, - .disable_promotion_to_c1e = 1, + .disable_promotion_to_c1e = true, }; static const struct idle_cpu idle_cpu_skx = { .state_table = skx_cstates, - .disable_promotion_to_c1e = 1, + .disable_promotion_to_c1e = true, }; static const struct idle_cpu idle_cpu_icx = { .state_table = icx_cstates, - .disable_promotion_to_c1e = 1, + .disable_promotion_to_c1e = true, }; static const struct idle_cpu idle_cpu_avn = { .state_table = avn_cstates, - .disable_promotion_to_c1e = 1, + .disable_promotion_to_c1e = true, }; static const struct idle_cpu idle_cpu_knl = { @@ -946,12 +946,12 @@ static const struct idle_cpu idle_cpu_kn static const struct idle_cpu idle_cpu_bxt = { .state_table = bxt_cstates, - .disable_promotion_to_c1e = 1, + .disable_promotion_to_c1e = true, }; static const struct idle_cpu idle_cpu_dnv = { .state_table = dnv_cstates, - .disable_promotion_to_c1e = 1, + .disable_promotion_to_c1e = true, }; #define ICPU(model, cpu) \ 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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jg0lTL5U3ou4ZXzhBRr9ZDJFWgSFdqKV1HGNXgLcv5f6p0BswazDDo1/iitWu3LmZfEw9viAvex8wcZrOtFaew5zsI52EGtT+76ej/i+mRpKdXQ0+S6HbGOjmHPvWZJ3yZwcQSA2xBhNShUEm4ih235NfWxtHBhVRMRKEiB5DSau0l61Rl3vqNL0zXVM7W+Y8HKJZX/CswrGFde4+a098luReurtaKE262KfMBthTRQKLMyonsYmGiId+YrYyBArIQN7TN/JK+LyLI7xz84188Mxm1GhIeaswmrBfjvnHStBUvYgvzFlXTdSoUy4znGcGnCM4pFbsafOG7h4OotIU5PopNSq5DErmbZgYiH49GCQeGN0wt1JFynWxWgd98os6Kzj59xBCORW3LdVTfFuQqWQEK4MwHL8fLZdMvZ1IWVfuBtscA+EUmPDHWyq822k7/ShOdcT13DY7WeuvYZWSO05QRsVD0qruZE9UuSr+7Nj1vs8ejm2hHUZPKf2Tx3xlLN6Yd9rHChxyNwq64JfLsUh76GgHjkWpNttwcQTfhJMKMyGWUmandu42HSv6FkoL9BowyD8gPw2aSIxnMg76H25xdTaMoDb2dWjOr1ewkFO0p8L2EocqbAeGSvZBJiiyoGAunTs2ZCtR3oLFrZVrAKWW0XEI= 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), {} }; From patchwork Thu Jan 20 14:04:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12718696 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 6B2B7C433EF for ; Thu, 20 Jan 2022 14:04:58 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.259076.446835 (Exim 4.92) (envelope-from ) id 1nAY3S-0007aX-16; Thu, 20 Jan 2022 14:04:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 259076.446835; Thu, 20 Jan 2022 14:04:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nAY3R-0007aN-U9; Thu, 20 Jan 2022 14:04:45 +0000 Received: by outflank-mailman (input) for mailman id 259076; Thu, 20 Jan 2022 14:04:45 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nAY3R-0007aF-2R for xen-devel@lists.xenproject.org; Thu, 20 Jan 2022 14:04:45 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id eaff67e9-79f9-11ec-8fa7-f31e035a9116; Thu, 20 Jan 2022 15:04:44 +0100 (CET) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02lp2055.outbound.protection.outlook.com [104.47.5.55]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-41-se1l-fHKO_mJLS3QJopwKA-1; Thu, 20 Jan 2022 15:04:42 +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:04:41 +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:04:41 +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: eaff67e9-79f9-11ec-8fa7-f31e035a9116 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1642687483; 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=7m7Y7Upa0+r0a+ciUd8pwYsa/PeoFa1xWQvHddn56eY=; b=JYpM0vyvV6atxHfdMidOI+3MZDVDKjB+ZLrwzmluhly3GYxUh2GV8aXjpwOMSF07dSomOp rDeTQoVEnIEMNgLTWY6v3WRaHBYWejAyQM96H5463KozciQ3HFAvWn1efw1Z8cHIIepDPh tkOvAp3lh5MaQ0kkmYsE8Ft+8cn4Puk= X-MC-Unique: se1l-fHKO_mJLS3QJopwKA-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=crEg0xyhA0n3UCTVJOOtb/U6gw8b2h+l5x83vWhOYpZgChiWCmB5ZD7cc7FiP1mx6VZor7SXiJ+CTvJUAh51/iC95TzQeve+nRCOLgZ8O7fq1qNxQDAMZBzNaa7cNOr158zUwHcS8ZptAQihExT49vqB5wWrflvWZQyRWO1sLXFVavVyPjqF7A42eEwhqzIpl2JDSlyZlOQlPkjbsjxS5gN4kczpeJFr48mW9Uy1juLsOzhnvEujDgsPz8EMPrrKLic7q4SxP2Bvqs5GPS0+U+Xp5sLsbDdsOWpIam72K21x+jjhMZuSMDLgPQXDUCiNUNCkvj4Ux8EbNnaZaz7w9g== 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=7m7Y7Upa0+r0a+ciUd8pwYsa/PeoFa1xWQvHddn56eY=; b=Z6N3unE3L3XNp6WhMcpmSk6D1SUp+YvkTzGA8Hc1ENACnhip0t7ghtDLkVLvqVkl4ITg5WjWJ5hy/WLslN99lBSLrexmaS9IhIi8uQZhrRwpNKzSfZXG/ULfmgVX3cH29ecJd7vhQT2GrUUG6JlQwiESQfskYsJpOWnrdSzcGy42XRuSN3RI3cp0W4oFs/JOeDQ6hCl/z4CFzdbUZr5+/0t922OeGpKDvuHxALmWFpejpf/LUJRspctTWAwKCkyfKb1WT5xXbYxMU4WIU8MZG8dL9uv7+Ki9d7QisDTXlqXo77P97QoJa2sFJlyJatl9HfiEVqfeFL5LpVWzGk+/SQ== 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:04:39 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: [PATCH RFC v2 4/5] x86/mwait-idle: enable interrupts before C1 on Xeons 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: AM6PR10CA0070.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::47) 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: aebfd843-7d0c-4d50-89ae-08d9dc1dcd66 X-MS-TrafficTypeDiagnostic: DBBPR04MB7643:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a2bGEuN0gz7d0hWgyVJh2RxFx5OLVYMDInTyc1MCeOzhiKqO9il63aFEpHt4xgoN1Z9XlUczOAv4uiCW23ZSOJrht0p7dcqcDwtBIpDRfwAjJni82lgH4kIxarGmoKIgToclb1WOr+J8DzvZvg0fYiKaG63thISPn160hVEJloEB7tFD6gNhvSUpCb90a2HvjZWiUUPI4cim0U4KYEc92u2N6EcWEccSZ5ZlFd0SjLtkqm2yrEyEqSYmkSA28ArF1LBiH54tAWNCsHVvLgRsbltgVKNROBMHUi/b8+jboLxbAv9hyV8FZhvfUykQU2qOqJle6d/9ZFzCY7Gw0TsBJAwAtdZBLNpKmoDNGA/flh+88bmdMsJPAGqzfXJ7RZZW40Qr7wzl2LeIu6aBJD8aFscv61DFSXDCvn58FOt7WbB2L0tyVZYk/5heZuzLTljaUEdszGKVigelDw6ZaBds5JwaTA7VDypsXdxyT2YxKo8H50fgVk2q6oOy4KCQ1d9krsvnMIhhsTne7lqd4/gbpV5M9Pa4ApV2Y2dIowFsmj7V3AYFwV0f8MReOmf6KhELqhJxLgvsmU0y3JWsvNPdUpJWEd45ZPYuUtGU4IpP559Lf8MGmvrFxDCK7nCq8EV5In4G8ypdXtWq3M0BBfWiyBFv38fQcoTpCCPErs5I79Y0TF+kreHTn6mbU7kzzwnHXXTcsk00o6VFAdpNKVjbbrB5jptVuOr7c92bQ6C6S0h73B4+0uHRpbz/As+FLegn 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)(83380400001)(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: =?utf-8?q?e0vUlIpE2U8hEwl6qk9gG2XQc0tP?= =?utf-8?q?5ImWDlnAjEOkFvVNEET4O0GUTND3dfASeptNaw9PWWg2A7ayyQfkfaFglOiAN1by/?= =?utf-8?q?hLp/oLuMc9KM838MrK3kr/OgIWLfQPntY9kbynxCKsFpGvtTk6z+RB1SxVJMneKtr?= =?utf-8?q?H01ye6lll1DY0R1JlGyAso6H/yK4OehbzjVYyQmgUXXM7X+ssGcl4cdFpTS01DRD1?= =?utf-8?q?tuHk/YOJow/ZdvGFwZAODDnWVk9Fq72uS4QdkuvlPlBgTqE/c6WXbZUJj3bZ05cYL?= =?utf-8?q?pEtGRqX9Ey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bjFlpVyGDXZuJr726uoPIe+eNrJkDupVSFXkj2yLp1NUVoduJM9T+K08tf?= =?utf-8?q?lmxRR5lZoWY6yRhl3YBCHV4NHSs3CgFNhrN7xIi43QqFgPzAWFPfzkiqnjW9upBrX?= =?utf-8?q?iCjBVx6EHHQCTQTte25/2SiWnf6wh2dEMELPYj43N4TiUjJc0me1GQ3oHoao85WTi?= =?utf-8?q?7tsJtRl4v17TEJpAemAMjN/k/ruhLQvh7BUu4t+M5nyh5X8nwczSDerSSOV9auq4q?= =?utf-8?q?FMyoT8QkMxJNyT2aE51l6XR76ynTJwCsSXEqw6LdJwbf5vS/jfXoRYgcs6BnV6Z8S?= =?utf-8?q?Yk8bCl+i0rsMUY5nXvJgXLHuCyXzSZM9YRgw4dpkJ35WcLwOXgDfC/85ubJHmftoj?= =?utf-8?q?nrz6LrZ7QTBOolIuMmSu7R1m+PUcbyM8HmXTLp2MIXqY9/orIou7UDU=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: aebfd843-7d0c-4d50-89ae-08d9dc1dcd66 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:04:40.9616 (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: JFR3eqvSV4ZDIu1hmy/w42SVMrFV9SrQnH0g+cbhCfqVcDwDufYChi+0c751g58SEG2fNzfV2ztYDmDy7HDGqg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7643 From: Artem Bityutskiy Enable local interrupts before requesting C1 on the last two generations of Intel Xeon platforms: Sky Lake, Cascade Lake, Cooper Lake, Ice Lake. This decreases average C1 interrupt latency by about 5-10%, as measured with the 'wult' tool. The '->enter()' function of the driver enters C-states with local interrupts disabled by executing the 'monitor' and 'mwait' pair of instructions. If an interrupt happens, the CPU exits the C-state and continues executing instructions after 'mwait'. It does not jump to the interrupt handler, because local interrupts are disabled. The cpuidle subsystem enables interrupts a bit later, after doing some housekeeping. With this patch, we enable local interrupts before requesting C1. In this case, if the CPU wakes up because of an interrupt, it will jump to the interrupt handler right away. The cpuidle housekeeping will be done after the pending interrupt(s) are handled. Enabling interrupts before entering a C-state has measurable impact for faster C-states, like C1. Deeper, but slower C-states like C6 do not really benefit from this sort of change, because their latency is a lot higher comparing to the delay added by cpuidle housekeeping. This change was also tested with cyclictest and dbench. In case of Ice Lake, the average cyclictest latency decreased by 5.1%, and the average 'dbench' throughput increased by about 0.8%. Both tests were run for 4 hours with only C1 enabled (all other idle states, including 'POLL', were disabled). CPU frequency was pinned to HFM, and uncore frequency was pinned to the maximum value. The other platforms had similar single-digit percentage improvements. It is worth noting that this patch affects 'cpuidle' statistics a tiny bit. Before this patch, C1 residency did not include the interrupt handling time, but with this patch, it will include it. This is similar to what happens in case of the 'POLL' state, which also runs with interrupts enabled. Suggested-by: Len Brown Signed-off-by: Artem Bityutskiy [Linux commit: c227233ad64c77e57db738ab0e46439db71822a3] We don't have a pointer into cpuidle_state_table[] readily available. To compensate, make use of the new flag only appearing for C1 and hence only in the first table entry. Unlike Linux we want to disable IRQs again after MWAITing, as subsequently invoked functions assume so. Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné --- RFC: I'm not entirely certain that we want to take this, i.e. whether we're as much worried about interrupt latency. RFC: I was going back and forth between putting the local_irq_enable() ahead of or after cpu_is_haltable(). --- v2: New. --- a/xen/arch/x86/cpu/mwait-idle.c +++ b/xen/arch/x86/cpu/mwait-idle.c @@ -108,6 +108,11 @@ static const struct cpuidle_state { #define CPUIDLE_FLAG_DISABLED 0x1 /* + * Enable interrupts before entering the C-state. On some platforms and for + * some C-states, this may measurably decrease interrupt latency. + */ +#define CPUIDLE_FLAG_IRQ_ENABLE 0x8000 +/* * Set this flag for states where the HW flushes the TLB for us * and so we don't need cross-calls to keep it consistent. * If this flag is set, SW flushes the TLB, so even if the @@ -539,7 +544,7 @@ static struct cpuidle_state __read_mostl static struct cpuidle_state __read_mostly skx_cstates[] = { { .name = "C1", - .flags = MWAIT2flg(0x00), + .flags = MWAIT2flg(0x00) | CPUIDLE_FLAG_IRQ_ENABLE, .exit_latency = 2, .target_residency = 2, }, @@ -561,7 +566,7 @@ static struct cpuidle_state __read_mostl static const struct cpuidle_state icx_cstates[] = { { .name = "C1", - .flags = MWAIT2flg(0x00), + .flags = MWAIT2flg(0x00) | CPUIDLE_FLAG_IRQ_ENABLE, .exit_latency = 1, .target_residency = 1, }, @@ -776,6 +781,7 @@ static void mwait_idle(void) unsigned int next_state; u64 before, after; u32 exp = 0, pred = 0, irq_traced[4] = { 0 }; + bool irq_enable_early = false; if (max_cstate > 0 && power && (next_state = cpuidle_current_governor->select(power)) > 0) { @@ -806,6 +812,12 @@ static void mwait_idle(void) return; } + if (cx->idx == 1 && cx->type == ACPI_STATE_C1 && + (cpuidle_state_table[0].flags & CPUIDLE_FLAG_IRQ_ENABLE)) { + ASSERT(cx->address == flg2MWAIT(cpuidle_state_table[0].flags)); + irq_enable_early = true; + } + cpufreq_dbs_timer_suspend(); rcu_idle_enter(cpu); @@ -842,9 +854,15 @@ static void mwait_idle(void) update_last_cx_stat(power, cx, before); - if (cpu_is_haltable(cpu)) + if (cpu_is_haltable(cpu)) { + if (irq_enable_early) + local_irq_enable(); + mwait_idle_with_hints(cx->address, MWAIT_ECX_INTERRUPT_BREAK); + local_irq_disable(); + } + after = alternative_call(cpuidle_get_tick); cstate_restore_tsc(); From patchwork Thu Jan 20 14:05:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12718697 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 009E3C433F5 for ; Thu, 20 Jan 2022 14:05:32 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.259078.446846 (Exim 4.92) (envelope-from ) id 1nAY3z-000877-9x; Thu, 20 Jan 2022 14:05:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 259078.446846; Thu, 20 Jan 2022 14:05:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nAY3z-00086y-6Y; Thu, 20 Jan 2022 14:05:19 +0000 Received: by outflank-mailman (input) for mailman id 259078; Thu, 20 Jan 2022 14:05:17 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nAY3x-00086o-Be for xen-devel@lists.xenproject.org; Thu, 20 Jan 2022 14:05:17 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id fe5a1628-79f9-11ec-8fa7-f31e035a9116; Thu, 20 Jan 2022 15:05:16 +0100 (CET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2106.outbound.protection.outlook.com [104.47.17.106]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-27-h-UCJEbNMF-Q3noT29XyHw-1; Thu, 20 Jan 2022 15:05:15 +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:05:14 +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:05:14 +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: fe5a1628-79f9-11ec-8fa7-f31e035a9116 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1642687516; 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=Ki88Bt745Kcm6s6wmFvsK/mpmFMQIsi3fvdnsTbkCRg=; b=D67rw/gdZiBrrX3ho+xcRyr4J+XfrgrxKZR9CzvbXVDflhe+N3+Dx9hXzlfEm5Y3itsMZy dpLi5Jpt/MbeXMOqNr08FRDYkvNowc9hNjV1kVASSGQ/Lfl32TcrIraBAUbizWqTE5aWuc BDvmitxJgrngUdNgLvXpwfKHtXRqI3M= X-MC-Unique: h-UCJEbNMF-Q3noT29XyHw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HILrtr//VkJcVq2upy2lyOAv+/g4fS+ydQ8UvgpnXIUwDbaTb5290o0iBQ2l69v1NCl/4ejW9+3ZKOjMdo5EDm6IvPOuWJw10XjGd16yNPS60HFyhONlWDsUGkT/yEOJApqdVoXO+NEIUavqyl6Kz3uV7HNG9BEcFmJB9t+cXKp+485Tua61yTTo8tFa/saw1cQLm69HXlwKb36BSLd9Cvm6ZbERpTfmoI1sxeD6PlCsIBokzaFiXoCExS6MsMaOoIcW9q/GAJkBMp/nFJzmnbum7kbKVzs2VcQtyOs0Mo8QNPHJgP2/43TKBUYnulOYMO51ju+byfhaZtOUZ9OgKg== 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=Ki88Bt745Kcm6s6wmFvsK/mpmFMQIsi3fvdnsTbkCRg=; b=EOCJhFgg2rW6AkWMHGepmDM2SDmuUSGpShByA78TBO2ByoDPWISzDz4MW2BBIgLal1+PWY4h7gsWHTbxF+9CcTd4mC5LzK1L0L6nHRAo8Wk2J5wTyfOYMAxnyD1fmfGHpuYT2Jvf8ApkEePqXnkxlP0cBI/D2phea7EKYEEcRe78ibZIV458YAHOqRpyS1IWA26M9/IPDt16z3Ff1ZxINKXf295bwUlc/6QgkvDDxrEdSDr5N1dBQRY3v7Df64etjumMozwop06TNZB7V8rUKToSKn5NpABIOmIFaZuN65CUjHzp85UAxG4MmloVodYy0MyKLel/IVytz7QC0vdRVQ== 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:05:12 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: [PATCH RFC v2 5/5] x86/mwait-idle: squash stats update when not actually entering C-state 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: AM6PR10CA0056.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::33) 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: e45165f2-d0bf-478b-d03d-08d9dc1de113 X-MS-TrafficTypeDiagnostic: DBBPR04MB7643:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ADc6HcxE6dFwD9vo7mpglQoi5RkNPccye5ZbVnLGfrAttZtDpQMQ0yvbt6sXpQVoxjIQTEQaqHaCIW0JLXi7ozbZtzohnh/chlEa3nMK7ByAeXHMYVbju0C7al/1U3PIcAcXkWXkKElwCRHam/97Hn3dxymupZUnjzlAVpc0TQsSGtUgGPUD461ISiCPh+nooDVYPbelfnIuEJeLWy94GzwCBOp8Ytz9jwH9jrzvmfZHoXvmJcUkuDHiywMuypf5wdGfFVtCRImFTu7ccJTEUfzDcqyd6nJ7eE8S0Nbaaxj8A3KeNs0lvaXXHroX+UXYHJ7RIF2x75uy7ZFp3ZkyHg1BKATz5Cfwlwe6YotsHZjdUB/3ju+MdzBls9P7MURI70oelWw0hJN8pbWlUq0PzoyiUyl6z4vEpC6zpiXM3rEwSmT7SEDpUL7Ptw/lECMyj9CoauWV1xL9l3IYeoh/SS0uvCJYMUr7FsMfTmEtsm57CGSPdtB0NeSgIPjcjzACmjZEaC4tuD3SbCa91ny4uNx5omjsYbIxc9ehUfAv1abV6D4nnTtxnG83786eWoCL3FG696Wqk5vndEtMNrTJayyC8mQSVwCvk+ff7tth1HGGfHbxCUJeFD9VaTpN2OkKkWq/jpRJeggLN1hBuYQ6j1PlHuY6RqNT7r5U3b6kJ6DQSFtdVb6WUjq7DG3sMObU2H1eUoDnUL00/sowm4cFDa0OVYAVTRsXGO1NGu8jEQAL1wsDX1uNds+eD3cosEpo 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)(83380400001)(6916009)(66556008)(66946007)(4744005)(316002)(2906002)(15650500001)(5660300002)(26005)(6512007)(54906003)(4326008)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?gB+2F28duTbr8xzZLXQV3Mlbh7yu?= =?utf-8?q?XBWeOu+GEiM1jXHT7OLGHQZ1E/br2ihVQp7ZH0avgmlaUUnFTkYCOucgz44zYIB/g?= =?utf-8?q?4C6J3j4AERhrmHq+dFRqAvtQQ57jIK+0W+iuZDhWtDcd4f/h0yuhbbGOYQuwT9V/e?= =?utf-8?q?8Ek975kq6DhX7s6o96UxQWAe2fIrTVspayz8RdNzXirUOXVC6dxyGZXD/zwqLQzkz?= =?utf-8?q?fGcl3nGx+LWapdfPZNgFzyHz2YWoB2Uv1ncjCTe1Zi01fPd7r3M38DmgE2dxaK1g4?= =?utf-8?q?2wiYOXu0CSutNtbw28/aHzwGrB/3ntdJQh8SAyFmjDlwgLDdqA9wOVW7kNkBoICYk?= =?utf-8?q?tfLavZ+/51/ukkpwT0K+Gah+8OJwP2Auay2wEcP6ipWAKe48fD01Opz8q0iUhD2Ya?= =?utf-8?q?TXnKG3/2ZPSL7Wdd9Pc0iO7zvxouXfBZbLNDVadmEPYlvySgRQl1cvqEVcVNI2SuM?= =?utf-8?q?AKnq7tjTPj5eHp+MK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uuE7zEuZCF0wPA7Sz9DM1X1j/8y4C?= =?utf-8?q?jz+ukIBxlkJDvvYUj1umB21Mv6m0CGbBROsliL8gQAPpBQvFz1k6r4tJcG/bkfCgO?= =?utf-8?q?1vFPEIv8bt+kFU2T+md42X2Wg4uRbVwUDLalg6SIKkRJSBJpmRR71afbrpopFz3pC?= =?utf-8?q?KiO4pLYM4GZco+Kik4nZ4QnJpVrOrY/JC9ft9QYN9rZ8R/PE6MAi41Q=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: e45165f2-d0bf-478b-d03d-08d9dc1de113 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:05:13.9319 (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: Rf3PEFF4rBQXN5aMVIWqBIesyxgdQlUo7RQCYq4qiz4ZyCgqS+ejZb9NUMixc+XsusJ4YT+FKQ1k0i/Z1CutIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7643 While we don't want to skip calling update_idle_stats(), arrange for it to not increment the overall time spent in the state we didn't really enter. Signed-off-by: Jan Beulich --- RFC: Arguably more of what follows could be moved into the if() - thoughts? --- v2: New. --- a/xen/arch/x86/cpu/mwait-idle.c +++ b/xen/arch/x86/cpu/mwait-idle.c @@ -861,9 +861,11 @@ static void mwait_idle(void) mwait_idle_with_hints(cx->address, MWAIT_ECX_INTERRUPT_BREAK); local_irq_disable(); - } - after = alternative_call(cpuidle_get_tick); + after = alternative_call(cpuidle_get_tick); + } + else + before = after = alternative_call(cpuidle_get_tick); cstate_restore_tsc(); trace_exit_reason(irq_traced);