ia64/xen-unstable

changeset 6343:b0d820178b81

This patch extends I/O APIC guest writes so that the correct destination
fields are written in the redirection table entry.

Signed-off-by: Aravindh Puthiyaparambil
<aravindh.puthiyaparambil@unisys.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Aug 23 09:49:12 2005 +0000 (2005-08-23)
parents 36cf17b65423
children 3889ca17ff58
files xen/arch/x86/io_apic.c
line diff
     1.1 --- a/xen/arch/x86/io_apic.c	Tue Aug 23 09:28:05 2005 +0000
     1.2 +++ b/xen/arch/x86/io_apic.c	Tue Aug 23 09:49:12 2005 +0000
     1.3 @@ -1751,8 +1751,30 @@ int ioapic_guest_write(int apicid, int a
     1.4      
     1.5      pin = (address - 0x10) >> 1;
     1.6  
     1.7 +    *(u32 *)&rte = val;
     1.8      rte.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS);
     1.9 -    *(int *)&rte = val;
    1.10 +
    1.11 +    /*
    1.12 +     * What about weird destination types?
    1.13 +     *  SMI:    Ignore? Ought to be set up by the BIOS.
    1.14 +     *  NMI:    Ignore? Watchdog functionality is Xen's concern.
    1.15 +     *  INIT:   Definitely ignore: probably a guest OS bug.
    1.16 +     *  ExtINT: Ignore? Linux only asserts this at start of day.
    1.17 +     * For now, print a message and return an error. We can fix up on demand.
    1.18 +     */
    1.19 +    if ( rte.delivery_mode > dest_LowestPrio )
    1.20 +    {
    1.21 +        printk("ERROR: Attempt to write weird IOAPIC destination mode!\n");
    1.22 +        printk("       APIC=%d/%d, lo-reg=%x\n", apicid, pin, val);
    1.23 +        return -EINVAL;
    1.24 +    }
    1.25 +
    1.26 +    /*
    1.27 +     * The guest does not know physical APIC arrangement (flat vs. cluster).
    1.28 +     * Apply genapic conventions for this platform.
    1.29 +     */
    1.30 +    rte.delivery_mode = INT_DELIVERY_MODE;
    1.31 +    rte.dest_mode     = INT_DEST_MODE;
    1.32  
    1.33      if ( rte.vector >= FIRST_DEVICE_VECTOR )
    1.34      {