From nobody Wed Dec 17 09:18:31 2025 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=1700822895; cv=none; d=zohomail.com; s=zohoarc; b=EXVbKX/Kmt1AYvrih/U24dvGV8vUgBhITx2ypgT1B0M6/RwzxjvFKMYpUOkXo/tddJpUoK7B3X5ThCybA87s5wTwD72xtaOuYntQisgzJNGm+cS2Tix/CIyyF3zR9RCr/bSuYJDND5yqEdD1nx6VpcEUCpsthURQV6CtqgVPQNw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700822895; 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=SZYBaKtqO03IaPhGnfIlixMtQetp2xv8QqhEqqcwd+k=; b=nXBEpFsxJJAAcCZb2T0SU0ZoufxFpuOheiiFZbtMgA59CYkJ8uwx4ynFv2+oqMPeyGJwQ5J28RKY7gRiend0OzI6Ik21EiEh5dCK/C2TK2XRIkd6s9qzb+k4xCMFH9s5H4gAP0Ga6p3A5yh2rQ/YOr7Qi0DfmW2WTqICXq3+CvU= 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 1700822895667409.62358990336907; Fri, 24 Nov 2023 02:48:15 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.640503.998823 (Exim 4.92) (envelope-from ) id 1r6Tj4-0002wU-Gg; Fri, 24 Nov 2023 10:47:58 +0000 Received: by outflank-mailman (output) from mailman id 640503.998823; Fri, 24 Nov 2023 10:47:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r6Tj4-0002wJ-E8; Fri, 24 Nov 2023 10:47:58 +0000 Received: by outflank-mailman (input) for mailman id 640503; Fri, 24 Nov 2023 10:47:57 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r6TTW-0006hx-Cy for xen-devel@lists.xenproject.org; Fri, 24 Nov 2023 10:31:54 +0000 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [2a00:1450:4864:20::632]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a95c321a-8ab4-11ee-9b0e-b553b5be7939; Fri, 24 Nov 2023 11:31:43 +0100 (CET) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a00b056ca38so243310666b.2 for ; Fri, 24 Nov 2023 02:31:43 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id g1-20020a170906348100b009de3641d538sm1882374ejb.134.2023.11.24.02.31.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 02:31:42 -0800 (PST) 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: a95c321a-8ab4-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700821903; x=1701426703; 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=SZYBaKtqO03IaPhGnfIlixMtQetp2xv8QqhEqqcwd+k=; b=UlhwHxmRKQbKJ2Inz952T3MgMb0VNYMJdlAyhczHMPDuto30FTWJvx3IPj2Ss/ergy Kq+O+XL84u7JQgD463sI3yV/u3ubWHIMlTDPjxBmHmU+2+TGDPiele4S6HsysGfv8p17 P1lp28u4iJTqUPW18FUmYeRm6eIALjyIHKzSdKhICO7EEDxCHwiTLxEn9BTyb7WembWS EFVnbmY+Nr66CvHTGsrkwFEEchBNvkDTz7R89291WRtKwQNsx0DMdoUPbZWZFb+HSxky LNbVjDIV7j73COlL2UOQi6QlYXlsmTw8l1cpamly60HjR1+lFchU01//uOtTK8G1Hz2D qELA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700821903; x=1701426703; 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=SZYBaKtqO03IaPhGnfIlixMtQetp2xv8QqhEqqcwd+k=; b=ghdpoCmjN4acDN36eBbbRPIioNJZ0dUB8Vqw03Zv2/MXQ85OZsX5MMNxCtsBYWkFoq lxQE9vEZbf8x9T5r9c5YtnaO9jBPPrUAjwgFTF5/wKL+Ew7pLsdmu4ib0g/n+i/08Plq tYueGFZEUrzcvYqSh81hV1lQvEWrZFcadPxlNwE/SM2H/qs6uQkJ2ikiZPY2N+Mvw0lj Up+nUWGoe7nr9WCC5GCdwrPN1HVK+Cy+z1AU2tPPGj61yc7xFOp6mGT+HDZy6YLjy/4C oMTKyqsAu1dhq4DI0ZzoF8sz8l1DTo2sh/s0ujVPZfRO1cJYQQxYkRQFoUxPq3yQpirV tLaw== X-Gm-Message-State: AOJu0YzquoPiPCeSUumtL8nrChyylve3zOjIgssucmHrof/dO70E6Yrz 2kbxCNe5QwasCztB2BxRgTE0nxQlC3ZFqw== X-Google-Smtp-Source: AGHT+IFoisvlUc6sGtkQ0PuK7EpcEjxDt7LEADKp7XJ8gqN7fWPxILq2oTpfBFaXOr0WNEMVNtW1tg== X-Received: by 2002:a17:906:35c7:b0:9e4:e405:27b4 with SMTP id p7-20020a17090635c700b009e4e40527b4mr1518113ejb.53.1700821902971; Fri, 24 Nov 2023 02:31:42 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Alistair Francis , Bob Eshleman , Connor Davis , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v2 32/39] xen/riscv: add minimal stuff to asm/page.h to build full Xen Date: Fri, 24 Nov 2023 12:30:52 +0200 Message-ID: <34a4bc023eb50e1d1cf70fa149825c51f2f4555f.1700761381.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1700822896971100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V2: - Nothing changed. Only rebase. --- xen/arch/riscv/include/asm/page.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/xen/arch/riscv/include/asm/page.h b/xen/arch/riscv/include/asm= /page.h index 95074e29b3..abbae75aaf 100644 --- a/xen/arch/riscv/include/asm/page.h +++ b/xen/arch/riscv/include/asm/page.h @@ -6,6 +6,7 @@ #ifndef __ASSEMBLY__ =20 #include +#include #include =20 #include @@ -32,6 +33,9 @@ #define PTE_LEAF_DEFAULT (PTE_VALID | PTE_READABLE | PTE_WRITAB= LE) #define PTE_TABLE (PTE_VALID) =20 +/* TODO */ +#define PAGE_HYPERVISOR 0 + /* Calculate the offsets into the pagetables for a given VA */ #define pt_linear_offset(lvl, va) ((va) >> XEN_PT_LEVEL_SHIFT(lvl)) =20 @@ -46,6 +50,9 @@ typedef struct { #endif } pte_t; =20 +#define pfn_to_paddr(pfn) ((paddr_t)(pfn) << PAGE_SHIFT) +#define paddr_to_pfn(pa) ((unsigned long)((pa) >> PAGE_SHIFT)) + static inline pte_t paddr_to_pte(paddr_t paddr, unsigned int permissions) { @@ -62,6 +69,20 @@ static inline bool pte_is_valid(pte_t p) return p.pte & PTE_VALID; } =20 +static inline void invalidate_icache(void) +{ + BUG(); +} + +#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) +#define copy_page(dp, sp) memcpy(dp, sp, PAGE_SIZE) + +/* TODO: Flush the dcache for an entire page. */ +static inline void flush_page_to_ram(unsigned long mfn, bool sync_icache) +{ + BUG(); +} + #endif /* __ASSEMBLY__ */ =20 #endif /* _ASM_RISCV_PAGE_H */ --=20 2.42.0