On 11/26/14 15:48, Laszlo Ersek wrote:
> Hi,
> 
> On 11/13/14 19:42, Jordan Justen wrote:
>> On 2014-11-06 17:23:01, Fan, Jeff wrote:
>>> Chen,
>>>
>>> Thanks your contribution. I will check-in your patch if there is no
>>> further comments from other guys.
>>>
>>> Reviewed-by: Jeff Fan <jeff....@intel.com>
>>
>> Chen,
>>
>> I committed your series (r16345-r16371) for Jeff (to preserve the
>> separate patches).
>>
>> Thanks for all your work on this!
>>
>> Let me know if you are interested in working on some follow up MP
>> tasks. (I have 2 ideas. :)
>>
>> Jeff,
>>
>> Thanks for your review of this big series!
> 
> I believe this series introduces an interesting performance regression,
> at least when it is part of OVMF and runs on qemu/kvm.
> 
> Now the APs seem to be spinning infinitely, for example while the user
> is in the UEFI Setup utility. Before, there used to be no CPU load to
> speak of, while the user was in the UEFI Setup utility.
> 
> The useless spinning is quite bad:
> - it hogs physical CPUs on the virtualization host for no good reason,
> - it wastes electricity (problem for both laptops and data centers).
> 
> Can we make this feature dependent on a Feature PCD? At the moment I
> can't think of any workload I would run on the APs during runtime.

No action needed; I realized there was a PCD already that allowed the
user to control this feature at build time -- I solved it for myself
with the attached patch.

Thank you
Laszlo

From 6ac0512132dc842f8156191c557802f815c983dd Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <ler...@redhat.com>
Date: Wed, 26 Nov 2014 16:32:06 +0100
Subject: [PATCH] OvmfPkg: disable multi-processor support for boot time

We have no useful workload for APs, so let's not start them up, because
they would spin indefinitely until ExitBootServices().

Setting gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber to 1
causes InitializeMpSupport() in "UefiCpuPkg/CpuDxe/CpuMp.c" to return
early.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <ler...@redhat.com>
---
 OvmfPkg/OvmfPkgIa32.dsc    | 4 ++++
 OvmfPkg/OvmfPkgIa32X64.dsc | 4 ++++
 OvmfPkg/OvmfPkgX64.dsc     | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 6598102..39763b1 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -329,6 +329,10 @@
   # IRQs 5, 9, 10, 11 are level-triggered
   gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeEdgeLevel|0x0E20
 
+  # We have no useful workload for APs, so let's not start them up, because
+  # they would spin indefinitely until ExitBootServices().
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|1
+
 ################################################################################
 #
 # Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index 4de961f..a363ed3 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -335,6 +335,10 @@
   # IRQs 5, 9, 10, 11 are level-triggered
   gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeEdgeLevel|0x0E20
 
+  # We have no useful workload for APs, so let's not start them up, because
+  # they would spin indefinitely until ExitBootServices().
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|1
+
 ################################################################################
 #
 # Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index eb5bce8..e1b8fce 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -356,6 +356,10 @@
   # IRQs 5, 9, 10, 11 are level-triggered
   gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeEdgeLevel|0x0E20
 
+  # We have no useful workload for APs, so let's not start them up, because
+  # they would spin indefinitely until ExitBootServices().
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|1
+
 ################################################################################
 #
 # Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform
-- 
1.8.3.1

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to