[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKv+Gu8t994-HEJ+Cyiw6a8Bf_Ka=5amOAw44+UgnJZ90WrpnQ@mail.gmail.com>
Date: Wed, 29 Jun 2016 15:57:47 +0200
From: Ard Biesheuvel <ard.biesheuvel@...aro.org>
To: Tomasz Nowicki <tn@...ihalf.com>
Cc: Christopher Covington <cov@...eaurora.org>,
Duc Dang <dhdang@....com>, Bjorn Helgaas <helgaas@...nel.org>,
Arnd Bergmann <arnd@...db.de>,
Will Deacon <will.deacon@....com>,
Catalin Marinas <catalin.marinas@....com>,
Rafael Wysocki <rafael@...nel.org>,
Hanjun Guo <hanjun.guo@...aro.org>,
Lorenzo Pieralisi <Lorenzo.Pieralisi@....com>,
Sinan Kaya <okaya@...eaurora.org>,
Jayachandran C <jchandra@...adcom.com>,
Robert Richter <robert.richter@...iumnetworks.com>,
Marcin Wojtas <mw@...ihalf.com>,
Liviu Dudau <Liviu.Dudau@....com>,
David Daney <ddaney@...iumnetworks.com>,
Yijing Wang <wangyijing@...wei.com>,
Mark Salter <msalter@...hat.com>, linux-pci@...r.kernel.org,
linux-arm <linux-arm-kernel@...ts.infradead.org>,
"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linaro ACPI Mailman List <linaro-acpi@...ts.linaro.org>,
Jon Masters <jcm@...hat.com>,
Andrea Gallo <andrea.gallo@...aro.org>,
Jeremy Linton <jeremy.linton@....com>,
Dongdong Liu <liudongdong3@...wei.com>,
Gabriele Paoloni <gabriele.paoloni@...wei.com>,
Jeffrey Hugo <jhugo@...eaurora.org>
Subject: Re: [RFC PATCH v4 3/5] PCI: Check platform specific ECAM quirks
On 29 June 2016 at 15:52, Tomasz Nowicki <tn@...ihalf.com> wrote:
> On 29.06.2016 15:34, Christopher Covington wrote:
>>
>> I'm confused by this statement. OEMID is defined as 6 bytes long and OEM
>> Table ID as 8 bytes long in the ACPI specification. As far as I can
>> tell, if your string isn't exactly that long, padding up to that length
>> is required.
>
>
> Well, I cannot find that requirement in ACPI spec. but I might missed
> something.
>
This has *nothing* to do with the ACPI spec.
There exist a couple of machines that have known quirks. Those
machines have certain 6 or 8 byte long strings in their MCFG tables
that we can match against. If any of those fields contains spaces,
whether you call that padding or not is totally irrelevant. The same
applies to NUL bytes.
So for a 6 byte field, our table contains the six characters that we
know is in the quirky hardware's table.
The same for an 8 byte field.
That means there is no need for strnlen, strncmp() with variable size
etc. Each match can be implemented using memcmp() [since the table
fields are not NUL terminated] with a constant argument for the length
parameter.
Regards,
Ard.
> I dumped my x86 machine ACPI tables and here is an example of MCFG:
>
> $ cat mcfg.dsl
> /*
> * Intel ACPI Component Architecture
> * AML/ASL+ Disassembler version 20160108-64
> * Copyright (c) 2000 - 2016 Intel Corporation
> *
> * Disassembly of mcfg.dat, Wed Jun 29 15:48:16 2016
> *
> * ACPI Data Table [MCFG]
> *
> * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue
> */
>
> [000h 0000 4] Signature : "MCFG" [Memory Mapped
> Configuration table]
> [004h 0004 4] Table Length : 0000003C
> [008h 0008 1] Revision : 01
> [009h 0009 1] Checksum : A9
> [00Ah 0010 6] Oem ID : "ALASKA"
> [010h 0016 8] Oem Table ID : "A M I"
> [018h 0024 4] Oem Revision : 01072009
> [01Ch 0028 4] Asl Compiler ID : "MSFT"
> [020h 0032 4] Asl Compiler Revision : 00000097
>
> [024h 0036 8] Reserved : 0000000000000000
>
> [02Ch 0044 8] Base Address : 00000000F8000000
> [034h 0052 2] Segment Group Number : 0000
> [036h 0054 1] Start Bus Number : 00
> [037h 0055 1] End Bus Number : 3F
> [038h 0056 4] Reserved : 00000000
>
> Raw Table Data: Length 60 (0x3C)
>
> 00000000 4d 43 46 47 3c 00 00 00 01 a9 41 4c 41 53 4b 41
> |MCFG<.....ALASKA|
> 00000010 41 20 4d 20 49 00 00 00 09 20 07 01 4d 53 46 54 |A M I....
> ..MSFT|
> 00000020 97 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f8
> |................|
> 00000030 00 00 00 00 00 00 00 3f 00 00 00 00 |.......?....|
>
> So in this example I have OEM table ID "A M I" 6 character long and 0
> padding.
>
> Tomasz
>
Powered by blists - more mailing lists