From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aUCmN-0002pg-MD for mharc-grub-devel@gnu.org; Fri, 12 Feb 2016 07:24:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUCmL-0002pX-VV for grub-devel@gnu.org; Fri, 12 Feb 2016 07:24:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aUCmK-0007Mw-WD for grub-devel@gnu.org; Fri, 12 Feb 2016 07:24:53 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:35185) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUCmK-0007Mp-LZ for grub-devel@gnu.org; Fri, 12 Feb 2016 07:24:52 -0500 Received: by mail-wm0-x241.google.com with SMTP id g62so2396659wme.2 for ; Fri, 12 Feb 2016 04:24:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type; bh=72Nv1NbqKz0wOV+J6eFLc45Ta/kU70zWjJbiF4QB3/U=; b=KPVg+O3qa/8N/yuzhrfBfLN982obuPMSNBR9yhOeDxjrLv+ftu1bwvD1sd0U8rBSMe DuWlleD4wvpweerotpkOZP7ogXW0AjYGQv6o2AFEdoBoZKzSAqlQ6fVDJvaFv+OsgoEB aBxq3l/yfqzob6wU52VESQz0ukTLbulD5KYykCnSa9pT6cl8AFC51Epqhs71b79LTUQq a9v2nKn+PhiIft7H2BudAfP5hDD2CFFi/ND8Q9QsiUCud7Cnka/dsF2ra4CrvnJnp8tH r2VJueNs19InRkq78zdsa8aZPBuft5YzOhz0L9ZyC7b4kRYM3ckeD7M78w9mcwtBrMWu kdxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=72Nv1NbqKz0wOV+J6eFLc45Ta/kU70zWjJbiF4QB3/U=; b=eWH0Bh3DjYjBVvgjGK+1eWBhzGQB+ewjeuOwUO4Jm99GG3FsXTV6YU4sgYSbyIpBJI FbE9whE99sijGHBtuJHBwLh3154/DJnGdz4uqReStKBW79OBo7BBqasN+9ufIF2aoC6A 2R9oCxCuLr04hHXi9VCCu2Q8Cy7wdSSJz0S/6fbqUOqY9EZHBNRxl4G0zpL1dy4c4eWH nXioPowREtsJra9BL/6Wn4RE1gbWtyeXM+RYkqscjmA+L84+1w5exrEan+MtQN6pUHcW LstZU8Dv4xNWz+UOLym+oEEtIf/lWr+o41t2i0KUgQIuOeZRryIy25SefkpHbVSvZS9/ SPlw== X-Gm-Message-State: AG10YOSCaM1n2a+FQ0vzvxPAH/4P22Z2gtUfFRwE3LVq3FZYKLMp8AKpxks51Ta7Igz5JQ== X-Received: by 10.28.226.212 with SMTP id z203mr4193293wmg.78.1455279892074; Fri, 12 Feb 2016 04:24:52 -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 gb9sm11809170wjb.26.2016.02.12.04.24.50 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Feb 2016 04:24:51 -0800 (PST) Subject: Re: [PATCH v2 4/6] xen: add capability to load initrd outside of initial mapping To: Juergen Gross , Daniel Kiper References: <1455177206-8974-1-git-send-email-jgross@suse.com> <1455177206-8974-5-git-send-email-jgross@suse.com> <20160211123352.GD3482@olila.local.net-space.pl> <56BC9714.7020101@suse.com> From: =?UTF-8?Q?Vladimir_'=cf=86-coder/phcoder'_Serbinenko?= Message-ID: <56BDCF12.6050108@gmail.com> Date: Fri, 12 Feb 2016 13:24:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <56BC9714.7020101@suse.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="XrtMUhsvBKJjtjjOfMsIff5A4rGgbPRv9" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::241 Cc: grub-devel@gnu.org, mchang@suse.com, xen-devel@lists.xen.org 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, 12 Feb 2016 12:24:55 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --XrtMUhsvBKJjtjjOfMsIff5A4rGgbPRv9 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11.02.2016 15:13, Juergen Gross wrote: > On 11/02/16 13:33, Daniel Kiper wrote: >> On Thu, Feb 11, 2016 at 08:53:24AM +0100, Juergen Gross wrote: >>> Modern pvops linux kernels support an initrd not covered by the initi= al >>> mapping. This capability is flagged by an elf-note. >>> >>> In case the elf-note is set by the kernel don't place the initrd into= >>> the initial mapping. This will allow to load larger initrds and/or >>> support domains with larger memory, as the initial mapping is limited= >>> to 2GB and it is containing the p2m list. >>> >>> Signed-off-by: Juergen Gross >>> --- >>> grub-core/loader/i386/xen.c | 56 ++++++++++++++++++++++++++++++-------- >>> grub-core/loader/i386/xen_fileXX.c | 3 ++ >>> include/grub/xen_file.h | 1 + >>> 3 files changed, 49 insertions(+), 11 deletions(-) >>> >>> diff --git a/grub-core/loader/i386/xen.c b/grub-core/loader/i386/xen.= c >>> index 65cec27..0f41048 100644 >>> --- a/grub-core/loader/i386/xen.c >>> +++ b/grub-core/loader/i386/xen.c >>> @@ -307,15 +307,14 @@ grub_xen_pt_alloc (void) >>> } >>> >>> static grub_err_t >>> -grub_xen_boot (void) >>> +grub_xen_alloc_end (void) >>> { >>> grub_err_t err; >>> - grub_uint64_t nr_pages; >>> - struct gnttab_set_version gnttab_setver; >>> - grub_size_t i; >>> + static int called =3D 0; >>> >>> - if (grub_xen_n_allocated_shared_pages) >>> - return grub_error (GRUB_ERR_BUG, "active grants"); >>> + if (called) >>> + return GRUB_ERR_NONE; >> >> Why? > > Did you look at the function? grub_xen_alloc_end() (some parts of the > original grub_xen_boot()) is new and may be called multiple times. It > was much easier to just call it and let it do what must be done only > at the first time called. > What if a boot fails and then fallback kernel is loaded? >>> + if (grub_xen_n_allocated_shared_pages) >>> + return grub_error (GRUB_ERR_BUG, "active grants"); >> >> Why? > > That's how it has been before. git just decided to generate the diff > that way. > This is also needed to avoid passing control when some drivers are still active >>> + case 16: >> >> Could you define this a constant and use it here? > > This would be the only case with a constant. All others are numeric > as well. > I'm ok with not insisisting on using constants given current state but in general constants are preferable (yes, xen code isn't always clean) --XrtMUhsvBKJjtjjOfMsIff5A4rGgbPRv9 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 iF4EAREKAAYFAla9zxIACgkQmBXlbbo5nOtbrAD+PHPoOGxkg+tBss0R76TjA9yj 57cFhw+3Dq6viUzRCzoBAIzkau3d9bfywZ4y8E+5dz/ZHIdnrN4ArGsu9c5LiwDB =t8n6 -----END PGP SIGNATURE----- --XrtMUhsvBKJjtjjOfMsIff5A4rGgbPRv9--