From nobody Fri Nov 22 03:05:53 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=1729070193; cv=none; d=zohomail.com; s=zohoarc; b=LSPuSCpp7M61Ee7npLRJVFnbXiG6cY+owfwJW7RMDReiAzqNDTrzr6onc/aTaqqIv5El2QYiK7Hq1/ebqzh+hENfBWEKfMDwkhGr7+CbVBbGsG8I39CVt6LHP0U/1Y0+fSD0Vg6GHMqZKqWNpv5mOHMyJ81gS+bp2vhqg98dfPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729070193; 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=5lMS96kWM5Eui5gIIP4UZOxeSh3q2YL3fIRawSS4m1s=; b=M+I6bmyGYwKOZGh/22cRRTTpwZT5zcRuRPKij3J9vdFmLfVSIr2ZdbPstQ5S6CAE3FL5ctxGQVuvkI+NKqjVWPZXRfE3+VhQjNL5THNcA/2IHA8Dvf1ByWOtEpfpMZfSuEenWNoUsjXDiNC9qAnakJWT0KnWMLqTfi2qtKB2UNw= 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 1729070193095554.3169029864947; Wed, 16 Oct 2024 02:16:33 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.819725.1233172 (Exim 4.92) (envelope-from ) id 1t108W-0005fR-Te; Wed, 16 Oct 2024 09:16:08 +0000 Received: by outflank-mailman (output) from mailman id 819725.1233172; Wed, 16 Oct 2024 09:16:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t108W-0005es-MA; Wed, 16 Oct 2024 09:16:08 +0000 Received: by outflank-mailman (input) for mailman id 819725; Wed, 16 Oct 2024 09:16:07 +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 1t108V-0005Dr-9e for xen-devel@lists.xenproject.org; Wed, 16 Oct 2024 09:16:07 +0000 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [2a00:1450:4864:20::132]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 45fe840f-8b9f-11ef-a0be-8be0dac302b0; Wed, 16 Oct 2024 11:16:06 +0200 (CEST) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-539983beb19so6739871e87.3 for ; Wed, 16 Oct 2024 02:16:06 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53a000129eesm391451e87.259.2024.10.16.02.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 02:16:04 -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: 45fe840f-8b9f-11ef-a0be-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729070166; x=1729674966; 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=5lMS96kWM5Eui5gIIP4UZOxeSh3q2YL3fIRawSS4m1s=; b=Mj0Wx8eCBhJJoinEo/hdwMCMVWWoA0evI5uarwiSx5zXUCfwylbAaVBCq/3d+L1m+L Hp8jepS4l7vnMfL/QApXfrnwVyPnwO2LSSpzGV4Nblh2Wn4HOsxLi+4GdSQU2dK3PXQE Mic6MA02b3SSZso4H0L6s+/LX6F3oaHaYHLzM7Ec2XlicUW7d7/m5/RzRXxloVdyolcM +fDIvM5BRsfEIgQ2q0fsrDL/W8X2YDFcl9SI5+4HAtW9ySZxTiw3gSSnLNjOoebP/9/+ B37FBZClijhVdeqvHBgpY1bavUte3WK2RKGomkV4nQWETTazGUhrhrorcZs8YbMTctbC QBIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729070166; x=1729674966; 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=5lMS96kWM5Eui5gIIP4UZOxeSh3q2YL3fIRawSS4m1s=; b=W5DQMtfJX0Q1r6FZVQ5+IL5bLSb2+IYTgSTXF+B26BLU1S02QPtXQ0beO9j2uDe+io gCM6jiM3ongdZ1qOWKWrwle/umbRTX8nCPiY3oiyB6SA8WHqIUiFDzIVATEfJDogEPbK wRoYkMXcvjYeMxzXr04uut9XFCjPF9YKZH04nxSkrdxXgaCtCQi7irXjHPSSiOu4nsqG jCBiakjaMWJHhLcddfbAVEOVUQMZvq/orjrcwO0YECZjlf6z5jtxHtXIoNnOh5KZwbS2 5x2ot7I90zMq5WFh6Dy1m+JdyKOTzVGEMWJzn/xvypCj4EB4UY9gMQWLdfjr9jKWQZX8 0t2A== X-Gm-Message-State: AOJu0YwQgBBq9goMRSNjGuV7cEU1lMI6cmIMic/5dXcywUWvCNIqV70s DJzhRWNovGoA8+cQ47AqfdVk4S3NpEbVokjRBhEBcvGdCKKTg0INYhi/eQ== X-Google-Smtp-Source: AGHT+IGb80fSI23TL9q6T+bth+NXlB2cHrY4hxUWVqG0EVh54POIsEn5HZendV2P+tHGigv2GJpZ1Q== X-Received: by 2002:ac2:4c4c:0:b0:539:8e77:9129 with SMTP id 2adb3069b0e04-539da583e0fmr9305769e87.44.1729070165278; Wed, 16 Oct 2024 02:16:05 -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 v1 4/5] xen/riscv: initialize the VMAP_DEFAULT virtual range Date: Wed, 16 Oct 2024 11:15:56 +0200 Message-ID: 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: 1729070193444116600 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 --- 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 53b7483f75..2a55246f80 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) @@ -516,3 +510,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