Re: [Xen-ia64-devel] Problems booting domU
Hi, Rodrigo You can add xencons=tty0 console=tty0 into extra option. My config is the below. == kernel = /boot/vmlinux-2.6.16.13-xenU ramdisk = /boot/initrd-2.6.16.13-xenU.img memory = 512 name = rhel4 disk = [ 'file:/xen/image/rhel4.img,hda1,w' ] root = /dev/hda1 ro extra = nomca xencons=tty0 console=tty0 root=/dev/hda1 3 vcpus= 2 cpus= 1-2 == Best Regards, Akio Takebe Hi Akio Takebe! That problem was resolved. Now, my domU boot, but don`t load... It`s stays stopped in Started domain vm01! debian-ia64:/home/peso# xm create -c -f /etc/xen/vm01-config.sxp Using config file /etc/xen/vm01-config.sxp. Started domain vm01 debian-ia64:/home/peso# xm list Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 236 1 r- 235.5 vm01 2 150 1 -- 143.3 Thanks! 2006/6/7, Akio Takebe [EMAIL PROTECTED]: Hi, Rodrigo Please try it as root user. And you may need to confirm that there is /etc/xen/vm01-config.sxp. Best Regards, Akio Takebe Hi, Rodrigo Please try the below. # xm create -c -f /etc/xen/vm01-config.sxp Best Regards, Akio Takebe I`m trying to boot my domU and occurrs the error below: debian-ia64:~# xm create -c /etc/xen/vm01-config.sxp ERROR: Could not obtain handle on privileged command interface (2 = No such file or directory) Using config file /etc/xen/vm01-config.sxp. Error: (2, 'No such file or directory') ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel ---html-part included links--- mailto:[EMAIL PROTECTED] mailto:Xen-ia64-devel@lists.xensource.com ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
[Xen-ia64-devel][PATCH] Fix a bug in vmx_vcpu_pta
Signed-off-by: Anthony Xu [EMAIL PROTECTED] Thanks, -Anthony pta_emulate.patch Description: pta_emulate.patch ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Re: [Xen-ia64-devel] [PATCH] remove some races between the p2m table and the m2p table
The previous patch was imcomplete. replace it with the attached one. -- yamahata # HG changeset patch # User [EMAIL PROTECTED] # Node ID 202f73abeeb953a263c2b249254a2843a2943941 # Parent 988c67e861a49a5d9e8a09cb7e318c327f64d354 remove some races between the p2m table and the m2p table PATCHNAME: fix_races_between_p2m_and_m2p Signed-off-by: Isaku Yamahata [EMAIL PROTECTED] diff -r 988c67e861a4 -r 202f73abeeb9 xen/arch/ia64/xen/domain.c --- a/xen/arch/ia64/xen/domain.cFri Jun 09 15:18:26 2006 +0900 +++ b/xen/arch/ia64/xen/domain.cFri Jun 09 15:18:44 2006 +0900 @@ -472,13 +472,7 @@ static void relinquish_memory(struct dom /* Follow the list chain and /then/ potentially free the page. */ ent = ent-next; #ifdef CONFIG_XEN_IA64_DOM0_VP -#if 1 BUG_ON(get_gpfn_from_mfn(page_to_mfn(page)) != INVALID_M2P_ENTRY); -#else -//XXX this should be done at traversing the P2M table. -if (page_get_owner(page) == d) -set_gpfn_from_mfn(page_to_mfn(page), INVALID_M2P_ENTRY); -#endif #endif put_page(page); } diff -r 988c67e861a4 -r 202f73abeeb9 xen/arch/ia64/xen/mm.c --- a/xen/arch/ia64/xen/mm.cFri Jun 09 15:18:26 2006 +0900 +++ b/xen/arch/ia64/xen/mm.cFri Jun 09 15:18:44 2006 +0900 @@ -212,16 +212,6 @@ share_xen_page_with_guest(struct page_in // alloc_xenheap_pages() doesn't initialize page owner. //BUG_ON(page_get_owner(page) != NULL); -#if 0 -if (get_gpfn_from_mfn(page_to_mfn(page)) != INVALID_M2P_ENTRY) { -printk(%s:%d page 0x%p mfn 0x%lx gpfn 0x%lx\n, __func__, __LINE__, - page, page_to_mfn(page), get_gpfn_from_mfn(page_to_mfn(page))); -} -#endif -// grant_table_destroy() release these pages. -// but it doesn't clear m2p entry. So there might remain stale entry. -// We clear such a stale entry here. -set_gpfn_from_mfn(page_to_mfn(page), INVALID_M2P_ENTRY); spin_lock(d-page_alloc_lock); @@ -239,6 +229,11 @@ share_xen_page_with_guest(struct page_in if ( unlikely(d-xenheap_pages++ == 0) ) get_knownalive_domain(d); list_add_tail(page-list, d-xenpage_list); + +// grant_table_destroy() releases these pages. +// but it doesn't clear their m2p entry. So there might remain stale +// entries. such a stale entry is cleared here. +set_gpfn_from_mfn(page_to_mfn(page), INVALID_M2P_ENTRY); spin_unlock(d-page_alloc_lock); } @@ -351,6 +346,9 @@ unsigned long translate_domain_mpaddr(un } //XXX !xxx_present() should be used instread of !xxx_none()? +// pud, pmd, pte page is zero cleared when they are allocated. +// Their area must be visible before population so that +// cmpxchg must have release semantics. static pte_t* lookup_alloc_domain_pte(struct domain* d, unsigned long mpaddr) { @@ -360,19 +358,38 @@ lookup_alloc_domain_pte(struct domain* d pmd_t *pmd; BUG_ON(mm-pgd == NULL); + pgd = pgd_offset(mm, mpaddr); -if (pgd_none(*pgd)) { -pgd_populate(mm, pgd, pud_alloc_one(mm,mpaddr)); + again_pgd: +if (unlikely(pgd_none(*pgd))) { +pud_t *old_pud = NULL; +pud = pud_alloc_one(mm, mpaddr); +if (unlikely(!pgd_cmpxchg_rel(mm, pgd, old_pud, pud))) { +pud_free(pud); +goto again_pgd; +} } pud = pud_offset(pgd, mpaddr); -if (pud_none(*pud)) { -pud_populate(mm, pud, pmd_alloc_one(mm,mpaddr)); + again_pud: +if (unlikely(pud_none(*pud))) { +pmd_t* old_pmd = NULL; +pmd = pmd_alloc_one(mm, mpaddr); +if (unlikely(!pud_cmpxchg_rel(mm, pud, old_pmd, pmd))) { +pmd_free(pmd); +goto again_pud; +} } pmd = pmd_offset(pud, mpaddr); -if (pmd_none(*pmd)) { -pmd_populate_kernel(mm, pmd, pte_alloc_one_kernel(mm, mpaddr)); + again_pmd: +if (unlikely(pmd_none(*pmd))) { +pte_t* old_pte = NULL; +pte_t* pte = pte_alloc_one_kernel(mm, mpaddr); +if (unlikely(!pmd_cmpxchg_kernel_rel(mm, pmd, old_pte, pte))) { +pte_free_kernel(pte); +goto again_pmd; +} } return pte_offset_map(pmd, mpaddr); @@ -389,15 +406,15 @@ lookup_noalloc_domain_pte(struct domain* BUG_ON(mm-pgd == NULL); pgd = pgd_offset(mm, mpaddr); -if (!pgd_present(*pgd)) +if (unlikely(!pgd_present(*pgd))) return NULL; pud = pud_offset(pgd, mpaddr); -if (!pud_present(*pud)) +if (unlikely(!pud_present(*pud))) return NULL; pmd = pmd_offset(pud, mpaddr); -if (!pmd_present(*pmd)) +if (unlikely(!pmd_present(*pmd))) return NULL; return pte_offset_map(pmd, mpaddr); @@ -414,15 +431,15 @@ lookup_noalloc_domain_pte_none(struct do BUG_ON(mm-pgd == NULL); pgd = pgd_offset(mm, mpaddr); -if (pgd_none(*pgd)) +if (unlikely(pgd_none(*pgd))) return NULL; pud = pud_offset(pgd, mpaddr); -if (pud_none(*pud)) +if
[Xen-ia64-devel] [PATCH] add volatile to mpt_table
mpt_table is accessed concurrently by cpus, so it needs volatile qualifier -- yamahata # HG changeset patch # User [EMAIL PROTECTED] # Node ID b6d7dc918455e9c83f13e7b654759cecdd2e1a0a # Parent 354565c96b098fe8951d0c6f6e580974f890f11c mpt_table is accessed concurrently by cpus, so it needs volatile qualifier PATCHNAME: volatile_mpt_table Signed-off-by: Isaku Yamahata [EMAIL PROTECTED] diff -r 354565c96b09 -r b6d7dc918455 xen/arch/ia64/xen/xenmem.c --- a/xen/arch/ia64/xen/xenmem.cFri Jun 09 15:18:59 2006 +0900 +++ b/xen/arch/ia64/xen/xenmem.cFri Jun 09 15:19:01 2006 +0900 @@ -35,7 +35,7 @@ unsigned long max_page; /* * Set up the page tables. */ -unsigned long *mpt_table; +volatile unsigned long *mpt_table; void paging_init (void) @@ -141,7 +141,7 @@ create_mpttable_page_table (u64 start, u create_mpttable_page_table (u64 start, u64 end, void *arg) { unsigned long address, start_page, end_page; - unsigned long *map_start, *map_end; + volatile unsigned long *map_start, *map_end; pgd_t *pgd; pud_t *pud; pmd_t *pmd; diff -r 354565c96b09 -r b6d7dc918455 xen/include/asm-ia64/mm.h --- a/xen/include/asm-ia64/mm.h Fri Jun 09 15:18:59 2006 +0900 +++ b/xen/include/asm-ia64/mm.h Fri Jun 09 15:19:01 2006 +0900 @@ -443,7 +443,7 @@ extern unsigned long dom0vp_add_physmap( extern unsigned long dom0vp_add_physmap(struct domain* d, unsigned long gpfn, unsigned long mfn, unsigned long flags, domid_t domid); #endif -extern unsigned long *mpt_table; +extern volatile unsigned long *mpt_table; extern unsigned long gmfn_to_mfn_foreign(struct domain *d, unsigned long gpfn); extern u64 translate_domain_pte(u64 pteval, u64 address, u64 itir__, u64* logps); #define machine_to_phys_mappingmpt_table ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
[Xen-ia64-devel] [PATCH] add seqlock to protect vtlb
add seqlock to protect vtlb -- yamahata # HG changeset patch # User [EMAIL PROTECTED] # Node ID b27c2f9cb883e62e8b9ac1ca501d5d69d5be4a4a # Parent b6d7dc918455e9c83f13e7b654759cecdd2e1a0a add seqlock to protect vtlb PATCHNAME: seqlock_to_protect_vtlb Signed-off-by: Isaku Yamahata [EMAIL PROTECTED] diff -r b6d7dc918455 -r b27c2f9cb883 xen/arch/ia64/xen/domain.c --- a/xen/arch/ia64/xen/domain.cFri Jun 09 15:19:01 2006 +0900 +++ b/xen/arch/ia64/xen/domain.cFri Jun 09 15:19:02 2006 +0900 @@ -300,6 +300,7 @@ int arch_domain_create(struct domain *d) d-xen_vaend = XEN_END_ADDR; d-arch.shared_info_va = SHAREDINFO_ADDR; d-arch.breakimm = 0x1000; + seqlock_init(d-arch.vtlb_lock); if (is_idle_domain(d)) return 0; diff -r b6d7dc918455 -r b27c2f9cb883 xen/arch/ia64/xen/faults.c --- a/xen/arch/ia64/xen/faults.cFri Jun 09 15:19:01 2006 +0900 +++ b/xen/arch/ia64/xen/faults.cFri Jun 09 15:19:02 2006 +0900 @@ -214,6 +214,8 @@ void ia64_do_page_fault (unsigned long a // FIXME should validate address here unsigned long pteval; unsigned long is_data = !((isr IA64_ISR_X_BIT) 1UL); + seqlock_t* vtlb_lock = current-domain-arch.vtlb_lock; + unsigned long seq; IA64FAULT fault; if ((isr IA64_ISR_IR) handle_lazy_cover(current, regs)) return; @@ -230,15 +232,15 @@ void ia64_do_page_fault (unsigned long a } again: + seq = read_seqbegin(vtlb_lock); fault = vcpu_translate(current,address,is_data,pteval,itir,iha); if (fault == IA64_NO_FAULT || fault == IA64_USE_TLB) { u64 logps; pteval = translate_domain_pte(pteval, address, itir, logps); vcpu_itc_no_srlz(current,is_data?2:1,address,pteval,-1UL,logps); - if (fault == IA64_USE_TLB !current-arch.dtlb.pte.p) { - /* dtlb has been purged in-between. This dtlb was - matching. Undo the work. */ - vcpu_flush_tlb_vhpt_range (address, 1); + if (read_seqretry(vtlb_lock, seq)) { + vcpu_flush_tlb_vhpt_range(address ((1 logps) - 1), + logps); goto again; } return; diff -r b6d7dc918455 -r b27c2f9cb883 xen/arch/ia64/xen/vhpt.c --- a/xen/arch/ia64/xen/vhpt.c Fri Jun 09 15:19:01 2006 +0900 +++ b/xen/arch/ia64/xen/vhpt.c Fri Jun 09 15:19:02 2006 +0900 @@ -152,7 +152,9 @@ void domain_flush_vtlb_all (void) { int cpu = smp_processor_id (); struct vcpu *v; - +seqlock_t* vtlb_lock = current-domain-arch.vtlb_lock; + + write_seqlock(vtlb_lock); for_each_vcpu (current-domain, v) if (v-processor == cpu) vcpu_flush_vtlb_all (); @@ -161,6 +163,7 @@ void domain_flush_vtlb_all (void) (v-processor, (void(*)(void *))vcpu_flush_vtlb_all, NULL,1,1); + write_sequnlock(vtlb_lock); } static void cpu_flush_vhpt_range (int cpu, u64 vadr, u64 addr_range) @@ -187,6 +190,7 @@ void vcpu_flush_tlb_vhpt_range (u64 vadr void domain_flush_vtlb_range (struct domain *d, u64 vadr, u64 addr_range) { +seqlock_t* vtlb_lock = d-arch.vtlb_lock; struct vcpu *v; #if 0 @@ -197,6 +201,7 @@ void domain_flush_vtlb_range (struct dom } #endif + write_seqlock(vtlb_lock); for_each_vcpu (d, v) { /* Purge TC entries. FIXME: clear only if match. */ @@ -213,6 +218,7 @@ void domain_flush_vtlb_range (struct dom /* ptc.ga */ ia64_global_tlb_purge(vadr,vadr+addr_range,PAGE_SHIFT); + write_sequnlock(vtlb_lock); } static void flush_tlb_vhpt_all (struct domain *d) @@ -224,6 +230,8 @@ static void flush_tlb_vhpt_all (struct d local_flush_tlb_all (); } +// this is called when a domain is destroyed +// so that there is no race. void domain_flush_destroy (struct domain *d) { /* Very heavy... */ @@ -233,8 +241,10 @@ void domain_flush_destroy (struct domain void flush_tlb_mask(cpumask_t mask) { +seqlock_t* vtlb_lock = current-domain-arch.vtlb_lock; int cpu; +write_seqlock(vtlb_lock); cpu = smp_processor_id(); if (cpu_isset (cpu, mask)) { cpu_clear(cpu, mask); @@ -242,11 +252,13 @@ void flush_tlb_mask(cpumask_t mask) } if (cpus_empty(mask)) -return; +goto out; for_each_cpu_mask (cpu, mask) smp_call_function_single (cpu, (void (*)(void *))flush_tlb_vhpt_all, NULL, 1, 1); +out: +write_sequnlock(vtlb_lock); } void zero_vhpt_stats(void) diff -r b6d7dc918455 -r b27c2f9cb883 xen/include/asm-ia64/domain.h --- a/xen/include/asm-ia64/domain.h Fri Jun 09 15:19:01 2006 +0900 +++ b/xen/include/asm-ia64/domain.h Fri
[Xen-ia64-devel] [PATCH/RFC] xensetup rework
Hi, I've been re-working the early start_kernel() section of xensetup.c to work better with the newer upstream efi changes required to boot on Kouya's PRIMEQUEST system. The main problem is the ordering of calling reserve_memory() versus setting up the xenheap area and moving the dom0 kernel image and ramdisk. We also need to make sure the xenheap area is in a type EFI_LOADER_DATA descriptor to prevent the efi code from using it to store the kernel copy of the MDT. The attached patch addresses these issues. Not shown is a trivial addition to efi.c called efi_get_md() which returns a memory descriptor covering a given address. One notable difference between this code and what's currently in the tree is that the dom0 and initrd images are only moved if they overlap with the xenheap area. The overlap should be rare, but I have hacked a version of elilo for testing. I'm not sure why we unconditionally moved these before. I'd appreciate any comments or feedback. Thanks, Alex -- Alex Williamson HP Open Source Linux Org. diff -r b87ff075dab9 xen/arch/ia64/xen/xensetup.c --- a/xen/arch/ia64/xen/xensetup.c Thu Jun 08 11:08:35 2006 -0600 +++ b/xen/arch/ia64/xen/xensetup.c Fri Jun 09 00:05:21 2006 -0600 @@ -90,20 +90,6 @@ xen_count_pages(u64 start, u64 end, void return 0; } -/* Find first hole after trunk for xen image */ -static int -xen_find_first_hole(u64 start, u64 end, void *arg) -{ -unsigned long *first_hole = arg; - -if ((*first_hole) == 0) { - if ((start = KERNEL_START) (KERNEL_START end)) - *first_hole = __pa(end); -} - -return 0; -} - static void __init do_initcalls(void) { initcall_t *call; @@ -197,15 +183,19 @@ efi_print(void) } } +extern efi_memory_desc_t *efi_get_md(unsigned long); +extern int is_available_memory(efi_memory_desc_t *); + void start_kernel(void) { unsigned char *cmdline; void *heap_start; -unsigned long nr_pages, firsthole_start; +unsigned long nr_pages; unsigned long dom0_memory_start, dom0_memory_size; unsigned long dom0_initrd_start, dom0_initrd_size; -unsigned long initial_images_start, initial_images_end; +unsigned long md_end, relo_start, relo_end, relo_size = 0; struct domain *idle_domain; +efi_memory_desc_t *kern_md, *last_md, *md; #ifdef CONFIG_SMP int i; #endif @@ -230,67 +220,106 @@ void start_kernel(void) init_console(); set_printk_prefix((XEN) ); +if (running_on_sim || ia64_boot_param-domain_start == 0 || + ia64_boot_param-domain_size == 0) { +/* This is possible only with the old elilo, which does not support + a vmm. Fix now, and continue without initrd. */ +printk (Your elilo is not Xen-aware. Bootparams fixed\n); +ia64_boot_param-domain_start = ia64_boot_param-initrd_start; +ia64_boot_param-domain_size = ia64_boot_param-initrd_size; +ia64_boot_param-initrd_start = 0; +ia64_boot_param-initrd_size = 0; +} + /* xenheap should be in same TR-covered range with xen image */ xenheap_phys_end = xen_pstart + xenheap_size; printk(xen image pstart: 0x%lx, xenheap pend: 0x%lx\n, - xen_pstart, xenheap_phys_end); - -/* Find next hole */ -firsthole_start = 0; -efi_memmap_walk(xen_find_first_hole, firsthole_start); - -if (running_on_sim || ia64_boot_param-domain_start == 0 - || ia64_boot_param-domain_size == 0) { - /* This is possible only with the old elilo, which does not support - a vmm. Fix now, and continue without initrd. */ - printk (Your elilo is not Xen-aware. Bootparams fixed\n); - ia64_boot_param-domain_start = ia64_boot_param-initrd_start; - ia64_boot_param-domain_size = ia64_boot_param-initrd_size; - ia64_boot_param-initrd_start = 0; - ia64_boot_param-initrd_size = 0; -} - -initial_images_start = xenheap_phys_end; -initial_images_end = initial_images_start + - PAGE_ALIGN(ia64_boot_param-domain_size); - -/* also reserve space for initrd */ -if (ia64_boot_param-initrd_start ia64_boot_param-initrd_size) - initial_images_end += PAGE_ALIGN(ia64_boot_param-initrd_size); -else { - /* sanity cleanup */ - ia64_boot_param-initrd_size = 0; - ia64_boot_param-initrd_start = 0; -} - - -/* Later may find another memory trunk, even away from xen image... */ -if (initial_images_end firsthole_start) { - printk(Not enough memory to stash the DOM0 kernel image.\n); - printk(First hole:0x%lx, relocation end: 0x%lx\n, - firsthole_start, initial_images_end); - for ( ; ; ); -} - -/* This copy is time consuming, but elilo may load Dom0 image - * within xenheap range */ -printk(ready to move Dom0 to 0x%lx with len %lx..., initial_images_start, - ia64_boot_param-domain_size); - -memmove(__va(initial_images_start), - __va(ia64_boot_param-domain_start), -
Re: [Xen-ia64-devel] [PATCH/RFC] xensetup rework
Hello Alex. Currently the area of dom0kernel and initrd aren't freed after they are copied into dom0 speudo physical address space. Would it become easier to free those area with this patch? Thanks. On Fri, Jun 09, 2006 at 12:28:24AM -0600, Alex Williamson wrote: Hi, I've been re-working the early start_kernel() section of xensetup.c to work better with the newer upstream efi changes required to boot on Kouya's PRIMEQUEST system. The main problem is the ordering of calling reserve_memory() versus setting up the xenheap area and moving the dom0 kernel image and ramdisk. We also need to make sure the xenheap area is in a type EFI_LOADER_DATA descriptor to prevent the efi code from using it to store the kernel copy of the MDT. The attached patch addresses these issues. Not shown is a trivial addition to efi.c called efi_get_md() which returns a memory descriptor covering a given address. One notable difference between this code and what's currently in the tree is that the dom0 and initrd images are only moved if they overlap with the xenheap area. The overlap should be rare, but I have hacked a version of elilo for testing. I'm not sure why we unconditionally moved these before. I'd appreciate any comments or feedback. Thanks, Alex -- Alex Williamson HP Open Source Linux Org. ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel -- yamahata ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
[Xen-ia64-devel][PATCH] Change PIB size to 2M
Signed-off-by: Anthony Xu [EMAIL PROTECTED] Thanks, -Anthony change_PIB_2M.patch Description: change_PIB_2M.patch ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
RE: [Xen-ia64-devel][PATCH] Change PIB size to 2M
From: Isaku Yamahata [mailto:[EMAIL PROTECTED] Sent: 2006?6?9? 15:18 To: Xu, Anthony Cc: xen-ia64-devel@lists.xensource.com Subject: Re: [Xen-ia64-devel][PATCH] Change PIB size to 2M Hi Anthony. Why do you want to change the size? This is a bug. The default PIB size is 2M, the other 1M include XTP and INTA. We need to virtualize XTP and INTA. On Fri, Jun 09, 2006 at 02:47:34PM +0800, Xu, Anthony wrote: Signed-off-by: Anthony Xu [EMAIL PROTECTED] Thanks, -Anthony ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel -- yamahata ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Re: [Xen-ia64-devel] [PATCH] sparse tree cleanups
Hi, Alex Without seeing the changes, it's hard to say. What I mean by simple checks are that it cannot call functions or declare variables that are only defined in CONFIG_XEN code. It's minor cleanup that you may not be able to use. Thanks, OK, I understand it. And I wanted to cleanup xenpage in linux-2.6-sparse/mm/memory.c But this xenpage isn't already used. So I simply remove it. I'll post this patch with another mail. Best Regards, Akio Takebe On Wed, 2006-06-07 at 15:08 +0900, Akio Takebe wrote: Hi, Alex I agree your suggestion. But your patch use ifdef CONFIG_XEN. You say we use simple is_running_on_xen() checks, aren't you? Is this mistake? or do I mis-understand? I want to clean up mm/memory.c. (This work is for cleanup fedora-xen's warning.) I should use is_running_on_xen() in mm/memory.c, shouldn't I? Hi Akio, Without seeing the changes, it's hard to say. What I mean by simple checks are that it cannot call functions or declare variables that are only defined in CONFIG_XEN code. It's minor cleanup that you may not be able to use. Thanks, Alex -- Alex Williamson HP Open Source Linux Org. ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
[Xen-ia64-devel] [patch] cleanup warning for fedora core
Hi, I remove xenpage in linux-2.6-xen-sparse/mm/memory.c This xenpage isn't used already. Signed-off-by: Akio Takebe [EMAIL PROTECTED] diff -r b87ff075dab9 linux-2.6-xen-sparse/mm/memory.c --- a/linux-2.6-xen-sparse/mm/memory.c Thu Jun 08 11:08:35 2006 -0600 +++ b/linux-2.6-xen-sparse/mm/memory.c Fri Jun 09 13:07:28 2006 +0900 @@ -968,7 +968,6 @@ int get_user_pages(struct task_struct *t { int i; unsigned int vm_flags; - int xenpage = 0; /* * Require read or write permissions. @@ -1026,7 +1025,6 @@ int get_user_pages(struct task_struct *t if (vma (vma-vm_flags VM_FOREIGN)) { struct page **map = vma-vm_private_data; int offset = (start - vma-vm_start) PAGE_SHIFT; - xenpage =1; if (map[offset] != NULL) { if (pages) { struct page *page = map[offset]; Best Regards, Akio Takebe remove_xenpage.patch Description: Binary data ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
[Xen-ia64-devel] [PATCH] add volatile to pte entry of the p2m table
add volatile to pte entry of the p2m table. p2m table are shared by cpu. added volatile as compiler barrier. -- yamahata # HG changeset patch # User [EMAIL PROTECTED] # Node ID 6e352c348fdb1baedbb35563d4e4e9579749c652 # Parent 68916203eb9717d6fb663fb89eab7378dba9944c add volatile pte entry of the p2m table. p2m table are shared by cpu. added volatile as compiler barrier. PATCHNAME: volatile_pte_t Signed-off-by: Isaku Yamahata [EMAIL PROTECTED] diff -r 68916203eb97 -r 6e352c348fdb xen/arch/ia64/xen/mm.c --- a/xen/arch/ia64/xen/mm.cFri Jun 09 16:22:24 2006 +0900 +++ b/xen/arch/ia64/xen/mm.cFri Jun 09 17:50:53 2006 +0900 @@ -349,7 +349,7 @@ unsigned long translate_domain_mpaddr(un // pud, pmd, pte page is zero cleared when they are allocated. // Their area must be visible before population so that // cmpxchg must have release semantics. -static pte_t* +static volatile pte_t* lookup_alloc_domain_pte(struct domain* d, unsigned long mpaddr) { struct mm_struct *mm = d-arch.mm; @@ -392,11 +392,11 @@ lookup_alloc_domain_pte(struct domain* d } } -return pte_offset_map(pmd, mpaddr); +return (volatile pte_t*)pte_offset_map(pmd, mpaddr); } //XXX xxx_none() should be used instread of !xxx_present()? -static pte_t* +static volatile pte_t* lookup_noalloc_domain_pte(struct domain* d, unsigned long mpaddr) { struct mm_struct *mm = d-arch.mm; @@ -417,11 +417,11 @@ lookup_noalloc_domain_pte(struct domain* if (unlikely(!pmd_present(*pmd))) return NULL; -return pte_offset_map(pmd, mpaddr); +return (volatile pte_t*)pte_offset_map(pmd, mpaddr); } #ifdef CONFIG_XEN_IA64_DOM0_VP -static pte_t* +static volatile pte_t* lookup_noalloc_domain_pte_none(struct domain* d, unsigned long mpaddr) { struct mm_struct *mm = d-arch.mm; @@ -442,13 +442,13 @@ lookup_noalloc_domain_pte_none(struct do if (unlikely(pmd_none(*pmd))) return NULL; -return pte_offset_map(pmd, mpaddr); +return (volatile pte_t*)pte_offset_map(pmd, mpaddr); } unsigned long lookup_domain_mpa(struct domain *d, unsigned long mpaddr) { -pte_t *pte; +volatile pte_t *pte; pte = lookup_noalloc_domain_pte(d, mpaddr); if (pte == NULL) @@ -515,7 +515,7 @@ __tr_entry_print_all(const char* func, i unsigned long lookup_domain_mpa(struct domain *d, unsigned long mpaddr) { -pte_t *pte; +volatile pte_t *pte; #ifdef CONFIG_DOMAIN0_CONTIGUOUS if (d == dom0) { @@ -531,9 +531,10 @@ unsigned long lookup_domain_mpa(struct d #endif pte = lookup_noalloc_domain_pte(d, mpaddr); if (pte != NULL) { -if (pte_present(*pte)) { +pte_t tmp_pte = *pte;// pte is volatile. copy the value. +if (pte_present(tmp_pte)) { //printk(lookup_domain_page: found mapping for %lx, pte=%lx\n,mpaddr,pte_val(*pte)); -return pte_val(*pte); +return pte_val(tmp_pte); } else if (VMX_DOMAIN(d-vcpu[0])) return GPFN_INV_MASK; } @@ -582,7 +583,8 @@ void *domain_mpa_to_imva(struct domain * /* Allocate a new page for domain and map it to the specified metaphysical address. */ struct page_info * -__assign_new_domain_page(struct domain *d, unsigned long mpaddr, pte_t* pte) +__assign_new_domain_page(struct domain *d, unsigned long mpaddr, + volatile pte_t* pte) { struct page_info *p = NULL; unsigned long maddr; @@ -644,7 +646,7 @@ assign_new_domain_page(struct domain *d, return __assign_new_domain_page(d, mpaddr, dummy_pte); #else struct page_info *p = NULL; -pte_t *pte; +volatile pte_t *pte; pte = lookup_alloc_domain_pte(d, mpaddr); if (pte_none(*pte)) { @@ -662,7 +664,7 @@ assign_new_domain0_page(struct domain *d assign_new_domain0_page(struct domain *d, unsigned long mpaddr) { #ifndef CONFIG_DOMAIN0_CONTIGUOUS -pte_t *pte; +volatile pte_t *pte; BUG_ON(d != dom0); pte = lookup_alloc_domain_pte(d, mpaddr); @@ -682,7 +684,7 @@ __assign_domain_page(struct domain *d, unsigned long mpaddr, unsigned long physaddr, unsigned long flags) { -pte_t *pte; +volatile pte_t *pte; unsigned long arflags = (flags ASSIGN_readonly)? _PAGE_AR_R: _PAGE_AR_RWX; pte = lookup_alloc_domain_pte(d, mpaddr); @@ -811,7 +813,7 @@ assign_domain_page_replace(struct domain unsigned long mfn, unsigned long flags) { struct mm_struct *mm = d-arch.mm; -pte_t* pte; +volatile pte_t* pte; pte_t old_pte; pte_t npte; unsigned long arflags = (flags ASSIGN_readonly)? _PAGE_AR_R: _PAGE_AR_RWX; @@ -854,7 +856,7 @@ assign_domain_page_cmpxchg_rel(struct do unsigned long flags) { struct mm_struct *mm = d-arch.mm; -pte_t* pte; +volatile pte_t* pte; unsigned long old_mfn; unsigned long old_arflags; pte_t old_pte; @@ -866,9 +868,14 @@
[Xen-ia64-devel] Weekly benchmark results (ww23)
Hi, all I will inform this week's benchmark results. The tools used now is as follows. - unixbench4.1.0 - bonnie++-1.03 - ltp-full-20060306 - iozone3_191 - lmbench-3.0-a5 TEST ENVIRONMENT Machine : Tiger4 KERN : 2.6.16.13-xen changeset: 10255:4e78528e3480 Dom0 OS : RHEL4 U2 (no SMP) DomU OS : RHEL4 U2 (2P) No. of DomU's: 1 SUMMARY: - In this week, we tried guest-smp, which is two CPUs. issues: - LTP was hung in fsync02 on domU. - lmbench was hung in Bandwidth measurements on domU. TEST RESULT unixbench4.1.0: Pass bonnie++-1.03 : Pass ltp-full-20060306 : 2/2 FAIL iozone3_191 : Pass lmbench-3.0-a5: 1 FAIL Thanks and best regards, Fujita and Fujitsu members ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Re: [Xen-ia64-devel] Problems booting domU
Hello again! It`s ok Akio! My domU is booting, but it`s yet with problems: VFS: Cannot open root device sda7 or unknown-block(0,0) Please append a correct root= boot option Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) My new domU configuration: name=vm01 #kernel=/boot/efi/efi/debian/vmlinuz-2.6.16.13-xenU kernel=/boot/vmlinuz-2.6.16.13-xenU root=/dev/sda7 ro memory=128 disk=['file:/vserver/images/vm01.img,sda7,w','file:/vserver/images/vm01-swap.im$vif=[''] dhcp=off ip=192.168.0.101 netmask=255.255.255.0 gateway=192.168.0.1 hostname=vm01.example.com extra=xencons=tty0 console=tty0 root=/dev/sda7 3 My kernel of domU appear to be ok... Do you know what can be? Thanks! 2006/6/9, Akio Takebe [EMAIL PROTECTED]: Hi, RodrigoYou can add xencons=tty0 console=tty0 into extra option.My config is the below.==kernel = /boot/vmlinux-2.6.16.13-xenU ramdisk = /boot/initrd-2.6.16.13-xenU.imgmemory = 512name = rhel4disk = [ 'file:/xen/image/rhel4.img,hda1,w' ]root = /dev/hda1 roextra = nomca xencons=tty0 console=tty0 root=/dev/hda1 3 vcpus= 2cpus= 1-2==Best Regards,Akio TakebeHi Akio Takebe!That problem was resolved.Now, my domU boot, but don`t load... It`s stays stopped in Started domain vm01!debian-ia64:/home/peso# xm create -c -f /etc/xen/vm01-config.sxpUsing config file /etc/xen/vm01-config.sxp.Started domain vm01 debian-ia64:/home/peso# xm listNameID Mem(MiB) VCPUs StateTime(s)Domain-0 0236 1 r- 235.5vm01 2150 1 -- 143.3Thanks!2006/6/7, Akio Takebe [EMAIL PROTECTED]: Hi, Rodrigo Please try it as root user. And you may need to confirm that there is /etc/xen/vm01-config.sxp. Best Regards, Akio Takebe Hi, Rodrigo Please try the below. # xm create -c -f /etc/xen/vm01-config.sxp Best Regards, Akio Takebe I`m trying to boot my domU and occurrs the error below: debian-ia64:~# xm create -c /etc/xen/vm01-config.sxp ERROR: Could not obtain handle on privileged command interface (2 = No such file or directory) Using config file /etc/xen/vm01-config.sxp. Error: (2, 'No such file or directory')___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel ---html-part included links---mailto:[EMAIL PROTECTED]mailto: Xen-ia64-devel@lists.xensource.com ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Re: [Xen-ia64-devel] [patch] cleanup warning for fedora core
On Fri, 2006-06-09 at 16:52 +0900, Akio Takebe wrote: Hi, I remove xenpage in linux-2.6-xen-sparse/mm/memory.c This xenpage isn't used already. Hi Akio, This needs to be sent to xen-devel since it's not ia64 specific. Thanks, Alex diff -r b87ff075dab9 linux-2.6-xen-sparse/mm/memory.c --- a/linux-2.6-xen-sparse/mm/memory.cThu Jun 08 11:08:35 2006 -0600 +++ b/linux-2.6-xen-sparse/mm/memory.cFri Jun 09 13:07:28 2006 +0900 @@ -968,7 +968,6 @@ int get_user_pages(struct task_struct *t { int i; unsigned int vm_flags; - int xenpage = 0; /* * Require read or write permissions. @@ -1026,7 +1025,6 @@ int get_user_pages(struct task_struct *t if (vma (vma-vm_flags VM_FOREIGN)) { struct page **map = vma-vm_private_data; int offset = (start - vma-vm_start) PAGE_SHIFT; - xenpage =1; if (map[offset] != NULL) { if (pages) { struct page *page = map[offset]; -- Alex Williamson HP Open Source Linux Org. ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Re: [Xen-ia64-devel] [PATCH/RFC] xensetup rework
On Fri, 2006-06-09 at 15:45 +0900, Isaku Yamahata wrote: Hello Alex. Currently the area of dom0kernel and initrd aren't freed after they are copied into dom0 speudo physical address space. Would it become easier to free those area with this patch? Hi Isaku, I don't think it changes anything with respect to freeing them. This only changes how they get moved around to make space for the xenheap area. Do we necessarily want to free them? If we wanted to support dom0 restart we might need them around. Thanks, Alex -- Alex Williamson HP Open Source Linux Org. ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Re: [Xen-ia64-devel] [PATCH] add volatile to pte entry of the p2m table
On Fri, 2006-06-09 at 18:16 +0900, Isaku Yamahata wrote: add volatile to pte entry of the p2m table. p2m table are shared by cpu. added volatile as compiler barrier. Are all of these really needed? Seems a little overkill to me. Thanks, Alex -- Alex Williamson HP Open Source Linux Org. ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
[Xen-ia64-devel] [PATCH] new efi and modified xensetup
For final review; this is a port of a newer upsteam efi.c to xen/ia64. For the most part, this patch is simply incorporating this upstream linux-ia64 patch into the tree: http://www.kernel.org/hg/linux-2.6/?cs=fb781f6d3e81 The xensetup part is similar to what I sent out last night, but cleaned up quite a bit and changes some of the error checking logic. This patch should enable Xen on the Fujistu PRIMEQUEST system as the original EFI MDT is not longer manipulated in the efi_memmap_walk() code. Please test, review, and let me know if you spot any problems. Thanks, Alex Signed-off-by: Alex Williamson [EMAIL PROTECTED] diff -r aa2298739112 xen/arch/ia64/linux-xen/efi.c --- a/xen/arch/ia64/linux-xen/efi.c Fri Jun 09 10:40:31 2006 -0600 +++ b/xen/arch/ia64/linux-xen/efi.c Fri Jun 09 13:53:52 2006 -0600 @@ -246,57 +246,30 @@ is_available_memory (efi_memory_desc_t * return 0; } -/* - * Trim descriptor MD so its starts at address START_ADDR. If the descriptor covers - * memory that is normally available to the kernel, issue a warning that some memory - * is being ignored. - */ +typedef struct kern_memdesc { + u64 attribute; + u64 start; + u64 num_pages; +} kern_memdesc_t; + +static kern_memdesc_t *kern_memmap; + static void -trim_bottom (efi_memory_desc_t *md, u64 start_addr) -{ - u64 num_skipped_pages; - - if (md-phys_addr = start_addr || !md-num_pages) - return; - - num_skipped_pages = (start_addr - md-phys_addr) EFI_PAGE_SHIFT; - if (num_skipped_pages md-num_pages) - num_skipped_pages = md-num_pages; - - if (is_available_memory(md)) - printk(KERN_NOTICE efi.%s: ignoring %luKB of memory at 0x%lx due to granule hole - at 0x%lx\n, __FUNCTION__, - (num_skipped_pages EFI_PAGE_SHIFT) 10, - md-phys_addr, start_addr - IA64_GRANULE_SIZE); - /* - * NOTE: Don't set md-phys_addr to START_ADDR because that could cause the memory - * descriptor list to become unsorted. In such a case, md-num_pages will be - * zero, so the Right Thing will happen. - */ - md-phys_addr += num_skipped_pages EFI_PAGE_SHIFT; - md-num_pages -= num_skipped_pages; -} - -static void -trim_top (efi_memory_desc_t *md, u64 end_addr) -{ - u64 num_dropped_pages, md_end_addr; - - md_end_addr = md-phys_addr + (md-num_pages EFI_PAGE_SHIFT); - - if (md_end_addr = end_addr || !md-num_pages) - return; - - num_dropped_pages = (md_end_addr - end_addr) EFI_PAGE_SHIFT; - if (num_dropped_pages md-num_pages) - num_dropped_pages = md-num_pages; - - if (is_available_memory(md)) - printk(KERN_NOTICE efi.%s: ignoring %luKB of memory at 0x%lx due to granule hole - at 0x%lx\n, __FUNCTION__, - (num_dropped_pages EFI_PAGE_SHIFT) 10, - md-phys_addr, end_addr); - md-num_pages -= num_dropped_pages; +walk (efi_freemem_callback_t callback, void *arg, u64 attr) +{ + kern_memdesc_t *k; + u64 start, end, voff; + + voff = (attr == EFI_MEMORY_WB) ? PAGE_OFFSET : __IA64_UNCACHED_OFFSET; + for (k = kern_memmap; k-start != ~0UL; k++) { + if (k-attribute != attr) + continue; + start = PAGE_ALIGN(k-start); + end = (k-start + (k-num_pages EFI_PAGE_SHIFT)) PAGE_MASK; + if (start end) + if ((*callback)(start + voff, end + voff, arg) 0) +return; + } } /* @@ -306,153 +279,17 @@ void void efi_memmap_walk (efi_freemem_callback_t callback, void *arg) { - int prev_valid = 0; - struct range { - u64 start; - u64 end; - } prev, curr; - void *efi_map_start, *efi_map_end, *p, *q; - efi_memory_desc_t *md, *check_md; - u64 efi_desc_size, start, end, granule_addr, last_granule_addr, first_non_wb_addr = 0; - unsigned long total_mem = 0; - - efi_map_start = __va(ia64_boot_param-efi_memmap); - efi_map_end = efi_map_start + ia64_boot_param-efi_memmap_size; - efi_desc_size = ia64_boot_param-efi_memdesc_size; - - for (p = efi_map_start; p efi_map_end; p += efi_desc_size) { - md = p; - - /* skip over non-WB memory descriptors; that's all we're interested in... */ - if (!(md-attribute EFI_MEMORY_WB)) - continue; - -#ifdef XEN -// this works around a problem in the ski bootloader -{ - extern long running_on_sim; - if (running_on_sim md-type != EFI_CONVENTIONAL_MEMORY) - continue; -} -#endif - /* - * granule_addr is the base of md's first granule. - * [granule_addr - first_non_wb_addr) is guaranteed to - * be contiguous WB memory. - */ - granule_addr = GRANULEROUNDDOWN(md-phys_addr); - first_non_wb_addr = max(first_non_wb_addr, granule_addr); - - if (first_non_wb_addr md-phys_addr) { - trim_bottom(md, granule_addr + IA64_GRANULE_SIZE); - granule_addr = GRANULEROUNDDOWN(md-phys_addr); - first_non_wb_addr = max(first_non_wb_addr, granule_addr); - } - - for (q = p; q efi_map_end; q += efi_desc_size) { - check_md = q; - - if ((check_md-attribute EFI_MEMORY_WB) - (check_md-phys_addr == first_non_wb_addr)) -first_non_wb_addr += check_md-num_pages EFI_PAGE_SHIFT; - else -break; /* non-WB or hole */ - } - - last_granule_addr =
Re: [Xen-ia64-devel] [PATCH] add volatile to pte entry of the p2m table
Hi Alex. On Fri, Jun 09, 2006 at 11:06:52AM -0600, Alex Williamson wrote: On Fri, 2006-06-09 at 18:16 +0900, Isaku Yamahata wrote: add volatile to pte entry of the p2m table. p2m table are shared by cpu. added volatile as compiler barrier. Are all of these really needed? Seems a little overkill to me. Actually no. assign_new_domain_page() and its families and domain_page_mapped() are used only when domain construction (for now). So their pte accesses aren't racy. However, to remove volatile of them, non-volatile version of lookup_alloc_domain_pte() is needed. Because domain creation isn't performance critical, I did't think it was worthwhile to both volatile version and non-volatile version of lookup_alloc_domain_pte(). Scattering volatile is very ugly and I don't have any reason to stick to add volatile to assing_new_domain_page() and its variants. If you prefer, I'll remove volatile of them. -- yamahata ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel