From nobody Sun Feb 8 21:29:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1676299266; cv=none; d=zohomail.com; s=zohoarc; b=cfzm6TJltEctDWy6dpDaWH1TLhhZMuRNbykJhU+YHwWIHajSyENsuu9mfh5F5pcNcsDUSwQJ8gToorUMdncZuJh4u4kC3b6L1Ni+VOmznid3w5S6p92ty88BEev6SHymJFous8e1gHW5CNAhp9il5L4UmilWGxM6DVuhjFDbNq8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676299266; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=O5ZHbzn8UznmI/HA0ZrfnP4iDQsCNTxYGyI26FNASvs=; b=lCdj7VarDfoJ5mOCjBtLLUocOvCLHU+gAWvRHWpDI9WvxE8cl4kCnaqcak0jOW5GonJQ1kKQcHnY0lJp/ejjnIaMWAiYYT65UIZf+YxboSCI5d7GplarFdd7BwmF3J4Jzscc19GW2LNPLa/wlte1mgUulXzqdOAgJHPZ86dQimE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1676299266775353.7486606611211; Mon, 13 Feb 2023 06:41:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRa0q-000692-8C; Mon, 13 Feb 2023 09:41:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRa0o-00068Y-E0 for qemu-devel@nongnu.org; Mon, 13 Feb 2023 09:40:58 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRa0m-0005Se-2F for qemu-devel@nongnu.org; Mon, 13 Feb 2023 09:40:58 -0500 Received: by mail-pj1-x1029.google.com with SMTP id f16-20020a17090a9b1000b0023058bbd7b2so12425945pjp.0 for ; Mon, 13 Feb 2023 06:40:55 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id y23-20020a63de57000000b004fb8732a2f9sm3777757pgi.88.2023.02.13.06.40.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 06:40:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O5ZHbzn8UznmI/HA0ZrfnP4iDQsCNTxYGyI26FNASvs=; b=BSo33pDSSADN9+f5he6nwOJZPK1c5IhwrUeKYv7eOcEoJe0GDmkS2z07qRvPZ89plv iZ6+hLWfCr58I073C4ph9wiAeUBD0EZTQ9FvOye/dYPTre+X79OuGIk5oumBS8ttFs3I 6bWwEA3PMrDwij6VBOG81IsytfBaLvO1uHrBIcFRulQ0sVpLXxC3gzambf1aDEm7rjlK zJMLCtjbV4CV60j0QxtIHyRxveVorx2Q1SPEXrqXXc5NXXWw6r4BK0vshUXYC20Mxbn+ k75F/nIPQmrQnojmr1RFnRoaRlWyUOBl5PoNZ47pSJaTfaBWociGpxVGzbvao+Dc0Mk8 l6jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O5ZHbzn8UznmI/HA0ZrfnP4iDQsCNTxYGyI26FNASvs=; b=kLSIz4CmZwPkdFH3By0pzCHFK9XdDh3wu0hVRFrHGUT6ugceWFnl8PkQCt2p6rMQlP r9ZtV3Pe7PJ5Z2zuxDyZz9XhgeZ0d902u0g0hi/952zdyHlkHjEGHzfzeHYt4M0AtvKP LhNSBZMfbT5t95q7aMPOsQ1nrq610Fl15x9lLdamE2n086JavixGnxht2e1R7rh78HkV 5ups1IMq3kO1y+MJwqO8xkawRc5Tgtrjx5SHAEkNvX47p0Fx3lB7tKSiZ9ymozvJ7LPH HrC4WblVRDZL7QxFc3HSDj3yFkHZeA4BFwi+BA8XonDLM7vwEGqZKJroKwSI4zve+ytH iZTA== X-Gm-Message-State: AO0yUKUEsq7B8NundpIOnIj77wvap5gP8EUT3EHX7ZmrZSJw453i22zy ng5+C/rhxVTDsmsD1uHKbQGdug== X-Google-Smtp-Source: AK7set9H5LwsLISspf9wX4l555IjcfE7kx0OLQg9coYrZQsEZCH5qLfTopJuK9oNmvsYol0sVFXzbg== X-Received: by 2002:a05:6a20:a026:b0:c3:3ea7:e318 with SMTP id p38-20020a056a20a02600b000c33ea7e318mr20379538pzj.42.1676299254786; Mon, 13 Feb 2023 06:40:54 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Alistair Francis , Bin Meng Cc: qemu-riscv@nongnu.org, qemu-devel@nongnu.org, Andrew Jones , Anup Patel , Atish Kumar Patra , Daniel Henrique Barboza , Sunil V L , Bin Meng Subject: [PATCH V2 03/10] hw/riscv/virt: Add memmap pointer to RiscVVirtState Date: Mon, 13 Feb 2023 20:10:31 +0530 Message-Id: <20230213144038.2547584-4-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230213144038.2547584-1-sunilvl@ventanamicro.com> References: <20230213144038.2547584-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=sunilvl@ventanamicro.com; helo=mail-pj1-x1029.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1676299268709100003 Content-Type: text/plain; charset="utf-8" memmap needs to be exported outside of virt.c so that modules like acpi can use it. Hence, add a pointer field in RiscVVirtState structure and initialize it with the memorymap. Signed-off-by: Sunil V L Reviewed-by: Bin Meng Acked-by: Alistair Francis Reviewed-by: Andrew Jones --- hw/riscv/virt.c | 2 ++ include/hw/riscv/virt.h | 1 + 2 files changed, 3 insertions(+) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 58d3765b6d..5017ba62ec 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1451,6 +1451,8 @@ static void virt_machine_init(MachineState *machine) ROUND_UP(virt_high_pcie_memmap.base, virt_high_pcie_memmap.siz= e); } =20 + s->memmap =3D virt_memmap; + /* register system main memory (actual RAM) */ memory_region_add_subregion(system_memory, memmap[VIRT_DRAM].base, machine->ram); diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h index 62efebaa32..379501edcc 100644 --- a/include/hw/riscv/virt.h +++ b/include/hw/riscv/virt.h @@ -59,6 +59,7 @@ struct RISCVVirtState { char *oem_id; char *oem_table_id; OnOffAuto acpi; + const MemMapEntry *memmap; }; =20 enum { --=20 2.34.1