From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1a2GtF-0005RJ-W5 for mharc-grub-devel@gnu.org; Fri, 27 Nov 2015 06:08:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2GtC-0005PU-Av for grub-devel@gnu.org; Fri, 27 Nov 2015 06:08:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2Gt7-00063i-LS for grub-devel@gnu.org; Fri, 27 Nov 2015 06:08:30 -0500 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:33875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2Gt7-00063b-CT for grub-devel@gnu.org; Fri, 27 Nov 2015 06:08:25 -0500 Received: by wmvv187 with SMTP id v187so65935633wmv.1 for ; Fri, 27 Nov 2015 03:08:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type; bh=SpzwaJUys2KDtaK8kJShX2akho5Zduh9F+eQ2GRPcpk=; b=IbUzonEZnsM6S5amWiCrBmsBS9kpi9dzKi0QwIqi7jGdfCCGDtXdYl+RGRggGonoYx okIhnK0omeKaBky9TwotUSqwXQxSFFCnwGsl3eJiDV2kk9P0hAr3zKvKRbCjLrgQ52f9 iL0cVv02o2bSXD9a7fA1CJ4hzyGOSerovN8c5Go+XiDeWlGIz4JKOx1ShjNxem3V7lw5 ljVMJiLcFH5mppJB+ruB84FOG3KsgnncTvRfjOYL3b9LSQe7faCHrTI67yvfaUMPj8gM hiU+4ZCuO+89U8Wq/d3sKAGtksKff86gjYHNgDEMPJmhd7hsrQGWnVxkZkr6PK3Lfruk /qUQ== X-Received: by 10.28.12.3 with SMTP id 3mr10149392wmm.84.1448622504525; Fri, 27 Nov 2015 03:08:24 -0800 (PST) Received: from ?IPv6:2620:0:105f:fd00:a2a8:cdff:fe64:b3b5? ([2620:0:105f:fd00:a2a8:cdff:fe64:b3b5]) by smtp.gmail.com with ESMTPSA id u134sm6968968wmd.0.2015.11.27.03.08.23 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Nov 2015 03:08:23 -0800 (PST) Subject: Re: grub causing NVDIMMs to be treated as normal memory To: The development of GNU GRUB References: <94D0CD8314A33A4D9D801C0FE68B40295BE539AF@G9W0745.americas.hpqcorp.net> <5655FFC3.9030603@gmail.com> <94D0CD8314A33A4D9D801C0FE68B40295BE5549A@G9W0745.americas.hpqcorp.net> <56567CC3.3040405@gmail.com> <94D0CD8314A33A4D9D801C0FE68B40295BE55713@G9W0745.americas.hpqcorp.net> <56573973.9060806@gmail.com> <94D0CD8314A33A4D9D801C0FE68B40295BE56257@G9W0745.americas.hpqcorp.net> <5657D4CD.7060205@gmail.com> <94D0CD8314A33A4D9D801C0FE68B40295BE575A4@G9W0745.americas.hpqcorp.net> From: =?UTF-8?Q?Vladimir_'=cf=86-coder/phcoder'_Serbinenko?= Message-ID: <5658399A.8020101@gmail.com> Date: Fri, 27 Nov 2015 12:08:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.3.0 MIME-Version: 1.0 In-Reply-To: <94D0CD8314A33A4D9D801C0FE68B40295BE575A4@G9W0745.americas.hpqcorp.net> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qWsPWLfkk0BVDFjxdPhw4VG5lFrhX9bfW" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c09::233 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: Fri, 27 Nov 2015 11:08:31 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qWsPWLfkk0BVDFjxdPhw4VG5lFrhX9bfW Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable What about this patch for the passing of pram? diff --git a/grub-core/mmap/efi/mmap.c b/grub-core/mmap/efi/mmap.c index 900a4d6..0c03c5d 100644 --- a/grub-core/mmap/efi/mmap.c +++ b/grub-core/mmap/efi/mmap.c @@ -118,6 +118,12 @@ grub_efi_mmap_iterate (grub_memory_hook_t hook, void *hook_data, GRUB_MEMORY_NVS, hook_data); break; + case GRUB_EFI_PERSISTENT_MEMORY: + hook (desc->physical_start, desc->num_pages * 4096, + GRUB_MEMORY_PRAM, hook_data); + break; + + default: grub_printf ("Unknown memory type %d, considering reserved\n", desc->type); diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h index 24a05c5..2bbfe34 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -476,6 +476,7 @@ enum grub_efi_memory_type GRUB_EFI_MEMORY_MAPPED_IO, GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE, GRUB_EFI_PAL_CODE, + GRUB_EFI_PERSISTENT_MEMORY, GRUB_EFI_MAX_MEMORY_TYPE }; typedef enum grub_efi_memory_type grub_efi_memory_type_t; diff --git a/include/grub/memory.h b/include/grub/memory.h index 083cfb6..1003a9c 100644 --- a/include/grub/memory.h +++ b/include/grub/memory.h @@ -30,6 +30,7 @@ typedef enum grub_memory_type GRUB_MEMORY_ACPI =3D 3, GRUB_MEMORY_NVS =3D 4, GRUB_MEMORY_BADRAM =3D 5, + GRUB_MEMORY_PRAM =3D 7, GRUB_MEMORY_COREBOOT_TABLES =3D 16, GRUB_MEMORY_CODE =3D 20, /* This one is special: it's used internally but is never reported >>> Note (b): The internal GRUB_MEMORY_CODE (20) value is >>> leaking through to the E820 table. >>> >>> That appears to be from this patch on 2013-10-14: >>> 6de9ee86 Pass-through unknown E820 types >> >> If we are discussing ACPI 6.0 systems here, it explicitly says that >> values above 12 should be treated as reserved. Does it cause >> problems? >=20 > All undefined values are reserved for future standardization; > the meaning they might have in the future is unpredictable. >=20 > Software compatible with ACPI 6.0 is supposed to treat them as > reserved, but software compatible with a future version of ACPI > might interpret them as having some different meaning that isn't > compatible with GRUB_MEMORY_CODE. >=20 > Some companies used e820 type 12 to mean persistent memory without > getting that assigned by the ACPI WG, so that value was > contaminated. We should probably mark 20 as contaminated too,=20 > given this issue. >=20 I see now that we have leaked 16 (coreboot tables) as well. Could we mark 16 as contaminated as well? For memory code: should we just pass reserved in linux e820 or is it better to keep doing this bug given possible reliance on it by other software? >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 --qWsPWLfkk0BVDFjxdPhw4VG5lFrhX9bfW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREKAAYFAlZYOZoACgkQmBXlbbo5nOuV9wD/XFWe9X2c2Wm4f+dQsnO0qcV9 FQj3sByQPedR1djE8f8A/iH19s2yWRndD4MplJcSbWDarxkPnmO2XNvFoQ2GofQ2 =oTmQ -----END PGP SIGNATURE----- --qWsPWLfkk0BVDFjxdPhw4VG5lFrhX9bfW--