From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: Re: [Qemu-devel] [RFC PATCH v3 3/3] fw/pci: Allocate IGD stolen memory Date: Tue, 16 Feb 2016 13:08:56 +0100 Message-ID: <1455624536.7504.76.camel@redhat.com> References: <20160213001835.18456.46422.stgit@gimli.home> <20160213002318.18456.48603.stgit@gimli.home> <20160213024904.GA31040@morn.lan> <20160213081209.6e4342ab@t450s.home> <20160213181838.GA8842@morn.lan> <20160213115151.542d5d42@t450s.home> <20160213200509.GB16826@morn.lan> <20160213135709.692f9a55@t450s.home> <20160214002032.GA27805@morn.lan> <20160213180331.2aa0d010@t450s.home> <20160215105451.76cf6329@nial.brq.redhat.com> <20160215122023.737c7781@t450s.home> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Cc: Igor Mammedov , "Kevin O'Connor" , kvm@vger.kernel.org, "Michael S. Tsirkin" , seabios@seabios.org, allen.m.kay@intel.com, qemu-devel@nongnu.org To: Alex Williamson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51934 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754968AbcBPMI6 convert rfc822-to-8bit (ORCPT ); Tue, 16 Feb 2016 07:08:58 -0500 In-Reply-To: <20160215122023.737c7781@t450s.home> Sender: kvm-owner@vger.kernel.org List-ID: Hi, > I don't mind the allocation of guest memory issue, the fact that guest > memory is consumed by built-in devices is exactly what happens on bare > metal. And following in qemu what happens on bare metal usually works best long-term. > to pre-populate it, we could. It at least puts QEMU in control, but > relaying back the address via a device specific register is still a bit > ugly. It is the usual way. We do the same for a few other addresses too (mmconfig xbar, acpi registers). Firmware programs the hardware, and qemu picks up the addresses from there (and puts them into the generated acpi tables for example). Main advantage is that we don't need a paravirtual firmware <=> qemu interface for each address. Yes, each firmware (seabios/ovmf/...) needs to handle it then. But if we allocate the stolen memory from guest ram the firmware has to handle it _anyway_ so it is marked reserved in e820 etc. cheers, Gerd From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVeRF-0007iG-4h for qemu-devel@nongnu.org; Tue, 16 Feb 2016 07:09:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVeR9-0004Nr-Iq for qemu-devel@nongnu.org; Tue, 16 Feb 2016 07:09:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVeR9-0004Nj-Di for qemu-devel@nongnu.org; Tue, 16 Feb 2016 07:08:59 -0500 Message-ID: <1455624536.7504.76.camel@redhat.com> From: Gerd Hoffmann Date: Tue, 16 Feb 2016 13:08:56 +0100 In-Reply-To: <20160215122023.737c7781@t450s.home> References: <20160213001835.18456.46422.stgit@gimli.home> <20160213002318.18456.48603.stgit@gimli.home> <20160213024904.GA31040@morn.lan> <20160213081209.6e4342ab@t450s.home> <20160213181838.GA8842@morn.lan> <20160213115151.542d5d42@t450s.home> <20160213200509.GB16826@morn.lan> <20160213135709.692f9a55@t450s.home> <20160214002032.GA27805@morn.lan> <20160213180331.2aa0d010@t450s.home> <20160215105451.76cf6329@nial.brq.redhat.com> <20160215122023.737c7781@t450s.home> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Subject: Re: [Qemu-devel] [RFC PATCH v3 3/3] fw/pci: Allocate IGD stolen memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: kvm@vger.kernel.org, "Michael S. Tsirkin" , seabios@seabios.org, allen.m.kay@intel.com, qemu-devel@nongnu.org, Kevin O'Connor , Igor Mammedov Hi, > I don't mind the allocation of guest memory issue, the fact that guest > memory is consumed by built-in devices is exactly what happens on bare > metal. And following in qemu what happens on bare metal usually works best long-term. > to pre-populate it, we could. It at least puts QEMU in control, but > relaying back the address via a device specific register is still a bit > ugly. It is the usual way. We do the same for a few other addresses too (mmconfig xbar, acpi registers). Firmware programs the hardware, and qemu picks up the addresses from there (and puts them into the generated acpi tables for example). Main advantage is that we don't need a paravirtual firmware <=3D> qemu interface for each address. Yes, each firmware (seabios/ovmf/...) needs to handle it then. But if we allocate the stolen memory from guest ram the firmware has to handle it _anyway_ so it is marked reserved in e820 etc. cheers, Gerd