public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Jiaxin" <jiaxin.wu@intel.com>
To: "Ni, Ray" <ray.ni@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Dong, Eric" <eric.dong@intel.com>
Subject: Re: [PATCH v1] [PATCH v1] UefiCpuPkg: Check SMM Delayed/Blocked AP Count to decide all CPUs in SMI or not
Date: Wed, 30 Nov 2022 03:29:57 +0000	[thread overview]
Message-ID: <MN0PR11MB6158E5726DD2B7F6A7866745FE159@MN0PR11MB6158.namprd11.prod.outlook.com> (raw)
In-Reply-To: <MWHPR11MB1631B6B87DA6C004D093AC2C8C129@MWHPR11MB1631.namprd11.prod.outlook.com>

Thanks Ray. I added the comments in patch v2 (https://edk2.groups.io/g/devel/message/96722) to clarify the expected value of "SmmRegSmmEnable" & "SmmRegSmmDelayed" & "SmmRegSmmBlocked" returned from SmmCpuFeaturesLib. That can answer the questions.

Due to more core count increasement, it's hard to reflect all APs
state via AP bitvector support in the register. Actually, SMM CPU
driver doesn't need to check each AP state to know all CPUs in SMI
or not, one alternative method is to check the SMM Delayed & Blocked
AP Count number:

APs in SMI + Blocked Count + Disabled Count >= All supported Aps
(code comments explained why can be > All supported Aps)

With above change, the returned value of "SmmRegSmmEnable" &
"SmmRegSmmDelayed" & "SmmRegSmmBlocked" from SmmCpuFeaturesLib
should be the AP count number within the existing CPU package.

For register that return the bitvector state, require
SmmCpuFeaturesGetSmmRegister() returns count number of all bit per
logical processor within the same package.

For register that return the AP count, require
SmmCpuFeaturesGetSmmRegister() returns the register value directly. 

Thanks,
Jiaxin 

> -----Original Message-----
> From: Ni, Ray <ray.ni@intel.com>
> Sent: Tuesday, November 29, 2022 5:11 PM
> To: Wu, Jiaxin <jiaxin.wu@intel.com>; devel@edk2.groups.io
> Cc: Dong, Eric <eric.dong@intel.com>
> Subject: RE: [PATCH v1] [PATCH v1] UefiCpuPkg: Check SMM
> Delayed/Blocked AP Count to decide all CPUs in SMI or not
> 
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4173
> >
> > The blocked register might return the counter instead of bitvector. This
> > request
> > is to update the code to handle the case by checking SMM
> Delayed/Blocked
> > AP Count
> > to decide all CPUs in SMI or not.
> 
> The code change actually assumes the SmmRegSmmBlocked,
> SmmRegSmmDelayed
> and SmmRegSmmEnable registers return the number of threads that are in
> blocked, delayed or disabled state.
> Can you provide suggestions regarding how to change those close source
> CpuSmmFeaturesLib
> implementation which still returns the bitmap value instead of count in the
> commit message?
> 
> 
> > +UINT32                       *mPackageBspInfo = NULL;
> 
> The variable name is confusing. Can you rename it to
> "mPackageFirstThreadIndex"?

      reply	other threads:[~2022-11-30  3:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29  8:18 [PATCH v1] [PATCH v1] UefiCpuPkg: Check SMM Delayed/Blocked AP Count to decide all CPUs in SMI or not Wu, Jiaxin
2022-11-29  9:11 ` Ni, Ray
2022-11-30  3:29   ` Wu, Jiaxin [this message]

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=MN0PR11MB6158E5726DD2B7F6A7866745FE159@MN0PR11MB6158.namprd11.prod.outlook.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