From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AE36C81D07 for ; Fri, 4 Nov 2016 09:34:21 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6BD2C81231; Fri, 4 Nov 2016 16:34:23 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-156.phx2.redhat.com [10.3.116.156]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uA4GYJQ0024157; Fri, 4 Nov 2016 12:34:20 -0400 To: Paolo Bonzini , "Yao, Jiewen" , "Kinney, Michael D" References: <74D8A39837DF1E4DA445A8C0B3885C50386BE1E9@shsmsx102.ccr.corp.intel.com> <74D8A39837DF1E4DA445A8C0B3885C50386BE2A5@shsmsx102.ccr.corp.intel.com> <188de6ef-f0cb-a330-bfdf-0fe4eec503ba@redhat.com> <74D8A39837DF1E4DA445A8C0B3885C50386BE6A3@shsmsx102.ccr.corp.intel.com> <77f850d5-910e-302e-b578-7b46b55d6d3b@redhat.com> Cc: "Tian, Feng" , =?UTF-8?B?UmFkaW0gS3I/bcOhPw==?= , "edk2-devel@ml01.01.org" , "Fan, Jeff" , "Zeng, Star" From: Laszlo Ersek Message-ID: Date: Fri, 4 Nov 2016 17:34:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <77f850d5-910e-302e-b578-7b46b55d6d3b@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 04 Nov 2016 16:34:23 +0000 (UTC) Subject: Re: [PATCH 0/6] Enable SMM page level protection. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2016 16:34:21 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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 >>