Isaku Yamahata wrote:
> I agree that The current design is broken.
> It comes from Xen/x86 and must be adjusted to IA64.
>
> Value based on xen_pstart, xenheap_phys_end or
> heap_start in start_kernel() can be used for that.
Hi Isaku,
How does this look to you then? I get as far with this patch as I got
with the previous one I sent out, so thats a good sign :) Without any of
the patches I get an MCA as soon as I start touching the mpt_table.
Cheers,
Jes
Do the pickling based on xen_heap_start, rather than __va/__pa. The
__va/__pa approach doesn't work as some systems do not have their heap
located within the 4GB window.
Signed-off-by: Jes Sorensen <jes@xxxxxxx>
diff -r 3e4fa8b5b245 xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c Tue Sep 12 11:43:22 2006 -0600
+++ b/xen/arch/ia64/xen/xensetup.c Thu Sep 21 10:47:20 2006 +0200
@@ -85,6 +87,7 @@ unsigned long xenheap_size = XENHEAP_DEF
unsigned long xenheap_size = XENHEAP_DEFAULT_SIZE;
extern long running_on_sim;
unsigned long xen_pstart;
+void *xen_heap_start;
static int
xen_count_pages(u64 start, u64 end, void *arg)
@@ -246,7 +249,6 @@ void start_kernel(void)
void start_kernel(void)
{
char *cmdline;
- void *heap_start;
unsigned long nr_pages;
unsigned long dom0_memory_start, dom0_memory_size;
unsigned long dom0_initrd_start, dom0_initrd_size;
@@ -393,10 +398,10 @@ void start_kernel(void)
printf("find_memory: efi_memmap_walk returns max_page=%lx\n",max_page);
efi_print();
- heap_start = memguard_init(ia64_imva(&_end));
- printf("Before heap_start: %p\n", heap_start);
- heap_start = __va(init_boot_allocator(__pa(heap_start)));
- printf("After heap_start: %p\n", heap_start);
+ xen_heap_start = memguard_init(ia64_imva(&_end));
+ printf("Before xen_heap_start: %p\n", xen_heap_start);
+ xen_heap_start = __va(init_boot_allocator(__pa(xen_heap_start)));
+ printf("After xen_heap_start: %p\n", xen_heap_start);
efi_memmap_walk(filter_rsvd_memory, init_boot_pages);
efi_memmap_walk(xen_count_pages, &nr_pages);
@@ -414,10 +419,10 @@ void start_kernel(void)
end_boot_allocator();
- init_xenheap_pages(__pa(heap_start), xenheap_phys_end);
+ init_xenheap_pages(__pa(xen_heap_start), xenheap_phys_end);
printk("Xen heap: %luMB (%lukB)\n",
- (xenheap_phys_end-__pa(heap_start)) >> 20,
- (xenheap_phys_end-__pa(heap_start)) >> 10);
+ (xenheap_phys_end-__pa(xen_heap_start)) >> 20,
+ (xenheap_phys_end-__pa(xen_heap_start)) >> 10);
late_setup_arch(&cmdline);
diff -r 3e4fa8b5b245 xen/include/asm-ia64/mm.h
--- a/xen/include/asm-ia64/mm.h Tue Sep 12 11:43:22 2006 -0600
+++ b/xen/include/asm-ia64/mm.h Thu Sep 21 10:42:04 2006 +0200
@@ -125,10 +125,14 @@ struct page_info
#define IS_XEN_HEAP_FRAME(_pfn) ((page_to_maddr(_pfn) < xenheap_phys_end) \
&& (page_to_maddr(_pfn) >= xen_pstart))
-static inline struct domain *unpickle_domptr(u32 _d)
-{ return (_d == 0) ? NULL : __va(_d); }
+extern void *xen_heap_start;
+#define __pickle(a) ((unsigned long)a - (unsigned long)xen_heap_start)
+#define __unpickle(a) (void *)(a + xen_heap_start)
+
+static inline struct domain *unpickle_domptr(u64 _d)
+{ return (_d == 0) ? NULL : __unpickle(_d); }
static inline u32 pickle_domptr(struct domain *_d)
-{ return (_d == NULL) ? 0 : (u32)__pa(_d); }
+{ return (_d == NULL) ? 0 : (u64)__pickle(_d); }
#define page_get_owner(_p) (unpickle_domptr((_p)->u.inuse._domain))
#define page_set_owner(_p, _d) ((_p)->u.inuse._domain = pickle_domptr(_d))
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
|