From patchwork Thu May 25 15:28:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13255368 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50343C7EE2D for ; Thu, 25 May 2023 15:28:52 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.539711.840872 (Exim 4.92) (envelope-from ) id 1q2CtF-0007bz-MH; Thu, 25 May 2023 15:28:33 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 539711.840872; Thu, 25 May 2023 15:28:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q2CtF-0007bn-J0; Thu, 25 May 2023 15:28:33 +0000 Received: by outflank-mailman (input) for mailman id 539711; Thu, 25 May 2023 15:28:31 +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 1q2CtD-0007Iw-SB for xen-devel@lists.xenproject.org; Thu, 25 May 2023 15:28:31 +0000 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [2a00:1450:4864:20::136]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id ce124b03-fb10-11ed-b230-6b7b168915f2; Thu, 25 May 2023 17:28:31 +0200 (CEST) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f4db9987f8so482761e87.1 for ; Thu, 25 May 2023 08:28:31 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id d22-20020ac244d6000000b004f37c0dfcaasm246853lfm.118.2023.05.25.08.28.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 08:28:30 -0700 (PDT) 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: ce124b03-fb10-11ed-b230-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685028511; x=1687620511; 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=kekLKeFIbeYDOHCuOxDTya7bEvDS56y6sN78THRHMuo=; b=L0CP3/72F4YA3SVThEPqoI7mTlLcCENpjUKA/RQczdmkGSSN/de6tE/mxtfAJdhp/b s7Pmr8VVHhdqY4kZV6LfPBeV1Q9uTNKQYVB9czdcwZiT7nKq/20beg2Q/XXpIcIVl3g8 DnxVTZOcwq56h8WzlnSlSw8SHJFilJqe5ATvyh+KXLiZofdcdDWXrGCoR+KIIf6DDHzO vUR7WmdwtwEAwZlfpBm6WgzSi4ztPzBnFxT0FGkrVTQtZxaBsQarYV2ZRSUYcyouLu/J PDLHHmPqMS4W1a79PtbJ5g+k/qdARdyheDU2XrzNei7cF3DEiHKdaJEUy4Ymp9Z0W4bq sBcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685028511; x=1687620511; 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=kekLKeFIbeYDOHCuOxDTya7bEvDS56y6sN78THRHMuo=; b=KnjVyu8Pqntljor17/+E23b85aOFh1jnTtP9ajheDG63U2ZZuuozuj0agIDrf2COnr BgHavI9UM5CbnBK6qIftfOE5Skvbd2I+5yoPVdsVVs6AV8nGed7C3umPnhdu3E7CsJSX H1ZMg8ieAcX96jMk9x0KkdqlP05fwQ3MBUcxqF3UqaNJnBo3NvDoFtce8Lq9RDXqkW6r AxgRPgjC6mMZ5FtYZrmnI6mrGnejPkGV5mAYgiY7iciQ6IJX4xtXtUYPvS60Mx57OOhZ DG5rsEw/Sf/RabKt2TP4SUNcjrfNi/M5TN+9Bf2PEZ8m+Qd3mOjtOowUyvaB4iCbe+s8 QLfg== X-Gm-Message-State: AC+VfDyp6Yq91aTYGqeASX4kKxGxFrDhDKobJxuGPIKPwq+2wAocMF+O 7bJ+kK1qV/J9LCRgxzZUcmztRrIIaGg= X-Google-Smtp-Source: ACHHUZ54mKL4yz2tswCT6bUSDgiMcAVpL9rQyxTaKnt81R9rivSGkf0GpgexQ4aAjwSzkEN/G8cAXg== X-Received: by 2002:a05:6512:3c86:b0:4eb:412f:9e0e with SMTP id h6-20020a0565123c8600b004eb412f9e0emr1126234lfv.26.1685028510793; Thu, 25 May 2023 08:28:30 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v9 4/5] xen/riscv: setup initial pagetables Date: Thu, 25 May 2023 18:28:17 +0300 Message-Id: <6ea28216df1c7f29ebd88e20adb05cdf75af20fe.1685027257.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 The patch does two thing: 1. Setup initial pagetables. 2. Enable MMU which end up with code in cont_after_mmu_is_enabled() Signed-off-by: Oleksii Kurochko Acked-by: Bobby Eshleman --- Changes in V9: - Nothing changed. Only rebase --- Changes in V8: - Nothing changed. Only rebase --- Changes in V7: - Nothing changed. Only rebase --- Changes in V6: - Nothing changed. Only rebase --- Changes in V5: - Nothing changed. Only rebase --- Changes in V4: - Nothing changed. Only rebase --- Changes in V3: - update the commit message that MMU is also enabled here - remove early_printk("All set up\n") as it was moved to cont_after_mmu_is_enabled() function after MMU is enabled. --- Changes in V2: * Update the commit message --- xen/arch/riscv/setup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index 315804aa87..cf5dc5824e 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -21,7 +21,10 @@ void __init noreturn start_xen(unsigned long bootcpu_id, { early_printk("Hello from C env\n"); - early_printk("All set up\n"); + setup_initial_pagetables(); + + enable_mmu(); + for ( ;; ) asm volatile ("wfi");