From: Marcelo Tosatti Subject: [patch 1/7] kvm: qemu: inform valid C2 state in ACPI table Date: Wed, 18 Jun 2008 13:42:06 -0300 Message-ID: <20080618164854.403430016@localhost.localdomain> References: <20080618164205.108219607@localhost.localdomain> Cc: kvm@vger.kernel.org, Marcelo Tosatti To: Avi Kivity Return-path: Received: from mx1.redhat.com ([66.187.233.31]:60225 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754038AbYFRQwa (ORCPT ); Wed, 18 Jun 2008 12:52:30 -0400 Content-Disposition: inline; filename=acpi-fake-c2 Sender: kvm-owner@vger.kernel.org List-ID: Inform C2 state support via ACPI's CST per-processor package. Signed-off-by: Marcelo Tosatti Index: kvm-userspace.tip/bios/acpi-dsdt.dsl =================================================================== --- kvm-userspace.tip.orig/bios/acpi-dsdt.dsl +++ kvm-userspace.tip/bios/acpi-dsdt.dsl @@ -33,6 +33,11 @@ DefinitionBlock ( PRU, 8, PRD, 8, } + OperationRegion(PWNO, SystemIO, 0xb040, 0x02) + Field (PWNO, WordAcc, NoLock, WriteAsZeros) + { + PWC, 16, + } #define gen_processor(nr, name) \ Processor (CPU##name, nr, 0x0000b010, 0x06) { \ @@ -44,11 +49,23 @@ DefinitionBlock ( Method (_STA) { \ Return(0xF) \ } \ + Name(_CST, Package() { \ + 1, Package() { \ + ResourceTemplate() {Register(SystemIO, 8, 0, 0xb014)}, \ + 2, 2, 300}, \ + }) \ } \ - Processor (CPU0, 0x00, 0x0000b010, 0x06) {Method (_STA) { Return(0xF)}} + Processor (CPU0, 0x00, 0x0000b010, 0x06) { + Method (_STA) { Return(0xF)} + Name(_CST, Package() { + 1, Package() { + ResourceTemplate() {Register(SystemIO, 8, 0, 0xb014)}, + 2, 2, 300}, + }) + } gen_processor(1, 1) gen_processor(2, 2) gen_processor(3, 3) @@ -747,7 +764,29 @@ DefinitionBlock ( Method(_L05) { Return(0x01) } +#define gen_power_notify(nr, name) \ + Store (0xfffff, \ + Index (DeRefOf (Index (\_PR.CPU##name._CST, 1)), 2)) \ + Notify(\_PR.CPU##name, 0x81) \ + Method(_L06) { + If (And(\_PR.PWC, 0x1)) { + gen_power_notify(0, 0) + gen_power_notify(1, 1) + gen_power_notify(2, 2) + gen_power_notify(3, 3) + gen_power_notify(4, 4) + gen_power_notify(5, 5) + gen_power_notify(6, 6) + gen_power_notify(7, 7) + gen_power_notify(8, 8) + gen_power_notify(9, 9) + gen_power_notify(10, A) + gen_power_notify(11, B) + gen_power_notify(12, C) + gen_power_notify(13, D) + gen_power_notify(14, E) + } Return(0x01) } Method(_L07) { --