From patchwork Fri Jan 17 15:39:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 23342 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 89EDA202DA for ; Fri, 17 Jan 2014 15:41:45 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id z10sf9029100pdj.9 for ; Fri, 17 Jan 2014 07:41:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type; bh=FWkP2sj14PA817RKR0WlWzo+CScQpuV0/lquzLuC5NM=; b=HEOgbybTKChQa3WF5A5s4aMcG3WTROb16bMS/NkSxDWgjGN1Pw1o6DQadEyjpMGNXM POwENcBsYFzDRDcUUZYJZkl8Z5Qq1uIVbvyvxXh7EwZhr6qGKltLXxE9UGlHvlZ7hNKW CXGZrQygLNnQiFhgiWx2LwmLcO2ay3Y5CBIeX59iAnlLCiY3s5DO25fqCKhzghOfFx7o FZ80Bfopwk5co6810t5VM7ARoFQTFo9bzlazryJaBi5fy2aIk7UaVVvpmQkDm4FN6w2C t71Mj5ATz3iBD/hI6MFmkHkPmeDwd4MuhPwJe37J9edtSooj7vkAfktnoPe2l75r9LtF WtNg== X-Gm-Message-State: ALoCoQltvvUt0ozeOJT9Hf47kBsbkigYToiXY1CaDNBqlPwXQpDK1Wav9QDE+WO4ZKDJM+k18dBX X-Received: by 10.69.16.98 with SMTP id fv2mr958497pbd.7.1389973304779; Fri, 17 Jan 2014 07:41:44 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.36.229 with SMTP id t5ls1114121qej.61.gmail; Fri, 17 Jan 2014 07:41:44 -0800 (PST) X-Received: by 10.58.116.239 with SMTP id jz15mr1262871veb.26.1389973304607; Fri, 17 Jan 2014 07:41:44 -0800 (PST) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id xw5si5069680vec.8.2014.01.17.07.41.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Jan 2014 07:41:44 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id ij19so1640297vcb.34 for ; Fri, 17 Jan 2014 07:41:44 -0800 (PST) X-Received: by 10.58.181.165 with SMTP id dx5mr1203468vec.19.1389973304525; Fri, 17 Jan 2014 07:41:44 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp28790ved; Fri, 17 Jan 2014 07:41:44 -0800 (PST) X-Received: by 10.224.29.4 with SMTP id o4mr4192215qac.43.1389973303920; Fri, 17 Jan 2014 07:41:43 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id a65si2480926qge.83.2014.01.17.07.41.43 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 17 Jan 2014 07:41:43 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:38890 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4BYF-0001Zs-I7 for patch@linaro.org; Fri, 17 Jan 2014 10:41:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4BX0-0000IN-Aj for qemu-devel@nongnu.org; Fri, 17 Jan 2014 10:40:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4BWw-0001O4-7R for qemu-devel@nongnu.org; Fri, 17 Jan 2014 10:40:26 -0500 Received: from smtp.citrix.com ([66.165.176.89]:30309) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4BWw-0001Nt-2g for qemu-devel@nongnu.org; Fri, 17 Jan 2014 10:40:22 -0500 X-IronPort-AV: E=Sophos;i="4.95,674,1384300800"; d="scan'208";a="93900489" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 17 Jan 2014 15:40:21 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.2.342.4; Fri, 17 Jan 2014 10:40:21 -0500 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1W4BWo-0002SE-TA; Fri, 17 Jan 2014 15:40:14 +0000 From: Stefano Stabellini To: Date: Fri, 17 Jan 2014 15:39:12 +0000 Message-ID: <1389973152-12997-3-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-DLP: MIA2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.89 Cc: anthony.perard@citrix.com, xen-devel@lists.xen, qemu-devel@nongnu.org, Stefano Stabellini Subject: [Qemu-devel] [PULL 3/3] xen_pt: Fix passthrough of device with ROM. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Anthony PERARD QEMU does not need and should not allocate memory for the ROM of a passthrough PCI device. So this patch initialize the particular region like any other PCI BAR of a passthrough device. When a guest will access the ROM, Xen will take care of the IO, QEMU will not be involved in it. Xen set a limit of memory available for each guest, allocating memory for a ROM can hit this limit. Signed-off-by: Anthony PERARD Signed-off-by: Stefano Stabellini Reported-and-Tested-by: Konrad Rzeszutek Wilk --- hw/xen/xen_pt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index eee4354..be4220b 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -440,8 +440,8 @@ static int xen_pt_register_regions(XenPCIPassthroughState *s) s->bases[PCI_ROM_SLOT].access.maddr = d->rom.base_addr; - memory_region_init_rom_device(&s->rom, OBJECT(s), NULL, NULL, - "xen-pci-pt-rom", d->rom.size); + memory_region_init_io(&s->rom, OBJECT(s), &ops, &s->dev, + "xen-pci-pt-rom", d->rom.size); pci_register_bar(&s->dev, PCI_ROM_SLOT, PCI_BASE_ADDRESS_MEM_PREFETCH, &s->rom);