[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-ia64-devel] Re: [Xen-devel] Xen 3.1.1 -- initial patchqueue
Alex Williamson writes: > Other ia64'ers, please speak up if there's something else missing. Hi Keir and Alex, Here's a list of additional(missing) patches for IA64: Must have fixes for HVM: http://xenbits.xensource.com/xen-unstable.hg?rev/8924215a5f95 15086-8924215a5f95 - fix VHPT insertion http://xenbits.xensource.com/xen-unstable.hg?rev/31be207e005e 15113-31be207e005e - fix VHPT walk http://xenbits.xensource.com/xen-unstable.hg?rev/7812598f65be 15115-7812598f65be - fix xen crash (vpd allocation) http://xenbits.xensource.com/xen-unstable.hg?rev/d6309cfd1fdd 15116-d6309cfd1fdd - fix resource allocation (rid) http://xenbits.xensource.com/xen-unstable.hg?rev/fd72e71de51a 15119-fd72e71de51a - fix Windows crash http://xenbits.xensource.com/xen-unstable.hg?rev/afb27041a2ce 15122-afb27041a2ce - fix Windows crash http://xenbits.xensource.com/xen-unstable.hg?rev/d30576123892 15307-d30576123892 - fix resource allocation (vpd size) http://xenbits.xensource.com/xen-unstable.hg?rev/466f71b1e831 *15311-466f71b1e831 - fix crash of VTI domain http://xenbits.xensource.com/xen-unstable.hg?rev/2fd72ec88a9a 15341-2fd72ec88a9a - fix boot of VTI domain Must have fixes: http://xenbits.xensource.com/xen-unstable.hg?rev/34f285b57b87 15568-34f285b57b87 - fix soft lock up http://xenbits.xensource.com/xen-unstable.hg?rev/9cd309378326 *15655-9cd309378326 - fix boot on NUMA systems http://xenbits.xensource.com/xen-unstable.hg?rev/2796311c6a55 15742-2796311c6a55 - fix boot related MCA Must have fixes for save/restore: http://xenbits.xensource.com/xen-unstable.hg?rev/204046d99562 15090-204046d99562 - fix time_resume() http://xenbits.xensource.com/xen-unstable.hg?rev/63263d715d43 15093-63263d715d43 - fix vcpu hotplug http://xenbits.xensource.com/xen-unstable.hg?rev/1a010d9444ba 15103-1a010d9444ba - prevent softlock up message http://xenbits.xensource.com/xen-unstable.hg?rev/8b9637467068 15107-8b9637467068 - fix save/restore An attached patch can be applied to xen-3.1-testing.pq.hg. Patches with an asterisk above are modified for xen-3.1-testing.hg. Thanks, Kouya Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx> 15086-8924215a5f95 | 80 ++++++++++++++++++++++++ 15090-204046d99562 | 103 +++++++++++++++++++++++++++++++ 15093-63263d715d43 | 141 +++++++++++++++++++++++++++++++++++++++++++ 15103-1a010d9444ba | 33 ++++++++++ 15107-8b9637467068 | 172 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 15113-31be207e005e | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 15115-7812598f65be | 28 ++++++++ 15116-d6309cfd1fdd | 31 +++++++++ 15119-fd72e71de51a | 101 +++++++++++++++++++++++++++++++ 15122-afb27041a2ce | 81 ++++++++++++++++++++++++ 15307-d30576123892 | 25 +++++++ 15311-466f71b1e831 | 82 +++++++++++++++++++++++++ 15341-2fd72ec88a9a | 48 ++++++++++++++ 15568-34f285b57b87 | 69 +++++++++++++++++++++ 15655-9cd309378326 | 46 ++++++++++++++ 15742-2796311c6a55 | 23 +++++++ 16 files changed, 1233 insertions(+) # HG changeset patch # User Kouya Shimura <kouya@xxxxxxxxxxxxxx> # Date 1189576945 -32400 # Node ID 41c9c4fcf3586947e3e79ad340da9d4ba7556294 # Parent 7ba52aa72ae5c0834df9570251ce7bf806a20a1d Additional fixes for IA64. diff -r 7ba52aa72ae5 -r 41c9c4fcf358 15086-8924215a5f95 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/15086-8924215a5f95 Wed Sep 12 15:02:25 2007 +0900 @@ -0,0 +1,80 @@ +# HG changeset patch +# User Alex Williamson <alex.williamson@xxxxxx> +# Date 1178222479 21600 +# Node ID 8924215a5f952d3127d24203a14e4b8d7e642a69 +# Parent 6cf6f49f26abd61e011a6513512478d7d2a0af70 +[IA64] Always insert entry to VHPT's head, or double TLB miss occurs. + +Always insert entry to VHPT head, or TLB miss will occur again although +the translation exists in its collision chain. + +Signed-off-by: Zhang xiantao <xiantao.zhang@xxxxxxxxx> +Signed-off-by: Anthony Xu <anthony.xu@xxxxxxxxx> +xen-unstable changeset: 15086:8924215a5f952d3127d24203a14e4b8d7e642a69 +xen-unstable date: Thu May 03 14:01:19 2007 -0600 + +diff -r 6cf6f49f26ab -r 8924215a5f95 xen/arch/ia64/vmx/vtlb.c +--- a/xen/arch/ia64/vmx/vtlb.c Thu May 03 13:55:28 2007 -0600 ++++ b/xen/arch/ia64/vmx/vtlb.c Thu May 03 14:01:19 2007 -0600 +@@ -150,33 +150,41 @@ static void vmx_vhpt_insert(thash_cb_t * + tag = ia64_ttag(ifa); + cch = head; + while (cch) { +- if (INVALID_VHPT(cch)) { +- len = cch->len; +- cch->page_flags = pte; +- cch->len = len; +- cch->itir = rr.ps << 2; +- cch->etag = tag; +- return; +- } ++ if (INVALID_VHPT(cch)) ++ break; + cch = cch->next; + } +- +- if(head->len>=MAX_CCN_DEPTH){ +- thash_recycle_cch(hcb, head); +- cch = cch_alloc(hcb); ++ if (cch) { ++ if (cch == head) { ++ len = head->len; ++ } else { ++ local_irq_disable(); ++ cch->page_flags = head->page_flags; ++ cch->itir = head->itir; ++ cch->etag = head->etag; ++ len = head->len; ++ local_irq_enable(); ++ } + } + else{ +- cch = __alloc_chain(hcb); +- } +- local_irq_disable(); +- *cch = *head; ++ if (head->len >= MAX_CCN_DEPTH) { ++ thash_recycle_cch(hcb, head); ++ cch = cch_alloc(hcb); ++ } else { ++ cch = __alloc_chain(hcb); ++ } ++ local_irq_disable(); ++ *cch = *head; ++ head->next = cch; ++ len = cch->len+1; ++ cch->len = 0; ++ local_irq_enable(); ++ } ++ + head->page_flags=pte; ++ head->len = len; + head->itir = rr.ps << 2; + head->etag=tag; +- head->next = cch; +- head->len = cch->len+1; +- cch->len = 0; +- local_irq_enable(); + return; + } + diff -r 7ba52aa72ae5 -r 41c9c4fcf358 15090-204046d99562 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/15090-204046d99562 Wed Sep 12 15:02:25 2007 +0900 @@ -0,0 +1,103 @@ +# HG changeset patch +# User Alex Williamson <alex.williamson@xxxxxx> +# Date 1178223699 21600 +# Node ID 204046d995621fe88649daaaffa32ee42c18cdd4 +# Parent a141484a91d0c420f1227e0914d61aaf74fb406b +[IA64] Fix time_resume() + +Add missing exclusion in time_resume() and steal time accounting +reinitialization after resume. + +Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx> +xen-unstable changeset: 15090:204046d995621fe88649daaaffa32ee42c18cdd4 +xen-unstable date: Thu May 03 14:21:39 2007 -0600 + +diff -r a141484a91d0 -r 204046d99562 linux-2.6-xen-sparse/arch/ia64/kernel/time.c +--- a/linux-2.6-xen-sparse/arch/ia64/kernel/time.c Thu May 03 14:14:41 2007 -0600 ++++ b/linux-2.6-xen-sparse/arch/ia64/kernel/time.c Thu May 03 14:21:39 2007 -0600 +@@ -267,6 +267,62 @@ static void init_missing_ticks_accountin + per_cpu(processed_stolen_time, cpu) = runstate->time[RUNSTATE_runnable] + + runstate->time[RUNSTATE_offline]; + } ++ ++static int xen_ia64_settimefoday_after_resume; ++ ++static int __init __xen_ia64_settimeofday_after_resume(char *str) ++{ ++ xen_ia64_settimefoday_after_resume = 1; ++ return 1; ++} ++ ++__setup("xen_ia64_settimefoday_after_resume", ++ __xen_ia64_settimeofday_after_resume); ++ ++/* Called after suspend, to resume time. */ ++void ++time_resume(void) ++{ ++ unsigned int cpu; ++ ++ /* Just trigger a tick. */ ++ ia64_cpu_local_tick(); ++ ++ if (xen_ia64_settimefoday_after_resume) { ++ /* do_settimeofday() resets timer interplator */ ++ struct timespec xen_time; ++ int ret; ++ efi_gettimeofday(&xen_time); ++ ++ ret = do_settimeofday(&xen_time); ++ WARN_ON(ret); ++ } else { ++#if 0 ++ /* adjust EFI time */ ++ struct timespec my_time = CURRENT_TIME; ++ struct timespec xen_time; ++ static timespec diff; ++ struct xen_domctl domctl; ++ int ret; ++ ++ efi_gettimeofday(&xen_time); ++ diff = timespec_sub(&xen_time, &my_time); ++ domctl.cmd = XEN_DOMCTL_settimeoffset; ++ domctl.domain = DOMID_SELF; ++ domctl.u.settimeoffset.timeoffset_seconds = diff.tv_sec; ++ ret = HYPERVISOR_domctl_op(&domctl); ++ WARN_ON(ret); ++#endif ++ /* Time interpolator remembers the last timer status. ++ Forget it */ ++ write_seqlock_irq(&xtime_lock); ++ time_interpolator_reset(); ++ write_sequnlock_irq(&xtime_lock); ++ } ++ ++ for_each_online_cpu(cpu) ++ init_missing_ticks_accounting(cpu); ++} + #else + #define init_missing_ticks_accounting(cpu) do {} while (0) + #endif +diff -r a141484a91d0 -r 204046d99562 linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c +--- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c Thu May 03 14:14:41 2007 -0600 ++++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c Thu May 03 14:21:39 2007 -0600 +@@ -863,19 +863,6 @@ direct_remap_pfn_range(struct vm_area_st + } + + +-/* Called after suspend, to resume time. */ +-void +-time_resume(void) +-{ +- extern void ia64_cpu_local_tick(void); +- +- /* Just trigger a tick. */ +- ia64_cpu_local_tick(); +- +- /* Time interpolator remembers the last timer status. Forget it */ +- time_interpolator_reset(); +-} +- + /////////////////////////////////////////////////////////////////////////// + // expose p2m table + #ifdef CONFIG_XEN_IA64_EXPOSE_P2M diff -r 7ba52aa72ae5 -r 41c9c4fcf358 15093-63263d715d43 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/15093-63263d715d43 Wed Sep 12 15:02:25 2007 +0900 @@ -0,0 +1,141 @@ +# HG changeset patch +# User Alex Williamson <alex.williamson@xxxxxx> +# Date 1178224706 21600 +# Node ID 63263d715d4309e7bccdd43d0f9c5c49be8c52ac +# Parent f8aede89c7065a5376a544c0b9bd49d4b22ac954 +[IA64] Fix vcpu hotplug + +When domain is saved and restored, the following message is printed out. +bind_ipi_to_irqhandler()/bind_virq_to_irqhandler() should be called +in process context. Move the call from cpu_init() to __cpu_init() like x86. + +BUG: sleeping function called from invalid context at /src1/yamahata/hg/xen/ia64 +/my150/compile/test-0/xen-ia64-unstable.hg/linux-2.6.18-xen/mm/slab.c:2901 +in_atomic():0, irqs_disabled():1 + +Call Trace: + [<a00000010001b190>] show_stack+0x50/0xa0 + sp=e0000000004ff8b0 bsp=e0000000004f9358 + [<a00000010001b210>] dump_stack+0x30/0x60 + sp=e0000000004ffa80 bsp=e0000000004f9340 + [<a000000100070f40>] __might_sleep+0x2c0/0x2e0 + sp=e0000000004ffa80 bsp=e0000000004f9318 + [<a00000010012c230>] __kmalloc+0xb0/0x320 + sp=e0000000004ffa90 bsp=e0000000004f92e0 + [<a0000001001a98d0>] proc_create+0x110/0x1c0 + sp=e0000000004ffa90 bsp=e0000000004f9298 + [<a0000001001a9ca0>] proc_mkdir_mode+0x40/0xe0 + sp=e0000000004ffaa0 bsp=e0000000004f9268 + [<a0000001001a9d70>] proc_mkdir+0x30/0x60 + sp=e0000000004ffab0 bsp=e0000000004f9240 + [<a0000001000e97e0>] register_handler_proc+0x1a0/0x1e0 + sp=e0000000004ffab0 bsp=e0000000004f91f0 + [<a0000001000e6420>] setup_irq+0x440/0x4e0 + sp=e0000000004ffb30 bsp=e0000000004f9198 + [<a0000001000e68c0>] request_irq+0x140/0x1a0 + sp=e0000000004ffb30 bsp=e0000000004f9150 + [<a0000001003e7a20>] bind_ipi_to_irqhandler+0x260/0x2c0 + sp=e0000000004ffb30 bsp=e0000000004f90e8 + [<a000000100019780>] xen_register_percpu_irq+0x2c0/0x880 + sp=e0000000004ffb40 bsp=e0000000004f9098 + [<a00000010001a1f0>] xen_smp_intr_init+0x170/0x1c0 + sp=e0000000004ffb40 bsp=e0000000004f9070 + [<a00000010003d350>] cpu_init+0x1090/0x10e0 + sp=e0000000004ffb50 bsp=e0000000004f8fe0 + [<a0000001000607a0>] start_secondary+0xc0/0x520 + sp=e0000000004ffe30 bsp=e0000000004f8f90 + [<a0000001000105f0>] __end_ivt_text+0x6d0/0x700 + sp=e0000000004ffe30 bsp=e0000000004f8f90 + +Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx> +xen-unstable changeset: 15093:63263d715d4309e7bccdd43d0f9c5c49be8c52ac +xen-unstable date: Thu May 03 14:38:26 2007 -0600 + +diff -r f8aede89c706 -r 63263d715d43 linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c +--- a/linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c Thu May 03 14:27:26 2007 -0600 ++++ b/linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c Thu May 03 14:38:26 2007 -0600 +@@ -319,9 +319,9 @@ static struct irqaction resched_irqactio + * required. + */ + static void +-xen_register_percpu_irq (unsigned int vec, struct irqaction *action, int save) +-{ +- unsigned int cpu = smp_processor_id(); ++xen_register_percpu_irq(unsigned int cpu, unsigned int vec, ++ struct irqaction *action, int save) ++{ + irq_desc_t *desc; + int irq = 0; + +@@ -423,7 +423,8 @@ xen_bind_early_percpu_irq (void) + * BSP will face with such step shortly + */ + for (i = 0; i < late_irq_cnt; i++) +- xen_register_percpu_irq(saved_percpu_irqs[i].irq, ++ xen_register_percpu_irq(smp_processor_id(), ++ saved_percpu_irqs[i].irq, + saved_percpu_irqs[i].action, 0); + } + +@@ -479,11 +480,21 @@ static struct notifier_block unbind_evtc + #endif + + DECLARE_PER_CPU(int, ipi_to_irq[NR_IPIS]); ++void xen_smp_intr_init_early(unsigned int cpu) ++{ ++#ifdef CONFIG_SMP ++ unsigned int i; ++ ++ for (i = 0; i < saved_irq_cnt; i++) ++ xen_register_percpu_irq(cpu, saved_percpu_irqs[i].irq, ++ saved_percpu_irqs[i].action, 0); ++#endif ++} ++ + void xen_smp_intr_init(void) + { + #ifdef CONFIG_SMP + unsigned int cpu = smp_processor_id(); +- unsigned int i = 0; + struct callback_register event = { + .type = CALLBACKTYPE_event, + .address = (unsigned long)&xen_event_callback, +@@ -500,12 +511,9 @@ void xen_smp_intr_init(void) + + /* This should be piggyback when setup vcpu guest context */ + BUG_ON(HYPERVISOR_callback_op(CALLBACKOP_register, &event)); +- +- for (i = 0; i < saved_irq_cnt; i++) +- xen_register_percpu_irq(saved_percpu_irqs[i].irq, +- saved_percpu_irqs[i].action, 0); + #endif /* CONFIG_SMP */ + } ++ + #endif /* CONFIG_XEN */ + + void +@@ -516,7 +524,8 @@ register_percpu_irq (ia64_vector vec, st + + #ifdef CONFIG_XEN + if (is_running_on_xen()) +- return xen_register_percpu_irq(vec, action, 1); ++ return xen_register_percpu_irq(smp_processor_id(), ++ vec, action, 1); + #endif + + for (irq = 0; irq < NR_IRQS; ++irq) +@@ -572,6 +581,14 @@ ia64_send_ipi (int cpu, int vector, int + /* TODO: we need to call vcpu_up here */ + if (unlikely(vector == ap_wakeup_vector)) { + extern void xen_send_ipi (int cpu, int vec); ++ ++ /* XXX ++ * This should be in __cpu_up(cpu) in ia64 smpboot.c ++ * like x86. But don't want to modify it, ++ * keep it untouched. ++ */ ++ xen_smp_intr_init_early(cpu); ++ + xen_send_ipi (cpu, vector); + //vcpu_prepare_and_up(cpu); + return; diff -r 7ba52aa72ae5 -r 41c9c4fcf358 15103-1a010d9444ba --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/15103-1a010d9444ba Wed Sep 12 15:02:25 2007 +0900 @@ -0,0 +1,33 @@ +# HG changeset patch +# User Alex Williamson <alex.williamson@xxxxxx> +# Date 1178565164 21600 +# Node ID 1a010d9444baa9c1b44f42856f607ab584574315 +# Parent 7c176473786b4e96723f8fb3cd794cc4db8923e9 +[IA64] Prevent softlock up message when domain is restored. + +Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx> +xen-unstable changeset: 15103:1a010d9444baa9c1b44f42856f607ab584574315 +xen-unstable date: Mon May 07 13:12:44 2007 -0600 + +diff -r 7c176473786b -r 1a010d9444ba linux-2.6-xen-sparse/arch/ia64/kernel/time.c +--- a/linux-2.6-xen-sparse/arch/ia64/kernel/time.c Mon May 07 10:37:16 2007 -0600 ++++ b/linux-2.6-xen-sparse/arch/ia64/kernel/time.c Mon May 07 13:12:44 2007 -0600 +@@ -322,6 +322,8 @@ time_resume(void) + + for_each_online_cpu(cpu) + init_missing_ticks_accounting(cpu); ++ ++ touch_softlockup_watchdog(); + } + #else + #define init_missing_ticks_accounting(cpu) do {} while (0) +@@ -412,6 +414,9 @@ ia64_init_itm (void) + if (is_running_on_xen()) + init_missing_ticks_accounting(smp_processor_id()); + ++ /* avoid softlock up message when cpu is unplug and plugged again. */ ++ touch_softlockup_watchdog(); ++ + /* Setup the CPU local timer tick */ + ia64_cpu_local_tick(); + } diff -r 7ba52aa72ae5 -r 41c9c4fcf358 15107-8b9637467068 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/15107-8b9637467068 Wed Sep 12 15:02:25 2007 +0900 @@ -0,0 +1,172 @@ +# HG changeset patch +# User Alex Williamson <alex.williamson@xxxxxx> +# Date 1178642391 21600 +# Node ID 8b96374670680257cbb988a17dfb88516ef0e7d7 +# Parent d7303c4a9dabdc7b461e7915fb8cd9d03ff7570c +[IA64] Make p2m exposure compatible with suspend/resume and fix one bug. + +Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx> +xen-unstable changeset: 15107:8b96374670680257cbb988a17dfb88516ef0e7d7 +xen-unstable date: Tue May 08 10:39:51 2007 -0600 + +diff -r d7303c4a9dab -r 8b9637467068 linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c +--- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c Tue May 08 09:09:17 2007 -0600 ++++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c Tue May 08 10:39:51 2007 -0600 +@@ -48,6 +48,7 @@ static int p2m_expose_init(void); + static int p2m_expose_init(void); + #else + #define p2m_expose_init() (-ENOSYS) ++#define p2m_expose_resume() ((void)0) + #endif + + EXPORT_SYMBOL(__hypercall); +@@ -882,6 +883,8 @@ static struct resource p2m_resource = { + }; + static unsigned long p2m_assign_start_pfn __read_mostly; + static unsigned long p2m_assign_end_pfn __read_mostly; ++static unsigned long p2m_expose_size; // this is referenced only when resume. ++ // so __read_mostly doesn't make sense. + volatile const pte_t* p2m_pte __read_mostly; + + #define GRNULE_PFN PTRS_PER_PTE +@@ -942,8 +945,15 @@ p2m_expose_dtr_call(struct notifier_bloc + unsigned int cpu = (unsigned int)(long)ptr; + if (event != CPU_ONLINE) + return 0; +- if (!(p2m_initialized && xen_ia64_p2m_expose_use_dtr)) +- smp_call_function_single(cpu, &p2m_itr, &p2m_itr_arg, 1, 1); ++ if (p2m_initialized && xen_ia64_p2m_expose_use_dtr) { ++ unsigned int me = get_cpu(); ++ if (cpu == me) ++ p2m_itr(&p2m_itr_arg); ++ else ++ smp_call_function_single(cpu, &p2m_itr, &p2m_itr_arg, ++ 1, 1); ++ put_cpu(); ++ } + return 0; + } + +@@ -958,7 +968,6 @@ p2m_expose_init(void) + p2m_expose_init(void) + { + unsigned long num_pfn; +- unsigned long size = 0; + unsigned long p2m_size = 0; + unsigned long align = ~0UL; + int error = 0; +@@ -1010,7 +1019,7 @@ p2m_expose_init(void) + p2m_convert_max_pfn = ROUNDUP(p2m_max_low_pfn, + granule_pfn); + num_pfn = p2m_convert_max_pfn - p2m_convert_min_pfn; +- size = num_pfn << PAGE_SHIFT; ++ p2m_expose_size = num_pfn << PAGE_SHIFT; + p2m_size = num_pfn / PTRS_PER_PTE; + p2m_size = ROUNDUP(p2m_size, granule_pfn << PAGE_SHIFT); + if (p2m_size == page_size) +@@ -1030,7 +1039,7 @@ p2m_expose_init(void) + p2m_granule_pfn); + p2m_convert_max_pfn = ROUNDUP(p2m_max_low_pfn, p2m_granule_pfn); + num_pfn = p2m_convert_max_pfn - p2m_convert_min_pfn; +- size = num_pfn << PAGE_SHIFT; ++ p2m_expose_size = num_pfn << PAGE_SHIFT; + p2m_size = num_pfn / PTRS_PER_PTE; + p2m_size = ROUNDUP(p2m_size, p2m_granule_pfn << PAGE_SHIFT); + align = max(privcmd_resource_align, +@@ -1054,14 +1063,14 @@ p2m_expose_init(void) + + error = HYPERVISOR_expose_p2m(p2m_convert_min_pfn, + p2m_assign_start_pfn, +- size, p2m_granule_pfn); ++ p2m_expose_size, p2m_granule_pfn); + if (error) { + printk(KERN_ERR P2M_PREFIX "failed expose p2m hypercall %d\n", + error); + printk(KERN_ERR P2M_PREFIX "conv 0x%016lx assign 0x%016lx " +- "size 0x%016lx granule 0x%016lx\n", ++ "expose_size 0x%016lx granule 0x%016lx\n", + p2m_convert_min_pfn, p2m_assign_start_pfn, +- size, p2m_granule_pfn);; ++ p2m_expose_size, p2m_granule_pfn);; + release_resource(&p2m_resource); + goto out; + } +@@ -1104,6 +1113,49 @@ p2m_expose_cleanup(void) + } + #endif + ++static void ++p2m_expose_resume(void) ++{ ++ int error; ++ ++ if (!xen_ia64_p2m_expose || !p2m_initialized) ++ return; ++ ++ /* ++ * We can't call {lock, unlock}_cpu_hotplug() because ++ * they require process context. ++ * We don't need them because we're the only one cpu and ++ * interrupts are masked when resume. ++ */ ++ error = HYPERVISOR_expose_p2m(p2m_convert_min_pfn, ++ p2m_assign_start_pfn, ++ p2m_expose_size, p2m_granule_pfn); ++ if (error) { ++ printk(KERN_ERR P2M_PREFIX "failed expose p2m hypercall %d\n", ++ error); ++ printk(KERN_ERR P2M_PREFIX "conv 0x%016lx assign 0x%016lx " ++ "expose_size 0x%016lx granule 0x%016lx\n", ++ p2m_convert_min_pfn, p2m_assign_start_pfn, ++ p2m_expose_size, p2m_granule_pfn);; ++ p2m_initialized = 0; ++ smp_mb(); ++ ia64_ptr(0x2, p2m_itr_arg.vaddr, p2m_itr_arg.log_page_size); ++ ++ /* ++ * We can't call those clean up functions because they ++ * require process context. ++ */ ++#if 0 ++#ifdef CONFIG_XEN_IA64_EXPOSE_P2M_USE_DTR ++ if (xen_ia64_p2m_expose_use_dtr) ++ unregister_cpu_notifier( ++ &p2m_expose_dtr_hotplug_notifier); ++#endif ++ release_resource(&p2m_resource); ++#endif ++ } ++} ++ + //XXX inlinize? + unsigned long + p2m_phystomach(unsigned long gpfn) +@@ -1187,3 +1239,15 @@ xen_ia64_unmap_resource(struct resource* + xen_ia64_release_resource(res); + } + EXPORT_SYMBOL_GPL(xen_ia64_unmap_resource); ++ ++/////////////////////////////////////////////////////////////////////////// ++// suspend/resume ++void ++xen_post_suspend(int suspend_cancelled) ++{ ++ if (suspend_cancelled) ++ return; ++ ++ p2m_expose_resume(); ++ /* add more if necessary */ ++} +diff -r d7303c4a9dab -r 8b9637467068 linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h +--- a/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h Tue May 08 09:09:17 2007 -0600 ++++ b/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h Tue May 08 10:39:51 2007 -0600 +@@ -168,6 +168,9 @@ xen_destroy_contiguous_region(unsigned l + __xen_destroy_contiguous_region(vstart, order); + } + ++/* For drivers/xen/core/machine_reboot.c */ ++#define HAVE_XEN_POST_SUSPEND ++void xen_post_suspend(int suspend_cancelled); + #endif /* !CONFIG_VMX_GUEST */ + + // for netfront.c, netback.c diff -r 7ba52aa72ae5 -r 41c9c4fcf358 15113-31be207e005e --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/15113-31be207e005e Wed Sep 12 15:02:25 2007 +0900 @@ -0,0 +1,170 @@ +# HG changeset patch +# User Alex Williamson <alex.williamson@xxxxxx> +# Date 1178833590 21600 +# Node ID 31be207e005eaf178c87c047d8827998d6122282 +# Parent 8745300bec4ec254b3e2426e4fb5e3f4a9e0e0bc +[IA64] Handle speculative vhpt walk + +Since processor may support speculative VHPT walk, +The long format VHPT head entry needs to be disabled +before programming it. + +Signed-off-by: Anthony Xu <anthony.xu@xxxxxxxxx> +xen-unstable changeset: 15113:31be207e005eaf178c87c047d8827998d6122282 +xen-unstable date: Thu May 10 15:46:30 2007 -0600 + +diff -r 8745300bec4e -r 31be207e005e xen/arch/ia64/vmx/vmx_ivt.S +--- a/xen/arch/ia64/vmx/vmx_ivt.S Thu May 10 15:18:27 2007 -0600 ++++ b/xen/arch/ia64/vmx/vmx_ivt.S Thu May 10 15:46:30 2007 -0600 +@@ -168,11 +168,11 @@ vmx_itlb_loop: + adds r16 = VLE_TITAG_OFFSET, r17 + adds r19 = VLE_CCHAIN_OFFSET, r17 + ;; +- ld8 r22 = [r16] ++ ld8 r24 = [r16] + ld8 r23 = [r19] + ;; + lfetch [r23] +- cmp.eq p6,p7 = r20, r22 ++ cmp.eq p6,p7 = r20, r24 + ;; + (p7)mov r17 = r23; + (p7)br.sptk vmx_itlb_loop +@@ -180,10 +180,12 @@ vmx_itlb_loop: + ld8 r25 = [r17] + ld8 r27 = [r18] + ld8 r29 = [r28] ++ dep r22 = -1,r24,63,1 //set ti=1 + ;; + st8 [r16] = r29, VLE_ITIR_OFFSET - VLE_TITAG_OFFSET + st8 [r28] = r22, VLE_ITIR_OFFSET - VLE_TITAG_OFFSET + extr.u r19 = r27, 56, 4 ++ mf + ;; + ld8 r29 = [r16] + ld8 r22 = [r28] +@@ -191,10 +193,11 @@ vmx_itlb_loop: + dep r25 = r19, r25, 56, 4 + ;; + st8 [r16] = r22 +- st8 [r28] = r29 ++ st8 [r28] = r29, VLE_TITAG_OFFSET - VLE_ITIR_OFFSET + st8 [r18] = r25 + st8 [r17] = r27 + ;; ++ st8.rel [r28] = r24 + itc.i r25 + dv_serialize_data + mov r17=cr.isr +@@ -246,11 +249,11 @@ vmx_dtlb_loop: + adds r16 = VLE_TITAG_OFFSET, r17 + adds r19 = VLE_CCHAIN_OFFSET, r17 + ;; +- ld8 r22 = [r16] ++ ld8 r24 = [r16] + ld8 r23 = [r19] + ;; + lfetch [r23] +- cmp.eq p6,p7 = r20, r22 ++ cmp.eq p6,p7 = r20, r24 + ;; + (p7)mov r17 = r23; + (p7)br.sptk vmx_dtlb_loop +@@ -258,10 +261,12 @@ vmx_dtlb_loop: + ld8 r25 = [r17] + ld8 r27 = [r18] + ld8 r29 = [r28] ++ dep r22 = -1,r24,63,1 //set ti=1 + ;; + st8 [r16] = r29, VLE_ITIR_OFFSET - VLE_TITAG_OFFSET + st8 [r28] = r22, VLE_ITIR_OFFSET - VLE_TITAG_OFFSET + extr.u r19 = r27, 56, 4 ++ mf + ;; + ld8 r29 = [r16] + ld8 r22 = [r28] +@@ -269,10 +274,11 @@ vmx_dtlb_loop: + dep r25 = r19, r25, 56, 4 + ;; + st8 [r16] = r22 +- st8 [r28] = r29 ++ st8 [r28] = r29, VLE_TITAG_OFFSET - VLE_ITIR_OFFSET + st8 [r18] = r25 + st8 [r17] = r27 +- ;; ++ ;; ++ st8.rel [r28] = r24 + itc.d r25 + dv_serialize_data + mov r17=cr.isr +diff -r 8745300bec4e -r 31be207e005e xen/arch/ia64/vmx/vtlb.c +--- a/xen/arch/ia64/vmx/vtlb.c Thu May 10 15:18:27 2007 -0600 ++++ b/xen/arch/ia64/vmx/vtlb.c Thu May 10 15:46:30 2007 -0600 +@@ -141,7 +141,7 @@ static void thash_recycle_cch(thash_cb_t + + static void vmx_vhpt_insert(thash_cb_t *hcb, u64 pte, u64 itir, u64 ifa) + { +- u64 tag ,len; ++ u64 tag; + ia64_rr rr; + thash_data_t *head, *cch; + pte = pte & ~PAGE_FLAGS_RV_MASK; +@@ -155,14 +155,12 @@ static void vmx_vhpt_insert(thash_cb_t * + cch = cch->next; + } + if (cch) { +- if (cch == head) { +- len = head->len; +- } else { ++ if (cch != head) { + local_irq_disable(); + cch->page_flags = head->page_flags; + cch->itir = head->itir; + cch->etag = head->etag; +- len = head->len; ++ head->ti = 1; + local_irq_enable(); + } + } +@@ -175,16 +173,17 @@ static void vmx_vhpt_insert(thash_cb_t * + } + local_irq_disable(); + *cch = *head; ++ head->ti = 1; + head->next = cch; +- len = cch->len+1; ++ head->len = cch->len + 1; + cch->len = 0; + local_irq_enable(); + } +- ++ //here head is invalid ++ wmb(); + head->page_flags=pte; +- head->len = len; + head->itir = rr.ps << 2; +- head->etag=tag; ++ *(volatile unsigned long*)&head->etag = tag; + return; + } + +diff -r 8745300bec4e -r 31be207e005e xen/arch/ia64/xen/vhpt.c +--- a/xen/arch/ia64/xen/vhpt.c Thu May 10 15:18:27 2007 -0600 ++++ b/xen/arch/ia64/xen/vhpt.c Thu May 10 15:46:30 2007 -0600 +@@ -78,11 +78,13 @@ void vhpt_insert (unsigned long vadr, un + struct vhpt_lf_entry *vlfe = (struct vhpt_lf_entry *)ia64_thash(vadr); + unsigned long tag = ia64_ttag (vadr); + +- /* No need to first disable the entry, since VHPT is per LP +- and VHPT is TR mapped. */ ++ /* Even though VHPT is per VCPU, still need to first disable the entry, ++ * because the processor may support speculative VHPT walk. */ ++ vlfe->ti_tag = INVALID_TI_TAG; ++ wmb(); + vlfe->itir = logps; + vlfe->page_flags = pte | _PAGE_P; +- vlfe->ti_tag = tag; ++ *(volatile unsigned long*)&vlfe->ti_tag = tag; + } + + void vhpt_multiple_insert(unsigned long vaddr, unsigned long pte, unsigned long logps) diff -r 7ba52aa72ae5 -r 41c9c4fcf358 15115-7812598f65be --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/15115-7812598f65be Wed Sep 12 15:02:25 2007 +0900 @@ -0,0 +1,28 @@ +# HG changeset patch +# User Alex Williamson <alex.williamson@xxxxxx> +# Date 1178910424 21600 +# Node ID 7812598f65beaf4934cec9e01e0f538ada097da6 +# Parent 7d8acd319d5b5927ce40230d48132ba4301edf44 +[IA64] Return ENOMEM if VPD allocation failed + +Usually ASSRET() is "(void)0". Therefore if VPD allocation +fails with xenheap shortage or fragmentation, NULL pointer +access occurs in vmx_final_setup_guest(). +This patch fixes it. + +Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx> +xen-unstable changeset: 15115:7812598f65beaf4934cec9e01e0f538ada097da6 +xen-unstable date: Fri May 11 13:07:04 2007 -0600 + +diff -r 7d8acd319d5b -r 7812598f65be xen/arch/ia64/vmx/vmx_init.c +--- a/xen/arch/ia64/vmx/vmx_init.c Thu May 10 15:55:22 2007 -0600 ++++ b/xen/arch/ia64/vmx/vmx_init.c Fri May 11 13:07:04 2007 -0600 +@@ -299,6 +299,8 @@ vmx_final_setup_guest(struct vcpu *v) + + vpd = alloc_vpd(); + ASSERT(vpd); ++ if (!vpd) ++ return -ENOMEM; + + v->arch.privregs = (mapped_regs_t *)vpd; + vcpu_share_privregs_with_guest(v); diff -r 7ba52aa72ae5 -r 41c9c4fcf358 15116-d6309cfd1fdd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/15116-d6309cfd1fdd Wed Sep 12 15:02:25 2007 +0900 @@ -0,0 +1,31 @@ +# HG changeset patch +# User Alex Williamson <alex.williamson@xxxxxx> +# Date 1178910552 21600 +# Node ID d6309cfd1fdd53c23fd8daf32afe67abb68b35d6 +# Parent 7812598f65beaf4934cec9e01e0f538ada097da6 +[IA64] Fix allocate_rid_range() + +Though there is a free ridblock_owner[], allocate_rid_range() +cannot allocate it. + +Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx> +xen-unstable changeset: 15116:d6309cfd1fdd53c23fd8daf32afe67abb68b35d6 +xen-unstable date: Fri May 11 13:09:12 2007 -0600 + +diff -r 7812598f65be -r d6309cfd1fdd xen/arch/ia64/xen/regionreg.c +--- a/xen/arch/ia64/xen/regionreg.c Fri May 11 13:07:04 2007 -0600 ++++ b/xen/arch/ia64/xen/regionreg.c Fri May 11 13:09:12 2007 -0600 +@@ -157,9 +157,12 @@ int allocate_rid_range(struct domain *d, + for (i = n_rid_blocks; i < MAX_RID_BLOCKS; i += n_rid_blocks) { + if (ridblock_owner[i] == NULL) { + for (j = i; j < i + n_rid_blocks; ++j) { +- if (ridblock_owner[j]) ++ if (ridblock_owner[j]) { ++ ++j; + break; ++ } + } ++ --j; + if (ridblock_owner[j] == NULL) + break; + } diff -r 7ba52aa72ae5 -r 41c9c4fcf358 15119-fd72e71de51a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/15119-fd72e71de51a Wed Sep 12 15:02:25 2007 +0900 @@ -0,0 +1,101 @@ +# HG changeset patch +# User Alex Williamson <alex.williamson@xxxxxx> +# Date 1179165121 21600 +# Node ID fd72e71de51a53f865e4e82d2bcca1c7664c9b04 +# Parent c0de8feef4cda1cfe6bd926f8b9adbc1fbc8589b +[IA64] Fix ptc.ga emulation + +cset14829(c42ae7839750) was incomplete. + +The region register 0 will be clobbered as follows. + +time pcpu0 pcpu1 pcpu2 + | vcpu0 vcpu1 idle // assignment of vcpu + V + 1.vcpu0 issues ptc.ga + 2.vcpu0 sends IPI to vcpu1(pcpu1) + 3.vcpu1 migrates from pcpu1 to pcpu2 + 4.pcpu1 receives IPI of 2 and exec ptc_ga_remote_func() + 5.pcpu1 saves and modifies vrr[0] + 6.vcpu1(pcpu2) modifies vrr[0] + 7.pcpu1 restores vrr[0] // vrr[0] of 6 is lost + +Windows will crash due to this issue. + +Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx> +xen-unstable changeset: 15119:fd72e71de51a53f865e4e82d2bcca1c7664c9b04 +xen-unstable date: Mon May 14 11:52:01 2007 -0600 + +diff -r c0de8feef4cd -r fd72e71de51a xen/arch/ia64/vmx/vmmu.c +--- a/xen/arch/ia64/vmx/vmmu.c Mon May 14 11:13:24 2007 -0600 ++++ b/xen/arch/ia64/vmx/vmmu.c Mon May 14 11:52:01 2007 -0600 +@@ -563,11 +563,17 @@ struct ptc_ga_args { + + static void ptc_ga_remote_func (void *varg) + { +- u64 oldrid, moldrid, mpta, oldpsbits, vadr; ++ u64 oldrid, moldrid, mpta, oldpsbits, vadr, flags; + struct ptc_ga_args *args = (struct ptc_ga_args *)varg; + VCPU *v = args->vcpu; + vadr = args->vadr; + ++ /* Try again if VCPU has migrated. */ ++ if (v->processor != current->processor) ++ return; ++ vcpu_schedule_lock_irqsave(v, flags); ++ if (v->processor != current->processor) ++ goto bail; + oldrid = VMX(v, vrr[0]); + VMX(v, vrr[0]) = args->rid; + oldpsbits = VMX(v, psbits[0]); +@@ -584,6 +590,9 @@ static void ptc_ga_remote_func (void *va + ia64_set_rr(0x0,moldrid); + ia64_set_pta(mpta); + ia64_dv_serialize_data(); ++ args->vcpu = NULL; ++bail: ++ vcpu_schedule_unlock_irqrestore(v, flags); + } + + +@@ -602,28 +611,21 @@ IA64FAULT vmx_vcpu_ptc_ga(VCPU *vcpu, u6 + if (!v->is_initialised) + continue; + ++ if (v == vcpu) { ++ vmx_vcpu_ptc_l(v, va, ps); ++ continue; ++ } ++ + args.vcpu = v; +-again: /* Try again if VCPU has migrated. */ +- proc = v->processor; +- if (proc != vcpu->processor) { +- /* Flush VHPT on remote processors. */ +- smp_call_function_single(v->processor, +- &ptc_ga_remote_func, &args, 0, 1); +- if (proc != v->processor) +- goto again; +- } else if (v == vcpu) { +- vmx_vcpu_ptc_l(v, va, ps); +- } else { +- vcpu_schedule_lock_irq(v); ++ do { + proc = v->processor; +- if (proc == vcpu->processor) ++ if (proc != vcpu->processor) ++ /* Flush VHPT on remote processors. */ ++ smp_call_function_single(proc, &ptc_ga_remote_func, ++ &args, 0, 1); ++ else + ptc_ga_remote_func(&args); +- else +- proc = INVALID_PROCESSOR; +- vcpu_schedule_unlock_irq(v); +- if (proc == INVALID_PROCESSOR) +- goto again; +- } ++ } while (args.vcpu != NULL); + } + return IA64_NO_FAULT; + } diff -r 7ba52aa72ae5 -r 41c9c4fcf358 15122-afb27041a2ce --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/15122-afb27041a2ce Wed Sep 12 15:02:25 2007 +0900 @@ -0,0 +1,81 @@ +# HG changeset patch +# User Alex Williamson <alex.williamson@xxxxxx> +# Date 1179333727 21600 +# Node ID afb27041a2ce4493b6c1d9cf87939858a96136d0 +# Parent 8c5ebe559a4ddfa05a6291a9b33ae29ea202a462 +[IA64] Fix deadlock of ptc.ga emulation + +ptc_ga_remote_func() might be invoked by IPI with a schedule_lock +that is acquired. (e.g., inside of vcpu_migrate()) +It will cause a deadlock. + +Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx> +xen-unstable changeset: 15122:afb27041a2ce4493b6c1d9cf87939858a96136d0 +xen-unstable date: Wed May 16 10:42:07 2007 -0600 + +diff -r 8c5ebe559a4d -r afb27041a2ce xen/arch/ia64/vmx/vmmu.c +--- a/xen/arch/ia64/vmx/vmmu.c Tue May 15 15:32:23 2007 -0600 ++++ b/xen/arch/ia64/vmx/vmmu.c Wed May 16 10:42:07 2007 -0600 +@@ -563,13 +563,16 @@ static void ptc_ga_remote_func (void *va + struct ptc_ga_args *args = (struct ptc_ga_args *)varg; + VCPU *v = args->vcpu; + vadr = args->vadr; ++ int cpu = v->processor; + + /* Try again if VCPU has migrated. */ +- if (v->processor != current->processor) ++ if (cpu != current->processor) + return; +- vcpu_schedule_lock_irqsave(v, flags); +- if (v->processor != current->processor) +- goto bail; ++ local_irq_save(flags); ++ if (!spin_trylock(&per_cpu(schedule_data, cpu).schedule_lock)) ++ goto bail2; ++ if (v->processor != cpu) ++ goto bail1; + oldrid = VMX(v, vrr[0]); + VMX(v, vrr[0]) = args->rid; + oldpsbits = VMX(v, psbits[0]); +@@ -587,8 +590,10 @@ static void ptc_ga_remote_func (void *va + ia64_set_pta(mpta); + ia64_dv_serialize_data(); + args->vcpu = NULL; +-bail: +- vcpu_schedule_unlock_irqrestore(v, flags); ++bail1: ++ spin_unlock(&per_cpu(schedule_data, cpu).schedule_lock); ++bail2: ++ local_irq_restore(flags); + } + + +@@ -598,7 +603,7 @@ IA64FAULT vmx_vcpu_ptc_ga(VCPU *vcpu, u6 + struct domain *d = vcpu->domain; + struct vcpu *v; + struct ptc_ga_args args; +- int proc; ++ int cpu; + + args.vadr = va; + vcpu_get_rr(vcpu, va, &args.rid); +@@ -614,13 +619,15 @@ IA64FAULT vmx_vcpu_ptc_ga(VCPU *vcpu, u6 + + args.vcpu = v; + do { +- proc = v->processor; +- if (proc != vcpu->processor) ++ cpu = v->processor; ++ if (cpu != current->processor) { ++ spin_unlock_wait(&per_cpu(schedule_data, cpu).schedule_lock); + /* Flush VHPT on remote processors. */ +- smp_call_function_single(proc, &ptc_ga_remote_func, ++ smp_call_function_single(cpu, &ptc_ga_remote_func, + &args, 0, 1); +- else ++ } else { + ptc_ga_remote_func(&args); ++ } + } while (args.vcpu != NULL); + } + return IA64_NO_FAULT; diff -r 7ba52aa72ae5 -r 41c9c4fcf358 15307-d30576123892 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/15307-d30576123892 Wed Sep 12 15:02:25 2007 +0900 @@ -0,0 +1,25 @@ +# HG changeset patch +# User Alex Williamson <alex.williamson@xxxxxx> +# Date 1179779409 21600 +# Node ID d305761238924735fc00fc091b3cf0bb5949517d +# Parent 6450f6287898ea5b2e7420647bf13cf709f949ce +[IA64] Fix vpd size + +New pal has fixed vpd size issue, so change it to 64K to conform to Spec. + +Signed-off-by: Zhang xiantao <xiantao.zhang@xxxxxxxxx> +xen-unstable changeset: 15307:d305761238924735fc00fc091b3cf0bb5949517d +xen-unstable date: Mon May 21 14:30:09 2007 -0600 + +diff -r 6450f6287898 -r d30576123892 xen/include/asm-ia64/vmx_vpd.h +--- a/xen/include/asm-ia64/vmx_vpd.h Mon May 21 14:09:27 2007 -0600 ++++ b/xen/include/asm-ia64/vmx_vpd.h Mon May 21 14:30:09 2007 -0600 +@@ -29,7 +29,7 @@ + #include <public/xen.h> + #include <xen/spinlock.h> + +-#define VPD_SHIFT 17 /* 128K requirement */ ++#define VPD_SHIFT 16 + #define VPD_SIZE (1 << VPD_SHIFT) + + typedef struct { diff -r 7ba52aa72ae5 -r 41c9c4fcf358 15311-466f71b1e831 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/15311-466f71b1e831 Wed Sep 12 15:02:25 2007 +0900 @@ -0,0 +1,82 @@ +# HG changeset patch +# User Alex Williamson <alex.williamson@xxxxxx> +# Date 1180037788 21600 +# Node ID 466f71b1e8319927dca16bd16b05faa09fad0cdd +# Parent 40542d29da2bda69fb3ed17b303e01d723b0aa9a +[IA64] Fix ld.s emulation + +With this patch, +* XEN correctly emulates ld.s for HVM +* original memory attribute is preserved in vcpu->arch.vtlb + +Without this, XEN infrequently calls panic_domain() by mistake for windows. + +Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx> +Signed-off-by: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx> +xen-unstable changeset: 15311:466f71b1e8319927dca16bd16b05faa09fad0cdd +xen-unstable date: Thu May 24 14:16:28 2007 -0600 + +diff -r d2ef85c6bf84 xen/arch/ia64/vmx/vmx_process.c +--- a/xen/arch/ia64/vmx/vmx_process.c Tue May 08 10:38:06 2007 +0100 ++++ b/xen/arch/ia64/vmx/vmx_process.c Wed Sep 12 14:46:46 2007 +0900 +@@ -311,6 +311,8 @@ vmx_hpw_miss(u64 vadr , u64 vec, REGS* r + + if(is_physical_mode(v)&&(!(vadr<<1>>62))){ + if(vec==2){ ++ if (misr.sp) /* Refer to SDM Vol2 Table 4-11,4-12 */ ++ return vmx_handle_lds(regs); + if (v->domain != dom0 + && __gpfn_is_io(v->domain, (vadr << 1) >> (PAGE_SHIFT + 1))) { + emulate_io_inst(v,((vadr<<1)>>1),4); // UC +@@ -323,9 +325,16 @@ vmx_hpw_miss(u64 vadr , u64 vec, REGS* r + + if((data=vtlb_lookup(v, vadr,type))!=0){ + if (v->domain != dom0 && type == DSIDE_TLB) { ++ if (misr.sp) { /* Refer to SDM Vol2 Table 4-10,4-12 */ ++ if ((data->ma == VA_MATTR_UC) || (data->ma == VA_MATTR_UCE)) ++ return vmx_handle_lds(regs); ++ } + gppa = (vadr & ((1UL << data->ps) - 1)) + + (data->ppn >> (data->ps - 12) << data->ps); + if (__gpfn_is_io(v->domain, gppa >> PAGE_SHIFT)) { ++ if (misr.sp) ++ panic_domain(NULL, "ld.s on I/O page not with UC attr." ++ " pte=0x%lx\n", data->page_flags); + if (data->pl >= ((regs->cr_ipsr >> IA64_PSR_CPL0_BIT) & 3)) + emulate_io_inst(v, gppa, data->ma); + else { +diff -r d2ef85c6bf84 xen/arch/ia64/vmx/vtlb.c +--- a/xen/arch/ia64/vmx/vtlb.c Tue May 08 10:38:06 2007 +0100 ++++ b/xen/arch/ia64/vmx/vtlb.c Wed Sep 12 14:46:46 2007 +0900 +@@ -500,6 +500,13 @@ u64 translate_phy_pte(VCPU *v, u64 *pte, + *pte |= VTLB_PTE_IO; + return -1; + } ++ /* Ensure WB attribute if pte is related to a normal mem page, ++ * which is required by vga acceleration since qemu maps shared ++ * vram buffer with WB. ++ */ ++ if (phy_pte.ma != VA_MATTR_NATPAGE) ++ phy_pte.ma = VA_MATTR_WB; ++ + // rr.rrval = ia64_get_rr(va); + // ps = rr.ps; + maddr = ((maddr & _PAGE_PPN_MASK) & PAGE_MASK) | (paddr & ~PAGE_MASK); +@@ -521,14 +528,10 @@ void thash_purge_and_insert(VCPU *v, u64 + vcpu_get_rr(current, ifa, &vrr.rrval); + mrr.rrval = ia64_get_rr(ifa); + if(VMX_DOMAIN(v)){ +- /* Ensure WB attribute if pte is related to a normal mem page, +- * which is required by vga acceleration since qemu maps shared +- * vram buffer with WB. +- */ +- if (!(pte & VTLB_PTE_IO) && ((pte & _PAGE_MA_MASK) != _PAGE_MA_NAT)) +- pte &= ~_PAGE_MA_MASK; +- + phy_pte = translate_phy_pte(v, &pte, itir, ifa); ++ ++ if (pte & VTLB_PTE_IO) ++ ret = 1; + vtlb_purge(v, ifa, ps); + vhpt_purge(v, ifa, ps); + if (ps == mrr.ps) { diff -r 7ba52aa72ae5 -r 41c9c4fcf358 15341-2fd72ec88a9a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/15341-2fd72ec88a9a Wed Sep 12 15:02:25 2007 +0900 @@ -0,0 +1,48 @@ +# HG changeset patch +# User Alex Williamson <alex.williamson@xxxxxx> +# Date 1181142830 21600 +# Node ID 2fd72ec88a9afa1af005b261d835ef8b42bbb5e8 +# Parent 9daa40cae3d6548f404bcfd4300e604185db6b64 +[IA64] Fix HVM boot failure + +HVM sometimes fails to boot with the message +"Guest nested fault vector=0x5400!". + +The cause of this issue is that cr.ifs never be initialized in very +first context switching. To optimize hypercall on HVM, cr.ifs is only +set with the predicate pNonSys(pr5)=1. + +Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx> +xen-unstable changeset: 15341:2fd72ec88a9afa1af005b261d835ef8b42bbb5e8 +xen-unstable date: Wed Jun 06 09:13:50 2007 -0600 + +diff -r 9daa40cae3d6 -r 2fd72ec88a9a xen/arch/ia64/vmx/vmx_init.c +--- a/xen/arch/ia64/vmx/vmx_init.c Wed Jun 06 09:10:52 2007 -0600 ++++ b/xen/arch/ia64/vmx/vmx_init.c Wed Jun 06 09:13:50 2007 -0600 +@@ -51,6 +51,7 @@ + #include <asm/viosapic.h> + #include <xen/event.h> + #include <asm/vlsapic.h> ++#include "entry.h" + + /* Global flag to identify whether Intel vmx feature is on */ + u32 vmx_enabled = 0; +@@ -296,6 +297,7 @@ vmx_final_setup_guest(struct vcpu *v) + { + vpd_t *vpd; + int rc; ++ struct switch_stack *sw; + + vpd = alloc_vpd(); + ASSERT(vpd); +@@ -331,6 +333,10 @@ vmx_final_setup_guest(struct vcpu *v) + /* Set up guest 's indicator for VTi domain*/ + set_bit(ARCH_VMX_DOMAIN, &v->arch.arch_vmx.flags); + ++ /* Initialize pNonSys=1 for the first context switching */ ++ sw = (struct switch_stack *)vcpu_regs(v) - 1; ++ sw->pr = (1UL << PRED_NON_SYSCALL); ++ + return 0; + } + diff -r 7ba52aa72ae5 -r 41c9c4fcf358 15568-34f285b57b87 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/15568-34f285b57b87 Wed Sep 12 15:02:25 2007 +0900 @@ -0,0 +1,69 @@ +# HG changeset patch +# User Alex Williamson <alex.williamson@xxxxxx> +# Date 1183662240 21600 +# Node ID 34f285b57b87e94948f9af22df80888452d85dce +# Parent 40608e5e394ee4bcc5b68a4cbf49973f39327981 +[IA64] Fix soft lock up caused by xen_timer_interrupt() + +This patch intends to fix softlockup caused by xen_timer_interrupt(). +This is caused by local_cpu_data->itm_next and stime_irq, itc_at_irq +inconsistency at CPU0 of hypervisor. This patch sets stime_irq and +itc_at_irq every time in xen_timer_interrupt() to avoid this soft +lock up. + +In other words, it is caused by competition of local_cpu_data->itm_next +and domain_itm in xen_timer_interrupt() and reprogram_timer() (more +specific vcpu_set_next_timer()). + +For example: + 1) reprogram_timer() runs and set local_cpu_data->itm_next and set + domain_itm as next itm. + 2) xen_timer_interrupt() called but following condition is not satisfied: + while(time_after(ia64_get_itc(), local_cpu_data->itm_next) + This skips stime_irq and itc_at_irq setting. + 3) goto 1) + 4) sometimes local_cpu_data->itm_next is rollback because + ns_to_cycle()/IA64 is representing almost 32bit. + (This occured at reprogram_timer()) + 5) It causes soft lock up. + 6) Hypervisor returns to work(not hang). + +To reproduce this issue, I do following configuration. + + 1) boot Xen with pcpu=4 and Dom0 with vcpu=4 + 2) boot domU1 with vcpu with vcpu-pin 0-1 + 3) boot domU2 with vcpu with vcpu-pin 0-1 + 4) run yes > /dev/null 2 process on domU1 + 5) run nothing on domU2(to check softlock up occured or not) + 6) run kernel compile with -j4 on Dom0 continuously + 7) wait 4 or 8 hours to occur softlockup. + +Signed-off-by: Atsushi SAKAI <sakaia@xxxxxxxxxxxxxx> +xen-unstable changeset: 15568:34f285b57b87e94948f9af22df80888452d85dce +xen-unstable date: Thu Jul 05 13:04:00 2007 -0600 + +diff -r 40608e5e394e -r 34f285b57b87 xen/arch/ia64/xen/xentime.c +--- a/xen/arch/ia64/xen/xentime.c Mon Jul 02 21:06:46 2007 -0600 ++++ b/xen/arch/ia64/xen/xentime.c Thu Jul 05 13:04:00 2007 -0600 +@@ -126,9 +126,7 @@ xen_timer_interrupt (int irq, void *dev_ + + + new_itm = local_cpu_data->itm_next; +- while (time_after(ia64_get_itc(), new_itm)) { +- new_itm += local_cpu_data->itm_delta; +- ++ while (1) { + if (smp_processor_id() == TIME_KEEPER_ID) { + /* + * Here we are in the timer irq handler. We have irqs locally +@@ -150,6 +148,10 @@ xen_timer_interrupt (int irq, void *dev_ + + local_cpu_data->itm_next = new_itm; + ++ if (time_after(new_itm, ia64_get_itc())) ++ break; ++ ++ new_itm += local_cpu_data->itm_delta; + } + + if (!is_idle_domain(current->domain) && !VMX_DOMAIN(current)) { diff -r 7ba52aa72ae5 -r 41c9c4fcf358 15655-9cd309378326 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/15655-9cd309378326 Wed Sep 12 15:02:25 2007 +0900 @@ -0,0 +1,46 @@ +# HG changeset patch +# User kfraser@xxxxxxxxxxxxxxxxxxxxx +# Date 1185791296 -3600 +# Node ID 9cd309378326c6efe4ae8a1454faa730597d1560 +# Parent c0fbee66aff63978addc5f8b263947553f606d08 +[IA64] Disable ACPI SRAT,SLIT table of dom0. + + On some ia64 NUMA machine, we cannot boot dom0. + This issue is caused by different infomation LSAPIC and SRAT. + Xen-ia64 modify LSAPIC IDs of dom0, but it does not modify SRAT. + So we decide disabling SRAT, SLIT of dom0 as first step of NUMA + work. + +Signed-off-by: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx> +xen-unstable changeset: 15655:9cd309378326c6efe4ae8a1454faa730597d1560 +xen-unstable date: Mon Jul 30 11:28:16 2007 +0100 + +diff -r d2ef85c6bf84 xen/arch/ia64/xen/dom_fw.c +--- a/xen/arch/ia64/xen/dom_fw.c Tue May 08 10:38:06 2007 +0100 ++++ b/xen/arch/ia64/xen/dom_fw.c Wed Sep 12 14:48:58 2007 +0900 +@@ -287,12 +287,25 @@ acpi_update_madt_checksum (unsigned long + /* base is physical address of acpi table */ + static void touch_acpi_table(void) + { ++ int result; + lsapic_nbr = 0; + if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_update_lsapic, 0) < 0) + printk("Error parsing MADT - no LAPIC entries\n"); + if (acpi_table_parse_madt(ACPI_MADT_PLAT_INT_SRC, + acpi_patch_plat_int_src, 0) < 0) + printk("Error parsing MADT - no PLAT_INT_SRC entries\n"); ++ ++ result = acpi_table_disable(ACPI_SRAT); ++ if ( result == 0 ) ++ printk("Success Disabling SRAT\n"); ++ else if ( result != -ENOENT ) ++ printk("ERROR: Failed Disabling SRAT\n"); ++ ++ result = acpi_table_disable(ACPI_SLIT); ++ if ( result == 0 ) ++ printk("Success Disabling SLIT\n"); ++ else if ( result != -ENOENT ) ++ printk("ERROR: Failed Disabling SLIT\n"); + + acpi_table_parse(ACPI_APIC, acpi_update_madt_checksum); + diff -r 7ba52aa72ae5 -r 41c9c4fcf358 15742-2796311c6a55 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/15742-2796311c6a55 Wed Sep 12 15:02:25 2007 +0900 @@ -0,0 +1,23 @@ +# HG changeset patch +# User Alex Williamson <alex.williamson@xxxxxx> +# Date 1184527976 21600 +# Node ID 2796311c6a5537cff38bba20b74a1e64a1d9e909 +# Parent f536eb8576eeb7363212911b02fbaff4918172df +[IA64] Fix a memory allocation bug in MCA + +Signed-off-by: Kazuhiro Suzuki <kaz@xxxxxxxxxxxxxx> +xen-unstable changeset: 15742:2796311c6a5537cff38bba20b74a1e64a1d9e909 +xen-unstable date: Sun Jul 15 13:32:56 2007 -0600 + +diff -r f536eb8576ee -r 2796311c6a55 xen/arch/ia64/linux-xen/mca.c +--- a/xen/arch/ia64/linux-xen/mca.c Wed Jul 11 11:32:30 2007 -0600 ++++ b/xen/arch/ia64/linux-xen/mca.c Sun Jul 15 13:32:56 2007 -0600 +@@ -184,7 +184,7 @@ static ia64_state_log_t ia64_state_log[I + #define IA64_LOG_ALLOCATE(it, size) \ + do { \ + unsigned int pageorder; \ +- pageorder = get_order_from_bytes(sizeof(struct ia64_mca_cpu)); \ ++ pageorder = get_order_from_bytes(size); \ + ia64_state_log[it].isl_log[IA64_LOG_CURR_INDEX(it)] = \ + (ia64_err_rec_t *)alloc_xenheap_pages(pageorder); \ + ia64_state_log[it].isl_log[IA64_LOG_NEXT_INDEX(it)] = \ _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-ia64-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |