> > >> + Segment0 = 0; > >> + Segment0Pages = 1; > >> + Status = gBS->AllocatePages (AllocateAddress, EfiReservedMemoryType, > >> + Segment0Pages, &Segment0); > >> + if (EFI_ERROR (Status)) { > >> + goto RestorePam1; > >> + } > > > > If CSM is enabled, we will fail to allocate, right?
Allocation at LegacyBiosInstall() function will fail, but no one cares about it and MemoryAddress remains uninitialized. This is because uefi video driver is being initialized earlier. > It's not clear what you mean by > > If the CSM is enabled > > > In addition, for v2 I'm thinking about changing the memory allocation > type (of the page at 0) from EfiReservedMemoryType back to > EfiBootServicesCode (same as in your int10-stub branch). The argument > goes like this: > > 1. correctly written UEFI OSes (ie. all except Windows 2008 R2) don't > care about the Int10h entry, hence they shouldn't lose a page forever > (EfiReservedMemoryType does that) Sorry for the noise, but I want to add some notes. 1. I'm curious why do you call w2k8 driver buggy. According to this document http://technet.microsoft.com/en-us/library/hh824898.aspx "Windows® 7, Windows Vista® with Service Pack 1 (SP1), Windows Server® 2008 R2 and Windows Server® 2008 Support UEFI 2.0 or later on 64-bit systems. They also support BIOS-based PCs, and UEFI-based PCs running in legacy BIOS-compatibility mode. Support on Class 2 systems running in legacy BIOS-compatibility mode by using a CSM, so they can use the legacy BIOS INT10 features. Are not supported on Class 3 systems, because these operating systems assume the presence of legacy BIOS INT10 support in the firmware, which is not available in a Class-3 UEFI implementation." it is expected behavior. It is also described in "UEFI Support and Requirements for Windows Operating Systems" > 2.a. "boot services code" vs. "reserved" makes no difference before > ExitBootServices() -- both types protect the IVT from other boot-time > allocations. > Here is my second note. I vote for EfiACPIMemoryNVS. It is not clear and violates ACPI spec, but it is true. Have you tried to run W7 or W2K8 R2 in SMP mode? > 2.b. Windows 2008 R2 accesses the IVT regardless of the type of the > memory allocation that we cover it with. It will certainly not free and > then *overwrite* the page at zero (after we've covered it with "boot > services code"), because then it couldn't fetch the Int10h entry from it > (for emulation). > > IOW, OSes different from Windows 2008 R2 don't care at all, hence they > shouldn't be penalized; and Windows 2008 R2 doesn't overwrite the IVT > anyway (at runtime either) before fetching the Int10h entry, so we don't > need to protect Win2k8r2 "from itself". We need to protect Windows from itself... There is a some Microsoft Hyper-V specific, that causes page 0 releasing in case of SMP kernel and Hyper-V feature enabled. Windows 6.1 SMP kernels do not work even in CSM mode. > Hence we should only protect > (allocate) this page from other UEFI components. Thanks. ------------------------------------------------------------------------------ "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel