ia64/xen-unstable

changeset 6868:f2309ac2648a

Get multiple domains working again
Signed-off-by Kevin Tian <kevin.tian@intel.com>

Some interesting issues found related to two small patches:
1. Only "xm console 1" and "Ctrl + ]" can make xenU forward progress,
and however still failed to connect blkback later.
[Reason] Previous event injection on XEN/IPF only set vIRR bit
when evtchn_set_pending. However with the latest xenlinux code, it's
possible for xenlinux to set pending indication and selector when
unmasking some pending event channel. This path has nothing to do with
vIRR bit.

[Solution] We should check event pending every time when
checking pending interrupts before returning to guest.

2. After fixing first issue, nested event is injected when first event
is still in handle with lock held. Then dead lock happens at end of
"xend start".
[Reason] Due to same logic as above, xenlinux may set pending
indication and re-trigger pending event by force_evtchn_callback. On
x86, this stub just does a dummy xen_version hypercall and pending event
will be injected back when leaving hypervisor. However on IA64,
force_evtchn_callback is incautiously made invoking evtchn_interrupt()
directly, while the former may be called with lock held.

[Solution] Just let force_evtchn_callback as empty for simple now.
author djm@kirby.fc.hp.com
date Tue Sep 20 13:03:25 2005 -0600 (2005-09-20)
parents 7f9acc83ffcd
children 8906825d5197
files xen/arch/ia64/xen/domain.c xen/arch/ia64/xen/vcpu.c
line diff
     1.1 --- a/xen/arch/ia64/xen/domain.c	Mon Sep 19 11:08:20 2005 -0600
     1.2 +++ b/xen/arch/ia64/xen/domain.c	Tue Sep 20 13:03:25 2005 -0600
     1.3 @@ -917,7 +917,7 @@ int construct_dom0(struct domain *d,
     1.4  #endif
     1.5  
     1.6  	/* Mask all upcalls... */
     1.7 -	for ( i = 0; i < MAX_VIRT_CPUS; i++ )
     1.8 +	for ( i = 1; i < MAX_VIRT_CPUS; i++ )
     1.9  	    d->shared_info->vcpu_data[i].evtchn_upcall_mask = 1;
    1.10  
    1.11  #ifdef CONFIG_VTI
     2.1 --- a/xen/arch/ia64/xen/vcpu.c	Mon Sep 19 11:08:20 2005 -0600
     2.2 +++ b/xen/arch/ia64/xen/vcpu.c	Tue Sep 20 13:03:25 2005 -0600
     2.3 @@ -21,6 +21,7 @@ int in_tpa = 0;
     2.4  #include <asm/processor.h>
     2.5  #include <asm/delay.h>
     2.6  #include <asm/vmx_vcpu.h>
     2.7 +#include <xen/event.h>
     2.8  
     2.9  typedef	union {
    2.10  	struct ia64_psr ia64_psr;
    2.11 @@ -654,6 +655,15 @@ UINT64 vcpu_check_pending_interrupts(VCP
    2.12  {
    2.13  	UINT64 *p, *q, *r, bits, bitnum, mask, i, vector;
    2.14  
    2.15 +	/* Always check pending event, since guest may just ack the
    2.16 +	 * event injection without handle. Later guest may throw out
    2.17 +	 * the event itself.
    2.18 +	 */
    2.19 +	if (event_pending(vcpu) && 
    2.20 +		!test_bit(vcpu->vcpu_info->arch.evtchn_vector,
    2.21 +			&PSCBX(vcpu, insvc[0])))
    2.22 +		vcpu_pend_interrupt(vcpu, vcpu->vcpu_info->arch.evtchn_vector);
    2.23 +
    2.24  	p = &PSCBX(vcpu,irr[3]);
    2.25  	/* q = &PSCB(vcpu,delivery_mask[3]); */
    2.26  	r = &PSCBX(vcpu,insvc[3]);