Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp3154081rwb; Sun, 30 Jul 2023 01:06:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlEriFdoSjq/6DRJhfm4aAcba/mL7NYTRIhha2pmQtar9Hz+z1U5yalIhOmtnqQ0n/2HzmXH X-Received: by 2002:a17:903:22c1:b0:1b8:b2c6:7e8d with SMTP id y1-20020a17090322c100b001b8b2c67e8dmr7847717plg.66.1690704363069; Sun, 30 Jul 2023 01:06:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690704363; cv=none; d=google.com; s=arc-20160816; b=l3mLdqyMBypH10fgfctePaplLCJfi3zWwCboQgJOYUnBeBX+JXi8/xafeXpQU02c51 PemtDabszBHY2QuFYnYKpa+136ncyS5VuAxLfqnOYKILyjNRDsbrYDMrmlu4wCyVgiD7 b7zpAK9MjZcYF3BHchAJAnXYThk6qn9O/7oDFLMFT371DdKXpdtdFs0LwiV9Ev7MPxgD aPyrj1XkjhrLm6dr/PYT8gQ10Ivl+R8bROFZBcus2tG8NWLh+ITWtrF0Oaht95N9vhlm uH74n1mBPH1YI2XSHwPZXA2dlLRgO7KBJ5bemfR9sCSsWkWJqV2SPu1Ct+GElyoghG14 iEeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=W6ewvr0FuRcnzy1sYvOX0rJHbQtOdV3pD/pLGGyIiQY=; fh=5adz2HQnpMCxK4ajp1zPSdYklcnBpfpcHzkKPXo9FXU=; b=c5IKMFVE+vXlxxa3UFltxbTP0edIrqlxVNJfbQENr7PQeA8NrEr9YRDr02dGFYseKK 3H+f1hCgJXhFrfnglhr/JjlRjeX54Kdh1V0RdbcdUnQiXCp8Ql0vtCbz1M6TZLHEnKKm w3zd+Cev+mN4nRPl5qFPjmVb4kAeg0mr+r4AdlC/E23UFvqJS7bLOfUMq2dmr2XK6gCB 4lw/LKg+ZHQ8LezN30Cfjk2Dicu+NJiIY/eIFKgu8limfyf37i7KkkuC5kjKc0fePPfv b5I+SCmZKsXMakumRSTkENALcZ5Obvaf7Fqz+2uyn6n3UOImTfhDQv+QLnmV7rSR80SX +FBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=YMgAsJVk; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=2+vO3fk7; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w19-20020a170902d11300b001bb21d502f0si3483418plw.76.2023.07.30.01.05.51; Sun, 30 Jul 2023 01:06:03 -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=@linutronix.de header.s=2020 header.b=YMgAsJVk; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=2+vO3fk7; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229644AbjG3HlJ (ORCPT + 99 others); Sun, 30 Jul 2023 03:41:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbjG3HlI (ORCPT ); Sun, 30 Jul 2023 03:41:08 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D0FF198E; Sun, 30 Jul 2023 00:41:06 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1690702863; 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=W6ewvr0FuRcnzy1sYvOX0rJHbQtOdV3pD/pLGGyIiQY=; b=YMgAsJVkeAQ/k4TtYhgWOi9bkYvqOMQ+kYKzry7qopWRF4X47YXCC7Qy6gJ6Lw0qoS1qr2 4ZgqlN0+3jV60xACrqVd7D8ISrN4s1o2/TjPYF3qDzybxyh61e2rknWIitqwwFi5JUTKzo etAcnlyPnyKDp0xgb+QbTITj+PtUIhmNrNKxxviN/GHNGadMn16gv4u7rQMeNHRJ5GBKTu 3w87BOkmCCGlqAd0RzEKMbVmpWYGrZ5vgOkPruSUW+So8+IFl0W8LHZB6P20xc/rRct+eK bWKmGXVuOod52Jdpfg/v7jZ+2uviCEzcKY6NVZFta2xwo4swF7N+rCfzzrw0Mg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1690702863; 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=W6ewvr0FuRcnzy1sYvOX0rJHbQtOdV3pD/pLGGyIiQY=; b=2+vO3fk74NOeBRY7+OMw/Co/dCVcOzO9c5JkJ7gmQmOGWOF+quzu0L5xhEPS0Z7Bnwsh8L bYMtr2WZS8qgvYBQ== To: "Michael Kelley (LINUX)" , LKML Cc: "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" , Guenter Roeck , "linux-hwmon@vger.kernel.org" , Jean Delvare , Huang Rui , Juergen Gross , Steve Wahl , Mike Travis , Dimitri Sivanich , Russ Anderson Subject: RE: [patch v2 28/38] x86/cpu: Provide an AMD/HYGON specific topology parser In-Reply-To: References: <20230728105650.565799744@linutronix.de> <20230728120931.226185847@linutronix.de> Date: Sun, 30 Jul 2023 09:41:02 +0200 Message-ID: <874jllq229.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,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 Sun, Jul 30 2023 at 05:20, Michael Kelley wrote: > From: Thomas Gleixner Sent: Friday, July 28, 2023 5:13 AM >> + /* >> + * If leaf 0xb is available, then SMT shift is set already. If not >> + * take it from ecx.threads_per_cpu and use topo_update_dom() as > > "take it from ebx.threads_per_cu and use topology_update_dom() as" > >> + * topology_set_dom() would propagate and overwrite the already >> + * propagated CORE level. >> + */ >> + if (!has_0xb) { >> + topology_update_dom(tscan, TOPO_SMT_DOMAIN, get_count_order(leaf.threads_per_cu), >> + leaf.threads_per_cu); > > leaf.threads_per_cu needs to be (leaf.threads_per_cu + 1) above. If > the core has two hyper-threads, the value of the threads_per_cu > field returned by CPUID is "1". > > All my Hyper-V VMs on AMD processors were coming up with only > one thread per core. The change fixes the problem. You are right. Thanks for tracking that down! tglx