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 DD8E9D80FDE for ; Tue, 17 Oct 2023 09:12:58 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=wUTM2T4ud+05Pd0VTfFNyn0VrHZZ3r0vvE/Bj03h9DI=; 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=1697533977; v=1; b=Hp6iZ4w4QlSstqI8y5cOuMxcvT9y+BDhiwV4SdYFW0dMWUb+2ybmnta+cZSZhfWnTDYd4BCp 0aEQhtSHqUac5WL7O2zFF4C1pYdHLSfVZYWNZPJsdH8Rdk0ItmCpPp9Qonu4GTLdFz+SsMwxiYe SssuZh8evBfSWrKXzwrSvDA4= X-Received: by 127.0.0.2 with SMTP id EFskYY7687511xAEu1HHyZYk; Tue, 17 Oct 2023 02:12:57 -0700 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.web10.203309.1697533976957264994 for ; Tue, 17 Oct 2023 02:12:57 -0700 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-379-UMeBt5OXNR6-t4O9Pm78Bw-1; Tue, 17 Oct 2023 05:12:52 -0400 X-MC-Unique: UMeBt5OXNR6-t4O9Pm78Bw-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ADC4681D9EC; Tue, 17 Oct 2023 09:12:51 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.193.174]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8179FC15BBC; Tue, 17 Oct 2023 09:12:51 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 49E261800DFD; Tue, 17 Oct 2023 11:12:50 +0200 (CEST) Date: Tue, 17 Oct 2023 11:12:50 +0200 From: "Gerd Hoffmann" To: Laszlo Ersek Cc: devel@edk2.groups.io, Rahul Kumar , Ray Ni , Eric Dong , Oliver Steffen Subject: Re: [edk2-devel] [PATCH 1/1] UefiCpuPkg/BaseXApicX2ApicLib: fix CPUID_V2_EXTENDED_TOPOLOGY detection Message-ID: <6hjo6bytkxi7cjinpdjggwri2bkci3vom6smryvvdlcewjpuxc@lw72dvlc2euv> References: <20231011100654.3313309-1-kraxel@redhat.com> <96d0233f-035d-628a-f2d4-c8456937650a@redhat.com> MIME-Version: 1.0 In-Reply-To: <96d0233f-035d-628a-f2d4-c8456937650a@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 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: ExosOAEGt7vkHOFj7olCA2Sfx7686176AA= 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=Hp6iZ4w4; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none) Hi, > This is a terrible *organization* bug in the Intel SDM. [ ... ] > So, keep scrolling... a whopping 14 pages later, on page 850, we find: > > INPUT EAX = 1FH: Returns V2 Extended Topology Information > > When CPUID executes with EAX set to 1FH, the processor returns > information about extended topology enumeration data. Software > must detect the presence of CPUID leaf 1FH by verifying (a) the > highest leaf index supported by CPUID is >= 1FH, and (b) > CPUID.1FH:EBX[15:0] reports a non-zero value. See Table 3-8. Wow. Thanks for finding that well hidden reference. An almost identical worded paragraph exists for "INPUT EAX = 0BH: Returns Extended Topology Information". > The patch is mostly good, but the commit message can be improved. We > shouldn't base the reasoning on the existent EBX check in > GetProcessorLocationByApicId(). Instead, we should quote this specific > passage from the SDM. Sure. I didn't notice all the notes at the bottom of the table, so that comment plus the fact that the 0x0b and 0x1f leafs are modeled in a very similar way was the best reference I had at hand. > Furthermore, it's not the "ExtendedTopologyEbx.Uint32" union field that > we should compare against zero; we should compare > "ExtendedTopologyEbx.Bits.LogicalProcessors" -- that's what the spec says. OK. take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109668): https://edk2.groups.io/g/devel/message/109668 Mute This Topic: https://groups.io/mt/101893551/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-