From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKJBI-0004Th-28 for qemu-devel@nongnu.org; Mon, 25 Mar 2013 22:00:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKJBD-0005Wr-0T for qemu-devel@nongnu.org; Mon, 25 Mar 2013 22:00:08 -0400 Received: from [222.73.24.84] (port=41770 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKJBC-0005Se-Ec for qemu-devel@nongnu.org; Mon, 25 Mar 2013 22:00:02 -0400 Date: Tue, 26 Mar 2013 09:59:52 +0800 From: Hu Tao Message-ID: <20130326015952.GC27169@localhost.localdomain> References: <1363856914-23399-2-git-send-email-hutao@cn.fujitsu.com> <514ACEDA.8080506@redhat.com> <20130321091711.GB21556@localhost.localdomain> <20130322074818.GM9382@redhat.com> MIME-Version: 1.0 In-Reply-To: <20130322074818.GM9382@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Subject: Re: [Qemu-devel] [PATCH v15 2/2] patch dsdt to use passed-in pvpanic ioport List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: Peter Maydell , "Michael S. Tsirkin" , Jan Kiszka , seabios@seabios.org, qemu-devel , Markus Armbruster , Blue Swirl , Orit Wasserman , Juan Quintela , Alexander Graf , Christian Borntraeger , Andrew Jones , Alex Williamson , Sasha Levin , Stefan Hajnoczi , Luiz Capitulino , KAMEZAWA Hiroyuki , Anthony Liguori , Marcelo Tosatti , Paolo Bonzini On Fri, Mar 22, 2013 at 09:48:18AM +0200, Gleb Natapov wrote: > On Thu, Mar 21, 2013 at 05:17:11PM +0800, Hu Tao wrote: > > On Thu, Mar 21, 2013 at 10:11:54AM +0100, Paolo Bonzini wrote: > > > Il 21/03/2013 10:08, Hu Tao ha scritto: > > > > Signed-off-by: Hu Tao > > > > --- > > > > src/acpi-dsdt-isa.dsl | 14 ++++++++++++-- > > > > src/acpi.c | 9 +++++++++ > > > > 2 files changed, 21 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/src/acpi-dsdt-isa.dsl b/src/acpi-dsdt-isa.dsl > > > > index 87a31b9..43fe719 100644 > > > > --- a/src/acpi-dsdt-isa.dsl > > > > +++ b/src/acpi-dsdt-isa.dsl > > > > @@ -102,7 +102,9 @@ Scope(\_SB.PCI0.ISA) { > > > > > > > > Device(PEVT) { > > > > Name(_HID, "QEMU0001") > > > > - OperationRegion(PEOR, SystemIO, 0x0505, 0x01) > > > > + ACPI_EXTRACT_NAME_WORD_CONST dsdt_isa_pest > > > > + Name(PEST, 0x505) > > > > + OperationRegion(PEOR, SystemIO, PEST, 0x01) > > > > Field(PEOR, ByteAcc, NoLock, Preserve) { > > > > PEPT, 8, > > > > } > > > > @@ -126,7 +128,15 @@ Scope(\_SB.PCI0.ISA) { > > > > } > > > > > > > > Name(_CRS, ResourceTemplate() { > > > > - IO(Decode16, 0x0505, 0x0505, 0x01, 0x01) > > > > + IO(Decode16, 0x0505, 0x0505, 0x01, 0x01, IO) > > > > }) > > > > + > > > > + CreateWordField(_CRS, IO._MIN, IOMN) > > > > + CreateWordField(_CRS, IO._MAX, IOMX) > > > > + > > > > + Method(_INI, 0, NotSerialized) { > > > > + Store(PEST, IOMN) > > > > + Store(PEST, IOMX) > > > > + } > > > > } > > > > } > > > > diff --git a/src/acpi.c b/src/acpi.c > > > > index 119d1c1..42fa06e 100644 > > > > --- a/src/acpi.c > > > > +++ b/src/acpi.c > > > > @@ -286,11 +286,20 @@ static const struct pci_device_id fadt_init_tbl[] = { > > > > PCI_DEVICE_END > > > > }; > > > > > > > > +static void patch_dsdt(void *dsdt) > > > > +{ > > > > + u8 *dsdt_ptr = dsdt; > > > > + int pvpanic_port = romfile_loadint("etc/pvpanic-port", 0x505); > > > > > > The default must be 0. > > > > > > Also, here: > > > > > > > > > + > > > + Method(_STA, 0, NotSerialized) { > > > + Store(PEPT, Local0) > > > + If (LEqual(Local0, Zero)) { > > > + Return (0x00) > > > + } Else { > > > + Return (0x0F) > > > + } > > > + } > > > + > > > > > > You must change it to look at PEST instead of PEPT (i.e. do not probe, > > > just see if you have a meaningful address). > > > > > > Just squash the patches, it's simpler that way probably. > > > > I forgot to add RFC to the title. This patch doesn't work for q35 with > > custom ioport. > > > Why doesn't it work with q35? ACPI_EXTRACT_NAME_WORD_CONST dsdt_isa_pest generates two dsdt_isa_pest, one in out/acpi-dsdt.hex the other in out/q35-acpi-dsdt.hex. We should use the one in q35-acpi-dsdt.hex to patch DSDT for q35. But including q35-acpi-dsdt.hex, along with acpi-dsdt.hex, will result in redefinition of dsdt_isa_pest. I didn't see a simple way to solve this. -- Regards, Hu Tao