From patchwork Thu Jun 27 15:19:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 11019977 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6ED2914BB for ; Thu, 27 Jun 2019 15:52:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DC4827FB7 for ; Thu, 27 Jun 2019 15:52:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51DEB283B2; Thu, 27 Jun 2019 15:52:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ED4F727FB7 for ; Thu, 27 Jun 2019 15:52:42 +0000 (UTC) Received: from localhost ([::1]:51968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgWhW-0002VC-8V for patchwork-qemu-devel@patchwork.kernel.org; Thu, 27 Jun 2019 11:52:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33119) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgWHa-0003Dn-HO for qemu-devel@nongnu.org; Thu, 27 Jun 2019 11:25:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgWHW-00008O-Uk for qemu-devel@nongnu.org; Thu, 27 Jun 2019 11:25:53 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:34260) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hgWHW-0006mV-HB for qemu-devel@nongnu.org; Thu, 27 Jun 2019 11:25:50 -0400 Received: by mail-pg1-f196.google.com with SMTP id p10so1187191pgn.1 for ; Thu, 27 Jun 2019 08:23:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:cc:from:to; bh=tHJ8TJeA8y3lZE06LLG15C3UoFOsuUPcKgVUlFGD2eo=; b=gFVJJJOaYU7EKQ2w7fZ5Se9Dco0JFQpvOxGsllFTAVKFApiyEgkPsjaVEz1E1+ANnT DSws7brIqY39pJpKPhkaHrYNYsVYsjBCmykVdpuqykfoQWsXHvgs5nDSKMjbdUaC56Ei LM2jdilqiJu3R+4L0oXtxq1IEqCPpNAyLDpnh85R3ftXw9yO797sFLa1XwrexTO5o+u3 7dwC6JHHUvcbidQnbQzllQqAs2BBZQRBsDRdsDn9r35oE2jX6swDd/f7qxYBWXG7pw3y QKPigw9h5lp7Id2eP9knrlMr760NNLb3Z232IAU1NJLdijoLMymcIbcadFtKhz01vJ8x 63vA== X-Gm-Message-State: APjAAAWXvoMvx8dHbwt/tPL/Ai/vS8Orp+7YoNvaA2SCA8wyXnG8D1TC K3CaZL4oUnJV31cmx6swVobd9Q== X-Google-Smtp-Source: APXvYqxAAiSGsJEMq09qAbmcVjS+lWBRmocPW0miY46BEjRuxT0HRsJB0zJ/PMtGlOiiuAHiSv9DZA== X-Received: by 2002:a17:90a:7f02:: with SMTP id k2mr6180344pjl.78.1561649029253; Thu, 27 Jun 2019 08:23:49 -0700 (PDT) Received: from localhost (220-132-236-182.HINET-IP.hinet.net. [220.132.236.182]) by smtp.gmail.com with ESMTPSA id f186sm3156781pfb.5.2019.06.27.08.23.48 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 27 Jun 2019 08:23:48 -0700 (PDT) Date: Thu, 27 Jun 2019 08:19:48 -0700 Message-Id: <20190627152011.18686-12-palmer@sifive.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190627152011.18686-1-palmer@sifive.com> References: <20190627152011.18686-1-palmer@sifive.com> MIME-Version: 1.0 From: Palmer Dabbelt To: Peter Maydell X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.215.196 Subject: [Qemu-devel] [PULL 11/34] riscv: virt: Correct pci "bus-range" encoding X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , Bin Meng , qemu-riscv@nongnu.org, qemu-devel@nongnu.org, Palmer Dabbelt Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Bin Meng The largest pci bus number should be calculated from ECAM size, instead of its base address. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 84d94d0c42d8..487f61404b21 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -298,7 +298,7 @@ static void *create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap, qemu_fdt_setprop_string(fdt, nodename, "device_type", "pci"); qemu_fdt_setprop_cell(fdt, nodename, "linux,pci-domain", 0); qemu_fdt_setprop_cells(fdt, nodename, "bus-range", 0, - memmap[VIRT_PCIE_ECAM].base / + memmap[VIRT_PCIE_ECAM].size / PCIE_MMCFG_SIZE_MIN - 1); qemu_fdt_setprop(fdt, nodename, "dma-coherent", NULL, 0); qemu_fdt_setprop_cells(fdt, nodename, "reg", 0, memmap[VIRT_PCIE_ECAM].base,