From patchwork Wed Jun 27 18:29:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 140375 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1225141ljj; Wed, 27 Jun 2018 11:30:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc6B16nojkive3ROJCDxuq1jRBswMqCbL5MnSVXinGq50HHB5fhoEAYj8HfSazpLOBdC5Nk X-Received: by 2002:ac8:1779:: with SMTP id u54-v6mr6463813qtk.285.1530124217777; Wed, 27 Jun 2018 11:30:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530124217; cv=none; d=google.com; s=arc-20160816; b=WUXX+LqLa4VaqNE6f3U0+2o+KaUI2NQ+ukSKAmZvHg421R54Dn9ARnoxDkEvnCJiOW 0VNppyuPHxnRJkzNHXooQZW5VfDPe2mjAvSkdjgHjNHmxjyfKUMxWKuQg7BSqDAmpVhp OtcerJDSuCfzAELU7yPmOU147vbBcu+YusxbuUfAzC+f4B2wbktQ0YpksW91qwYdYvzf X2+OfX87ULCrHQXIj8hk5TNNtdKStUxcCfPrb/eOgwFaEUNzx746btnoK5QdW99b815n G7RvNv5hvwggiRrd2aTbGaaUjxkjDe6txsoytXOrs8t3LQIDaHUbsBXrzxcEdd8It4zi BYmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=m21j1VbFxH34aYAN9spcYffhozOBNjSYOioCmo1JxLw=; b=d87wjkidxBtvijRJlZEKOujezQe7QSdWCwnkL9oRfQgXYTL3EY0iazG032z+KIMYbL ZTA7MTROjg7mN1Tnwg7WVWakPRMRPyYbWJp90EH67SvTnjRx1RgP3Erpe18ZJmstPFEm /jemu0EJ71z76cfJqcBTgZ5cddVsJn1bh8zaPMzO/rDCZFaEQb5eibfRmwiUf11EjtDf 3vgkOjitjqFzABoFOYzIW54hJbk3ZLN+ncPow17uugSzONTfhasd4aUoJq6zDrCfQkLy iqWbtwB1xmFhqlUeZWTBQ5uyV5+F3tYX6YEVGJcOXrtUjgjvNoq5SFeNXJhQXDuZMWbo hSDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x8-v6si79418qvi.49.2018.06.27.11.30.17 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 27 Jun 2018 11:30:17 -0700 (PDT) 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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:60855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYFCq-0007OJ-V0 for patch@linaro.org; Wed, 27 Jun 2018 14:30:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYFCI-0007Kw-QG for qemu-devel@nongnu.org; Wed, 27 Jun 2018 14:29:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYFCG-0000o5-LQ for qemu-devel@nongnu.org; Wed, 27 Jun 2018 14:29:42 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:47458 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fYFCG-0000ko-EL for qemu-devel@nongnu.org; Wed, 27 Jun 2018 14:29:40 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 9DA9E1A22A1; Wed, 27 Jun 2018 20:29:14 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 67C221A2101; Wed, 27 Jun 2018 20:29:14 +0200 (CEST) From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Wed, 27 Jun 2018 20:29:04 +0200 Message-Id: <1530124149-3900-5-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530124149-3900-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1530124149-3900-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PULL v2 4/9] hw/pci-host/xilinx-pcie: don't make "io" region be RAM X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Currently we use memory_region_init_rom_nomigrate() to create the "io" memory region to pass to pci_register_root_bus(). This is a dummy region, because this PCI controller doesn't support accesses to PCI IO space. There is no reason for the dummy region to be a RAM region; it is only used as a place where PCI BARs can be mapped, and if you could get a PCI card to do a bus master access to the IO space it should not get acts-like-RAM behaviour. Use a simple container memory region instead. (We do have one PCI card model which can do bus master accesses to IO space -- the LSI53C895A SCSI adaptor.) This avoids the oddity of having a memory region which is RAM but where the RAM is not migrated. Note that the size of the region we use here has no effect on behaviour. Signed-off-by: Peter Maydell Reviewed-by: Alistair Francis Signed-off-by: Aleksandar Markovic --- hw/pci-host/xilinx-pcie.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c index 044e312..b0a31b9 100644 --- a/hw/pci-host/xilinx-pcie.c +++ b/hw/pci-host/xilinx-pcie.c @@ -120,9 +120,8 @@ static void xilinx_pcie_host_realize(DeviceState *dev, Error **errp) memory_region_init(&s->mmio, OBJECT(s), "mmio", UINT64_MAX); memory_region_set_enabled(&s->mmio, false); - /* dummy I/O region */ - memory_region_init_ram_nomigrate(&s->io, OBJECT(s), "io", 16, NULL); - memory_region_set_enabled(&s->io, false); + /* dummy PCI I/O region (not visible to the CPU) */ + memory_region_init(&s->io, OBJECT(s), "io", 16); /* interrupt out */ qdev_init_gpio_out_named(dev, &s->irq, "interrupt_out", 1);