* [PATCH] hvmloader: don't use AML operations on 64-bit fields @ 2014-05-27 8:57 Jan Beulich 2014-05-27 10:44 ` Jan Beulich 0 siblings, 1 reply; 4+ messages in thread From: Jan Beulich @ 2014-05-27 8:57 UTC (permalink / raw) To: xen-devel; +Cc: Ian Campbell, Ian Jackson, Stefano Stabellini [-- Attachment #1: Type: text/plain, Size: 2529 bytes --] WinXP and Win2K3, while having no problem with the QWordMemory resource (there was another one there before), don't like operations on 64-bit fields. Split the fields d0688669 ("hvmloader: also cover PCI MMIO ranges above 4G with UC MTRR ranges") added to 32-bit ones, handling carry over explicitly. Signed-off-by: Jan Beulich <jbeulich@suse.com> --- a/tools/firmware/hvmloader/acpi/dsdt.asl +++ b/tools/firmware/hvmloader/acpi/dsdt.asl @@ -57,8 +57,10 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, MSUA, 32, /* MADT checksum address */ MAPA, 32, /* MADT LAPIC0 address */ VGIA, 32, /* VM generation id address */ - HMIN, 64, - HLEN, 64 + LMIN, 32, + HMIN, 32, + LLEN, 32, + HLEN, 32 } /* Fix HCT test for 0x400 pci memory: @@ -176,15 +178,27 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, Add(MMIN, MLEN, MMAX) Subtract(MMAX, One, MMAX) - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, HMIN) - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MAX, HMAX) - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._LEN, HLEN) - - Store(\_SB.HMIN, HMIN) - Store(\_SB.HLEN, HLEN) - Add(HMIN, HLEN, HMAX) - If(LOr(HMIN, HLEN)) { - Subtract(HMAX, One, HMAX) + CreateDWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, MINL) + CreateDWordField(PRT0, \_SB.PCI0._CRS._Y02._MAX, MAXL) + CreateDWordField(PRT0, \_SB.PCI0._CRS._Y02._LEN, LENL) + CreateDWordField(PRT0, Add(\_SB.PCI0._CRS._Y02._MIN, 4), MINH) + CreateDWordField(PRT0, Add(\_SB.PCI0._CRS._Y02._MAX, 4), MAXH) + CreateDWordField(PRT0, Add(\_SB.PCI0._CRS._Y02._LEN, 4), LENH) + + Store(\_SB.LMIN, MINL) + Store(\_SB.HMIN, MINH) + Store(\_SB.LLEN, LENL) + Store(\_SB.HLEN, LENH) + Add(MINL, LENL, MAXL) + Add(MINH, LENH, MAXH) + If(LLess(MAXL, MINL)) { + Add(MAXH, One, MAXH) + } + If(LOr(MINH, LENL)) { + If(LEqual(MAXL, 0)) { + Subtract(MAXH, One, MAXH) + } + Subtract(MAXL, One, MAXL) } Return (PRT0) [-- Attachment #2: hvmloader-WinXP.patch --] [-- Type: text/plain, Size: 2579 bytes --] hvmloader: don't use AML operations on 64-bit fields WinXP and Win2K3, while having no problem with the QWordMemory resource (there was another one there before), don't like operations on 64-bit fields. Split the fields d0688669 ("hvmloader: also cover PCI MMIO ranges above 4G with UC MTRR ranges") added to 32-bit ones, handling carry over explicitly. Signed-off-by: Jan Beulich <jbeulich@suse.com> --- a/tools/firmware/hvmloader/acpi/dsdt.asl +++ b/tools/firmware/hvmloader/acpi/dsdt.asl @@ -57,8 +57,10 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, MSUA, 32, /* MADT checksum address */ MAPA, 32, /* MADT LAPIC0 address */ VGIA, 32, /* VM generation id address */ - HMIN, 64, - HLEN, 64 + LMIN, 32, + HMIN, 32, + LLEN, 32, + HLEN, 32 } /* Fix HCT test for 0x400 pci memory: @@ -176,15 +178,27 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, Add(MMIN, MLEN, MMAX) Subtract(MMAX, One, MMAX) - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, HMIN) - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MAX, HMAX) - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._LEN, HLEN) - - Store(\_SB.HMIN, HMIN) - Store(\_SB.HLEN, HLEN) - Add(HMIN, HLEN, HMAX) - If(LOr(HMIN, HLEN)) { - Subtract(HMAX, One, HMAX) + CreateDWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, MINL) + CreateDWordField(PRT0, \_SB.PCI0._CRS._Y02._MAX, MAXL) + CreateDWordField(PRT0, \_SB.PCI0._CRS._Y02._LEN, LENL) + CreateDWordField(PRT0, Add(\_SB.PCI0._CRS._Y02._MIN, 4), MINH) + CreateDWordField(PRT0, Add(\_SB.PCI0._CRS._Y02._MAX, 4), MAXH) + CreateDWordField(PRT0, Add(\_SB.PCI0._CRS._Y02._LEN, 4), LENH) + + Store(\_SB.LMIN, MINL) + Store(\_SB.HMIN, MINH) + Store(\_SB.LLEN, LENL) + Store(\_SB.HLEN, LENH) + Add(MINL, LENL, MAXL) + Add(MINH, LENH, MAXH) + If(LLess(MAXL, MINL)) { + Add(MAXH, One, MAXH) + } + If(LOr(MINH, LENL)) { + If(LEqual(MAXL, 0)) { + Subtract(MAXH, One, MAXH) + } + Subtract(MAXL, One, MAXL) } Return (PRT0) [-- Attachment #3: Type: text/plain, Size: 126 bytes --] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hvmloader: don't use AML operations on 64-bit fields 2014-05-27 8:57 [PATCH] hvmloader: don't use AML operations on 64-bit fields Jan Beulich @ 2014-05-27 10:44 ` Jan Beulich 2014-05-27 13:21 ` [PATCH v2] " Jan Beulich 0 siblings, 1 reply; 4+ messages in thread From: Jan Beulich @ 2014-05-27 10:44 UTC (permalink / raw) To: xen-devel; +Cc: Ian Campbell, Ian Jackson, Stefano Stabellini >>> On 27.05.14 at 10:57, <JBeulich@suse.com> wrote: > WinXP and Win2K3, while having no problem with the QWordMemory resource > (there was another one there before), don't like operations on 64-bit > fields. Split the fields d0688669 ("hvmloader: also cover PCI MMIO > ranges above 4G with UC MTRR ranges") added to 32-bit ones, handling > carry over explicitly. > > Signed-off-by: Jan Beulich <jbeulich@suse.com> I have to withdraw this - just found an iasl version that mis-compiles (afaict at least) it. > --- a/tools/firmware/hvmloader/acpi/dsdt.asl > +++ b/tools/firmware/hvmloader/acpi/dsdt.asl > @@ -57,8 +57,10 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, > MSUA, 32, /* MADT checksum address */ > MAPA, 32, /* MADT LAPIC0 address */ > VGIA, 32, /* VM generation id address */ > - HMIN, 64, > - HLEN, 64 > + LMIN, 32, > + HMIN, 32, > + LLEN, 32, > + HLEN, 32 > } > > /* Fix HCT test for 0x400 pci memory: > @@ -176,15 +178,27 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, > Add(MMIN, MLEN, MMAX) > Subtract(MMAX, One, MMAX) > > - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, HMIN) > - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MAX, HMAX) > - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._LEN, HLEN) > - > - Store(\_SB.HMIN, HMIN) > - Store(\_SB.HLEN, HLEN) > - Add(HMIN, HLEN, HMAX) > - If(LOr(HMIN, HLEN)) { > - Subtract(HMAX, One, HMAX) > + CreateDWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, MINL) > + CreateDWordField(PRT0, \_SB.PCI0._CRS._Y02._MAX, MAXL) > + CreateDWordField(PRT0, \_SB.PCI0._CRS._Y02._LEN, LENL) > + CreateDWordField(PRT0, Add(\_SB.PCI0._CRS._Y02._MIN, 4), MINH) > + CreateDWordField(PRT0, Add(\_SB.PCI0._CRS._Y02._MAX, 4), MAXH) > + CreateDWordField(PRT0, Add(\_SB.PCI0._CRS._Y02._LEN, 4), LENH) > + > + Store(\_SB.LMIN, MINL) > + Store(\_SB.HMIN, MINH) > + Store(\_SB.LLEN, LENL) > + Store(\_SB.HLEN, LENH) > + Add(MINL, LENL, MAXL) > + Add(MINH, LENH, MAXH) > + If(LLess(MAXL, MINL)) { > + Add(MAXH, One, MAXH) > + } > + If(LOr(MINH, LENL)) { > + If(LEqual(MAXL, 0)) { > + Subtract(MAXH, One, MAXH) > + } > + Subtract(MAXL, One, MAXL) > } > > Return (PRT0) ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] hvmloader: don't use AML operations on 64-bit fields 2014-05-27 10:44 ` Jan Beulich @ 2014-05-27 13:21 ` Jan Beulich 2014-05-28 8:52 ` Ian Campbell 0 siblings, 1 reply; 4+ messages in thread From: Jan Beulich @ 2014-05-27 13:21 UTC (permalink / raw) To: xen-devel; +Cc: Ian Campbell, Ian Jackson, Stefano Stabellini [-- Attachment #1: Type: text/plain, Size: 3833 bytes --] WinXP and Win2K3, while having no problem with the QWordMemory resource (there was another one there before), don't like operations on 64-bit fields. Split the fields d0688669 ("hvmloader: also cover PCI MMIO ranges above 4G with UC MTRR ranges") added to 32-bit ones, handling carry over explicitly. Sadly the constructs needed to create the sub-fields - nominally CreateDWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, MINL) CreateDWordField(PRT0, Add(\_SB.PCI0._CRS._Y02._MIN, 4), MINH) - can't be used: The former gets warned upon by newer iasl, i.e. would need to be replaced by the latter just with the addend changed to 0, and the latter doesn't translate properly with recent iasl). Hence, short of having an ASL/iasl expert at hand, we need to work around the shortcomings of various iasl versions. See the code comment. Signed-off-by: Jan Beulich <jbeulich@suse.com> --- v2: Avoid mis-compilation and warnings issued by newer iasl. --- a/tools/firmware/hvmloader/acpi/dsdt.asl +++ b/tools/firmware/hvmloader/acpi/dsdt.asl @@ -57,8 +57,10 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, MSUA, 32, /* MADT checksum address */ MAPA, 32, /* MADT LAPIC0 address */ VGIA, 32, /* VM generation id address */ - HMIN, 64, - HLEN, 64 + LMIN, 32, + HMIN, 32, + LLEN, 32, + HLEN, 32 } /* Fix HCT test for 0x400 pci memory: @@ -176,15 +178,41 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, Add(MMIN, MLEN, MMAX) Subtract(MMAX, One, MMAX) - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, HMIN) - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MAX, HMAX) - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._LEN, HLEN) - - Store(\_SB.HMIN, HMIN) - Store(\_SB.HLEN, HLEN) - Add(HMIN, HLEN, HMAX) - If(LOr(HMIN, HLEN)) { - Subtract(HMAX, One, HMAX) + /* + * WinXP / Win2K3 blue-screen for operations on 64-bit values. + * Therefore we need to split the 64-bit calculations needed + * here, but different iasl versions evaluate name references + * to integers differently: + * Year (approximate) 2006 2008 2012 + * \_SB.PCI0._CRS._Y02 zero valid valid + * \_SB.PCI0._CRS._Y02._MIN valid valid huge + */ + If(LEqual(Zero, \_SB.PCI0._CRS._Y02)) { + Subtract(\_SB.PCI0._CRS._Y02._MIN, 14, Local0) + } Else { + Store(\_SB.PCI0._CRS._Y02, Local0) + } + CreateDWordField(PRT0, Add(Local0, 14), MINL) + CreateDWordField(PRT0, Add(Local0, 18), MINH) + CreateDWordField(PRT0, Add(Local0, 22), MAXL) + CreateDWordField(PRT0, Add(Local0, 26), MAXH) + CreateDWordField(PRT0, Add(Local0, 38), LENL) + CreateDWordField(PRT0, Add(Local0, 42), LENH) + + Store(\_SB.LMIN, MINL) + Store(\_SB.HMIN, MINH) + Store(\_SB.LLEN, LENL) + Store(\_SB.HLEN, LENH) + Add(MINL, LENL, MAXL) + Add(MINH, LENH, MAXH) + If(LLess(MAXL, MINL)) { + Add(MAXH, One, MAXH) + } + If(LOr(MINH, LENL)) { + If(LEqual(MAXL, 0)) { + Subtract(MAXH, One, MAXH) + } + Subtract(MAXL, One, MAXL) } Return (PRT0) [-- Attachment #2: hvmloader-WinXP.patch --] [-- Type: text/plain, Size: 3883 bytes --] hvmloader: don't use AML operations on 64-bit fields WinXP and Win2K3, while having no problem with the QWordMemory resource (there was another one there before), don't like operations on 64-bit fields. Split the fields d0688669 ("hvmloader: also cover PCI MMIO ranges above 4G with UC MTRR ranges") added to 32-bit ones, handling carry over explicitly. Sadly the constructs needed to create the sub-fields - nominally CreateDWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, MINL) CreateDWordField(PRT0, Add(\_SB.PCI0._CRS._Y02._MIN, 4), MINH) - can't be used: The former gets warned upon by newer iasl, i.e. would need to be replaced by the latter just with the addend changed to 0, and the latter doesn't translate properly with recent iasl). Hence, short of having an ASL/iasl expert at hand, we need to work around the shortcomings of various iasl versions. See the code comment. Signed-off-by: Jan Beulich <jbeulich@suse.com> --- v2: Avoid mis-compilation and warnings issued by newer iasl. --- a/tools/firmware/hvmloader/acpi/dsdt.asl +++ b/tools/firmware/hvmloader/acpi/dsdt.asl @@ -57,8 +57,10 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, MSUA, 32, /* MADT checksum address */ MAPA, 32, /* MADT LAPIC0 address */ VGIA, 32, /* VM generation id address */ - HMIN, 64, - HLEN, 64 + LMIN, 32, + HMIN, 32, + LLEN, 32, + HLEN, 32 } /* Fix HCT test for 0x400 pci memory: @@ -176,15 +178,41 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, Add(MMIN, MLEN, MMAX) Subtract(MMAX, One, MMAX) - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, HMIN) - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MAX, HMAX) - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._LEN, HLEN) - - Store(\_SB.HMIN, HMIN) - Store(\_SB.HLEN, HLEN) - Add(HMIN, HLEN, HMAX) - If(LOr(HMIN, HLEN)) { - Subtract(HMAX, One, HMAX) + /* + * WinXP / Win2K3 blue-screen for operations on 64-bit values. + * Therefore we need to split the 64-bit calculations needed + * here, but different iasl versions evaluate name references + * to integers differently: + * Year (approximate) 2006 2008 2012 + * \_SB.PCI0._CRS._Y02 zero valid valid + * \_SB.PCI0._CRS._Y02._MIN valid valid huge + */ + If(LEqual(Zero, \_SB.PCI0._CRS._Y02)) { + Subtract(\_SB.PCI0._CRS._Y02._MIN, 14, Local0) + } Else { + Store(\_SB.PCI0._CRS._Y02, Local0) + } + CreateDWordField(PRT0, Add(Local0, 14), MINL) + CreateDWordField(PRT0, Add(Local0, 18), MINH) + CreateDWordField(PRT0, Add(Local0, 22), MAXL) + CreateDWordField(PRT0, Add(Local0, 26), MAXH) + CreateDWordField(PRT0, Add(Local0, 38), LENL) + CreateDWordField(PRT0, Add(Local0, 42), LENH) + + Store(\_SB.LMIN, MINL) + Store(\_SB.HMIN, MINH) + Store(\_SB.LLEN, LENL) + Store(\_SB.HLEN, LENH) + Add(MINL, LENL, MAXL) + Add(MINH, LENH, MAXH) + If(LLess(MAXL, MINL)) { + Add(MAXH, One, MAXH) + } + If(LOr(MINH, LENL)) { + If(LEqual(MAXL, 0)) { + Subtract(MAXH, One, MAXH) + } + Subtract(MAXL, One, MAXL) } Return (PRT0) [-- Attachment #3: Type: text/plain, Size: 126 bytes --] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] hvmloader: don't use AML operations on 64-bit fields 2014-05-27 13:21 ` [PATCH v2] " Jan Beulich @ 2014-05-28 8:52 ` Ian Campbell 0 siblings, 0 replies; 4+ messages in thread From: Ian Campbell @ 2014-05-28 8:52 UTC (permalink / raw) To: Jan Beulich; +Cc: xen-devel, Ian Jackson, Stefano Stabellini On Tue, 2014-05-27 at 14:21 +0100, Jan Beulich wrote: > WinXP and Win2K3, while having no problem with the QWordMemory resource > (there was another one there before), don't like operations on 64-bit > fields. Split the fields d0688669 ("hvmloader: also cover PCI MMIO > ranges above 4G with UC MTRR ranges") added to 32-bit ones, handling > carry over explicitly. > > Sadly the constructs needed to create the sub-fields - nominally > > CreateDWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, MINL) > CreateDWordField(PRT0, Add(\_SB.PCI0._CRS._Y02._MIN, 4), MINH) > > - can't be used: The former gets warned upon by newer iasl, i.e. would > need to be replaced by the latter just with the addend changed to 0, > and the latter doesn't translate properly with recent iasl). Hence, > short of having an ASL/iasl expert at hand, we need to work around the > shortcomings of various iasl versions. See the code comment. > > Signed-off-by: Jan Beulich <jbeulich@suse.com> > --- > v2: Avoid mis-compilation and warnings issued by newer iasl. All rather unfortunate isn't it. Oh well. Acked-by: Ian Campbell <ian.campbell@citrix.com> > > --- a/tools/firmware/hvmloader/acpi/dsdt.asl > +++ b/tools/firmware/hvmloader/acpi/dsdt.asl > @@ -57,8 +57,10 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, > MSUA, 32, /* MADT checksum address */ > MAPA, 32, /* MADT LAPIC0 address */ > VGIA, 32, /* VM generation id address */ > - HMIN, 64, > - HLEN, 64 > + LMIN, 32, > + HMIN, 32, > + LLEN, 32, > + HLEN, 32 > } > > /* Fix HCT test for 0x400 pci memory: > @@ -176,15 +178,41 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, > Add(MMIN, MLEN, MMAX) > Subtract(MMAX, One, MMAX) > > - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, HMIN) > - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MAX, HMAX) > - CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._LEN, HLEN) > - > - Store(\_SB.HMIN, HMIN) > - Store(\_SB.HLEN, HLEN) > - Add(HMIN, HLEN, HMAX) > - If(LOr(HMIN, HLEN)) { > - Subtract(HMAX, One, HMAX) > + /* > + * WinXP / Win2K3 blue-screen for operations on 64-bit values. > + * Therefore we need to split the 64-bit calculations needed > + * here, but different iasl versions evaluate name references > + * to integers differently: > + * Year (approximate) 2006 2008 2012 > + * \_SB.PCI0._CRS._Y02 zero valid valid > + * \_SB.PCI0._CRS._Y02._MIN valid valid huge > + */ > + If(LEqual(Zero, \_SB.PCI0._CRS._Y02)) { > + Subtract(\_SB.PCI0._CRS._Y02._MIN, 14, Local0) > + } Else { > + Store(\_SB.PCI0._CRS._Y02, Local0) > + } > + CreateDWordField(PRT0, Add(Local0, 14), MINL) > + CreateDWordField(PRT0, Add(Local0, 18), MINH) > + CreateDWordField(PRT0, Add(Local0, 22), MAXL) > + CreateDWordField(PRT0, Add(Local0, 26), MAXH) > + CreateDWordField(PRT0, Add(Local0, 38), LENL) > + CreateDWordField(PRT0, Add(Local0, 42), LENH) > + > + Store(\_SB.LMIN, MINL) > + Store(\_SB.HMIN, MINH) > + Store(\_SB.LLEN, LENL) > + Store(\_SB.HLEN, LENH) > + Add(MINL, LENL, MAXL) > + Add(MINH, LENH, MAXH) > + If(LLess(MAXL, MINL)) { > + Add(MAXH, One, MAXH) > + } > + If(LOr(MINH, LENL)) { > + If(LEqual(MAXL, 0)) { > + Subtract(MAXH, One, MAXH) > + } > + Subtract(MAXL, One, MAXL) > } > > Return (PRT0) > > > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-05-28 8:52 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-05-27 8:57 [PATCH] hvmloader: don't use AML operations on 64-bit fields Jan Beulich 2014-05-27 10:44 ` Jan Beulich 2014-05-27 13:21 ` [PATCH v2] " Jan Beulich 2014-05-28 8:52 ` Ian Campbell
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).