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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88C14C0015E for ; Tue, 25 Jul 2023 06:51:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231749AbjGYGvR (ORCPT ); Tue, 25 Jul 2023 02:51:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231187AbjGYGvQ (ORCPT ); Tue, 25 Jul 2023 02:51:16 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AB10BD; Mon, 24 Jul 2023 23:51:15 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1690267873; 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: in-reply-to:in-reply-to:references:references; bh=qTSiGFdzDyf1mwg76cDRV4nFA1LBdaWOeq/VwaKIiXQ=; b=gugcPXUsURN8CiK4gBblLM8WprgclBunxGBjioeu0mP2lJgVKud+4wII4ChSIKvsaNcTpm iqvMelH1IG0ENaS7X0FC+yHmn74aljtxc1JiKvoDb+z6ToAd0KClYAuxUXP0Jfx+TPm6ZX 6J0UehC7IeTAWKl62CyNzj5UTbl3Mh8LDD22lx6lN3lrfrMP/3gY6m06uQHzfkTy+lru3A al1YUmzbuVaT6eeYUxexb5OLkAIuL5E35d1mI3iagp82RY9eAia7/q/JsteVd7C+3sQdm8 qumt/8+WVlbFDWz3Ec2djWWWj/4aMnHcMj9rnspNnsWZCANCzzmwncUf4xzVag== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1690267873; 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: in-reply-to:in-reply-to:references:references; bh=qTSiGFdzDyf1mwg76cDRV4nFA1LBdaWOeq/VwaKIiXQ=; b=ZIJyz3EHuhOHXV5TbBCQJvJ6IxAQUYjVqwLnNxOTSl/LKu+0yOvmitEHAINhkGkvG7WmKe nDOEuof05OYfuNDA== To: Peter Zijlstra Cc: LKML , x86@kernel.org, Tom Lendacky , Andrew Cooper , Arjan van de Ven , "James E.J. Bottomley" , Dick Kennedy , James Smart , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-hwmon@vger.kernel.org, Jean Delvare , Huang Rui , Guenter Roeck , Steve Wahl , Mike Travis , Dimitri Sivanich , Russ Anderson Subject: Re: [patch 17/29] x86/cpu: Provide a sane leaf 0xb/0x1f parser In-Reply-To: <20230724204942.GD3745454@hirez.programming.kicks-ass.net> References: <20230724155329.474037902@linutronix.de> <20230724172844.690165660@linutronix.de> <20230724204942.GD3745454@hirez.programming.kicks-ass.net> Date: Tue, 25 Jul 2023 08:51:12 +0200 Message-ID: <87a5vktrfj.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org On Mon, Jul 24 2023 at 22:49, Peter Zijlstra wrote: > On Mon, Jul 24, 2023 at 07:44:17PM +0200, Thomas Gleixner wrote: > >> +static inline bool topo_subleaf(struct topo_scan *tscan, u32 leaf, u32 subleaf) >> +{ >> + unsigned int dom, maxtype = leaf == 0xb ? CORE_TYPE + 1 : MAX_TYPE; >> + struct { >> + // eax >> + u32 x2apic_shift : 5, // Number of bits to shift APIC ID right >> + // for the topology ID at the next level >> + __rsvd0 : 27; // Reserved >> + // ebx >> + u32 num_processors : 16, // Number of processors at current level >> + __rsvd1 : 16; // Reserved >> + // ecx >> + u32 level : 8, // Current topology level. Same as sub leaf number >> + type : 8, // Level type. If 0, invalid >> + __rsvd2 : 16; // Reserved >> + // edx >> + u32 x2apic_id : 32; // X2APIC ID of the current logical processor > > That comment seems inconsistent, either have then all aligned or move > all register names left. Bah. I had all the register names left at some point. No idea how I lost that again. Probably when I rolled back to some earlier version after screwing up :) >> + >> + /* Read all available subleafs and populate the levels */ >> + for (subleaf = 0; topo_subleaf(tscan, leaf, subleaf); subleaf++); > > Personally I prefer: > > for (;;) > ; > > that is, have the semicolon on it's own line, but meh. :)