Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4890241iob; Mon, 9 May 2022 04:11:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPt9ufgeFp5vi8kmLByDtZIybkiMAW6ql3CEtCJKkxEy4lfJxXpS/CHXFof66jhvm3Wtt7 X-Received: by 2002:a05:6a00:2484:b0:50e:68e:d5a5 with SMTP id c4-20020a056a00248400b0050e068ed5a5mr15658711pfv.47.1652094691785; Mon, 09 May 2022 04:11:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1652094691; cv=pass; d=google.com; s=arc-20160816; b=S2qwz+Rxh7/t1500JI1mTVEGqe+FOZ0uvz+Hqhyrlr/yOvFiAukT632I+otEtHUdTO NwehR+x8L/c6gP1I4qMyHmLeicksil7728s/7yzCuwqg/cCOQLOqaKqzIjNrWfOTFEpX GHLqISVz9dk7qLBRY2Eg9a1TH6Ra8E5IpsT2nsmO6npc54n2cC+4GxWYAOwwKi3HLDUu XJYuZextKuVin9ImJprzAjEkeQsOhE4m+B8Ajw7bemaPijb8kl68Y1U+LDayE6hRFwrH lOFfbpk+BCDg6NhKDUaC+QqNFYk57EnMov0+Mhn+9az1NSgvIm0n5cWOTpndovUH3qoG 8aXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=Dr+Netug3QUKH5IV7iH5M5ElXjSX/Xa4k6duXAC2+Rc=; b=ProzLoixO/RKHBKY1jDYRG5WFG15ibfAPH6B/iY5e9IxCf6j61a7hrQtiy48lo1vTo 2dRzOCJL6/pwM12gflP364BVNhncA1iCvvPywTrwpv5e9GD5qEj2Pl4DNUoehBRoTPDB gnGo2+Jgi4c28S3JUUA3GILiIZ+44jmTGfJBQ8+jixsiIQgTKFK5So0+dJ21AAWJ4QOl DJM5y/8+HAl1k8STMu0CKBpSMtcY0FAI2fKV9q/TEebz79Oy82PCTAwwDaE3cwKZ98F3 IdAl5zq1ic/c2otT4lElu+UX2u9h5jHY+JuPnS0n/GyWqwFfQ+rv1PUqfiDe1TWQnQjb Q8oQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="SAB8/dWd"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h16-20020a62b410000000b004fa3a8dffa2si12822505pfn.89.2022.05.09.04.11.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 04:11:31 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="SAB8/dWd"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A892022EA53; Mon, 9 May 2022 03:22:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357388AbiEFJqo (ORCPT + 99 others); Fri, 6 May 2022 05:46:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235926AbiEFJqm (ORCPT ); Fri, 6 May 2022 05:46:42 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2050.outbound.protection.outlook.com [40.107.244.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FE80309 for ; Fri, 6 May 2022 02:42:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N1OM1NWWk7sOKEikorgANpZqD4Ml20XwuhM6HNBYlJo82d2PoFSbiH34tB4SZhpodxCeSLosJyIEhT5iNFd4x9ZZIFfEXLgf30vBY0jLEV2SXQl+Jw/2tc9G9ZbLgUjZqGm6SAvCar/NhBd4FBVpuQBIFfDqD7X/zfoFtE2IRrKXnZoRXHCG4KoY9DjCWg4SC9gYlET/Cd7m52EdmKm7G/nmPx4mkB2VecslGKqp5Ih8fw953ab4NKG43oPvqEdCQYVpynrzmg917j6Lqf4EzRN3hka2RnLzJjOmWIJtLnrZJWzbU1uT/cU//M4YEI475LzEmix7Zphsb54z9fm93w== 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=Dr+Netug3QUKH5IV7iH5M5ElXjSX/Xa4k6duXAC2+Rc=; b=h5syhtCq28qs8PFClFIBt5Ozq5opYeMccm8WAWYWXNsQKob64HWTpsTDE6KlbteS7mRGZy5bH62ncbk3eFOYbRB97J8hFniYscEzsQDYY4BDNewdfGB0nMJZyF4RFo+Xp7JEEg42C3n6Y/3uv/PDuxSeZ3F9NwwZnD8DljkmL+20kvxb7zmewUhK9KyexX/nNalzbEOjPSVbo2o+PYDBlKCayzZEPGKoLS6zyC0aUGvtJxR8PnJA/huRAyi4jsgazx3nXZcvb6plWchl7RcsnC/tGOH08NkR1Mawnvdo/mIzibh4exr0poPuOIZ0HJdv9A5WmaEbeWzPUPDoJkfSyw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Dr+Netug3QUKH5IV7iH5M5ElXjSX/Xa4k6duXAC2+Rc=; b=SAB8/dWd9DffFDiDMrVycoTwF7MwMtVRnACTkY+zVLDRqAXimBYa5hfLEA5P/7w2rq6+Ea0OAO/gXJfeDT47CojxNQqlXND0hQsR47FbycO+RrmWKOgxsMO9Wp6Zhy3mKlu0UW4Qy7gT1hGkMnQtqdFNMHBvtDwPhp8ze7RbwJo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BYAPR12MB3368.namprd12.prod.outlook.com (2603:10b6:a03:dc::20) by BN6PR1201MB0211.namprd12.prod.outlook.com (2603:10b6:405:55::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.25; Fri, 6 May 2022 09:42:53 +0000 Received: from BYAPR12MB3368.namprd12.prod.outlook.com ([fe80::1c22:8110:ebf0:f38d]) by BYAPR12MB3368.namprd12.prod.outlook.com ([fe80::1c22:8110:ebf0:f38d%7]) with mapi id 15.20.5186.028; Fri, 6 May 2022 09:42:52 +0000 Message-ID: Date: Fri, 6 May 2022 15:12:33 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v2 2/3] x86: Remove vendor checks from prefer_mwait_c1_over_halt Content-Language: en-US To: Dave Hansen , linux-kernel@vger.kernel.org Cc: Lewis.Carroll@amd.com, Mario.Limonciello@amd.com, gautham.shenoy@amd.com, Ananth.Narayan@amd.com, bharata@amd.com, len.brown@intel.com, x86@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, peterz@infradead.org, chang.seok.bae@intel.com, keescook@chromium.org, metze@samba.org, zhengqi.arch@bytedance.com, mark.rutland@arm.com, puwen@hygon.cn, rafael.j.wysocki@intel.com, andrew.cooper3@citrix.com, jing2.liu@intel.com, jmattson@google.com, pawan.kumar.gupta@linux.intel.com References: <20220505104856.452311-1-wyes.karny@amd.com> <20220505110140.453184-1-wyes.karny@amd.com> <0b501f18-a6b8-1d9b-e72a-ea6cb33720a2@intel.com> From: Wyes Karny In-Reply-To: <0b501f18-a6b8-1d9b-e72a-ea6cb33720a2@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: PN3PR01CA0135.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:bf::6) To BYAPR12MB3368.namprd12.prod.outlook.com (2603:10b6:a03:dc::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c0a127cb-178f-417e-d532-08da2f44ca32 X-MS-TrafficTypeDiagnostic: BN6PR1201MB0211:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pbrzXmRdsMwph2rEziBhdFWnNtepBAJvRgGbVe8voJaTvnUeqcXLYE9rxyGHrefgVXJPWm8GHvJfP7XNpsu8MecRhzWaLwtQM0fhsoKqAAzC/VpLweUyobL5HQwFopoWYNzwCOZ8ABEAAAoCbFitEBosD4PmjO7aE0hTmmGrf38NJ87scFCkPRdU7YJXAvxDGKtMxoagoAvGSuXByeYeH1IRcePTKYWVrN6tKb3GKUxvFJfyE9gGz6dXUhrcrOS55fZiNd8y4jhWt1IdzHJqjPeceVQPrQTn8ys5/0eOlEXoBfBEEGBcpfRB2YDMtvj+oR2vP48P1P1mINyvifQbd76RqxvyGtF+eRLDilwOB3QvuLQUkJZHo2c4M+Jf+FEjeRGEc1Q1SNpIQV6g1jtJDqbYY8JhulZviw933GX/dCHwARWnIpS+htYS+9JsZhDq1cvuWjDwY9nrxMzY/VuRw6N4JBo0C5lrxl5npHh+doqfnpRwbVVPSPRxYZDoMqra9oKx+kVRfdvZbH2BbnToaQB7hap0/ShylrvUfwmuEJ5GnuYrFqckNmaVvj0cB+UcHwX/QWFgVWNidyXgGtlnvZg2n58hJI807o6hjLQvIwQdglfxeA8MDd3QUj/pzq01Ed5al/8Pgqr4mpXDEvnU7iM9lf9AVmJHsFNbSq1Ytq3iFVZhrzw7+pehvuZgWEsBE6iKfgb/WEjR4pvn+1ITCkG8/NCmeRI2wj7MFV28sl4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB3368.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(7416002)(5660300002)(508600001)(83380400001)(44832011)(6486002)(8936002)(36756003)(66476007)(31686004)(316002)(4326008)(66556008)(66946007)(8676002)(2906002)(26005)(6512007)(2616005)(186003)(6666004)(6506007)(53546011)(38100700002)(86362001)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WXJGZnhFQytMZDM4S2FkajdYbHJwanYzV1dGK3Z2MEx6OHhiTDE1UjNzTnhV?= =?utf-8?B?andycFlGSFMxMXgrS1B3NjROTFJQcFJ6VDBaSDMybE5ycnRuT3JXNlQzRkd3?= =?utf-8?B?eE5LR0xEU3QxTVVoZVJUT1hUQ3hKVng1d3M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?bUlaaUlLNmZPQnZHWEg5ZHh5bzlnVFQ3SkRvQ0RmWWIrYlRJd3dYRjBPWFYv?= =?utf-8?B?bmtsVSt6aEg5Z1FTdFEyUkxPL0F3STRzUGYrUTd6c1YvUm9LMXYzWmg5azBX?= =?utf-8?B?blFzdUQrRENZV3RuQSs5Nnl5c3kvcnNNdEVscXNNVldsTXBzSlJHbkxmVVBO?= =?utf-8?B?NFgzVjUveXFKQk9TcGc2ZTlVbnhPY3NCSEF5NWpFcTRlSE5IOWhQNUlkOGJO?= =?utf-8?B?Q2hiYjhtbkhJNmFnVXhTMzRQaEQvdTczMVM2ZHZ4cE9odFBkb2RoRjVpUSth?= =?utf-8?B?dFh1YUN6OVgrQ3phZEt4N3BEaEtkdkxlM1E0R2pNb2pUeTIrcjcyWHZVZmo0?= =?utf-8?B?MmFhc1JjYVFWOC9LdDVpb1F0ekVPWXRseUpDMjFhbWRBZW1idU83UT09?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0a127cb-178f-417e-d532-08da2f44ca32 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB3368.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2022 09:42:52.7331 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rIyE9HwZhQN9IIncSJ7AUai6wB+ztcx+YJDDXqZ2X3IXP+Z29S9lGMVvLXApsZtQGnfbB6hohImMD9Wj0SNJTg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB0211 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_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 Hello Dave, On 5/5/2022 10:34 PM, Dave Hansen wrote: > On 5/5/22 04:01, Wyes Karny wrote: >> - if (c->x86_vendor != X86_VENDOR_INTEL) >> + /* MWAIT is not supported on this platform. Fallback to HALT */ >> + if (!cpu_has(c, X86_FEATURE_MWAIT)) >> + return 0; >> + >> + /* Monitor has a bug. Fallback to HALT */ >> + if (boot_cpu_has_bug(X86_BUG_MONITOR)) >> return 0; >> >> - if (!cpu_has(c, X86_FEATURE_MWAIT) || boot_cpu_has_bug(X86_BUG_MONITOR)) >> + if (c->cpuid_level < CPUID_MWAIT_LEAF) >> return 0; > > First of all, thanks for all the detail in this new version of the patches! > > In arch/x86/kernel/cpu/common.c, we have: > > cpuid_dependent_features[] = { > { X86_FEATURE_MWAIT, 0x00000005 }, > ... > > Shouldn't that clear X86_FEATURE_MWAIT on all systems without > CPUID_MWAIT_LEAF? That would make the c->cpuid_level check above > unnecessary. Agreed. I will update it in the next version. > >> + /* >> + * If ECX doesn't have extended info about MWAIT, >> + * don't need to check substates. >> + */ >> + if (!(ecx & CPUID5_ECX_EXTENSIONS_SUPPORTED)) >> + return 1; > > Could you explain a bit more about this? I don't know this CPUID leaf > off the top of my head and the line after this is checking EDX. It's > not apparent from this comment why "!ECX_EXTENSIONS_SUPPORTED" means > that MWAIT should be preferred. MWAIT can be used for two cases - address range monitoring and advanced power management. According to Intel Architectures Software Developer’s Manual, Volume2B: "MWAIT accepts a hint and optional extension to the processor that it can enter a specified target C state while waiting for an event or a store operation to the address range armed by MONITOR. Support for MWAIT extensions for power management is indicated by CPUID.05H:ECX[bit 0] reporting 1. EAX and ECX are used to communicate the additional information to the MWAIT instruction, such as the kind of optimized state the processor should enter. ECX specifies optional extensions for the MWAIT instruction. EAX may contain hints such as the preferred optimized state the processor should enter." So, if CPUID.05H:ECX[0] = 0, MWAIT extensions are not available (not allowed) and hence it is safe to use MWAIT with EAX=0,ECX=0. Otherwise, we have to check CPUID.05H:EDX[bit 7:4] to get the number of C1 substates and this should be greater than equal to 1. > >> + /* Check, whether at least 1 MWAIT C1 substate is present */ >> + return (edx & MWAIT_C1_SUBSTATE_MASK); > Thanks, Wyes