From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDAK2-0007hC-RZ for qemu-devel@nongnu.org; Wed, 06 Mar 2013 04:07:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDAK1-0004YR-Ti for qemu-devel@nongnu.org; Wed, 06 Mar 2013 04:07:38 -0500 Received: from mail-we0-x235.google.com ([2a00:1450:400c:c03::235]:51817) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDAK1-0004YI-N8 for qemu-devel@nongnu.org; Wed, 06 Mar 2013 04:07:37 -0500 Received: by mail-we0-f181.google.com with SMTP id t44so7638491wey.40 for ; Wed, 06 Mar 2013 01:07:37 -0800 (PST) Sender: Paolo Bonzini Message-ID: <51370753.90806@redhat.com> Date: Wed, 06 Mar 2013 10:07:31 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20130303091738.GB23616@redhat.com> <513471F1.5020702@redhat.com> <20130306085628.GB4719@localhost.localdomain> In-Reply-To: <20130306085628.GB4719@localhost.localdomain> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v13 0/8] pv event interface between host and guest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao Cc: Kevin Wolf , Peter Maydell , Andrew Jones , Anthony Liguori , Alex Williamson , kvm list , Gleb Natapov , "Michael S. Tsirkin" , Jan Kiszka , Juan Quintela , "linux-kernel@vger.kernel.org" , Markus Armbruster , qemu-devel , Blue Swirl , Orit Wasserman , Alexander Graf , Sasha Levin , Stefan Hajnoczi , Luiz Capitulino , Marcelo Tosatti , KAMEZAWA Hiroyuki Il 06/03/2013 09:56, Hu Tao ha scritto: >> > >> > Something like this should work (in SeaBIOS's src/acpi-dsdt-isa.dsl): >> > >> > Device(PEVT) { >> > Name(_HID, EisaId("QEMU0001")) >> > OperationRegion(PEOR, SystemIO, 0x505, 0x01) >> > Field(PEOR, ByteAcc, NoLock, Preserve) { >> > PEPT, 8, >> > } >> > >> > Method(_STA, 0, NotSerialized) { >> > Store(PEPT, Local0) >> > If (LEqual(Local0, Zero)) { >> > Return (0x00) >> > } Else { >> > Return (0x0F) >> > } >> > } > IIUC, here _STA reads from ioport 0x505, if the result is 0, then the > device is not present. Otherwise, the device is present. But as Gleb > said, ''the data you read from unassigned port is not guarantied to be > zero, it may depend on QEMU version''. What should I do to tell if the > device is present or not correctly? The firmware is tied to the QEMU version, so you can rely on unassigned ports returning zero. Later we can change this to use fw-cfg. Paolo