public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: "Kinney, Michael D" <michael.d.kinney@intel.com>,
	"Ni, Ray" <ray.ni@intel.com>, "Zeng, Star" <star.zeng@intel.com>,
	"Wu, Hao A" <hao.a.wu@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Dong, Eric" <eric.dong@intel.com>,
	"Brian J . Johnson" <brian.johnson@hpe.com>
Subject: Re: [edk2-devel] [PATCH v2] UefiCpuPkg/MpInitLib DXE: Add PCD to control AP status check interval
Date: Wed, 25 Mar 2020 02:37:00 +0100	[thread overview]
Message-ID: <8243c17d-25dc-d91a-bd28-e4382d7455b2@redhat.com> (raw)
In-Reply-To: <E92EE9817A31E24EB0585FDF735412F5B9EEE2BC@ORSMSX113.amr.corp.intel.com>

On 03/24/20 16:59, Kinney, Michael D wrote:
> How was the milliseconds units selected?

I suggested msecs for continuity with the pre-patch unit:

#define  AP_CHECK_INTERVAL     (EFI_TIMER_PERIOD_MILLISECONDS (100))

> We have other PCDs that provide timer intervals in 
> 100ns unit and my microseconds.  I would prefer we
> be consistent so platform developers do not have
> to keep track of so many different units for time
> intervals.

Sounds OK to me.

What's more: your suggestion points at a bug in the v2 patch. The patch replaces the argument for the gBS->SetTimer() service's "TriggerTime" parameter, namely:

   Status = gBS->SetTimer (
                   mCheckAllApsEvent,
                   TimerPeriodic,
-                  AP_CHECK_INTERVAL
+                  PcdGet64 (PcdCpuApStatusCheckInterval)
                   );

But that parameter is taken in units of 100ns, per spec.

Pre-patch, AP_CHECK_INTERVAL takes that into account:

#define EFI_TIMER_PERIOD_MILLISECONDS(Milliseconds) MultU64x32((UINT64)(Milliseconds), 10000)

but post-patch, the PCD does not:

+  gUefiCpuPkgTokenSpaceGuid.PcdCpuApStatusCheckInterval|100|UINT64|0x0000001E

So this patch would shorten the interval by a divisor of 10000 at once, namely from (100 * 10000) * 100ns, to 100 * 100ns.

The fix is to update the PCD comments according to your remark, and to change the default PCD value to (100 * 10000) = 1000,000.

Thanks,
Laszlo


  parent reply	other threads:[~2020-03-25  1:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24  6:33 [PATCH v2] UefiCpuPkg/MpInitLib DXE: Add PCD to control AP status check interval Wu, Hao A
2020-03-24  7:01 ` [edk2-devel] " Zeng, Star
2020-03-24  7:11   ` Wu, Hao A
2020-03-24  7:29     ` Zeng, Star
2020-03-24  7:52       ` Ni, Ray
2020-03-24 15:59         ` Michael D Kinney
2020-03-25  0:46           ` Ni, Ray
2020-03-25  1:24             ` Wu, Hao A
2020-03-25 16:33               ` Laszlo Ersek
2020-03-25  1:37           ` Laszlo Ersek [this message]
2020-03-25  1:50             ` Wu, Hao A

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8243c17d-25dc-d91a-bd28-e4382d7455b2@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox