From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web10.8510.1600849879135629568 for ; Wed, 23 Sep 2020 01:31:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a8n+ItkM; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600849878; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EU9BzjpyN/aig1jtCgpQ5pR3qlz4QtgQ5cL9vrJy1dY=; b=a8n+ItkMTlpQIK5/+czVaYJiVV2/HM8Pr35HIG6MjojCHcxiOMOYQdXFu+vbLVhs8bGDDe Q6ApO8AGL1+7iq6vSihuBHtinn20+M07K2MvXJ6knovk9NXBJvyivAtxmz8rUd5rcZsgJt 4dIWzr3HfEExn3815xHmwIkjz5CtjRo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-548-Ggvm1Z2UP-6sLyZY6QJBgQ-1; Wed, 23 Sep 2020 04:31:14 -0400 X-MC-Unique: Ggvm1Z2UP-6sLyZY6QJBgQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 22255802B76; Wed, 23 Sep 2020 08:31:13 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-233.ams2.redhat.com [10.36.112.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 89F015C1DC; Wed, 23 Sep 2020 08:31:11 +0000 (UTC) Subject: Re: [PATCH 1/1] UefiCpuPkg/MpInitLib: Reduce reset vector memory pressure From: "Laszlo Ersek" To: Tom Lendacky , devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar , Brijesh Singh , Garrett Kirkendall References: <22eb2625-6ece-6f1d-43b2-4ca6aad54b9c@redhat.com> Message-ID: <58ed06b7-dc6e-61ab-1e82-ec14d10a700e@redhat.com> Date: Wed, 23 Sep 2020 10:31:10 +0200 MIME-Version: 1.0 In-Reply-To: <22eb2625-6ece-6f1d-43b2-4ca6aad54b9c@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US On 09/23/20 10:14, Laszlo Ersek wrote: > (3) Even better... can you modify GetApResetVectorSize() to take > &CpuMpData rather than &CpuMpData->AddressMap, and then check > CpuMpData->SevEsIsEnabled? > > Hmmm, wait, that's not really simple, as we call GetApResetVectorSize() > from MpInitLibInitialize() too, way before we set > CpuMpData->SevEsIsEnabled from the PCD. > > So I guess we should pass a dedicated BOOLEAN parameter to > GetApResetVectorSize(), called "SevEsIsEnabled". At the call site in > MpInitLibInitialize(), we should pass in the PCD's value. At the call > site in AllocateResetVector(), we should pass in > CpuMpData->SevEsIsEnabled. > > The reason I'm suggesting (3) is that I don't feel comfortable with > checking dynamic PCDs outside of entry point functions / initialization > functions. You know what, never mind (3) -- I've just realized that PcdCpuMaxLogicalProcessorNumber may be a dynamic PCD too. It might require a lot of work to restrict all dynamic PCD accesses to the init function only, and I couldn't necessarily justify all that work at the moment (for myself or for anyone else). So please consider (1), (2) and (4). Thanks! Laszlo