From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v13 0/8] pv event interface between host and guest Date: Wed, 6 Mar 2013 04:48:17 -0500 (EST) Message-ID: <1810739463.3115068.1362563297384.JavaMail.root@redhat.com> References: <20130306093852.GK11223@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Kevin Wolf , Peter Maydell , Andrew Jones , Anthony Liguori , Alex Williamson , kvm list , "Michael S. Tsirkin" , Hu Tao , Juan Quintela , linux-kernel@vger.kernel.org, qemu-devel , Markus Armbruster , Blue Swirl , Orit Wasserman , Alexander Graf , Sasha Levin , Stefan Hajnoczi , Jan Kiszka , Luiz Capitulino , Marcelo Tosatti , KAMEZAWA Hiroyuki To: Gleb Natapov Return-path: In-Reply-To: <20130306093852.GK11223@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org > On Wed, Mar 06, 2013 at 10:07:31AM +0100, Paolo Bonzini wrote: > > 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. > > I thought we agreed to do it from the start :) Then Hu will need to patch the _STA method. Paolo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756345Ab3CFJtZ (ORCPT ); Wed, 6 Mar 2013 04:49:25 -0500 Received: from mx4-phx2.redhat.com ([209.132.183.25]:55030 "EHLO mx4-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752884Ab3CFJtY (ORCPT ); Wed, 6 Mar 2013 04:49:24 -0500 Date: Wed, 6 Mar 2013 04:48:17 -0500 (EST) From: Paolo Bonzini To: Gleb Natapov Cc: Hu Tao , Peter Maydell , "Michael S. Tsirkin" , Jan Kiszka , qemu-devel , Markus Armbruster , Blue Swirl , Orit Wasserman , kvm list , Juan Quintela , Alexander Graf , Andrew Jones , Alex Williamson , Sasha Levin , Stefan Hajnoczi , Luiz Capitulino , KAMEZAWA Hiroyuki , Kevin Wolf , Anthony Liguori , Marcelo Tosatti , linux-kernel@vger.kernel.org Message-ID: <1810739463.3115068.1362563297384.JavaMail.root@redhat.com> In-Reply-To: <20130306093852.GK11223@redhat.com> Subject: Re: [PATCH v13 0/8] pv event interface between host and guest MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [93.34.176.20] X-Mailer: Zimbra 7.2.0_GA_2669 (ZimbraWebClient - FF3.0 (Linux)/7.2.0_GA_2669) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Wed, Mar 06, 2013 at 10:07:31AM +0100, Paolo Bonzini wrote: > > 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. > > I thought we agreed to do it from the start :) Then Hu will need to patch the _STA method. Paolo From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDAxk-0003B5-NJ for qemu-devel@nongnu.org; Wed, 06 Mar 2013 04:48:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDAxj-0007rC-CB for qemu-devel@nongnu.org; Wed, 06 Mar 2013 04:48:40 -0500 Received: from mx4-phx2.redhat.com ([209.132.183.25]:55965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDAxj-0007qz-4i for qemu-devel@nongnu.org; Wed, 06 Mar 2013 04:48:39 -0500 Date: Wed, 6 Mar 2013 04:48:17 -0500 (EST) From: Paolo Bonzini Message-ID: <1810739463.3115068.1362563297384.JavaMail.root@redhat.com> In-Reply-To: <20130306093852.GK11223@redhat.com> MIME-Version: 1.0 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: Gleb Natapov Cc: Kevin Wolf , Peter Maydell , Andrew Jones , Anthony Liguori , Alex Williamson , kvm list , "Michael S. Tsirkin" , Hu Tao , Juan Quintela , linux-kernel@vger.kernel.org, qemu-devel , Markus Armbruster , Blue Swirl , Orit Wasserman , Alexander Graf , Sasha Levin , Stefan Hajnoczi , Jan Kiszka , Luiz Capitulino , Marcelo Tosatti , KAMEZAWA Hiroyuki > On Wed, Mar 06, 2013 at 10:07:31AM +0100, Paolo Bonzini wrote: > > 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. > > I thought we agreed to do it from the start :) Then Hu will need to patch the _STA method. Paolo