From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 895C6C433DF for ; Sat, 10 Oct 2020 03:52:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 039AA20657 for ; Sat, 10 Oct 2020 03:52:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="qkRhSrZT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730880AbgJJDvr (ORCPT ); Fri, 9 Oct 2020 23:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730925AbgJJDkH (ORCPT ); Fri, 9 Oct 2020 23:40:07 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBB28C0613CF for ; Fri, 9 Oct 2020 20:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=wix0OR8IOfPgSne8A99eWONXUDggFI/kUCZD+8EgRMw=; b=qkRhSrZTa/NwMUwIqh3XeSDfTj 3nGzzbuex3jPg54qibCknHX7pcxOjodP6seN5QL1lBF078fBDKHpwymDLA7gDNceGyd6aGCvWiwKE CtmX2uZRqUiewz8gCkhIcxKxiXa6yB++/jnFy8CJQU/h+6qQrbGsjBHvBPrnlo0iFNAzdRyXPsa2q tB6BWQvda0y5DgrF2/pcQUyEVEPTLcGL2wqYG8pvVMKyY2ZKadyvRjbfKrMT2vnBv4fWrh9AjJvak QRWbEj174ex8sJ1XgFgp2QZvzITO8Li9DvQO0GI5a/NSSHPyV3wpX2Z5Tgwd02d/xKTsvELRMvgao TFb4oC8w==; Received: from [2601:1c0:6280:3f0::507c] by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kR5LT-0002U7-LI; Sat, 10 Oct 2020 03:14:56 +0000 Subject: Re: [PATCH 1/4] drivers core: Introduce CPU type sysfs interface To: Ricardo Neri Cc: Greg Kroah-Hartman , x86@kernel.org, Borislav Petkov , Ingo Molnar , Thomas Gleixner , "Rafael J. Wysocki" , Tony Luck , Len Brown , "Ravi V. Shankar" , linux-kernel@vger.kernel.org, Andi Kleen , Dave Hansen , "Gautham R. Shenoy" , Kan Liang , Srinivas Pandruvada References: <20201003011745.7768-1-ricardo.neri-calderon@linux.intel.com> <20201003011745.7768-2-ricardo.neri-calderon@linux.intel.com> <20201006011550.GG6041@ranerica-svr.sc.intel.com> From: Randy Dunlap Message-ID: <011d6f26-0a8c-a726-a81c-cd18df43c366@infradead.org> Date: Fri, 9 Oct 2020 20:14:50 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201006011550.GG6041@ranerica-svr.sc.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/5/20 6:15 PM, Ricardo Neri wrote: > On Fri, Oct 02, 2020 at 08:27:41PM -0700, Randy Dunlap wrote: >> On 10/2/20 6:17 PM, Ricardo Neri wrote: >>> +/** >>> + * arch_get_cpu_type() - Get the CPU type number >>> + * @cpu: Index of the CPU of which the index is needed >>> + * >>> + * Get the CPU type number of @cpu, a non-zero unsigned 32-bit number that > > Thank you for your feedback Randy! > >> Are you sure that @cpu is non-zero? > > This is the intent. Maybe it can be reworked to return -EINVAL instead? > I gues it is plausible but less likely that an arch defines a type as > 0xffffffea; You lost me here. >> >>> + * uniquely identifies a type of CPU micro-architecture. All CPUs of the same >>> + * type have the same type number. Type numbers are defined by each CPU >>> + * architecture. >>> + */ >>> +u32 __weak arch_get_cpu_type(int cpu) >>> +{ >>> + return 0; >>> +} >> >> arch_get_cpu_type() in patch 4/4 allows @cpu to be 0. > > It should not return 0 if the system does not have > X86_FEATURE_HYBRID_CPU. The currently existing CPU types are all > non-zero as per the Intel SDM. Am I missing anything? @cpu is a cpu index, not a cpu type. -- ~Randy