From patchwork Wed May 29 08:52:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 10966503 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 88F3E1398 for ; Wed, 29 May 2019 08:53:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B405288BC for ; Wed, 29 May 2019 08:53:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B6AE288C6; Wed, 29 May 2019 08:53:14 +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.0 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,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 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1EF6E288BC for ; Wed, 29 May 2019 08:53:14 +0000 (UTC) Received: from localhost ([127.0.0.1]:50080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVuKe-0003at-Vv for patchwork-qemu-devel@patchwork.kernel.org; Wed, 29 May 2019 04:53:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVuJe-0002t0-US for qemu-devel@nongnu.org; Wed, 29 May 2019 04:52:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVuJe-0002Gk-2p for qemu-devel@nongnu.org; Wed, 29 May 2019 04:52:10 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:32768) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVuJc-0002Fp-0x; Wed, 29 May 2019 04:52:08 -0400 Received: by mail-pg1-x543.google.com with SMTP id h17so982916pgv.0; Wed, 29 May 2019 01:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=kS9RwfTWm7yJJiKansvU2AvQ0hnlJBsSRKgE5jXjYTI=; b=LEhTsuy7OuQN3yJeX8u96tFxbMduV5X4UGXTxM6OGEcfjS9OJK24Ec+0FORgchb8wu rSIj/WjoCCE1V2BfM/uwpKpr+i+3z5uhRhvEG2+ko1y7gHWSyoEOpsAYxI3e7KOTkUnY 5W6Bm1iTVanPQ9hiUV4F+JQ0TIDMI3vt0q7p98S1iAgA+lpwDMsqJG5uap8jEviokCQ2 D3b+3EVXMS/jmbBJb6ka9Q9+mBvbmrUvJVeiHDdWhn5fZYZs2b7PF2DCbzQv2jfFetEQ KhBPE8H7/yreuEk59HqKR0nJv9jokOp8W/Wg3DfXzMy911rj4A+x8pC6P9Wya95BMlZy nJ0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=kS9RwfTWm7yJJiKansvU2AvQ0hnlJBsSRKgE5jXjYTI=; b=nQfqDu5e1Hk/Mlm4z2XOOrgynLpGtUDDqi3oQXe+KjeucGYQXbJYNoT0En0gtjbler Ww3jo5peLvMqxb+6eHM08ckax0emMSHCZttKl789PFynsnvrK3jHNg1cQfkR8d07zJ3k lGArq0d5kmpB5hNKQVerLqldIrSvaUR4cpxKaMKge2fZXy+g2nMoIus6kRuji1v1zo5C xrmoctIwoHlK66KuA+Qk/DNfLvjiEVFko9MWixUPJ6zCVIXyp8Eh7Bd3nwcNPq/DcvL6 HOw3OnkiOX3xy6RSZDtdd8oNzd9zQMzkP8NMnvJEbXqKFYHnfI4DJgO+NQ3eNPrnXRQv 6pgQ== X-Gm-Message-State: APjAAAWdrqcKKhAWqzloTEvpuHV2+fMKODwZxT5Fe1JYvPMhEGx8uCz0 GieSqtuyJdtGiVwcjVr1CyIZe3mJ X-Google-Smtp-Source: APXvYqz8bmnpoQpg410Xq1RIALZdOTrKcVxM63F9hjaug5EBQk5GGssoXPEldQZ7A5WSDPRctlbjpw== X-Received: by 2002:a17:90a:240c:: with SMTP id h12mr10916017pje.12.1559119926436; Wed, 29 May 2019 01:52:06 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id k3sm16310838pgo.81.2019.05.29.01.52.05 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 29 May 2019 01:52:05 -0700 (PDT) From: Bin Meng To: qemu-riscv@nongnu.org, qemu-devel@nongnu.org, Alistair Francis , Palmer Dabbelt Date: Wed, 29 May 2019 01:52:01 -0700 Message-Id: <1559119921-6098-1-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 Subject: [Qemu-devel] [PATCH] riscv: virt: Correct pci "bus-range" encoding 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: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 fc4c6b3..d6132d9 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -299,7 +299,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,