ACPI: Avoid array address overflow when _CST MWAIT hint bits are set
commit3b9720cedb49b94ca1f9523da9f7c76647878b5a
authorZhao Yakui <yakui.zhao@intel.com>
Sun, 4 Jan 2009 04:04:21 +0000 (4 12:04 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 6 Feb 2009 22:00:41 +0000 (6 14:00 -0800)
treec8098f9ee71f710e3a34bcedc034fe5d71ec3de8
parent3157bb44c4d5d1c0b8808c13a4b4264f78f0cb8d
ACPI: Avoid array address overflow when _CST MWAIT hint bits are set

commit 13b40a1a065824d2d4e55c8b48ea9f3f9d162929 upstream.

The Cx Register address obtained from the _CST object is used as the MWAIT
hints if the register type is FFixedHW. And it is used to check whether
the Cx type is supported or not.

On some boxes the following Cx state package is obtained from _CST object:
    >{
                ResourceTemplate ()
                {
                    Register (FFixedHW,
                        0x01,               // Bit Width
                        0x02,               // Bit Offset
                        0x0000000000889759, // Address
                        0x03,               // Access Size
                        )
                },

                0x03,
                0xF5,
                0x015E }

   In such case we should use the bit[7:4] of Cx address to check whether
the Cx type is supported or not.

mask the MWAIT hint to avoid array address overflow

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by:Venki Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Cc: Thomas Renninger <trenn@suse.de>
arch/x86/kernel/acpi/cstate.c