From nobody Fri Nov 22 03:13:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1729698754; cv=none; d=zohomail.com; s=zohoarc; b=ZDKLTUbdcJ7r2MEOBnWs7q+Uaj0yA3n3pmxA7cuZbpCbgVk04V+UtTIoSBndOtqCpCOOVavkbhyYg8VEg0wqEIdVP8N1tKc0NdbdxYWZ8Q62daD0cQ1ev+jOEOCsbOAJpfrU80nnwlRUfjicmVIXeqKqEEj0gwFMFupB53SncOg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729698754; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=h1/gFSOgI0n7fD5scAMG4iAUzufNhbJI1UL9lZIj5zM=; b=iUShANdtY0JVIYVpK94tfxckCuPz1a3CJsahilN8ZWuYhmlAy7cj38RKPkcrWZyRcpeIyBzcci1gP4XFBD8Jz/wGRu1kgnp0GU26FuGuuiEL7SPc9ZAnA8tQwfebYs5/kVvP64d1rTQESw3np2sEEtJwxmvVRwNi0KRS5xkSzJs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1729698754630498.9020487359695; Wed, 23 Oct 2024 08:52:34 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.824768.1238962 (Exim 4.92) (envelope-from ) id 1t3de6-0005un-63; Wed, 23 Oct 2024 15:51:38 +0000 Received: by outflank-mailman (output) from mailman id 824768.1238962; Wed, 23 Oct 2024 15:51:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t3de6-0005tp-1m; Wed, 23 Oct 2024 15:51:38 +0000 Received: by outflank-mailman (input) for mailman id 824768; Wed, 23 Oct 2024 15:51:37 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t3de4-0005bd-Tv for xen-devel@lists.xenproject.org; Wed, 23 Oct 2024 15:51:36 +0000 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [2a00:1450:4864:20::629]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id aead0d55-9156-11ef-a0be-8be0dac302b0; Wed, 23 Oct 2024 17:51:35 +0200 (CEST) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a9abe139088so158736266b.1 for ; Wed, 23 Oct 2024 08:51:35 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a912ee592sm493214466b.79.2024.10.23.08.51.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2024 08:51:34 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: aead0d55-9156-11ef-a0be-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729698695; x=1730303495; darn=lists.xenproject.org; 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=h1/gFSOgI0n7fD5scAMG4iAUzufNhbJI1UL9lZIj5zM=; b=Zk71UPDrnWoY++hFGPKQBAsCVAsJlBr56+deoeKqP/M138aUtadvOhOuxDTwcAYtVf +I3oGbQ7MqRir6rld9u0guhcLk0je5SpYXnFmGsQKIkrjzqty4OIeoCgbuxn3vWi1SF6 aY7/iqcWwVuOqIuZltWnlndr+HUe+0rQH0+iGmJsTG6H2QG5uKjBAl+yruJUuFrSoTDQ GCC5KYuKW4qmVWzeR0bjaMf+cnqVG4f/bXxyHRhHQYqhvUvMxp91N+7+XERQfUT3263B Q7o8fqRYHcGuS8AfYJihoHwsRUbmpIOQliPlHHkhSK92mqnCN3H0GqNdmx6i70l8zXQL X6Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729698695; x=1730303495; 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=h1/gFSOgI0n7fD5scAMG4iAUzufNhbJI1UL9lZIj5zM=; b=J2ffRWD2ebAk2Yi2V4ZTw8HlvgowhWec8dwsfHQmqLjfkhF05XmB/x5Bqar1uSc6jp FxkVDzeL7uOyIX+ChnEyWj8JgV6lt9E270LZHF41YMp7F8UvOsrEXM0vs6TaQ9Er4Pmo 1vJeAhLw2ia7mfk8NFeuPN58+uepr12XOvFOLtEPJNm6LG7bpwQ7XUJF4EIxBG4RxJA+ PooG1672RMZfztlPbGL6FvZiSgCr6DRW2WVbIuaq1sM2fr+ENAetWAnWH+FnVW7Q3d+v G/3F62KW+QgMdPdOc5p4MwGBDsIA54wKoDMgpcCKk98VQ6nC34dwa8jA52pgtzWYHFqK dApA== X-Gm-Message-State: AOJu0YyHQAdA91mJgIjH+dWqzIOZX1348CqL2EU8IEjE+7joTSY/yHC6 QY3srC12qutkhi0KBhFB1oYk8xRetpuHZA8q9DnCzHEPOChyn4aODIyq0Q== X-Google-Smtp-Source: AGHT+IHz/V25m9u1OlsezUz8Gn3how6y3qg3H8yFaNBhmaZQT6vgjI8xnBXhKGQmXrWyYFCGTrWPXw== X-Received: by 2002:a17:906:6a25:b0:a9a:7899:eb87 with SMTP id a640c23a62f3a-a9abf84884amr360254966b.13.1729698694717; Wed, 23 Oct 2024 08:51:34 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Alistair Francis , Bob Eshleman , Connor Davis , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [PATCH v2 2/3] xen/riscv: initialize the VMAP_DEFAULT virtual range Date: Wed, 23 Oct 2024 17:50:23 +0200 Message-ID: <4ae2957044e4e17be652d5fd28d54fd38110e4cf.1729697111.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1729698754813116600 Content-Type: text/plain; charset="utf-8" Call vm_init() to initialize the VMAP_DEFAULT virtual range. To support this, introduce the populate_pt_range() and arch_vmap_virt_end() functions, which are used by vm_init()->vm_init_type(). Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Change in V2: - Acked-by: Jan Beulich --- xen/arch/riscv/mm.c | 11 +++++------ xen/arch/riscv/pt.c | 6 ++++++ xen/arch/riscv/setup.c | 3 +++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c index 5be5a7b52a..262cec811e 100644 --- a/xen/arch/riscv/mm.c +++ b/xen/arch/riscv/mm.c @@ -352,12 +352,6 @@ void arch_dump_shared_mem_info(void) BUG_ON("unimplemented"); } =20 -int populate_pt_range(unsigned long virt, unsigned long nr_mfns) -{ - BUG_ON("unimplemented"); - return -1; -} - int xenmem_add_to_physmap_one(struct domain *d, unsigned int space, union add_to_physmap_extra extra, unsigned long idx, gfn_t gfn) @@ -544,3 +538,8 @@ void __init setup_mm(void) #else /* CONFIG_RISCV_32 */ #error setup_mm(), setup_{directmap,frametable}_mapping() should be implem= ented for RV_32 #endif + +void *__init arch_vmap_virt_end(void) +{ + return (void *)(VMAP_VIRT_START + VMAP_VIRT_SIZE); +} diff --git a/xen/arch/riscv/pt.c b/xen/arch/riscv/pt.c index cc5e2d3266..d62aceb36c 100644 --- a/xen/arch/riscv/pt.c +++ b/xen/arch/riscv/pt.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -419,3 +420,8 @@ int map_pages_to_xen(unsigned long virt, =20 return pt_update(virt, mfn, nr_mfns, flags); } + +int __init populate_pt_range(unsigned long virt, unsigned long nr_mfns) +{ + return pt_update(virt, INVALID_MFN, nr_mfns, PTE_POPULATE); +} diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index 2887a18c0c..3652cb056d 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -7,6 +7,7 @@ #include #include #include +#include =20 #include =20 @@ -62,6 +63,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id, =20 setup_mm(); =20 + vm_init(); + printk("All set up\n"); =20 machine_halt(); --=20 2.47.0