Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3636198rwo; Mon, 24 Jul 2023 14:17:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlEARK7LS6DB4gQHfvy2ZKbtUHvlzVdymhZEYnQZ7qcxJVth3uYgB6K2s7xXKm65De9p39Nu X-Received: by 2002:a05:6a21:3389:b0:121:ca90:df01 with SMTP id yy9-20020a056a21338900b00121ca90df01mr11915677pzb.40.1690233457357; Mon, 24 Jul 2023 14:17:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690233457; cv=none; d=google.com; s=arc-20160816; b=zjwGPClFK1QZ8cuqI5/75LaAxV5XjroUUMBPos08PNK1Wy2JJfRN3z0Uo+3sHU97lb dXYwRACL2Xu/lk/BD/aLP4H82srVgFp7uSxrHNeDceK3YscE4E982yYpuZmyuF03cRFW iyORp9rYcnSgjreWNzo8zrV8Ro5x43rYma4IqYAHeJx73YshedgOD/oWIzs3AyfIyI4M nSryxBWP1S7FuKa+dU/K0yivWKGGKL6G4iQKD8H4QN7bC8kMzQ8pB5epxw6O2YX6WGVS XsQHjxu8UwP3dvQaWfDEeTdusezyp0XBxqwnxDsPoA5AWWiALPUgox/4UhnfLFmgQk3W B9Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ikv5RWJ2ZX7Htggzkm0GhNiijEx+JWmm8AH3RJo3Msw=; fh=v+WmNA0RMzct7SP05KgOdLnJ5uzVzLKBck9lm3I9zao=; b=kiq/aHkLDhLYC3jAKdfuibqQBKIJJMAsQ8EJwPzXgCD+DvFDIWT4XntN6NrV4vNAqj 2iohTJ8bt25FnF0fMDzoVXLjB142zR9crQ4EzXTT62piT1E7sDy6CQS4iZ/SBu2hhQMB c1OEN5GrFUsicQ9rYCZzRemnFyh3O13igBrUGk+tvzzdTyUuPNIZ/V7yD9VLsLajhAHW XDw8sqNDUAIDl42PnbsGnl3votRT7/eloPYuevgZzXEpDDAMZEfU+rKYc+4nQrIESvPJ 1UU7xvEZpMA+YzKqNNNQPjh5eDVmlsbZn9dUUdRKJtBCJvVAeuAOT+64gz+6XKjDgI74 Lygg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=lMUXDEMM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t40-20020a056a0013a800b0067b77e7f472si9884593pfg.402.2023.07.24.14.17.25; Mon, 24 Jul 2023 14:17:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=lMUXDEMM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230231AbjGXVDO (ORCPT + 99 others); Mon, 24 Jul 2023 17:03:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbjGXVDN (ORCPT ); Mon, 24 Jul 2023 17:03:13 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 118DF187; Mon, 24 Jul 2023 14:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Ikv5RWJ2ZX7Htggzkm0GhNiijEx+JWmm8AH3RJo3Msw=; b=lMUXDEMMWct/2mxwlw6njxwJMG mrTykE5uacXXfi2B7KyFMenBk5MNW9KWcqydaBvDuz3J1bP/XWS0DJZGzG7feVOdINkmjIGmgFqCg +x3HjxDWYl529w4JV97dPzIeUjtuUTHVG+qxoip6k2YtnpOZLffNhopIn1Y2WagLpWpT3Pr+aFm/F YLEzzsSb878lyI+y3aYSavsi4adduZ8ITINi4eZD5S3iqPVSwSx/cciFWfo4g9P3qZBezQU4oZpN7 5UeXSNgFGM5diU9xT6Q64KwkiAPq76jbbjb5QMdTx/hvl6XKBBE5RPj3hNkSr2qvnEtM4QA1Ted4l dPgBLhzg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qO2hJ-004o2T-BB; Mon, 24 Jul 2023 21:02:30 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 68B55300155; Mon, 24 Jul 2023 23:02:28 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4AC702CC644CF; Mon, 24 Jul 2023 23:02:28 +0200 (CEST) Date: Mon, 24 Jul 2023 23:02:28 +0200 From: Peter Zijlstra To: Thomas Gleixner 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 Message-ID: <20230724210228.GA3749554@hirez.programming.kicks-ass.net> References: <20230724155329.474037902@linutronix.de> <20230724172844.690165660@linutronix.de> <20230724204942.GD3745454@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230724204942.GD3745454@hirez.programming.kicks-ass.net> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Mon, Jul 24, 2023 at 10:49:42PM +0200, 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. AMD code seems to have the reg names left aligned -- perhaps do the same here.