From patchwork Thu Mar 2 13:23:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13157330 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 6BB29C7EE30 for ; Thu, 2 Mar 2023 13:23:45 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.504922.777376 (Exim 4.92) (envelope-from ) id 1pXiuA-0008UL-Eu; Thu, 02 Mar 2023 13:23:30 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 504922.777376; Thu, 02 Mar 2023 13:23:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pXiuA-0008TH-8e; Thu, 02 Mar 2023 13:23:30 +0000 Received: by outflank-mailman (input) for mailman id 504922; Thu, 02 Mar 2023 13:23:29 +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 1pXiu9-0008Qd-Dk for xen-devel@lists.xenproject.org; Thu, 02 Mar 2023 13:23:29 +0000 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [2a00:1450:4864:20::22e]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6a480313-b8fd-11ed-a550-8520e6686977; Thu, 02 Mar 2023 14:23:26 +0100 (CET) Received: by mail-lj1-x22e.google.com with SMTP id t14so17578814ljd.5 for ; Thu, 02 Mar 2023 05:23:26 -0800 (PST) Received: from fedora.. (46.204.108.203.nat.umts.dynamic.t-mobile.pl. [46.204.108.203]) by smtp.gmail.com with ESMTPSA id s8-20020a05651c048800b00290679ebac1sm2109551ljc.9.2023.03.02.05.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 05:23:25 -0800 (PST) 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: 6a480313-b8fd-11ed-a550-8520e6686977 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677763406; 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=qrA0iYFCR4ncdpexRkMJ+7MgkO9AgTh8mz6kQeU8h+o=; b=AjsUzrH84OxVO8RIOWzgeLAumthUbfkJTRGXH9QgOM04DUyXL8Bu/z0aM2yYZ5ARDd nuJ29lbO39yywp/bKKMsG72zud/brTiOP/jZODaw7zo5+nghlqWKvyxHFowACD3zwMp4 tmIgQFVrgBmypuafzS1Mgtz3FaQbN9ElRqB1tOAn6SUHuazbvwiBuHeHme0aVSZzdJPn 40vbTVDS2f0/5G6RD6/fEdF9Rf0A5n2uac2WFpwvjArWRyLF3emy9usYkdVtACUaWCZW c5aYzmPNmEUBSyQGaZw2uTp0Yyn3K+Gihg5jtB0ch7snHDMBT0eSKgkV7m8FY4iTx1Yk SGxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677763406; 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=qrA0iYFCR4ncdpexRkMJ+7MgkO9AgTh8mz6kQeU8h+o=; b=71g7sYaei5SkeBK8blC7yDz3Tfk8OCDAYqPqPwF3babGKax3f5pAJPBSrHTxrbZoHy dm7Rd4917/TTMKeD9LWaLzMbwrXQGWj7zwGf95F8/PjJsiFnj3DiS3QOxwVmL1xjhDBO cwmeHduaDJcYPdbH1/xchHhvwTA4Co7wsuejHWCw1obdXMVPkQnAKP++KZuqpma/y8B7 h8EdY+3UR0JE/ww5cZPTHdEe3nmit2Hlpvqvi5X/7wGVUpjY4GQWQx5sLPJ82CwH/J/d kAIfAot+iA3Ni+u8eGNNbOdKJ8RYXyvjmDAambX/1dpzOfgvG4aew7LEZ4MDytlHwIZr n0Dg== X-Gm-Message-State: AO0yUKWJKvnGQ9lfkBUf6RGLlYFf111eB+uqQDyTY1sKA84TGpFBzsVL hoF8xzKzE+aOnO5Uo8/tzBXUVB2U2UY= X-Google-Smtp-Source: AK7set+8wFX5A2EYqKw+8A7DbB1spXHihKRDg6dn1++XEl/b6f6lpLTLXFNYNt1l5kSZCqjsJBtxvQ== X-Received: by 2002:a2e:b0d3:0:b0:295:b2f0:a858 with SMTP id g19-20020a2eb0d3000000b00295b2f0a858mr2852131ljl.10.1677763406277; Thu, 02 Mar 2023 05:23:26 -0800 (PST) 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 v2 1/3] xen/riscv: read/save hart_id and dtb_base passed by bootloader Date: Thu, 2 Mar 2023 15:23:18 +0200 Message-Id: <3edbb40e86e480b2b71d596ff61c05336004b14c.1677762812.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 Signed-off-by: Oleksii Kurochko --- Changes since v1: * read/save/pass of hart_id and dtb_base passed by a bootloader were moved to head.S. * Update start_xen() to recieve hard_id & dtb_base --- xen/arch/riscv/riscv64/head.S | 24 ++++++++++++++++++++++++ xen/arch/riscv/setup.c | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S index ffd95f9f89..851b4691a5 100644 --- a/xen/arch/riscv/riscv64/head.S +++ b/xen/arch/riscv/riscv64/head.S @@ -1,3 +1,4 @@ +#include #include .section .text.header, "ax", %progbits @@ -6,8 +7,31 @@ ENTRY(start) /* Mask all interrupts */ csrw CSR_SIE, zero + /* Save HART ID and DTB base */ + lla a6, _bootcpu_id + REG_S a0, (a6) + lla a6, _dtb_base + REG_S a1, (a6) + la sp, cpu0_boot_stack li t0, STACK_SIZE add sp, sp, t0 + lla a6, _bootcpu_id + REG_L a0, (a6) + lla a6, _dtb_base + REG_L a1, (a6) + tail start_xen + + /* + * Boot cpu id is passed by a bootloader + */ +_bootcpu_id: + RISCV_PTR 0x0 + + /* + * DTB base is passed by a bootloader + */ +_dtb_base: + RISCV_PTR 0x0 diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index 1c87899e8e..d9723fe1c0 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -7,7 +7,8 @@ unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZE); -void __init noreturn start_xen(void) +void __init noreturn start_xen(unsigned long bootcpu_id, + unsigned long dtb_base) { early_printk("Hello from C env\n"); From patchwork Thu Mar 2 13:23:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13157331 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 6BAECC678D4 for ; Thu, 2 Mar 2023 13:23:45 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.504923.777389 (Exim 4.92) (envelope-from ) id 1pXiuB-0000U7-Iz; Thu, 02 Mar 2023 13:23:31 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 504923.777389; Thu, 02 Mar 2023 13:23:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pXiuB-0000U0-GM; Thu, 02 Mar 2023 13:23:31 +0000 Received: by outflank-mailman (input) for mailman id 504923; Thu, 02 Mar 2023 13:23:30 +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 1pXiuA-0008Qd-Dq for xen-devel@lists.xenproject.org; Thu, 02 Mar 2023 13:23:30 +0000 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [2a00:1450:4864:20::22c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6b38479c-b8fd-11ed-a550-8520e6686977; Thu, 02 Mar 2023 14:23:28 +0100 (CET) Received: by mail-lj1-x22c.google.com with SMTP id y14so17583480ljq.4 for ; Thu, 02 Mar 2023 05:23:28 -0800 (PST) Received: from fedora.. (46.204.108.203.nat.umts.dynamic.t-mobile.pl. [46.204.108.203]) by smtp.gmail.com with ESMTPSA id s8-20020a05651c048800b00290679ebac1sm2109551ljc.9.2023.03.02.05.23.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 05:23:27 -0800 (PST) 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: 6b38479c-b8fd-11ed-a550-8520e6686977 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677763408; 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=IcGex5in4thV+OlZrwNvKuJkjY8dPXTKwAgZbk5Bkbk=; b=EhuIONdNarO4l8MGOsL1rPZ5xLfOd0ik+8zpXehgJjsP4X7Df4xTErTzxcjh4uNyzx cKOpX0h6LrwPH88eUbWXvR+TYgZ4RwkxmHJWeDeQeBXs91xRVp0qI1DCdVa7VEXZIp6/ nPMyaVPk7Nztml/KeJQ6I3Y6VBRxPtahCCC/dZRQTNEIEUIa7mNOIFv5zH5vaGwEswx4 Tdw2cu00ecBaEZv9m3kjFEiktIQLfNXEBFTQ7zpej3oQLJkvna4j4OaXB8L3xVvMrQDG jMV+H75aEK8bxjnahDSF1wLzp08+NacHx+4xZbXPDWuo9FV0/xGLPqBqzMScEA0lO2S1 19tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677763408; 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=IcGex5in4thV+OlZrwNvKuJkjY8dPXTKwAgZbk5Bkbk=; b=SLSRT4ormkqG4J+2B2u9l5Uppk/7C4LCGqnHXe0k7xzNBUvfeLbWy7sRW3XqJOQU5A 6DVevH15OX22CfHEMoEQgdaQC7HiniebAwblRSpMtUFFQjI3wIb3f8QhaU+anXiE9+Kv Tnh/wxI8eg1uh+7kjpNT0YC+tpFyPIgrQS3KtCrf/0bbV8/3C/2+spY6Azfxtw/YUjn3 w95smUiL0wCQOHjFM7nK9EcqUEpQgWcvq8sGaeLAi7r8Dvf82eYrIhaw/rErrTSSiQaj KrWUQnkr31LSMIDtu7TYLxPITQhSK0xy6MFvB1KbXaZERpkLSgZ2ig/gi7ht+abrLwOf OJMQ== X-Gm-Message-State: AO0yUKXJWtuUVmzWBF0oMRuHZWPk8696zE25RfSkF9bRFc2FPqTL3DEc N7eyEJXQ2MUCYAjJ1Z00BKNeqmrUAm4= X-Google-Smtp-Source: AK7set/FrsS26xxLZ/uLPuGuy47aOWDBW+J+JZWvWpCNMiDAmCb0p0n3PqX6Edy2RQanmMbTuHUlMA== X-Received: by 2002:a2e:8048:0:b0:295:c399:686 with SMTP id p8-20020a2e8048000000b00295c3990686mr2976784ljg.13.1677763407706; Thu, 02 Mar 2023 05:23:27 -0800 (PST) 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 v2 2/3] xen/riscv: initialize .bss section Date: Thu, 2 Mar 2023 15:23:19 +0200 Message-Id: <495bd1d7fc2becdd48bd00253c079971e2231e99.1677762812.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 Signed-off-by: Oleksii Kurochko --- Changes since v1: * initialization of .bss was moved to head.S --- xen/arch/riscv/include/asm/asm.h | 4 ++++ xen/arch/riscv/riscv64/head.S | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/xen/arch/riscv/include/asm/asm.h b/xen/arch/riscv/include/asm/asm.h index 6d426ecea7..5208529cb4 100644 --- a/xen/arch/riscv/include/asm/asm.h +++ b/xen/arch/riscv/include/asm/asm.h @@ -26,14 +26,18 @@ #if __SIZEOF_POINTER__ == 8 #ifdef __ASSEMBLY__ #define RISCV_PTR .dword +#define RISCV_SZPTR 8 #else #define RISCV_PTR ".dword" +#define RISCV_SZPTR 8 #endif #elif __SIZEOF_POINTER__ == 4 #ifdef __ASSEMBLY__ #define RISCV_PTR .word +#define RISCV_SZPTR 4 #else #define RISCV_PTR ".word" +#define RISCV_SZPTR 4 #endif #else #error "Unexpected __SIZEOF_POINTER__" diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S index 851b4691a5..b139976b7a 100644 --- a/xen/arch/riscv/riscv64/head.S +++ b/xen/arch/riscv/riscv64/head.S @@ -13,6 +13,15 @@ ENTRY(start) lla a6, _dtb_base REG_S a1, (a6) + la a3, __bss_start + la a4, __bss_end + ble a4, a3, clear_bss_done +clear_bss: + REG_S zero, (a3) + add a3, a3, RISCV_SZPTR + blt a3, a4, clear_bss +clear_bss_done: + la sp, cpu0_boot_stack li t0, STACK_SIZE add sp, sp, t0 From patchwork Thu Mar 2 13:23:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13157333 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 7B700C6FA8E for ; Thu, 2 Mar 2023 13:23:45 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.504924.777399 (Exim 4.92) (envelope-from ) id 1pXiuC-0000jP-QO; Thu, 02 Mar 2023 13:23:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 504924.777399; Thu, 02 Mar 2023 13:23:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pXiuC-0000jI-Ng; Thu, 02 Mar 2023 13:23:32 +0000 Received: by outflank-mailman (input) for mailman id 504924; Thu, 02 Mar 2023 13:23:31 +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 1pXiuB-0008Qd-F8 for xen-devel@lists.xenproject.org; Thu, 02 Mar 2023 13:23:31 +0000 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [2a00:1450:4864:20::230]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6c241d3d-b8fd-11ed-a550-8520e6686977; Thu, 02 Mar 2023 14:23:29 +0100 (CET) Received: by mail-lj1-x230.google.com with SMTP id j17so17539071ljq.11 for ; Thu, 02 Mar 2023 05:23:30 -0800 (PST) Received: from fedora.. (46.204.108.203.nat.umts.dynamic.t-mobile.pl. [46.204.108.203]) by smtp.gmail.com with ESMTPSA id s8-20020a05651c048800b00290679ebac1sm2109551ljc.9.2023.03.02.05.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 05:23:29 -0800 (PST) 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: 6c241d3d-b8fd-11ed-a550-8520e6686977 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677763409; 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=g8MaW6bU1cbVIh9lyUx2jnADjWazCTCDdecZrd3onsY=; b=N2oonot0HbSfj0KLZHIlG8/Ef4uXJfhbDIqmYh6UQhCqZFQfjlCq1+l8hsMV5gyb0T PqCrc3dHg7seaDgB5Kwz0diWaMzEy+F/tAOV03lZyR7cZpKRRAZmMXxn0x4Vo7n8EXmp JBeomU3BM9IOulJD6e5ncwg5OXQUJnOKWqAcJ5fUIBLabSZYF5/XJ/qfq0IEG7t77CHr ecfv07jzC5DGS7W+s6FhY5zzaXqH/S4YKtQnMpZhistDtbvdCxhrbEvVMLqrqoqJX1mH jrBh6J+FRXSFE+iwJlb+3OYV65Z2g8Ce1cjBsPAPJNSXhXrYYVgad4gM6XB0Rb3U2NZm 4sHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677763409; 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=g8MaW6bU1cbVIh9lyUx2jnADjWazCTCDdecZrd3onsY=; b=aBoCo2fM/PH43DvVeozQ6rr9TictXdoxXpMV/pS1pIhmIJWzaKy60AiLegcKgBZ+Qd zK2wdaCm5S+9IKOKKCKMowvoFYRKB3pjmXnW8Vr812fdzbu+czWitVacxl6fnyxjc9DH 5dGfJzkBJFPfwIda7AS838+MylmmTxto4/Sl4+tlq/pkWdRPbRug2KgTF8eir/Gty43X X3R116sZKwLx3DjE1LkhbOpx+rjLOikFY8HqutTeTuxvKaAGWDEn9GTEJvJP7i1XTqr/ I9SF82NFmlXGzkqaW9poJZVnZ0jUOzLImelRZ36G53OUx/0DRb1rqAkAFImt7BnJS7Je sGXQ== X-Gm-Message-State: AO0yUKU4NkIR4+6wE8BMCeOoSOfxzqLG2VciLFgYw+tDTmUaifBb3hYQ ctSMAMpl93l6njPZcbTiESbAO3YJTD4= X-Google-Smtp-Source: AK7set+Pl1tPpShibOMgKeLVaLNrRDdLBx4Hz7FkN7FO99uaWL2VCOe8CKd0uFc1W14fnXWEfXw0Zg== X-Received: by 2002:a05:651c:cb:b0:290:6d3b:79dd with SMTP id 11-20020a05651c00cb00b002906d3b79ddmr2945347ljr.20.1677763409433; Thu, 02 Mar 2023 05:23:29 -0800 (PST) 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 v2 3/3] xen/riscv: disable fpu Date: Thu, 2 Mar 2023 15:23:20 +0200 Message-Id: X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 Disable FPU to detect illegal usage of floating point in kernel space. Signed-off-by: Oleksii Kurochko --- Changes since v1: * Rebase on top of two previous patches. --- xen/arch/riscv/setup.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index d9723fe1c0..23d60ed7f0 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -1,15 +1,23 @@ #include #include +#include #include /* Xen stack for bringing up the first CPU. */ unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZE); +static void __init disable_fpu(void) +{ + csr_write(CSR_SSTATUS, SSTATUS_FS); +} + void __init noreturn start_xen(unsigned long bootcpu_id, unsigned long dtb_base) { + disable_fpu(); + early_printk("Hello from C env\n"); early_printk("All set up\n");