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 CDCBDC0015E for ; Fri, 11 Aug 2023 17:11:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235908AbjHKRLY (ORCPT ); Fri, 11 Aug 2023 13:11:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234215AbjHKRLV (ORCPT ); Fri, 11 Aug 2023 13:11:21 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04CC130DC for ; Fri, 11 Aug 2023 10:11:08 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1691773865; 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=JwyIkaKnmged+6iD5cEH4DiyqcAjZzg85lmaqTOjsCM=; b=xPk6eNzOBlGDBWMWdONIUP8oaVOw9O0gtZGBdxu+2qTUp2QEjL1jxazsgQ1EwSpkEm+8Tp erdcIwzoDhwVdPh0MDPymdm6RUXFYfSEmmlEcrF++o6vY72YpHxULrFzVa30DKMiZgD/1J 5XqwVwlNJM8yoq36q7nk1hNf0YGIExb/1vCmxJCV2fFvVpSAp8V8UNB3HxVGchiVbf6eY2 LlqDEDQIzCPaBjukGuivT7iF2Qwa7fg88SW+CgP7S0gwGIOnobBvken5MMsdlvjL3T+wjV 1rFBUPzSha7D/clqmo32YtBqXurxYxkF1q09xuRZfFjl3u9mXFVcolRZSayaGw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1691773865; 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=JwyIkaKnmged+6iD5cEH4DiyqcAjZzg85lmaqTOjsCM=; b=Lj3+5TtBev8QyRTlUSTewJWtY5QIpCm1lvYgcTPPpJ2TeeKTD4g1UahuunSQHJWgvlaKhI +EzPuDumVD+CuNBw== To: Pu Wen , LKML Cc: x86@kernel.org, Tom Lendacky , Andrew Cooper , Arjan van de Ven , Huang Rui , Juergen Gross , Dimitri Sivanich , Michael Kelley , Wei Liu Subject: Re: [patch V3a 30/40] x86/cpu: Provide an AMD/HYGON specific topology parser In-Reply-To: References: <20230802101635.459108805@linutronix.de> <20230802101934.418143974@linutronix.de> <87il9xjk95.ffs@tglx> Date: Fri, 11 Aug 2023 19:11:05 +0200 Message-ID: <87jzu1h5cm.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 11 2023 at 20:58, Pu Wen wrote: > On 2023/8/3 3:51, Thomas Gleixner wrote: >> + if (tscan->c->x86_vendor == X86_VENDOR_AMD) { >> + if (tscan->c->x86 == 0x15) >> + tscan->c->topo.cu_id = leaf.cuid; >> + >> + cacheinfo_amd_init_llc_id(tscan->c, leaf.nodeid); >> + } else { >> + /* >> + * Package ID is ApicId[6..] on Hygon CPUs. See commit >> + * e0ceeae708ce for explanation. The topology info is >> + * screwed up: The package shift is always 6 and the node >> + * ID is bit [4:5]. Don't touch the latter without >> + * confirmation from the Hygon developers. >> + */ >> + topology_set_dom(tscan, TOPO_CORE_DOMAIN, 6, tscan->dom_ncpus[TOPO_CORE_DOMAIN]); > > Hygon updated CPUs will not always shift 6, and shift 6 is not good for > running guests. > So suggest to modify like this: > if (!boot_cpu_has(X86_FEATURE_HYPERVISOR) && tscan->c->x86_model <= > 0x3) > topology_set_dom(tscan, TOPO_CORE_DOMAIN, 6, > tscan->dom_ncpus[TOPO_CORE_DOMAIN]); This is exactly what the existing code does today. Can you please send a delta patch on top of this with a proper explanation? Thanks, tglx