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 ED3A17803D8 for ; Mon, 19 Feb 2024 09:51:14 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=GNvqlTL0trZr4TgyM2jETPFDTXETp1QXGDPAQFu/PtY=; 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=1708336273; v=1; b=RE/VFgpe1AC/a0Fi1s/0nC93XIduX+CLxJvt7xwrcwwJ2unzG9KLpiq8Q35oDmh+FrTh/WWF 9kXNa79fEYbBAzdZIzwxRWg3XE7Z1auqywbbCESVMWpRuC2AB6hUB40e3vazBqfXI7rzlAOvQSJ Fmza4rSIwgjvy9XIkriO/a+E= X-Received: by 127.0.0.2 with SMTP id 1FWBYY7687511xJnCpJRlQ9I; Mon, 19 Feb 2024 01:51:13 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.38297.1708336272786246796 for ; Mon, 19 Feb 2024 01:51:12 -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-74-9p7H3ab-N8-uFbGoIMInNw-1; Mon, 19 Feb 2024 04:51:10 -0500 X-MC-Unique: 9p7H3ab-N8-uFbGoIMInNw-1 X-Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 0B2EB3814E8B; Mon, 19 Feb 2024 09:51:10 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.193.175]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DC2D9492BE2; Mon, 19 Feb 2024 09:51:09 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C5DD11800DCF; Mon, 19 Feb 2024 10:51:08 +0100 (CET) Date: Mon, 19 Feb 2024 10:51:08 +0100 From: "Gerd Hoffmann" To: "Ni, Ray" Cc: "devel@edk2.groups.io" , Oliver Steffen , Laszlo Ersek , "Kumar, Rahul R" Subject: Re: [edk2-devel] [PATCH 1/5] UefiCpuPkg/MpInitLib: Add ProcessorIndex argument to GetMpHandOffHob() Message-ID: References: <20240215093149.251319-1-kraxel@redhat.com> <20240215093149.251319-2-kraxel@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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: igYqEJdfwSu2OJvxMlPTwep8x7686176AA= 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="RE/VFgpe"; 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 Mon, Feb 19, 2024 at 02:34:42AM +0000, Ni, Ray wrote: > > + for (GuidHob = GetFirstGuidHob (&mMpHandOffGuid); > > + GuidHob != NULL; > > + GuidHob = GetNextGuidHob (&mMpHandOffGuid, GET_NEXT_HOB > > (GuidHob))) > > + { > > MpHandOff = (MP_HAND_OFF *)GET_GUID_HOB_DATA (GuidHob); > > + if (MpHandOff->ProcessorIndex == ProcessorIndex) { > > + return MpHandOff; > > + } > > Gerd, > The code is doing correctly but I have concerns about the performance impact. > > With the prototype GetMpHandOffHob(), callers call it multiple times to enumerate all HOB instances. > > But every call is a HOB list enumeration from top of the HOB list which may be slow in a platform > that contains lots of HOB items and the MpHandOff HOB instances happen to be in the very bottom. > > How about add another parameter "HobStart" to GetMpHandOffHob()? So that only the first call to > GetMpHandOffHob() is a HOB list enumeration from top, latter calls start from the next HOB of the previous > found MpHandOff HOB instance. That will only work if the HOBs are returned in ProcessorIndex order. That happens to be the case in my testing; the HOBs are returned in the same order they are created by patch #5 of this series. Is that behavior guaranteed? MdePkg/Include/Library/HobLib.h doesn't say anything about the ordering. take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115588): https://edk2.groups.io/g/devel/message/115588 Mute This Topic: https://groups.io/mt/104369841/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-