Received: from list by lists.gnu.org with archive (Exim 4.71) id 1RiAxp-0007KK-Tp for mharc-grub-devel@gnu.org; Tue, 03 Jan 2012 15:28:05 -0500 Received: from eggs.gnu.org ([140.186.70.92]:39234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RiAxm-0007G5-Mp for grub-devel@gnu.org; Tue, 03 Jan 2012 15:28:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RiAxk-00079c-Fv for grub-devel@gnu.org; Tue, 03 Jan 2012 15:28:02 -0500 Received: from rcsinet15.oracle.com ([148.87.113.117]:28810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RiAxk-00079W-AR for grub-devel@gnu.org; Tue, 03 Jan 2012 15:28:00 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id q03KRtJ6014497 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 3 Jan 2012 20:27:56 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q03KRslF020177 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 3 Jan 2012 20:27:55 GMT Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q03KRsOS024186; Tue, 3 Jan 2012 14:27:54 -0600 Received: from bergsoft (/10.132.136.136) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 03 Jan 2012 12:27:53 -0800 Date: Tue, 3 Jan 2012 12:26:47 -0800 (PST) From: Seth Goldberg X-X-Sender: sethg@bergsoft To: "=?ISO-8859-7?Q?Vladimir_'=F6-coder=2Fphcoder'_Serbinenko?=" Subject: Re: RFC: New multiboot2 memory map entry type In-Reply-To: <4F035705.8060409@gmail.com> Message-ID: References: <4ECF98BC.4050106@gmail.com> <1B5AE297-7721-42A2-8F65-E2929E2877C5@oracle.com> <65394F19-6327-450B-B19C-14B891EBB78D@oracle.com> <4F035705.8060409@gmail.com> User-Agent: Alpine 2.00 (GSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-2027626070-1325622408=:717" X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-CT-RefId: str=0001.0A090204.4F0364CC.009F,ss=1,re=0.000,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 148.87.113.117 Cc: The development of GNU GRUB , Seth Goldberg X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 20:28:04 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---559023410-2027626070-1325622408=:717 Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Does that mean you are OK with the addition of the tag I proposed? :). Thanks, --S Quoting Vladimir '=CF=86-coder/phcoder' Serbinenko, who wrote the following= on...: > On 24.12.2011 08:45, Seth Goldberg wrote: >> Hi, >> >> In a perfect world, I agree that would be enough, but sometimes an is= =20 >> needs to know, specifically, the UEFI-defined map itself to work around= =20 >> firmware bugs. I see no reason why both your proposal and mine couldn't= =20 >> coexist. > This information is used in 2 different parts: > - First it's used for doing EFI calls. For at SetVirtualMap you need orig= inal=20 > map and not some more convenient representation. The code using these cal= ls=20 > need to know EFI in any case and as such receiving a map in EFI-way shoul= dn't=20 > be a problem > - Early in boot one needs to know which physical memory is occupied and w= hich=20 > virtual memory should be left out to allow problemless mapping later when= =20 > using firmware-specific code. So we need to mark them somehow in memory m= ap=20 > as "Writable, firmware X is here both physically or virtually either don'= t=20 > erase it and reserve virtual space or renounce using firmware X", in this= =20 > case X=3DEFI. The above mentionned bugs means that bootservices memory wi= ll=20 > need to be marked so as well. > So I'd recommend having both in different tags, one will be used by=20 > firmware-independent code and another by firmware-specific code. >> --S >>=20 >> On Dec 23, 2011, at 10:37 PM, Brendan Trotter wrote= : >>=20 >>> Hi, >>>=20 >>> On Sat, Dec 24, 2011 at 3:01 PM, Seth Goldberg=20 >>> wrote: >>>>> On 09.11.2011 06:25, Seth Goldberg wrote: >>>>>> The proposal is to add an additional type (value =3D 6) that denotes= =20 >>>>>> runtime memory that some firmware marks as required to be mapped to= =20 >>>>>> take advantage of services after the end of boot (UEFI is the canoni= cal=20 >>>>>> example). Without this information, it's impossible for a=20 >>>>>> multiboot2-compliant OS to set up proper mappings for this memory. >>>> I'm actually withdrawing this request in exchange for a multiboot2= =20 >>>> info tag that includes the EFI memory map (as returned by=20 >>>> GetMemoryMap()). I think this is better because it's more complete an= d=20 >>>> provides an OS with a much more complete set of map information (an ar= ray=20 >>>> of EFI_MEMORY_DESCRIPTOR structures, as per the UEFI 2.0 spec) for UEF= I=20 >>>> systems (and considering the workarounds required to fully utilize UEF= I,=20 >>>> this is a necessity), so the proposal is (based on the=20 >>>> http://bzr.savannah.gnu.org/r/grub/branches/multiboot2/ repo): >>> I think the multiboot memory map should be in a single, clear, >>> consistent and complete format; and shouldn't just be a "dumb" copy of >>> whatever each different type of firmware felt like providing; and a >>> multiboot OS should be able to use that single, clear, consistent and >>> complete memory map without caring about where it came from or what >>> type of firmware booted GRUB. >>>=20 >>> My recommendation would be "base_address, size, type, attributes, >>> NUMA_domain", where the multiboot specification determines the >>> meanings for "type" and the meanings of bits in the "attributes" >>> bit-field without any regard for any other specification; and where >>> the boot loader (GRUB) also uses the ACPI SRAT (or any other >>> information, if possible) to try to determine the NUMA domain that >>> each area belongs to (and any "hot-plug RAM" areas). >>>=20 >>> Suggested types would be: >>> - reserved (includes "unknown", areas used by legacy devices, ROMs, API= Cs,=20 >>> etc) >>> - usable RAM (combines "AddressRangeMemory", "EfiConventionalMemory", >>> "EfiBootServicesCode", "EfiBootServicesData") >>> - ACPI reclaimable (OS can reuse after it has finished with all ACPI=20 >>> tables) >>> - boot code reclaimable (OS can reuse after it has finished with all >>> multi-boot information) >>> - boot module reclaimable (used to store the kernel and any modules >>> that were loaded with the kernel) >>> - preserved (combines "ACPI NVS", "EfiRuntimeServiceCode", >>> "EfiRuntimeServicesData" and "EfiPalCode") >>> - faulty RAM >>> - not-present RAM (area reserved for "hot-add") >>> - unused (the only type of area that is suitable for use for memory >>> mapped PCI devices) >>> - unusable (not used, but can't be used for memory mapped PCI devices= =20 >>> either) >>>=20 >>> Suggested attribute flags would be: >>> - uncached (same as UEFI spec) >>> - write combining (same as UEFI spec) >>> - write-through (same as UEFI spec) >>> - write back (same as UEFI spec) >>> - uncached exportable (same as UEFI spec) >>> - write protectable (same as UEFI spec) >>> - read protectable (same as UEFI spec) >>> - execute protectable (same as UEFI spec) >>> - runtime (same as UEFI spec) >>> - volatile (same as ACPI spec) >>> - slow (same as ACPI spec) >>> - errorLog (same as ACPI spec) >>> - is hot-plug (e.g. either "usable RAM" that may be unplugged or "not >>> present" RAM that may be plugged in) >>> - has NUMA domain (NUMA domain field is valid if this flag is set) >>>=20 >>> In addition, multiboot should guarantee that the memory map: >>> - is sorted in order from lowest base address to highest base address >>> - contains no overlapping areas >>> - contains no adjacent areas of the same type, attributes and NUMA doma= in >>> - contains no unmentioned holes (every byte in the 64-bit physical >>> address space is accounted for; for example, a "32-bit physical >>> addresses only" system would have a massive 1757500617114 GiB area >>> marked as "unusable" at the top of the 64-bit physical address space). >>>=20 >>> Note: on 80x86, determining the size of the physical address space >>> that the system supports involves using "CPUID.function 0x80000008" if >>> present (and working around the errata for Pentium 4 (family =3D 0xF, >>> model =3D 3) which incorrectly reports support for 40-bit physical >>> addresses when it only supports 36-bit physical addresses). If this >>> CPUID function isn't supported then check feature flags to see if >>> PSE36 or PAE is supported and assume 36-bit if they are, and assume >>> 32-bit if they aren't (or if CPUID itself isn't supported). >>>=20 >>> The boot loader (GRUB) would do the best it can with available >>> information. For example, for an ancient PC BIOS system that doesn't >>> even support "int 0x15, eax=3D0xE820" it might use "int 0x12" to get on= e >>> usable RAM area (from zero to the start of the EBDA), then assume the >>> area immediately above that up to 0x00100000 is "reserved", then use >>> other old BIOS functions to determine if there's more RAM above >>> 0x00100000, then have an assumed "unusable" area (in case the old BIOS >>> functions didn't report all extended memory), then have an assumed >>> "unused" area up to about 0xFE000000, then have an assumed "reserved" >>> area up to 0xFFFFFFFF (in case of APICs, ROM, etc), then have an >>> assumed "unusable" area for everything above that. After that it would >>> split "usable RAM" entries to create new "boot code reclaimable" and >>> "boot module reclaimable entries. Obviously the memory map will >>> contain more information (and less "conservative assumptions") if the >>> firmware provides more/better information to the boot loader. >>>=20 >>>=20 >>> Cheers, >>>=20 >>> Brendan >>>=20 >>> _______________________________________________ >>> Grub-devel mailing list >>> Grub-devel@gnu.org >>> https://lists.gnu.org/mailman/listinfo/grub-devel >> _______________________________________________ >> Grub-devel mailing list >> Grub-devel@gnu.org >> https://lists.gnu.org/mailman/listinfo/grub-devel >>=20 > > > --=20 > Regards > Vladimir '=CF=86-coder/phcoder' Serbinenko > > ---559023410-2027626070-1325622408=:717--