From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWo5B-0001jH-PP for qemu-devel@nongnu.org; Mon, 29 Apr 2013 09:25:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UWo54-0006Bx-JG for qemu-devel@nongnu.org; Mon, 29 Apr 2013 09:25:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWo54-0006Bi-BE for qemu-devel@nongnu.org; Mon, 29 Apr 2013 09:25:22 -0400 Date: Mon, 29 Apr 2013 16:25:13 +0300 From: "Michael S. Tsirkin" Message-ID: <20130429132513.GB1850@redhat.com> References: <4fd91502526b9977807a8dff28dcba4db670af7c.1366879705.git.mst@redhat.com> <517E5C4D.7080502@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <517E5C4D.7080502@redhat.com> Subject: Re: [Qemu-devel] [PATCH RFC 2/3] acpi: load and link tables from /etc/acpi/ List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: seabios@seabios.org, qemu-devel@nongnu.org On Mon, Apr 29, 2013 at 01:41:01PM +0200, Laszlo Ersek wrote: > Not sure how much it counts, but I personally can agree with you on this > direction :) > > One note below: > > > @@ -603,8 +604,72 @@ acpi_setup(void) > > if (! CONFIG_ACPI) > > return; > > > > + int acpi_generate = 1; > > + > > dprintf(3, "init ACPI tables\n"); > > > > + struct romfile_s *file = NULL; > > + for (;;) { > > + file = romfile_findprefix("/etc/acpi/", file); > > + if (!file) > > + break; > > + > > + /* > > + * Disable ACPI table generation. All ACPI tables must come from > > + * etc/acpi/ romfile entries. > > + */ > > + acpi_generate = 0; > > + > > [...] > > > + } > > + > > + linker_link("/etc/linker-script"); > > + > > + if (!acpi_generate) { > > + return; > > + } > > + > > + dprintf(3, "generate ACPI tables\n"); > > + > > // This code is hardcoded for PIIX4 Power Management device. > > struct pci_device *pci = pci_find_init_device(acpi_find_tbl, NULL); > > if (!pci) > > Are you deliberately calling linker_link() independently from > "acpi_generate"? My hunch is that linker_link() only makes sense if > acpi_generate == 0 (ie. qemu has passed down at least one table to > repoint some pointer to), but I may be missing a use case. > > Thanks > Laszlo In theory linker code is unrelated to acpi, and host can the linker to patch any romfile. I could add if (!acpi_generate) but it just seems like adding code to remove something potentially useful. -- MST