direct-io.hg

changeset 9370:b4769816a409

SVM patch to fix problem with evtchn/lost interrupts and re-enable hvm_safe_block().

Signed-off-by: Tom Woller <thomas.woller@amd.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Mar 22 10:36:02 2006 +0100 (2006-03-22)
parents e995d090bba9
children 573bb82d0402
files xen/arch/x86/hvm/svm/intr.c xen/arch/x86/hvm/svm/svm.c
line diff
     1.1 --- a/xen/arch/x86/hvm/svm/intr.c	Wed Mar 22 10:35:35 2006 +0100
     1.2 +++ b/xen/arch/x86/hvm/svm/intr.c	Wed Mar 22 10:36:02 2006 +0100
     1.3 @@ -58,6 +58,7 @@ static inline int svm_inject_extint(stru
     1.4      intr.fields.intr_masking = 1;
     1.5      intr.fields.vector = trap;
     1.6      intr.fields.prio = 0xF;
     1.7 +    intr.fields.ign_tpr = 1;
     1.8      vmcb->vintr = intr;
     1.9  //  printf( "IRQ = %d\n", trap );
    1.10      return 0;
    1.11 @@ -160,18 +161,21 @@ asmlinkage void svm_intr_assist(void)
    1.12      }
    1.13      /* Now let's check for newer interrrupts  */
    1.14      else {
    1.15 -        /* Interrput pending at the PIC? */
    1.16 -        hvm_pic_assist(v);
    1.17 +
    1.18 +      if ( v->vcpu_id == 0 )
    1.19 +         hvm_pic_assist(v);
    1.20  
    1.21 -        if (vpit->pending_intr_nr) {
    1.22 -            pic_set_irq(pic, 0, 0);
    1.23 -            pic_set_irq(pic, 0, 1);
    1.24 -        }
    1.25 -
    1.26 -        if (plat->interrupt_request) {
    1.27 -            intr_vector = cpu_get_interrupt(v, &intr_type);
    1.28 -            plat->interrupt_request = 0;
    1.29 -        }
    1.30 +      /* Before we deal with PIT interrupts, let's check
    1.31 +         for interrupts set by the device model.
    1.32 +      */
    1.33 +      if ( cpu_has_pending_irq(v) ) {
    1.34 +           intr_vector = cpu_get_interrupt(v, &intr_type);
    1.35 +      }
    1.36 +      else  if ( (v->vcpu_id == 0) && vpit->pending_intr_nr ) {
    1.37 +          pic_set_irq(pic, 0, 0);
    1.38 +          pic_set_irq(pic, 0, 1);
    1.39 +          intr_vector = cpu_get_interrupt(v, &intr_type);
    1.40 +      }
    1.41      }
    1.42  
    1.43      /* have we got an interrupt to inject? */
     2.1 --- a/xen/arch/x86/hvm/svm/svm.c	Wed Mar 22 10:35:35 2006 +0100
     2.2 +++ b/xen/arch/x86/hvm/svm/svm.c	Wed Mar 22 10:36:02 2006 +0100
     2.3 @@ -1777,6 +1777,10 @@ static inline void svm_vmexit_do_hlt(str
     2.4  
     2.5      __update_guest_eip(vmcb, 1);
     2.6  
     2.7 +    /* check for interrupt not handled or new interrupt */
     2.8 +    if ( vmcb->vintr.fields.irq || cpu_has_pending_irq(v) )
     2.9 +       return; 
    2.10 +
    2.11      if ( !v->vcpu_id )
    2.12          next_pit = get_pit_scheduled(v, vpit);
    2.13      next_wakeup = get_apictime_scheduled(v);
    2.14 @@ -1784,9 +1788,7 @@ static inline void svm_vmexit_do_hlt(str
    2.15          next_wakeup = next_pit;
    2.16      if ( next_wakeup != - 1 )
    2.17          set_timer(&current->arch.hvm_svm.hlt_timer, next_wakeup);
    2.18 -/* temporary workaround for 8828/8822 evtchn patches causing SVM failure.
    2.19      hvm_safe_block();
    2.20 -*/
    2.21  }
    2.22  
    2.23