WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH][QEMU] Fix ACPI COM port detection

To: Ben Guthro <bguthro@xxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH][QEMU] Fix ACPI COM port detection
From: Keir Fraser <keir@xxxxxxxxxxxxx>
Date: Tue, 28 Aug 2007 11:35:20 +0100
Cc: Gary Grebus <ggrebus@xxxxxxxxxxxxxxx>
Delivery-date: Tue, 28 Aug 2007 03:36:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <46D31C01.3020407@xxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcfpXyG0YFwV5FVSEdyEfAAX8io7RQ==
Thread-topic: [Xen-devel] [PATCH][QEMU] Fix ACPI COM port detection
User-agent: Microsoft-Entourage/11.3.6.070618
Could we just always-on a UAR2 device? We don't use IRQ 3 for anything else.
Also we already always-on LTP1 and UAR1, and switching those off on
already-installed guests is likely to cause Windows to get upset.

Also, PIIX4 is not hardcoded to 00:01.2, and if it moves then we have set
ourselves up here for a subtle bug.

 -- Keir

On 27/8/07 19:46, "Ben Guthro" <bguthro@xxxxxxxxxxxxxxx> wrote:

> Fix to ACPI DSDT and qemu to properly detect COM ports.
> 
> Signed-off-by: Ben Guthro <bguthro@xxxxxxxxxxxxxxx>
> Signed-off-by: Gary Grebus <ggrebus@xxxxxxxxxxxxxxx>
> 
> diff -r b3ff399f3be9 tools/firmware/hvmloader/acpi/dsdt.asl
> --- a/tools/firmware/hvmloader/acpi/dsdt.asl Mon Jul 30 15:02:51 2007 -0400
> +++ b/tools/firmware/hvmloader/acpi/dsdt.asl Mon Jul 30 15:02:51 2007 -0400
> @@ -635,7 +635,16 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2,
>                      Name (_UID, 0x01)
>                      Method (_STA, 0, NotSerialized)
>                      {
> -                        Return (0x0F)
> +                        Store (\_SB.PCI0.PX13.DRSC, Local0)
> +                        And (Local0, 0x08000000, Local0)
> +                        If (LEqual (Local0, 0))
> +                        {
> +                            Return (0x00)
> +                        }
> +                        Else
> +                        {
> +                            Return (0x0F)
> +                        }
>                      }
>  
>                      Name (_CRS, ResourceTemplate()
> @@ -644,7 +653,29 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2,
>                          IRQNoFlags () {4}
>                      })
>                  }
> -
> +                Device (UAR2)
> +                {
> +                    Name (_HID, EisaId ("PNP0501"))
> +                    Name (_UID, 0x02)
> +                    Method (_STA, 0, NotSerialized)
> +                    {
> +                        Store (\_SB.PCI0.PX13.DRSC, Local0)
> +                        And (Local0, 0x80000000, Local0)
> +                        If (LEqual (Local0, 0))
> +                        {
> +                            Return (0x00)
> +                        }
> +                        Else
> +                        {
> +                            Return (0x0F)
> +                        }
> +                    }
> +                    Name (_CRS, ResourceTemplate()
> +                    {
> +   IO (Decode16, 0x02F8, 0x02F8, 0x00, 0x08)
> +                 IRQNoFlags () {3}
> +                    })
> +                }
>                  Device (LTP1)
>                  {
>                      Name (_HID, EisaId ("PNP0400"))
> @@ -661,6 +692,25 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2,
>                      })
>                  }
>              }
> +            /* PIIX4 PM */
> +            Device (PX13) {
> +                Name (_ADR, 0x00010002)
> +
> +                OperationRegion (P13C, PCI_Config, 0x5c, 0x24)
> +                Field (P13C, DWordAcc, NoLock, Preserve)
> +                {
> +                    DRSA, 32,
> +                    DRSB, 32,
> +                    DRSC, 32,
> +                    DRSE, 32,
> +                    DRSF, 32,
> +                    DRSG, 32,
> +                    DRSH, 32,
> +                    DRSI, 32,
> +                    DRSJ, 32
> +         }
> +     }
> +
>          }
>      }
>  }
> diff -r b3ff399f3be9 tools/firmware/hvmloader/acpi/dsdt.c
> --- a/tools/firmware/hvmloader/acpi/dsdt.c Mon Jul 30 15:02:51 2007 -0400
> +++ b/tools/firmware/hvmloader/acpi/dsdt.c Tue Jul 31 13:17:34 2007 -0400
> @@ -1,22 +1,22 @@
>  /*
>   * 
>   * Intel ACPI Component Architecture
> - * ASL Optimizing Compiler version 20060707 [Feb 16 2007]
> + * ASL Optimizing Compiler version 20060127 [Jun 16 2006]
>   * Copyright (C) 2000 - 2006 Intel Corporation
>   * Supports ACPI Specification Revision 3.0a
>   * 
> - * Compilation of "dsdt.asl" - Wed Jul 11 13:34:30 2007
> + * Compilation of "dsdt.asl" - Tue Jul 31 11:23:43 2007
>   * 
>   * C source code output
>   *
>   */
>  unsigned char AmlCode[] =
>  {
> -    0x44,0x53,0x44,0x54,0x9F,0x0D,0x00,0x00,  /* 00000000    "DSDT...." */
> -    0x02,0x2E,0x58,0x65,0x6E,0x00,0x00,0x00,  /* 00000008    "..Xen..." */
> +    0x44,0x53,0x44,0x54,0x69,0x0E,0x00,0x00,  /* 00000000    "DSDTi..." */
> +    0x02,0x1B,0x58,0x65,0x6E,0x00,0x00,0x00,  /* 00000008    "..Xen..." */
>      0x48,0x56,0x4D,0x00,0x00,0x00,0x00,0x00,  /* 00000010    "HVM....." */
>      0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
> -    0x07,0x07,0x06,0x20,0x08,0x50,0x4D,0x42,  /* 00000020    "... .PMB" */
> +    0x27,0x01,0x06,0x20,0x08,0x50,0x4D,0x42,  /* 00000020    "'.. .PMB" */
>      0x53,0x0B,0x00,0x0C,0x08,0x50,0x4D,0x4C,  /* 00000028    "S....PML" */
>      0x4E,0x0A,0x08,0x08,0x49,0x4F,0x42,0x31,  /* 00000030    "N...IOB1" */
>      0x00,0x08,0x49,0x4F,0x4C,0x31,0x00,0x08,  /* 00000038    "..IOL1.." */
> @@ -27,7 +27,7 @@ unsigned char AmlCode[] =
>      0x04,0x0A,0x07,0x0A,0x07,0x00,0x00,0x08,  /* 00000060    "........" */
>      0x50,0x49,0x43,0x44,0x00,0x14,0x0C,0x5F,  /* 00000068    "PICD..._" */
>      0x50,0x49,0x43,0x01,0x70,0x68,0x50,0x49,  /* 00000070    "PIC.phPI" */
> -    0x43,0x44,0x10,0x44,0xD2,0x5F,0x53,0x42,  /* 00000078    "CD.D._SB" */
> +    0x43,0x44,0x10,0x4E,0xDE,0x5F,0x53,0x42,  /* 00000078    "CD.N._SB" */
>      0x5F,0x5B,0x82,0x49,0x04,0x4D,0x45,0x4D,  /* 00000080    "_[.I.MEM" */
>      0x30,0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,  /* 00000088    "0._HID.A" */
>      0xD0,0x0C,0x02,0x08,0x5F,0x43,0x52,0x53,  /* 00000090    "...._CRS" */
> @@ -37,7 +37,7 @@ unsigned char AmlCode[] =
>      0x00,0x00,0xFF,0xFF,0x09,0x00,0x00,0x00,  /* 000000B0    "........" */
>      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000B8    "........" */
>      0x00,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,  /* 000000C0    "........" */
> -    0x00,0x00,0x79,0x00,0x5B,0x82,0x41,0xCD,  /* 000000C8    "..y.[.A." */
> +    0x00,0x00,0x79,0x00,0x5B,0x82,0x4B,0xD9,  /* 000000C8    "..y.[.K." */
>      0x50,0x43,0x49,0x30,0x08,0x5F,0x48,0x49,  /* 000000D0    "PCI0._HI" */
>      0x44,0x0C,0x41,0xD0,0x0A,0x03,0x08,0x5F,  /* 000000D8    "D.A...._" */
>      0x55,0x49,0x44,0x00,0x08,0x5F,0x41,0x44,  /* 000000E0    "UID.._AD" */
> @@ -348,7 +348,7 @@ unsigned char AmlCode[] =
>      0x0C,0x04,0x0C,0xFF,0xFF,0x0F,0x00,0x0A,  /* 00000A68    "........" */
>      0x02,0x00,0x0A,0x2F,0x12,0x0C,0x04,0x0C,  /* 00000A70    ".../...." */
>      0xFF,0xFF,0x0F,0x00,0x0A,0x03,0x00,0x0A,  /* 00000A78    "........" */
> -    0x10,0x5B,0x82,0x4C,0x31,0x49,0x53,0x41,  /* 00000A80    ".[.L1ISA" */
> +    0x10,0x5B,0x82,0x44,0x39,0x49,0x53,0x41,  /* 00000A80    ".[.D9ISA" */
>      0x5F,0x08,0x5F,0x41,0x44,0x52,0x0C,0x00,  /* 00000A88    "_._ADR.." */
>      0x00,0x01,0x00,0x5B,0x80,0x50,0x49,0x52,  /* 00000A90    "...[.PIR" */
>      0x51,0x02,0x0A,0x60,0x0A,0x04,0x10,0x2E,  /* 00000A98    "Q..`...." */
> @@ -434,19 +434,45 @@ unsigned char AmlCode[] =
>      0x47,0x01,0xF0,0x03,0xF0,0x03,0x01,0x06,  /* 00000D18    "G......." */
>      0x47,0x01,0xF7,0x03,0xF7,0x03,0x01,0x01,  /* 00000D20    "G......." */
>      0x22,0x40,0x00,0x2A,0x04,0x00,0x79,0x00,  /* 00000D28    ""@.*..y." */
> -    0x5B,0x82,0x35,0x55,0x41,0x52,0x31,0x08,  /* 00000D30    "[.5UAR1." */
> -    0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x05,  /* 00000D38    "_HID.A.." */
> -    0x01,0x08,0x5F,0x55,0x49,0x44,0x01,0x14,  /* 00000D40    ".._UID.." */
> -    0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,  /* 00000D48    "._STA..." */
> -    0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,0x10,  /* 00000D50    ".._CRS.." */
> -    0x0A,0x0D,0x47,0x01,0xF8,0x03,0xF8,0x03,  /* 00000D58    "..G....." */
> -    0x01,0x08,0x22,0x10,0x00,0x79,0x00,0x5B,  /* 00000D60    ".."..y.[" */
> -    0x82,0x36,0x4C,0x54,0x50,0x31,0x08,0x5F,  /* 00000D68    ".6LTP1._" */
> -    0x48,0x49,0x44,0x0C,0x41,0xD0,0x04,0x00,  /* 00000D70    "HID.A..." */
> -    0x08,0x5F,0x55,0x49,0x44,0x0A,0x02,0x14,  /* 00000D78    "._UID..." */
> -    0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,  /* 00000D80    "._STA..." */
> -    0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,0x10,  /* 00000D88    ".._CRS.." */
> -    0x0A,0x0D,0x47,0x01,0x78,0x03,0x78,0x03,  /* 00000D90    "..G.x.x." */
> -    0x08,0x08,0x22,0x80,0x00,0x79,0x00,
> +    0x5B,0x82,0x45,0x05,0x55,0x41,0x52,0x31,  /* 00000D30    "[.E.UAR1" */
> +    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000D38    "._HID.A." */
> +    0x05,0x01,0x08,0x5F,0x55,0x49,0x44,0x01,  /* 00000D40    "..._UID." */
> +    0x14,0x28,0x5F,0x53,0x54,0x41,0x00,0x70,  /* 00000D48    ".(_STA.p" */
> +    0x5E,0x5E,0x5E,0x2E,0x50,0x58,0x31,0x33,  /* 00000D50    "^^^.PX13" */
> +    0x44,0x52,0x53,0x43,0x60,0x7B,0x60,0x0C,  /* 00000D58    "DRSC`{`." */
> +    0x00,0x00,0x00,0x08,0x60,0xA0,0x06,0x93,  /* 00000D60    "....`..." */
> +    0x60,0x00,0xA4,0x00,0xA1,0x04,0xA4,0x0A,  /* 00000D68    "`......." */
> +    0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,0x10,  /* 00000D70    ".._CRS.." */
> +    0x0A,0x0D,0x47,0x01,0xF8,0x03,0xF8,0x03,  /* 00000D78    "..G....." */
> +    0x01,0x08,0x22,0x10,0x00,0x79,0x00,0x5B,  /* 00000D80    ".."..y.[" */
> +    0x82,0x46,0x05,0x55,0x41,0x52,0x32,0x08,  /* 00000D88    ".F.UAR2." */
> +    0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x05,  /* 00000D90    "_HID.A.." */
> +    0x01,0x08,0x5F,0x55,0x49,0x44,0x0A,0x02,  /* 00000D98    ".._UID.." */
> +    0x14,0x28,0x5F,0x53,0x54,0x41,0x00,0x70,  /* 00000DA0    ".(_STA.p" */
> +    0x5E,0x5E,0x5E,0x2E,0x50,0x58,0x31,0x33,  /* 00000DA8    "^^^.PX13" */
> +    0x44,0x52,0x53,0x43,0x60,0x7B,0x60,0x0C,  /* 00000DB0    "DRSC`{`." */
> +    0x00,0x00,0x00,0x80,0x60,0xA0,0x06,0x93,  /* 00000DB8    "....`..." */
> +    0x60,0x00,0xA4,0x00,0xA1,0x04,0xA4,0x0A,  /* 00000DC0    "`......." */
> +    0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,0x10,  /* 00000DC8    ".._CRS.." */
> +    0x0A,0x0D,0x47,0x01,0xF8,0x02,0xF8,0x02,  /* 00000DD0    "..G....." */
> +    0x00,0x08,0x22,0x08,0x00,0x79,0x00,0x5B,  /* 00000DD8    ".."..y.[" */
> +    0x82,0x36,0x4C,0x54,0x50,0x31,0x08,0x5F,  /* 00000DE0    ".6LTP1._" */
> +    0x48,0x49,0x44,0x0C,0x41,0xD0,0x04,0x00,  /* 00000DE8    "HID.A..." */
> +    0x08,0x5F,0x55,0x49,0x44,0x0A,0x02,0x14,  /* 00000DF0    "._UID..." */
> +    0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,  /* 00000DF8    "._STA..." */
> +    0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,0x10,  /* 00000E00    ".._CRS.." */
> +    0x0A,0x0D,0x47,0x01,0x78,0x03,0x78,0x03,  /* 00000E08    "..G.x.x." */
> +    0x08,0x08,0x22,0x80,0x00,0x79,0x00,0x5B,  /* 00000E10    ".."..y.[" */
> +    0x82,0x40,0x05,0x50,0x58,0x31,0x33,0x08,  /* 00000E18    ".@.PX13." */
> +    0x5F,0x41,0x44,0x52,0x0C,0x02,0x00,0x01,  /* 00000E20    "_ADR...." */
> +    0x00,0x5B,0x80,0x50,0x31,0x33,0x43,0x02,  /* 00000E28    ".[.P13C." */
> +    0x0A,0x5C,0x0A,0x24,0x5B,0x81,0x33,0x50,  /* 00000E30    ".\.$[.3P" */
> +    0x31,0x33,0x43,0x03,0x44,0x52,0x53,0x41,  /* 00000E38    "13C.DRSA" */
> +    0x20,0x44,0x52,0x53,0x42,0x20,0x44,0x52,  /* 00000E40    " DRSB DR" */
> +    0x53,0x43,0x20,0x44,0x52,0x53,0x45,0x20,  /* 00000E48    "SC DRSE " */
> +    0x44,0x52,0x53,0x46,0x20,0x44,0x52,0x53,  /* 00000E50    "DRSF DRS" */
> +    0x47,0x20,0x44,0x52,0x53,0x48,0x20,0x44,  /* 00000E58    "G DRSH D" */
> +    0x52,0x53,0x49,0x20,0x44,0x52,0x53,0x4A,  /* 00000E60    "RSI DRSJ" */
> +    0x20,
>  };
>  int DsdtLen=sizeof(AmlCode);
> diff -r b3ff399f3be9 tools/ioemu/hw/piix4acpi.c
> --- a/tools/ioemu/hw/piix4acpi.c Mon Jul 30 15:02:51 2007 -0400
> +++ b/tools/ioemu/hw/piix4acpi.c Mon Jul 30 15:02:51 2007 -0400
> @@ -166,6 +166,11 @@ void pci_piix4_acpi_init(PCIBus *bus, in
>      pci_conf[0x43] = 0x00;
>      d->pm1_control = SCI_EN;
>  
> +    /* ACPI BIOS determines presence of COM ports based on these decodes */
> +    pci_conf[0x63] = 0x60;
> +    pci_conf[0x67] = (serial_hds[0] != NULL ? 0x08 : 0) |
> + (serial_hds[1] != NULL ? 0x90 : 0);
> +
>      acpi_map((PCIDevice *)d, 0, 0x1f40, 0x10, PCI_ADDRESS_SPACE_IO);
>  
>      register_savevm("piix4acpi", 0, 1, piix4acpi_save, piix4acpi_load, d);
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel