From patchwork Wed Jul 11 10:31:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasilis Liaskovitis X-Patchwork-Id: 170454 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 92ADF2C0089 for ; Wed, 11 Jul 2012 22:14:11 +1000 (EST) Received: from localhost ([::1]:41598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SouER-00055r-TJ for incoming@patchwork.ozlabs.org; Wed, 11 Jul 2012 06:33:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SouDX-0003Md-Qi for qemu-devel@nongnu.org; Wed, 11 Jul 2012 06:32:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SouDP-0005pP-5I for qemu-devel@nongnu.org; Wed, 11 Jul 2012 06:32:23 -0400 Received: from mail-bk0-f45.google.com ([209.85.214.45]:57574) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SouDO-0005oR-V9 for qemu-devel@nongnu.org; Wed, 11 Jul 2012 06:32:15 -0400 Received: by bkcji1 with SMTP id ji1so712860bkc.4 for ; Wed, 11 Jul 2012 03:32:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=5trGvOStVLldFOgFr/hzxoRDITcRFdm+kqinA+Dhjmw=; b=ImSmVAaxOcQszKcRoXXzeD+Gfpw1LuaTBWWTP9s0RqwLKY207/EB7xHMhNz40fsNOW lcCl0yN7mNllwdq27OMl/z6t5s57QF/yRgI7j5669ZY503ALsucj/I0CAhZne3aesqS4 yRGAanqeahNxpZJnhmyJrU1uzaf2a3+redGtn41gyGF0e6gVZMW/T1+uWh3gFmEROAqm f/NU7KhpLshwRzp26pRwSRr1EdkuwSZFMO0i2iyyqDi2CYqbPRI/haKG/5XzDQnSAOSO or1fd5yj9IIcrhVuwkD+B6yFhbmG0rkeRTE+RCR42lV6S3f1U68gw5a3uuBvTX+ddz21 HMaw== Received: by 10.204.128.196 with SMTP id l4mr9033742bks.21.1342002732711; Wed, 11 Jul 2012 03:32:12 -0700 (PDT) Received: from dhcp-192-168-178-175.ri.profitbricks.localdomain ([62.217.45.26]) by mx.google.com with ESMTPS id e20sm794740bkv.10.2012.07.11.03.32.12 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Jul 2012 03:32:12 -0700 (PDT) From: Vasilis Liaskovitis To: qemu-devel@nongnu.org, kvm@vger.kernel.org, seabios@seabios.org Date: Wed, 11 Jul 2012 12:31:48 +0200 Message-Id: <1342002726-18258-4-git-send-email-vasilis.liaskovitis@profitbricks.com> X-Mailer: git-send-email 1.7.9 In-Reply-To: <1342002726-18258-1-git-send-email-vasilis.liaskovitis@profitbricks.com> References: <1342002726-18258-1-git-send-email-vasilis.liaskovitis@profitbricks.com> X-Gm-Message-State: ALoCoQlsZuT4WAqsZLKaHWxH4+Y3Xo5q89hDkVie9hP7WAVlhsAvTPVewXDWIHIoe8K8sX73VAFC X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.45 Cc: gleb@redhat.com, Vasilis Liaskovitis , kevin@koconnor.net, avi@redhat.com, anthony@codemonkey.ws, imammedo@redhat.com Subject: [Qemu-devel] [RFC PATCH v2 03/21][SeaBIOS] acpi-dsdt: Implement functions for memory hotplug X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Extend the DSDT to include methods for handling memory hot-add and hot-remove notifications and memory device status requests. These functions are called from the memory device SSDT methods. Signed-off-by: Vasilis Liaskovitis --- src/acpi-dsdt.dsl | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 68 insertions(+), 2 deletions(-) diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl index 2060686..5d3e92b 100644 --- a/src/acpi-dsdt.dsl +++ b/src/acpi-dsdt.dsl @@ -737,6 +737,71 @@ DefinitionBlock ( } Return(One) } + /* Objects filled in by run-time generated SSDT */ + External(MTFY, MethodObj) + External(MEON, PkgObj) + + Method (CMST, 1, NotSerialized) { + // _STA method - return ON status of memdevice + // Local0 = MEON flag for this cpu + Store(DerefOf(Index(MEON, Arg0)), Local0) + If (Local0) { Return(0xF) } Else { Return(0x0) } + } + + /* Memory hotplug notify array */ + OperationRegion(MEST, SystemIO, 0xaf80, 32) + Field (MEST, ByteAcc, NoLock, Preserve) + { + MES, 256 + } + + /* Memory eject byte */ + OperationRegion(MEMJ, SystemIO, 0xafa0, 1) + Field (MEMJ, ByteAcc, NoLock, Preserve) + { + MPE, 8 + } + + Method(MESC, 0) { + // Local5 = active memdevice bitmap + Store (MES, Local5) + // Local2 = last read byte from bitmap + Store (Zero, Local2) + // Local0 = memory device iterator + Store (Zero, Local0) + While (LLess(Local0, SizeOf(MEON))) { + // Local1 = MEON flag for this memory device + Store(DerefOf(Index(MEON, Local0)), Local1) + If (And(Local0, 0x07)) { + // Shift down previously read bitmap byte + ShiftRight(Local2, 1, Local2) + } Else { + // Read next byte from memdevice bitmap + Store(DerefOf(Index(Local5, ShiftRight(Local0, 3))), Local2) + } + // Local3 = active state for this memory device + Store(And(Local2, 1), Local3) + + If (LNotEqual(Local1, Local3)) { + // State change - update MEON with new state + Store(Local3, Index(MEON, Local0)) + // Do MEM notify + If (LEqual(Local3, 1)) { + MTFY(Local0, 1) + } Else { + MTFY(Local0, 3) + } + } + Increment(Local0) + } + Return(One) + } + + Method (MPEJ, 2, NotSerialized) { + // _EJ0 method - eject callback + Store(Arg0, MPE) + Sleep(200) + } } @@ -759,8 +824,9 @@ DefinitionBlock ( // CPU hotplug event Return(\_SB.PRSC()) } - Method(_L03) { - Return(0x01) + Method(_E03) { + // Memory hotplug event + Return(\_SB.MESC()) } Method(_L04) { Return(0x01)