From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: Re: access shared_info? Date: Wed, 07 Jun 2006 19:27:01 +0200 Message-ID: <44870C65.2030603@suse.de> References: <4486D496.1070905@suse.de> <20b4659f13d0ed8c0ee5d23d93579b4c@cl.cam.ac.uk> <4486F676.6080301@suse.de> <7c8cd23f1fb1eafe50db8bf82cadad3a@cl.cam.ac.uk> <4486FE71.9090606@suse.de> <63a099e0b962a2154960cebf413487c2@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030208060109070707080101" Return-path: In-Reply-To: <63a099e0b962a2154960cebf413487c2@cl.cam.ac.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Xen devel list List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------030208060109070707080101 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Keir Fraser wrote: > Oh, I see it's moved to a new function. I guess that's okay, although > couldn't you fake up an e820 map and call legacy_init_iomem_resource on > the domU path, rather than having to pull code out into a new function? > Does this patch change behaviour for dom0 at all? I think /proc/iomem > already looks like native there? Also the patch will need to include > x86/64 too. new version attached. cheers, Gerd -- Gerd Hoffmann http://www.suse.de/~kraxel/julika-dora.jpeg --------------030208060109070707080101 Content-Type: text/x-patch; name="iomem.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="iomem.diff" diff -r c191c649cdb3 linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c --- a/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c Tue Jun 6 09:25:59 2006 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c Wed Jun 7 19:24:19 2006 @@ -1378,7 +1378,6 @@ res->end = res->start + e820[i].size - 1; res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; request_resource(&iomem_resource, res); -#ifndef CONFIG_XEN if (e820[i].type == E820_RAM) { /* * We don't know which RAM region contains kernel data, @@ -1391,7 +1390,6 @@ request_resource(res, &crashk_res); #endif } -#endif } } @@ -1460,8 +1458,16 @@ int i; /* Nothing to do if not running in dom0. */ - if (!(xen_start_info->flags & SIF_INITDOMAIN)) + if (!(xen_start_info->flags & SIF_INITDOMAIN)) { + struct e820entry domU_e820 = { + .addr = 0, + .size = max_pfn << PAGE_SHIFT, + .type = E820_RAM, + }; + legacy_init_iomem_resources(&domU_e820, 1, + &code_resource, &data_resource); return; + } #ifdef CONFIG_XEN machine_e820 = alloc_bootmem_low_pages(PAGE_SIZE); @@ -1698,11 +1704,10 @@ init_mm.brk = (PFN_UP(__pa(xen_start_info->pt_base)) + xen_start_info->nr_pt_frames) << PAGE_SHIFT; - /* XEN: This is nonsense: kernel may not even be contiguous in RAM. */ - /*code_resource.start = virt_to_phys(_text);*/ - /*code_resource.end = virt_to_phys(_etext)-1;*/ - /*data_resource.start = virt_to_phys(_etext);*/ - /*data_resource.end = virt_to_phys(_edata)-1;*/ + code_resource.start = virt_to_phys(_text); + code_resource.end = virt_to_phys(_etext)-1; + data_resource.start = virt_to_phys(_etext); + data_resource.end = virt_to_phys(_edata)-1; parse_cmdline_early(cmdline_p); diff -r c191c649cdb3 linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c Tue Jun 6 09:25:59 2006 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c Wed Jun 7 19:24:19 2006 @@ -44,9 +44,7 @@ */ unsigned long end_user_pfn = MAXMEM>>PAGE_SHIFT; -#ifndef CONFIG_XEN extern struct resource code_resource, data_resource; -#endif /* Check for some hardcoded bad areas that early boot is not allowed to touch */ static inline int bad_addr(unsigned long *addrp, unsigned long size) @@ -251,8 +249,7 @@ res->end = res->start + e820[i].size - 1; res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; request_resource(&iomem_resource, res); -#ifndef CONFIG_XEN - if (e820.map[i].type == E820_RAM) { + if (e820[i].type == E820_RAM) { /* * We don't know which RAM region contains kernel data, * so we try it repeatedly and let the resource manager @@ -264,7 +261,6 @@ request_resource(res, &crashk_res); #endif } -#endif } } diff -r c191c649cdb3 linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c Tue Jun 6 09:25:59 2006 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c Wed Jun 7 19:24:19 2006 @@ -692,12 +692,10 @@ init_mm.end_data = (unsigned long) &_edata; init_mm.brk = (unsigned long) &_end; -#ifndef CONFIG_XEN code_resource.start = virt_to_phys(&_text); code_resource.end = virt_to_phys(&_etext)-1; data_resource.start = virt_to_phys(&_etext); data_resource.end = virt_to_phys(&_edata)-1; -#endif parse_cmdline_early(cmdline_p); @@ -937,6 +935,13 @@ BUG_ON(HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap)); e820_reserve_resources(machine_e820, memmap.nr_entries); + } else { + struct e820entry domU_e820 = { + .addr = 0, + .size = max_pfn << PAGE_SHIFT, + .type = E820_RAM, + }; + e820_reserve_resources(&domU_e820, 1); } #elif !defined(CONFIG_XEN) probe_roms(); --------------030208060109070707080101 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------030208060109070707080101--