From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH v13 0/8] pv event interface between host and guest Date: Mon, 4 Mar 2013 12:21:31 +0200 Message-ID: <20130304102131.GK23616@redhat.com> References: <20130303091738.GB23616@redhat.com> <513471F1.5020702@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Peter Maydell , kvm list , "Michael S. Tsirkin" , Hu Tao , qemu-devel , Markus Armbruster , Blue Swirl , Orit Wasserman , Juan Quintela , Alexander Graf , Jan Kiszka , Andrew Jones , Alex Williamson , Sasha Levin , Stefan Hajnoczi , Luiz Capitulino , KAMEZAWA Hiroyuki , Kevin Wolf , Anthony Liguori , Marcelo Tosatti , "linux-kernel@vger.kernel.org" To: Paolo Bonzini Return-path: Content-Disposition: inline In-Reply-To: <513471F1.5020702@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 Mon, Mar 04, 2013 at 11:05:37AM +0100, Paolo Bonzini wrote: > > Guest uses acpi_get_devices() to discover a platform device by > > its name (QEMU0001). Then you put the driver for the platform device > > into drivers/platform/x86/ and QEMU/kvm/Xen all will be able to use it. > > Just to clarify it for Hu Tao, the read from a random ioport is how the > ACPI code will detect presence of the device. > Actually no (at least in the long run, for the first version it may be OK). Since we want to move DSDT generation into QEMU if device will not be present QEMU will not generate corresponded Device() in DSDT, or it will generate it with _STA() { Return (0x00)} hard coded. Seabios can do the same if we will pass it info about device presence via fw_cfg. Not sure Kevin will like it now when we plan to move DSDT into QEMU anyway :) > 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) > } > } > > Name(_CRS, ResourceTemplate() { > IO(Decode16, 0x505, 0x505, 0x01, 0x01) > }) > } > > Please test this with a QEMU option like "-M pc-1.4". The device should > _not_ be detected if you're doing it right. > -- Gleb.