From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gNE4y-0005KT-5p for mharc-grub-devel@gnu.org; Thu, 15 Nov 2018 04:36:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNE4s-0005KJ-8P for grub-devel@gnu.org; Thu, 15 Nov 2018 04:36:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNE4e-0000ho-VN for grub-devel@gnu.org; Thu, 15 Nov 2018 04:36:38 -0500 Received: from smtp.eu.citrix.com ([185.25.65.24]:25267) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gNE4c-0000fa-CV for grub-devel@gnu.org; Thu, 15 Nov 2018 04:36:32 -0500 X-IronPort-AV: E=Sophos;i="5.56,236,1539648000"; d="scan'208";a="81894625" Date: Thu, 15 Nov 2018 10:36:20 +0100 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Juergen Gross CC: , , , , Subject: Re: [Xen-devel] [PATCH v4 11/19] xen: get memory map from hypervisor for PVH Message-ID: <20181115093620.q45jwqciodx4s4v2@mac> References: <20181102123738.16395-1-jgross@suse.com> <20181102123738.16395-12-jgross@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20181102123738.16395-12-jgross@suse.com> User-Agent: NeoMutt/20180716 X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 185.25.65.24 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 09:36:51 -0000 On Fri, Nov 02, 2018 at 01:37:30PM +0100, Juergen Gross wrote: > Retrieve the memory map from the hypervisor and normalize it to contain > no overlapping entries and to be sorted by address. > > Signed-off-by: Juergen Gross > --- > V3: use grub_e820_mmap_entry instead of own struct (Daniel Kiper) > --- > grub-core/kern/i386/xen/pvh.c | 96 ++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 95 insertions(+), 1 deletion(-) > > diff --git a/grub-core/kern/i386/xen/pvh.c b/grub-core/kern/i386/xen/pvh.c > index 7e90a4538..58e6fefd5 100644 > --- a/grub-core/kern/i386/xen/pvh.c > +++ b/grub-core/kern/i386/xen/pvh.c > @@ -23,9 +23,14 @@ > #include > #include > #include > +#include > #include > +#include > +#include > > -#define XEN_CONSOLE_PORT 0xe9 > +#define XEN_CONSOLE_PORT 0xe9 > + > +#define XEN_MEMORY_MAP_SIZE 128 > > grub_uint64_t grub_rsdp_addr; > > @@ -33,6 +38,8 @@ static char hypercall_page[GRUB_XEN_PAGE_SIZE] > __attribute__ ((aligned (GRUB_XEN_PAGE_SIZE))); > > static grub_uint32_t xen_cpuid_base; > +static struct grub_e820_mmap_entry map[XEN_MEMORY_MAP_SIZE]; > +static unsigned int nr_map_entries; > > static void > grub_xen_panic (const char *msg) > @@ -92,11 +99,98 @@ grub_xen_hypercall (grub_uint32_t callno, grub_uint32_t a0, > return __res; > } > > +static void > +grub_xen_sort_mmap (void) There's nothing Xen-specific about this function, shouldn't it reside in some x86 related file? Thanks, Roger.