From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 75786AC119C for ; Tue, 16 Jan 2024 09:41:17 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Jdl7fpEnBiUFUtMEM1YEYxuR183zdG3dyQ4r3NwzhvY=; c=relaxed/simple; d=groups.io; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Disposition; s=20140610; t=1705398076; v=1; b=f9PmqzIW49GHz30PpL9QbUKNW6O49EVkWOKrUhfhxLa/peSKh87ELCibF9lWp/HTaemDrepk skPHtOTRU9vGAHNTQakVYbsuRFP1JpgzfxkxBFSeyMWDNkde20NEkI0fcyurYaqGDTazxdC9j+x B1qwNsWRSN/EO6hl0Iu62/9k= X-Received: by 127.0.0.2 with SMTP id 8OunYY7687511xoERWGv7eKy; Tue, 16 Jan 2024 01:41:16 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.9548.1705398075596351776 for ; Tue, 16 Jan 2024 01:41:15 -0800 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-287-DDtBLvCzNGik3FGJOgOlbw-1; Tue, 16 Jan 2024 04:41:10 -0500 X-MC-Unique: DDtBLvCzNGik3FGJOgOlbw-1 X-Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8BBDB3C000BA; Tue, 16 Jan 2024 09:41:10 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.193.155]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6926D40C6EB9; Tue, 16 Jan 2024 09:41:10 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 96F511800987; Tue, 16 Jan 2024 10:41:07 +0100 (CET) Date: Tue, 16 Jan 2024 10:41:07 +0100 From: "Gerd Hoffmann" To: Abdul Lateef Attar Cc: devel@edk2.groups.io, Abdul Lateef Attar , Ray Ni , Rahul Kumar Subject: Re: [edk2-devel] [PATCH v1 2/2] UefiCpuPkg/BaseXApicX2ApicLib: Implements AMD extended cpu topology Message-ID: References: <030184fe0cac804e7f3c98569ebedaf67c71fc50.1705387772.git.AbdulLateef.Attar@amd.com> MIME-Version: 1.0 In-Reply-To: <030184fe0cac804e7f3c98569ebedaf67c71fc50.1705387772.git.AbdulLateef.Attar@amd.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,kraxel@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: LRzX5temr2aNSGe0r7yy9Zdfx7686176AA= Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=f9PmqzIW; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On Tue, Jan 16, 2024 at 12:31:21PM +0530, Abdul Lateef Attar wrote: > From: Abdul Lateef Attar > > This patch adds support for AMD's new extended topology. > If processor supports CPUID 80000026 leaf then obtain > the topology information using new method. > + /// Check if extended toplogy supported > + AsmCpuid (CPUID_EXTENDED_FUNCTION, &MaxExtendedCpuIdIndex, NULL, NULL, NULL); > + if (MaxExtendedCpuIdIndex < AMD_CPUID_EXTENDED_TOPOLOGY) { > + GetProcessorLocationByApicId (InitialApicId, Package, Core, Thread); > + return; > + } Sure this is correct? On Intel processors checking MaxExtendedCpuIdIndex alone is not enough, see commit 170d4ce8e90a ("UefiCpuPkg/BaseXApicX2ApicLib: fix CPUID_V2_EXTENDED_TOPOLOGY detection") Especially in virtual machines it can happen that the vCPU supports extended cpuid leaf N but does not support N-1, so checking MaxExtendedCpuIdIndex alone looks rather fragile to me. take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113882): https://edk2.groups.io/g/devel/message/113882 Mute This Topic: https://groups.io/mt/103757657/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-