Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2616841pxu; Sat, 10 Oct 2020 01:27:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxy4rGzlnLOs6n9ptVSh2N8RKs+LxJoIyV1vjMUU0mvxq51Ge8O+Lrv//nKVDSqVwx+Y460 X-Received: by 2002:a17:906:c407:: with SMTP id u7mr7715313ejz.206.1602318456185; Sat, 10 Oct 2020 01:27:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602318456; cv=none; d=google.com; s=arc-20160816; b=AIMJLhXtcoSNIUXnmSh4pSDeEBTCfYM+OeE8+Z9N5/vafxHKHa4s1rwgWZ+LPjCO18 +T3WFGIvnb1ombhc30huc8fcd5Izrte5EdWBjqKbX0QsNPnVZmqIJho6Q60Ogwvhdnwy MoShCj4X3egPqX65yWCog+1G6xfB4RFW1wJ6A1xi0ypTTDNXUjjZghgirPWWZ9lWSjc4 JsxMksD8pOhyHsNgFCAeF7wr5Mz8Ri1eII2EjmRNSV+bK7Xkjbh6ON459geT+l0acfP8 1lrcOcXfnR/rj13o+LSbl1tm4sUMaXrFjGoJCIshzG6+ppoqSQUKtWXF+NKUzhaEVH9o J5yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=wix0OR8IOfPgSne8A99eWONXUDggFI/kUCZD+8EgRMw=; b=gXX8Qvfv53VHqjoBTRi/D373CUUuB8QSXBuqC5+bZxYtTgUZZI5mz89xMVxgnSvmQn zQmiCRZa/VulRRmkXbGIpGytxGjwe5aSHeVoPlzpKgFC1rJQ92oXhqRPqhPnDcMydbAI IPTkZKd55b0YFJRJ+Unl09bTqqwD7Ega96LJ6Sg7sO/iDXqJLpvhj2xHEv4DU0XHCfGN G/P3Hqp4adVmSuu3WsY2Oz3AokTInB/M7tCFmTnb6k+lNDOG939oTly2t+pguqXNpN5o dvw8OTmpQKGEGCwy/6fyUwqrFGyGK03uKcc+WkHY1JuXEXF1DAvehkYyeSl65/AXdYnu nYRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=qkRhSrZT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q26si7822451ejt.308.2020.10.10.01.27.12; Sat, 10 Oct 2020 01:27:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=qkRhSrZT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730784AbgJJDvC (ORCPT + 99 others); Fri, 9 Oct 2020 23:51:02 -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