OvmfPkg: Work around issue seen with kvm + grub2 (efi)

When OVMF is run with kvm and grub2 (efi), an exception
occurs when mmx/sse registers are accessed.

As a work around, this change eliminates firmware usage
of these register types.

First, only the BaseMemoryLib implementation
MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
is used.

Second, the GCC compiler is passes the additional
'-mno-mmx -mno-sse' parameters.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11218 6f19259b-4bc3-4df7-8a09-765794883524
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 4fbbce7..d29ed07 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -33,6 +33,7 @@
   GCC:RELEASE_*_*_CC_FLAGS             = -DMDEPKG_NDEBUG

   INTEL:RELEASE_*_*_CC_FLAGS           = /D MDEPKG_NDEBUG

   MSFT:RELEASE_*_*_CC_FLAGS            = /D MDEPKG_NDEBUG

+  GCC:*_*_*_CC_FLAGS                   = -mno-mmx -mno-sse

 

 ################################################################################

 #

@@ -51,7 +52,7 @@
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf

   TimerLib|OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.inf

   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf

-  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf

+  BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf

   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf

   SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf

   CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf

@@ -111,7 +112,6 @@
   MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf

 

 [LibraryClasses.common.PEI_CORE]

-  BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf

   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf

   PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf

   PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf

@@ -124,7 +124,6 @@
   PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf

 

 [LibraryClasses.common.PEIM]

-  BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf

   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf

   PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf

   PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf

@@ -142,7 +141,6 @@
 !endif

 

 [LibraryClasses.common.DXE_CORE]

-  BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf

   HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf

   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf

   MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf

@@ -155,7 +153,6 @@
 !endif

 

 [LibraryClasses.common.DXE_RUNTIME_DRIVER]

-  BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf

   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf

   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf

   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf

@@ -166,7 +163,6 @@
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf

 

 [LibraryClasses.common.UEFI_DRIVER]

-  BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf

   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf

   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf

   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf

@@ -176,7 +172,6 @@
   UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf

 

 [LibraryClasses.common.DXE_DRIVER]

-  BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf

   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf

   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf

   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf

@@ -191,7 +186,6 @@
   PlatformBdsLib|OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf

 

 [LibraryClasses.common.UEFI_APPLICATION]

-  BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf

   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf

   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf

   DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf