From nobody Thu May 16 17:44:51 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=1677763433; cv=none; d=zohomail.com; s=zohoarc; b=GyzxZ0qRWwT+CGUbr94wBP6QOY/4CB4RDjICen4n5EnQ1UZM3UutnFYcNQvvUC6W0rtbL/Q9VXpzU1Ap9/goO4LYoxfUCzBvhxwIT5SAa7Nz2vmguTnu4CNGC/8/uenUHIig/eqofvolhbdAWh7pjEUZZ6FdNOC4Dwo8Wr7XNvc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677763433; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qrA0iYFCR4ncdpexRkMJ+7MgkO9AgTh8mz6kQeU8h+o=; b=VxR44THtXGFsaZ0N8U9roUH4ch7hdmWwIvdcAtyFqvNBjc/v9EEBzX8/wCug05c2e4SDnIev7xyB94aaZa9KG2uFq8D3BvsGCRLmK8GlVw9ua9BKYQoqCgnCSOsEdC3cB5t2TncTFsSd/KXjJ4Q+IWAmjMRpUxLyi5ZnTEdhauU= 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 1677763432992956.7475168370722; Thu, 2 Mar 2023 05:23:52 -0800 (PST) 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 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-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: 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 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1677763434026100001 Content-Type: text/plain; charset="utf-8" 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.=20 * 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 =20 .section .text.header, "ax", %progbits @@ -6,8 +7,31 @@ ENTRY(start) /* Mask all interrupts */ csrw CSR_SIE, zero =20 + /* 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 =20 + 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); =20 -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"); =20 --=20 2.39.0 From nobody Thu May 16 17:44:51 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=1677763431; cv=none; d=zohomail.com; s=zohoarc; b=lz+rLUJJswtHbgXxDNSW6HDLd6Tqn/Cbi0mWqjxsLYTJETdWuP/SJdpnLIpxSluFVXL77BLHopvgzZaTlnojzLzt6KUEW3SLCDjFVEykVRt+8XteF2BUReGqeTxMxdFpmlTLzdHllbD5RY0a7TDXWlkVYmMR7luPNBDigqes9PY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677763431; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IcGex5in4thV+OlZrwNvKuJkjY8dPXTKwAgZbk5Bkbk=; b=SkedWHFwe5km6Y8R9yidCfkFoS7AAi63iD/bqyX+MsqJX5lVXRecA2qqhZE9ThqAB2VxhFCExX61yqre/9XCJ8AC59+pW2tZqV5E1jYlg4K9MJa+4FFobHLROo5i3ab2Al01VgkW7l230HV9FKJzFEZs9+q+rn43+jcruBVpssA= 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 1677763431790388.6935183336965; Thu, 2 Mar 2023 05:23:51 -0800 (PST) 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 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-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: 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 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1677763434030100002 Content-Type: text/plain; charset="utf-8" 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__ =3D=3D 8 #ifdef __ASSEMBLY__ #define RISCV_PTR .dword +#define RISCV_SZPTR 8 #else #define RISCV_PTR ".dword" +#define RISCV_SZPTR 8 #endif #elif __SIZEOF_POINTER__ =3D=3D 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) =20 + 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 --=20 2.39.0 From nobody Thu May 16 17:44:51 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=1677763436; cv=none; d=zohomail.com; s=zohoarc; b=XXxI14Db23lkeUyVFSk3PpudVEGVSWVDyTPO+CBG/X71ra95ewB8VFFbgGY0JpPiY5XegNvwtmvRdOMTAyzmaICNgC3fF2F2TeVkDRg+R4DsNRyIeCcjOiybw0zNYIXiwaS+2b363FzCICY6l3hJiIjKOJONgdFuLP6M5ciEfVg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677763436; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=g8MaW6bU1cbVIh9lyUx2jnADjWazCTCDdecZrd3onsY=; b=PSsQo2obGucoU+Tlh9T+LRuouQsMnRiuKrPjwBuTx64P2rbir2udztbiusGtyQqLVIUfOg6lb2vh2EdniITyT4Ty9KE0XTk7m3Di49kUmGgO+9y5+eT0ZIID3GAAUKn3s2I+WQ/c21rSjMNLouYMRfZVXc49I4gRdqhLz5Su5oM= 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 1677763436470100.71775883404871; Thu, 2 Mar 2023 05:23:56 -0800 (PST) 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 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-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: 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 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1677763437817100002 Content-Type: text/plain; charset="utf-8" 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 =20 +#include #include =20 /* Xen stack for bringing up the first CPU. */ unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZE); =20 +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"); =20 early_printk("All set up\n"); --=20 2.39.0