From nobody Sun Feb 8 09:32:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1532379973396530.9075650314599; Mon, 23 Jul 2018 14:06:13 -0700 (PDT) Received: from localhost ([::1]:36627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhi20-00020M-D9 for importer@patchew.org; Mon, 23 Jul 2018 17:06:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhhJy-0003F9-SZ for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:20:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhhJx-0004uA-UJ for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:20:42 -0400 Received: from mail-oi0-x230.google.com ([2607:f8b0:4003:c06::230]:43126) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhhJx-0004tk-Ou; Mon, 23 Jul 2018 16:20:41 -0400 Received: by mail-oi0-x230.google.com with SMTP id b15-v6so3466858oib.10; Mon, 23 Jul 2018 13:20:41 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id q18-v6sm1082473oic.18.2018.07.23.13.20.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 13:20:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=rlKboz4z72+ISy/gALo19ELGOLmC9GOfsjOKdbEnSsQ=; b=S6BeCgiBPq2P4U4AIEd1hceALn8UL90GRJmhzE5V6sK9BC8nDx3YDHD7F+W/9+NHz0 wHCo47y44PEss9ykY/JoWfXPvM3YuEmjCG2/ZOavAL71j4F6mP0PlPQhs86q1ylF3TqU 8UUV2u4neQFnmE5APdojKkCMXtn10NKdwmtPwA2pOQLqIiT/7RFtn8Dg4QXAQc9BStpo hnDTdIC/WkSu8Rka0XO6Y+4vvVZejRp8PyrjyesrOlZA6Un+lDsy6l276ok77r/2g+B4 n1R1S0rwKBy9hF6bhHWANNmUasXhEFi4JSftpMNrd66n8s8UkCei6vRY0r2CS4OkLYCy +kwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=rlKboz4z72+ISy/gALo19ELGOLmC9GOfsjOKdbEnSsQ=; b=Jwfi/0LO4SPdS1pFij71Zky7GPF3nX5xQ7WZMy0Yc/IL2R0nqLAK8Infv4K6EKUOlG OlrTpraAv3iIM/UkTqT9fxZ+Zx3pvgPhZsQDbQEg05Rz45MQH7IxardzanYJPkzgyS8I QCtDZBD/8VWU/P0vWA0I3qCWjy3y+c8koYQ8vflb2TrD+/Hll+eT0OOHuHDbpO/TU2rb 40WYt3i5+HvzbUnJNeUud1sOd4wmEbsqtFj1+7790CNOohyLDXpSr6MPtb7GMX0d7BsG kJs7HDryk/p1s9ZIH6HnN37DgBtkQA0OYCLXHhSh/CKDGdwOBaufwySewX6M7DUSE/Dy +r2g== X-Gm-Message-State: AOUpUlH3JXoph0eFUjGRnK3VU8S0BbElM20ccqFtjKqplT+EBguReZP+ qBEILOLUEhBnt2mYKl0kkyQVNjG+sGyF7w== X-Google-Smtp-Source: AAOMgpfNQKOqVhkmM+/BdPqVH3p+jjePRMTYt1D3eb0Sml6mSw7/3FEv2vtHPYewrdaKCIOg9ssr5A== X-Received: by 2002:aca:c78c:: with SMTP id x134-v6mr328815oif.8.1532377240624; Mon, 23 Jul 2018 13:20:40 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 23 Jul 2018 15:17:09 -0500 Message-Id: <20180723201748.25573-61-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> References: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::230 Subject: [Qemu-devel] [PATCH 60/99] riscv: spike: allow base == 0 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: KONRAD Frederic , Michael Clark , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: KONRAD Frederic The sanity check on base doesn't allow htif to be mapped @0. Check if the symbol exists instead so we can map it where we want. Reviewed-by: Michael Clark Signed-off-by: KONRAD Frederic Signed-off-by: Michael Clark Message-Id: <1525360636-18229-2-git-send-email-frederic.konrad@adacore.com> (cherry picked from commit 17b9751e85b9989cc841ed387794d7f1e8aa5e46) Signed-off-by: Michael Roth --- hw/riscv/riscv_htif.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/riscv/riscv_htif.c b/hw/riscv/riscv_htif.c index 3e17f30251..be252ec8cc 100644 --- a/hw/riscv/riscv_htif.c +++ b/hw/riscv/riscv_htif.c @@ -41,17 +41,20 @@ } while (0) =20 static uint64_t fromhost_addr, tohost_addr; +static int address_symbol_set; =20 void htif_symbol_callback(const char *st_name, int st_info, uint64_t st_va= lue, - uint64_t st_size) + uint64_t st_size) { if (strcmp("fromhost", st_name) =3D=3D 0) { + address_symbol_set |=3D 1; fromhost_addr =3D st_value; if (st_size !=3D 8) { error_report("HTIF fromhost must be 8 bytes"); exit(1); } } else if (strcmp("tohost", st_name) =3D=3D 0) { + address_symbol_set |=3D 2; tohost_addr =3D st_value; if (st_size !=3D 8) { error_report("HTIF tohost must be 8 bytes"); @@ -248,7 +251,7 @@ HTIFState *htif_mm_init(MemoryRegion *address_space, Me= moryRegion *main_mem, qemu_chr_fe_init(&s->chr, chr, &error_abort); qemu_chr_fe_set_handlers(&s->chr, htif_can_recv, htif_recv, htif_event, htif_be_change, s, NULL, true); - if (base) { + if (address_symbol_set =3D=3D 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); --=20 2.17.1