Received: from eggs.gnu.org ([208.118.235.92]:49691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SU6nN-0001Mb-8h for qemu-devel@nongnu.org; Mon, 14 May 2012 21:43:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SU6nL-0008Bc-FO for qemu-devel@nongnu.org; Mon, 14 May 2012 21:43:24 -0400 Received: from mail-qa0-f52.google.com ([209.85.216.52]:55047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SU6nL-0008BQ-B7 for qemu-devel@nongnu.org; Mon, 14 May 2012 21:43:23 -0400 Received: by qabj34 with SMTP id j34so4488109qab.11 for ; Mon, 14 May 2012 18:43:21 -0700 (PDT) Date: Mon, 14 May 2012 21:43:19 -0400 From: Kevin O'Connor Message-ID: <20120515014319.GA21845@morn.localdomain> References: <1336998923-30144-1-git-send-email-gleb@redhat.com> <1336998923-30144-2-git-send-email-gleb@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1336998923-30144-2-git-send-email-gleb@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/2] Get system state configuration from QEMU and patcth DSDT with it. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: seabios@seabios.org, qemu-devel@nongnu.org On Mon, May 14, 2012 at 03:35:23PM +0300, Gleb Natapov wrote: > QEMU may want to disable guest's S3/S4 support and it wants to distinguish > between regular powerdown and S4 powerdown. To support that new fw_cfg > option was added that passes supported system states and what value should > guest use to enter each state. States are passed in 6 byte array. Each > byte represents one system state. If byte at offset X has its MSB set > it means that system state X is supported and to enter it guest should > use the value from lowest 7 bits. Patch also detects old QEMU and uses > values that work in backwards compatible way there. A couple of comments - see below. [...] > --- a/src/acpi-dsdt.dsl > +++ b/src/acpi-dsdt.dsl > @@ -613,6 +613,7 @@ DefinitionBlock ( > * S3 (suspend-to-ram), S4 (suspend-to-disk) and S5 (power-off) type codes: > * must match piix4 emulation. > */ > + ACPI_EXTRACT_NAME_STRING acpi_s3_name > Name (\_S3, Package (0x04) > { > 0x01, /* PM1a_CNT.SLP_TYP */ > @@ -620,10 +621,12 @@ DefinitionBlock ( > Zero, /* reserved */ > Zero /* reserved */ > }) > + ACPI_EXTRACT_NAME_STRING acpi_s4_name > + ACPI_EXTRACT_PKG_START acpi_s4_pkg The DSDT is quite complex and has a diverse usage. I'd feel more comfortable leaving it as static and doing any dynamic work in an SSDT. In this particular case, can't the objects be turned into methods which calculate the associated values and return the correct results? [...] > --- a/src/paravirt.c > +++ b/src/paravirt.c > @@ -92,6 +92,22 @@ int qemu_cfg_irq0_override(void) > return v; > } > > +int qemu_cfg_system_states(char *states) > +{ I'd prefer to see any new fw_cfg entries use the QEMU_CFG_FILE_DIR mechanism so that seabios can use romfile_loadfile (or similar). -Kevin