direct-io.hg

changeset 11461:21dc71840bc0

[HVM] Add broadcast destination for physical destination mode in
VLAPIC.
Based on a patch from Xiaohui Xin <xiaohui.xin@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Sep 13 14:12:28 2006 +0100 (2006-09-13)
parents 1ece34466781
children 29bc328cd8d3
files xen/arch/x86/hvm/vioapic.c
line diff
     1.1 --- a/xen/arch/x86/hvm/vioapic.c	Wed Sep 13 14:05:33 2006 +0100
     1.2 +++ b/xen/arch/x86/hvm/vioapic.c	Wed Sep 13 14:12:28 2006 +0100
     1.3 @@ -362,21 +362,35 @@ static uint32_t ioapic_get_delivery_bitm
     1.4  
     1.5      ASSERT(s);
     1.6  
     1.7 -    if (dest_mode == 0) { /* Physical mode */
     1.8 -        for (i = 0; i < s->lapic_count; i++) {
     1.9 -            if (VLAPIC_ID(s->lapic_info[i]) == dest) {
    1.10 +    if ( dest_mode == 0 )
    1.11 +    {
    1.12 +        /* Physical mode. */
    1.13 +        for ( i = 0; i < s->lapic_count; i++ )
    1.14 +        {
    1.15 +            if ( VLAPIC_ID(s->lapic_info[i]) == dest )
    1.16 +            {
    1.17                  mask = 1 << i;
    1.18                  break;
    1.19              }
    1.20          }
    1.21 -    } else {
    1.22 -        /* logical destination. call match_logical_addr for each APIC. */
    1.23 -        if (dest != 0) {
    1.24 -            for (i=0; i< s->lapic_count; i++) {
    1.25 +
    1.26 +        /* Broadcast. */
    1.27 +        if ( dest == 0xFF )
    1.28 +        {
    1.29 +            for ( i = 0; i < s->lapic_count; i++ )
    1.30 +                mask |= ( 1 << i );
    1.31 +        }
    1.32 +    }
    1.33 +    else
    1.34 +    {
    1.35 +        /* Logical destination. Call match_logical_addr for each APIC. */
    1.36 +        if ( dest != 0 )
    1.37 +        {
    1.38 +            for ( i = 0; i < s->lapic_count; i++ )
    1.39 +            {
    1.40                  if ( s->lapic_info[i] &&
    1.41 -                     ioapic_match_logical_addr(s, i, dest) ) {
    1.42 +                     ioapic_match_logical_addr(s, i, dest) )
    1.43                      mask |= (1<<i);
    1.44 -                }
    1.45              }
    1.46          }
    1.47      }