From patchwork Tue May 8 20:07:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Clark X-Patchwork-Id: 10387475 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AF4F4602C2 for ; Tue, 8 May 2018 20:12:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACC2D28924 for ; Tue, 8 May 2018 20:12:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FE4728E86; Tue, 8 May 2018 20:12:47 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8B49B28924 for ; Tue, 8 May 2018 20:12:46 +0000 (UTC) Received: from localhost ([::1]:53184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fG8yb-0006jj-S2 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 08 May 2018 16:12:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fG8vH-0003oH-BZ for qemu-devel@nongnu.org; Tue, 08 May 2018 16:09:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fG8vG-0004yL-AJ for qemu-devel@nongnu.org; Tue, 08 May 2018 16:09:19 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:37628) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fG8vG-0004xm-3s for qemu-devel@nongnu.org; Tue, 08 May 2018 16:09:18 -0400 Received: by mail-pf0-x241.google.com with SMTP id e9so20473692pfi.4 for ; Tue, 08 May 2018 13:09:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=A6e+Oc96R/yne0h81eqyS2dKTfKs0vOv/Aj+HUAk7AM=; b=fE5478ipg1gqCxKVBJqvcIdoi7K3TJYpw9FTpdpxu6ewmFOY5hj+vMc7Tt0UiYSESV gPpM9bCtRE84E4Wmrv0Ahf95UkxZHklHGlBIT/Q7mhMw7csvC2rPk3gSn1kBcAx+6zA8 bT6DxlT7ElquFVyynqsb8Pn5gU6uPahzyUOeucoTJRNjVnfdfyahkQ4UcYkxR0OmnVXw XubItlHtbesOhiM1Da171S/OH+XP3Ex3+k98/HR83LfvKDe8/0Ysng/0pC/zV4v8Ixo5 mL85dhyuaSrOTqLq3QZF0XrKpR9mMdWdLMGTPlH7Hoil4n9r4TkqEx6nlUqx0ZFo/GVV UAjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=A6e+Oc96R/yne0h81eqyS2dKTfKs0vOv/Aj+HUAk7AM=; b=KiQPvacT7qaSRo+Ci6Mbn+n4CTbx8SlNtClfJb7V2Pt+PyFyTEIaHqplx2tgrTO0Rf JgDY3lBU8pLGOu/RZLc4FK5zi6bsbgPMeYNwSYz1fvMtHV4jQ9vwhQXzyf/EVyxhjSkv 4ZykUty4U/dC98s6ztm9sEKcyb/jAD907lWcRYhrz3eKTHiIgK7c6jjr7I5sxzNoQlA1 pDU+8v5UdOVPsm+pZp77PScF/p+y6VpRiGg144v2TcQ7KmwjyYRiMicJUwn3Eq4pTrPd 9JY4hvygV9Av1EqqRC+2wa4GJ51DQwya5i+t098g3iZhwPTBjz7GeMBJJzOVpBcK4/lZ JpkA== X-Gm-Message-State: ALQs6tAoeOT/U/rCeBzOh4atEmLviIgDjCnTRMkYe/+lpXcYHfwrCHAV nOXzgi4R/rG7jAb50NNOSyzbMiu/bW4= X-Google-Smtp-Source: AB8JxZpkSnAtTTgTwP34e1mHwrfuXDbk7Ba3YrrHdwDG0M2v+ffOLhJZaDxzZfAsHV6ZI7oqCVEHGg== X-Received: by 10.98.7.140 with SMTP id 12mr29928893pfh.178.1525810157045; Tue, 08 May 2018 13:09:17 -0700 (PDT) Received: from localhost.localdomain (122-58-167-38-fibre.bb.spark.co.nz. [122.58.167.38]) by smtp.gmail.com with ESMTPSA id g16-v6sm205171pgn.51.2018.05.08.13.09.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 May 2018 13:09:16 -0700 (PDT) From: Michael Clark To: qemu-devel@nongnu.org Date: Wed, 9 May 2018 08:07:39 +1200 Message-Id: <1525810060-36690-3-git-send-email-mjc@sifive.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1525810060-36690-1-git-send-email-mjc@sifive.com> References: <1525810060-36690-1-git-send-email-mjc@sifive.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::241 Subject: [Qemu-devel] [PULL 2/3] riscv: htif: increase the priority of the htif subregion 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: patches@groups.riscv.org, KONRAD Frederic , Michael Clark Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: KONRAD Frederic The htif device is supposed to be mapped over an other subregion. So increase its priority to one to avoid any conflict. Here is the output of info mtree: Before: (qemu) info mtree address-space: memory 0000000000000000-ffffffffffffffff (prio 0, i/o): system 0000000000000000-000000000000000f (prio 0, i/o): riscv.htif.uart 0000000000000000-0000000000011fff (prio 0, ram): riscv.spike.bootrom 0000000002000000-000000000200ffff (prio 0, i/o): riscv.sifive.clint 0000000080000000-0000000087ffffff (prio 0, ram): riscv.spike.ram address-space: I/O 0000000000000000-000000000000ffff (prio 0, i/o): io address-space: cpu-memory-0 0000000000000000-ffffffffffffffff (prio 0, i/o): system 0000000000000000-000000000000000f (prio 0, i/o): riscv.htif.uart 0000000000000000-0000000000011fff (prio 0, ram): riscv.spike.bootrom 0000000002000000-000000000200ffff (prio 0, i/o): riscv.sifive.clint 0000000080000000-0000000087ffffff (prio 0, ram): riscv.spike.ram After: (qemu) info mtree address-space: memory 0000000000000000-ffffffffffffffff (prio 0, i/o): system 0000000000000000-000000000000000f (prio 1, i/o): riscv.htif.uart 0000000000000000-0000000000011fff (prio 0, ram): riscv.spike.bootrom 0000000002000000-000000000200ffff (prio 0, i/o): riscv.sifive.clint 0000000080000000-0000000087ffffff (prio 0, ram): riscv.spike.ram address-space: I/O 0000000000000000-000000000000ffff (prio 0, i/o): io address-space: cpu-memory-0 0000000000000000-ffffffffffffffff (prio 0, i/o): system 0000000000000000-000000000000000f (prio 1, i/o): riscv.htif.uart 0000000000000000-0000000000011fff (prio 0, ram): riscv.spike.bootrom 0000000002000000-000000000200ffff (prio 0, i/o): riscv.sifive.clint 0000000080000000-0000000087ffffff (prio 0, ram): riscv.spike.ram Reviewed-by: Michael Clark Signed-off-by: KONRAD Frederic Signed-off-by: Michael Clark Message-Id: <1525360636-18229-3-git-send-email-frederic.konrad@adacore.com> --- hw/riscv/riscv_htif.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/riscv/riscv_htif.c b/hw/riscv/riscv_htif.c index be252ec8cce9..f73512941fb6 100644 --- a/hw/riscv/riscv_htif.c +++ b/hw/riscv/riscv_htif.c @@ -253,8 +253,9 @@ HTIFState *htif_mm_init(MemoryRegion *address_space, MemoryRegion *main_mem, htif_be_change, s, NULL, true); if (address_symbol_set == 3) { memory_region_init_io(&s->mmio, NULL, &htif_mm_ops, s, - TYPE_HTIF_UART, size); - memory_region_add_subregion(address_space, base, &s->mmio); + TYPE_HTIF_UART, size); + memory_region_add_subregion_overlap(address_space, base, + &s->mmio, 1); } return s;