[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [edk2] [PATCH RFC 0/7] OvmfPkg: make OVMF fully working with Xen



On Sun, Nov 17, 2013 at 02:24:35AM +0000, Wei Liu wrote:
> On Sun, Nov 17, 2013 at 2:11 AM, Jordan Justen <jljusten@xxxxxxxxx> wrote:
> > On Sat, Nov 16, 2013 at 5:31 PM, Wei Liu <liuw@xxxxxxxxx> wrote:
> >> On Sat, Nov 16, 2013 at 3:31 AM, Jordan Justen <jljusten@xxxxxxxxx> wrote:
> >>> When I try to boot this on qemu or kvm, it asserts because the video
> >>> framebuffer address is NULL.
> >>
> >> That's expected because of the hack. ;-)
> >
> > I see. But, I don't want to spend to much time considering it if is
> > not going to work with QEMU & KVM. :)
> >
> > I think a simpler approach would be to retain the enumeration and
> > figure out a memory range that works with Xen.
> >
> >>> On Fri, Nov 15, 2013 at 7:58 AM, Wei Liu <wei.liu2@xxxxxxxxxx> wrote:
> >>>> Wei Liu (7):
> >>>>   HACK: Use DeutPkg/PciRootBridgeNoEnumeration and
> >>>>     PciBusNoEnumerationDxe
> >>>
> >>> These modules would need to move to PcAtChipsetPkg in the non-hack 
> >>> version.
> >>>
> >>> Actually, it would be even better if the generic version of these
> >>> modules could be tweaked with a PCD to not do enumeration.
> >
> > My first choice would be to add a PCD to MdeModulePkg/MdeModulePkg.dec
> > that prevents enumeration in
> > MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf, and continue to use this
> > main driver. But, I don't know how easy those changes would be to
> > make. It probably would also mean changing
> > PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf by looking at the
> > same PCD. If some OVMF environments require enumeration, and some
> > don't then this would allow us to choose what will happen at runtime.
> >
> > The only other option would be to move those modules to PcAtChipset.
> > But, first we'd have to prove that QEMU & KVM are okay with using
> > those drivers.
> >
> 
> Would it be simpler if we have ifdef in .dsc file to detect predefine
> macros and choose different modules during build time?
> 

Hmm... Just realized that my other email wasn't subscribed to edk2-devel
so my mails didn't go through.

Here is my proposal, seems to be shorter and simpler than modifying
modules outside OVMF.

Wei.

---8<---
From 807e24daa8f96597f656e5e26aed1107acf0ae5c Mon Sep 17 00:00:00 2001
From: Wei Liu <wei.liu2@xxxxxxxxxx>
Date: Fri, 15 Nov 2013 15:30:12 +0000
Subject: [PATCH] OvmfPkg: disable PCI enumeration if Xen is enabled

PCI enumeration is done by Xen's hvmloader.

Luckily DuetPkg has code that skips enumeration, simply make use of it
saves us lots of coding.

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 OvmfPkg/OvmfPkgX64.dsc |    6 ++++++
 OvmfPkg/OvmfPkgX64.fdf |    6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 53945d0..4d5b25f 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -388,8 +388,14 @@
   UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf
   UefiCpuPkg/CpuDxe/CpuDxe.inf
   PcAtChipsetPkg/8254TimerDxe/8254Timer.inf
+!ifdef $(XEN_ENABLE)
+  DuetPkg/PciRootBridgeNoEnumerationDxe/PciRootBridgeNoEnumeration.inf
+  DuetPkg/PciBusNoEnumerationDxe/PciBusNoEnumeration.inf
+!else
   PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf
   MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
+!endif
+
   PcAtChipsetPkg/KbcResetDxe/Reset.inf
   MdeModulePkg/Universal/Metronome/Metronome.inf {
     <LibraryClasses>
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
index 751b94b..2c2f70a 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -259,8 +259,14 @@ INF  PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf
 INF  UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf
 INF  UefiCpuPkg/CpuDxe/CpuDxe.inf
 INF  PcAtChipsetPkg/8254TimerDxe/8254Timer.inf
+!ifdef $(XEN_ENABLE)
+INF   DuetPkg/PciRootBridgeNoEnumerationDxe/PciRootBridgeNoEnumeration.inf
+INF   DuetPkg/PciBusNoEnumerationDxe/PciBusNoEnumeration.inf
+!else
 INF  PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf
 INF  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
+!endif
+
 INF  PcAtChipsetPkg/KbcResetDxe/Reset.inf
 INF  MdeModulePkg/Universal/Metronome/Metronome.inf
 INF  PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf
-- 
1.7.10.4


> Wei.
> 
> > -Jordan
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.