public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "Tian, Feng" <feng.tian@intel.com>,
	"Radim Kr?má?" <rkrcmar@redhat.com>,
	"edk2-devel@ml01.01.org" <edk2-devel@ml01.01.org>,
	"Fan, Jeff" <jeff.fan@intel.com>,
	"Zeng, Star" <star.zeng@intel.com>
Subject: Re: [PATCH 0/6] Enable SMM page level protection.
Date: Fri, 4 Nov 2016 17:34:19 +0100	[thread overview]
Message-ID: <aa8751b9-aedd-25ca-6a24-3b4563e76251@redhat.com> (raw)
In-Reply-To: <77f850d5-910e-302e-b578-7b46b55d6d3b@redhat.com>

On 11/04/16 14:50, Paolo Bonzini wrote:
> 
> 
> On 04/11/2016 14:28, Yao, Jiewen wrote:
>> I tried below way. But it does not help too much. It still takes more
>> than 1 minutes to boot with SMP=8.
>>
>>   SendSmiIpiAllExcludingSelf ();
>>   IoWrite8 (ICH9_APM_STS, DataPort    == NULL ? 0 : *DataPort);
>>   IoWrite8 (ICH9_APM_CNT, CommandPort == NULL ? 0 : *CommandPort);
>>
>> I also tried to reduce the timeout PCD to:
>>
>>   gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout|1000
>>
>> However, I find CPU-2 is still missing.
>>
>> Maybe it is caused by QEMU emulate AP in serial mode, not parallel mode.
> 
> Yeah, that's possible without KVM.  Do you issue a PAUSE instruction in
> the spin loops?  That could help.

There's a BaseLib helper function for that BTW:

/**
  Requests CPU to pause for a short period of time.

  Requests CPU to pause for a short period of time. Typically used in MP
  systems to prevent memory starvation while waiting for a spin lock.

**/
VOID
EFIAPI
CpuPause (
  VOID
  );


The implementation in "MdePkg/Library/BaseLib/X64/GccInline.c" is

  __asm__ __volatile__ ("pause");

Thanks
Laszlo


>> I think it might be best choice to set PcdCpuSmmSyncMode|0x1
>>
>> It also helps cover a very corner case in SMM. J
>>



  reply	other threads:[~2016-11-04 16:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-04  2:49 [PATCH 0/6] Enable SMM page level protection Kinney, Michael D
2016-11-04  2:55 ` Yao, Jiewen
2016-11-04  3:05   ` Kinney, Michael D
2016-11-04  3:12     ` Kinney, Michael D
2016-11-04  3:20       ` Yao, Jiewen
2016-11-04 11:34         ` Paolo Bonzini
2016-11-04 13:28           ` Yao, Jiewen
2016-11-04 13:50             ` Paolo Bonzini
2016-11-04 16:34               ` Laszlo Ersek [this message]
2016-11-04  3:14     ` Yao, Jiewen
2016-11-04 16:28       ` Laszlo Ersek
  -- strict thread matches above, loose matches on Subject: below --
2016-11-03  6:53 Jiewen Yao
2016-11-03  6:55 ` Yao, Jiewen
2016-11-03 21:43 ` Laszlo Ersek
2016-11-03 23:51   ` Yao, Jiewen
2016-11-04  0:09     ` Kinney, Michael D
2016-11-04  1:15       ` Yao, Jiewen
2016-11-04 16:15         ` Laszlo Ersek
2016-11-04 15:22     ` Laszlo Ersek
2016-11-04 15:29       ` Paolo Bonzini
2016-11-04 17:36         ` Laszlo Ersek
2016-11-04  9:35   ` Yao, Jiewen
2016-11-04 15:23     ` Laszlo Ersek

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=aa8751b9-aedd-25ca-6a24-3b4563e76251@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