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 2F706C001E0 for ; Sun, 30 Jul 2023 07:41:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229620AbjG3HlJ (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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