From nobody Thu May 2 22:49:10 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=1673010908; cv=none; d=zohomail.com; s=zohoarc; b=F+Ka/06QX5FxcqJWKDlD/G5QFRNh60xxcw5IG+cpYLlStdqbastgr3pZM7X9x3xeoo0R2In2prppfS1GmfFoTshxR8m17Qa9ebj4zGpdBTBcDEv0Bg1LAQ0ANN2uatJO43BzPZeWa/ALpc8u/pAn04sk/KvOUIQxlvy5L0c/cjk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673010908; 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=yAcYh/VW7eYXXl0R2jdwjlS37Qv+vZcW+kdMkmb+PS4=; b=lHWlms2XMHJVWtDIXazms3XMDYXxYruIMXLJjNCkLj+ETYn+ePdO8Pq/Qx+qnkq0G1q5KBrKgDSWma8887tvtxL6MgEzVzmOJa9ii1+lZ0t2cHCV3K5HmA1I6xrtuwFWfpqTJC51HedQZbR99mTIz3eOAPed6rk+B26OgUFjxog= 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 1673010908510587.0386033485295; Fri, 6 Jan 2023 05:15:08 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.472541.732787 (Exim 4.92) (envelope-from ) id 1pDmYU-00035p-Hx; Fri, 06 Jan 2023 13:14:42 +0000 Received: by outflank-mailman (output) from mailman id 472541.732787; Fri, 06 Jan 2023 13:14:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pDmYU-00034D-CJ; Fri, 06 Jan 2023 13:14:42 +0000 Received: by outflank-mailman (input) for mailman id 472541; Fri, 06 Jan 2023 13:14:41 +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 1pDmYT-0002z5-Dm for xen-devel@lists.xenproject.org; Fri, 06 Jan 2023 13:14:41 +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 13e4f564-8dc4-11ed-91b6-6bf2151ebd3b; Fri, 06 Jan 2023 14:14:40 +0100 (CET) Received: by mail-lf1-x136.google.com with SMTP id b3so1912398lfv.2 for ; Fri, 06 Jan 2023 05:14:40 -0800 (PST) Received: from fedora.. ([195.234.76.149]) by smtp.gmail.com with ESMTPSA id f14-20020a0565123b0e00b004b7033da2d7sm150221lfv.128.2023.01.06.05.14.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 05:14:39 -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: 13e4f564-8dc4-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=yAcYh/VW7eYXXl0R2jdwjlS37Qv+vZcW+kdMkmb+PS4=; b=IlrI0mSe81MehUEzGp9/MbqL/Pkl6vTOQkeNdnArj8JWWJejtDMyERVIbGWTZ3BpXm cdl2hGleDIcpJ8VKttf+B3DguD+ugtu1V5plc39rePhJu70fhf4HORtDXOluwNgzZFdF HPU35Kzhc/c0ITVRDRzHYzb+qkaLBq9q8fpq4gFPV6cVl8Ct3QcAV2Theof2IrBH4SHE 2KCh5GoBjbLvlq+IxEVb/ykaL0xTbyg+kX6ILflHPNKLfqeC9SXO2/19T6giQkNi91q5 vctCpEYEioJe8qs2XLEIUQyPX5+UPDs1eNsh6eCsx3C76Yk8+brLRJzm+IWy0S7DSxOW np5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=yAcYh/VW7eYXXl0R2jdwjlS37Qv+vZcW+kdMkmb+PS4=; b=qvCxCB94RnvTv9Okv6riYgvGGcH3oOafz3lGhFCDqn7TIozOh5gDr7I40MmpHQKhtV UAnk7iFqkr8rGL9mX9w1ob7vVNhHpNIvN0yOFgaIBHfwfog6lbM8F5CodV3K5Wv0DsIF 7nJ1VBafyahkPpV6LVrUNUWXxTVZkU2UPYHSOvHPoQXnS+HKK15m/Hv1/90YaoNsf0jm iVItWbDgsEmIaaO2ThyaTBtCLdm/4owYAnvVj4I4qivKJipY0lBsjshZGMm4GgjRZeOb VZ5Yx4ax3qa7uzCUCcoQRYMDS9T7Z3S+O8a/5DS+vVqfXWDreV6mu4aO94LydDgEGYsa bO9g== X-Gm-Message-State: AFqh2kp444fpXxSdwXUmiXCXaUfRtsmD2gOnDXrJIZ6g7fcCTdZCI07u 4iwpvpQE1zrBNdi14AZbXCVPdakgVcBoSYwp X-Google-Smtp-Source: AMrXdXuRGgsiwA4HhZEUjvPe3rUe82HuuCxRCrIxhvRyjc68zQIey6oqWemF0IKGffdvUIL0o0nSeQ== X-Received: by 2002:a05:6512:6ce:b0:4cc:553f:5b68 with SMTP id u14-20020a05651206ce00b004cc553f5b68mr3020397lff.40.1673010879984; Fri, 06 Jan 2023 05:14:39 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v1 1/8] xen/riscv: introduce dummy asm/init.h Date: Fri, 6 Jan 2023 15:14:22 +0200 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1673010910471100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Oleksii Kurochko Reviewed-by: Julien Grall --- xen/arch/riscv/include/asm/init.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 xen/arch/riscv/include/asm/init.h diff --git a/xen/arch/riscv/include/asm/init.h b/xen/arch/riscv/include/asm= /init.h new file mode 100644 index 0000000000..237ec25e4e --- /dev/null +++ b/xen/arch/riscv/include/asm/init.h @@ -0,0 +1,12 @@ +#ifndef _XEN_ASM_INIT_H +#define _XEN_ASM_INIT_H + +#endif /* _XEN_ASM_INIT_H */ +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ --=20 2.38.1 From nobody Thu May 2 22:49:10 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=1673010909; cv=none; d=zohomail.com; s=zohoarc; b=Q7ArbAvsXTz25pJBvnfo1JgN6RnLjzuXqTPL3R/aoDlNw3OvWZPT2e3AwoS8FbPfnyRqVSOfG9IhhwMwTpXKGSlNnbDSzWEUn1gUIH+vutIemBabh5S3pT1/mxfM7y5DKlEsca5sIULgWc/PnAXI8vt/UhAJV0JhtEoOrvSgYxs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673010909; 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=MB3mP3saGY5zi4vniFjN+fb62F0tD8zzx/q/eV6PI4g=; b=gOQGNBjPsOv4Ug2tmFKErbPOQjcjpWJ/QOm914k+3GhFc/2xFzXSQw0KHM5TabrD77LRPbfSkSsoMWpJ33UjBI2bs4/0Ky/dKQeGXa2X1rn+LOq6VMUHAfgeFR5Oo/InetaW42gbH8PP3ku8rfD2qgDrlotsW1bC5XU1gyUDQIM= 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 1673010909243703.4954483767258; Fri, 6 Jan 2023 05:15:09 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.472542.732803 (Exim 4.92) (envelope-from ) id 1pDmYV-0003TR-Qd; Fri, 06 Jan 2023 13:14:43 +0000 Received: by outflank-mailman (output) from mailman id 472542.732803; Fri, 06 Jan 2023 13:14:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pDmYV-0003Sw-Kp; Fri, 06 Jan 2023 13:14:43 +0000 Received: by outflank-mailman (input) for mailman id 472542; Fri, 06 Jan 2023 13:14:42 +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 1pDmYU-0002z5-Dm for xen-devel@lists.xenproject.org; Fri, 06 Jan 2023 13:14:42 +0000 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [2a00:1450:4864:20::12f]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 149870ba-8dc4-11ed-91b6-6bf2151ebd3b; Fri, 06 Jan 2023 14:14:41 +0100 (CET) Received: by mail-lf1-x12f.google.com with SMTP id cf42so1913806lfb.1 for ; Fri, 06 Jan 2023 05:14:41 -0800 (PST) Received: from fedora.. ([195.234.76.149]) by smtp.gmail.com with ESMTPSA id f14-20020a0565123b0e00b004b7033da2d7sm150221lfv.128.2023.01.06.05.14.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 05:14:40 -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: 149870ba-8dc4-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=MB3mP3saGY5zi4vniFjN+fb62F0tD8zzx/q/eV6PI4g=; b=dHhG0y7E8/G36jeTb3kkFqbhUorGTTD1mCXTlEOCv5nLd0t6yij8q6f2XhSvjbCHSz 4LzUKh/1RbdJJ7qgeiImwk3EztRh9oPbpX+iJqmQgCuJY2xHs3Jqb3giU9uM6FDa+cFP gutliizUf4Wg24ZwSqNd3yN/cKX5mUXHtkje923o2AaxnnfaLMYg/53aRm+WB7XV95bC 0ND1IglLWaPtvyWmqxjBvmnsy29uP6OkLA6ELEAiogGUwyvDU08UIx8tU6BBSVrsHKUk bOfrfqyRVJhfSD4VpvorITmB1PTLQxhnzj9KYF7wEyyyEBYF+qQXyj7s8YOnkkMMQZ1g 5ufQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=MB3mP3saGY5zi4vniFjN+fb62F0tD8zzx/q/eV6PI4g=; b=H8EkbD5Bs3MyPAC5+0dBnv88GLV9kVuGS3+EXnaXKhG5Pgecjjb3x37di/aiUJNgBB rxDWUjO3Up91Nq49mLD5129Q0AVtnE+kzn8KkAjwOxTT6GlIvdVedEfbpCVRf/zRGpcT zk4eeBgrTqh+qHATHSEQbfxdl50tjvM1qS1rf40v8xG83jYcnogGZu1kx3ObenzkfOph VHc20MK5z+OsEemOL1rYr/1QYc9wCAIsPOsfruHPjtxX2RtifUrPriQZ7ur1jjn8Y19X 1hooJ0kr6kGSmpurlv2lffmnuzxwNtEIfezuQSLKrnKEL1vBTHW7tLQnPTHQd5+Rc/4V mJ2Q== X-Gm-Message-State: AFqh2kpCRf64iCbwrcO5crNNwEPYOFNnTun2nMD6SosStHjyz+yn4p7c ObeJvLWYrjtkfDYfkk021kmDFVDgaeMX0rv0 X-Google-Smtp-Source: AMrXdXtja92B/6NXyi/klzTpbEH82FEmrjFVVSWx/83yonduRUFATBxzf42E31lSTN70xqAB7n1C+w== X-Received: by 2002:a05:6512:1513:b0:4a4:a7d7:4769 with SMTP id bq19-20020a056512151300b004a4a7d74769mr17352068lfb.8.1673010881180; Fri, 06 Jan 2023 05:14:41 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v1 2/8] xen/riscv: introduce asm/types.h header file Date: Fri, 6 Jan 2023 15:14:23 +0200 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1673010910443100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/include/asm/types.h | 73 ++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 xen/arch/riscv/include/asm/types.h diff --git a/xen/arch/riscv/include/asm/types.h b/xen/arch/riscv/include/as= m/types.h new file mode 100644 index 0000000000..48f27f97ba --- /dev/null +++ b/xen/arch/riscv/include/asm/types.h @@ -0,0 +1,73 @@ +#ifndef __RISCV_TYPES_H__ +#define __RISCV_TYPES_H__ + +#ifndef __ASSEMBLY__ + +typedef __signed__ char __s8; +typedef unsigned char __u8; + +typedef __signed__ short __s16; +typedef unsigned short __u16; + +typedef __signed__ int __s32; +typedef unsigned int __u32; + +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +#if defined(CONFIG_RISCV_32) +typedef __signed__ long long __s64; +typedef unsigned long long __u64; +#elif defined (CONFIG_RISCV_64) +typedef __signed__ long __s64; +typedef unsigned long __u64; +#endif +#endif + +typedef signed char s8; +typedef unsigned char u8; + +typedef signed short s16; +typedef unsigned short u16; + +typedef signed int s32; +typedef unsigned int u32; + +#if defined(CONFIG_RISCV_32) +typedef signed long long s64; +typedef unsigned long long u64; +typedef u32 vaddr_t; +#define PRIvaddr PRIx32 +typedef u64 paddr_t; +#define INVALID_PADDR (~0ULL) +#define PRIpaddr "016llx" +typedef u32 register_t; +#define PRIregister "x" +#elif defined (CONFIG_RISCV_64) +typedef signed long s64; +typedef unsigned long u64; +typedef u64 vaddr_t; +#define PRIvaddr PRIx64 +typedef u64 paddr_t; +#define INVALID_PADDR (~0UL) +#define PRIpaddr "016lx" +typedef u64 register_t; +#define PRIregister "lx" +#endif + +#if defined(__SIZE_TYPE__) +typedef __SIZE_TYPE__ size_t; +#else +typedef unsigned long size_t; +#endif +typedef signed long ssize_t; + +#endif /* __ASSEMBLY__ */ + +#endif /* __RISCV_TYPES_H__ */ +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ --=20 2.38.1 From nobody Thu May 2 22:49:10 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=1673010908; cv=none; d=zohomail.com; s=zohoarc; b=j9LwzBzKNUtNtO/3I855trRFuIM9DBSmPJZSZdYabvI9nlh04eIpiudJqFwNGr41ITuPyLrDAFCZKwlS81CTgHWKBs0pqicX+iRyLeCAN3vF2UdYF5jZsGbmm92BVdr8jBklcsoQfofEHduFLm/rt+4mUDibBopqMXw/GJ800rU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673010908; 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=WNxlUh9Ka9jPjJlnMEMMefixCKNIhgCiXW1ZWCXQV/k=; b=g8WSlj7qnv/MJYtQpHhCMkpnkj3vXugWXTzAsD1Z5HDZ9qLGf1D0btH1R2f9xMhUltFMRUdb7mtRq24TzTKGd+8TapM0dxzzpc3pOH3F84S2tPxpVuP1Vc8PLujAqsCP4guzX1Zz9Z7BnEIeZCno2gkjoRVh1qPs6hj8D2vjpbc= 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 1673010908223626.5625559904745; Fri, 6 Jan 2023 05:15:08 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.472543.732815 (Exim 4.92) (envelope-from ) id 1pDmYX-0003kP-4n; Fri, 06 Jan 2023 13:14:45 +0000 Received: by outflank-mailman (output) from mailman id 472543.732815; Fri, 06 Jan 2023 13:14:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pDmYW-0003kH-VJ; Fri, 06 Jan 2023 13:14:44 +0000 Received: by outflank-mailman (input) for mailman id 472543; Fri, 06 Jan 2023 13:14:43 +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 1pDmYV-0002z5-E9 for xen-devel@lists.xenproject.org; Fri, 06 Jan 2023 13:14:43 +0000 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [2a00:1450:4864:20::12f]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 154670af-8dc4-11ed-91b6-6bf2151ebd3b; Fri, 06 Jan 2023 14:14:42 +0100 (CET) Received: by mail-lf1-x12f.google.com with SMTP id cf42so1913857lfb.1 for ; Fri, 06 Jan 2023 05:14:42 -0800 (PST) Received: from fedora.. ([195.234.76.149]) by smtp.gmail.com with ESMTPSA id f14-20020a0565123b0e00b004b7033da2d7sm150221lfv.128.2023.01.06.05.14.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 05:14: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: 154670af-8dc4-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=WNxlUh9Ka9jPjJlnMEMMefixCKNIhgCiXW1ZWCXQV/k=; b=Cmp2WrBPADxtPoiKL4ZCWZjbwolz9CwJgGbJPD1rMDDiI4pZKxyKs8tIFpSVx7xZph Zcr/Wt6lvg3FkgxLGPbYrF4RjLh+MGPOl10al8e9P5VIfsaWmG7qfqwCr0gDRlmbkAfz CO6Ru90aBDKMmqCyBvUnfKTZ59ad/qLzNaERvfFpq6tS0plPuFGbhtSTcZgJkNcphG7/ lPwDSreK1qoe1UVY5EEgEN8gA9fHaUCF8UDtd1r6OC2Dyo1tcmf6wdE+qUhpO9dKCZ/u AR6XI3Uh00paOLb9LVgKW81uqYPOwtEkeq9LK9r8uTmgKaMjbvQUwNO/eMCW375itLxT /Wmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=WNxlUh9Ka9jPjJlnMEMMefixCKNIhgCiXW1ZWCXQV/k=; b=ujdg131bgkDNS3qAHK/yHdeARCfT6Gj+cHjplIlO4XNknz8yGVkhbyBx3HluqPEz1T /RJmQCwgxUVUDUZnYNwX0JW53//D1T/2E7QDUyDdU58ktV3XSrokah9aVxM19fxiq1rB uWCXBLK19ZmHoAs8V0zaxMfgpucQnkR6zBTgTFTt3XTh87d5cHnMrN1pYyuoQd5Okaap U4aQGT14qXm8yayUpL2kYv/b8LLT79qT7uYKfSOHwntgqzoR+OQr2j2CHN/ikZIHnDCy 6b/HMN+P2Tev0od2jf60jAGIS8aIe7uQvBiQmNgU+PXK4YkvcY6lAxoWlQ/FendQiOh1 B8Qw== X-Gm-Message-State: AFqh2kpRjTK+rKIz6o+3fwT73Gd5hIN9KMZWW2jQhsyZHkEQepBrLSj4 fu73Q2D9zyY9feCAmQ5OiKWGp5c9exjV3cpW X-Google-Smtp-Source: AMrXdXvor3i3sFq+rVboLeo1F3I7ZDy57MwxwjjT77+SwrslgXm0lEQNqBGQktwp9LJBw0V3e91aUw== X-Received: by 2002:ac2:4f13:0:b0:4b5:5da1:4bcb with SMTP id k19-20020ac24f13000000b004b55da14bcbmr20144859lfr.13.1673010882425; Fri, 06 Jan 2023 05:14:42 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v1 3/8] xen/riscv: introduce stack stuff Date: Fri, 6 Jan 2023 15:14:24 +0200 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1673010910483100004 Content-Type: text/plain; charset="utf-8" The patch introduces and sets up a stack in order to go to C environment Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/Makefile | 1 + xen/arch/riscv/riscv64/head.S | 8 +++++++- xen/arch/riscv/setup.c | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 xen/arch/riscv/setup.c diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile index 248f2cbb3e..5a67a3f493 100644 --- a/xen/arch/riscv/Makefile +++ b/xen/arch/riscv/Makefile @@ -1,4 +1,5 @@ obj-$(CONFIG_RISCV_64) +=3D riscv64/ +obj-y +=3D setup.o =20 $(TARGET): $(TARGET)-syms $(OBJCOPY) -O binary -S $< $@ diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S index 990edb70a0..ddc7104701 100644 --- a/xen/arch/riscv/riscv64/head.S +++ b/xen/arch/riscv/riscv64/head.S @@ -1,4 +1,10 @@ .section .text.header, "ax", %progbits =20 ENTRY(start) - j start + la sp, cpu0_boot_stack + li t0, PAGE_SIZE + add sp, sp, t0 + +_start_hang: + wfi + j _start_hang diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c new file mode 100644 index 0000000000..2c7dca1daa --- /dev/null +++ b/xen/arch/riscv/setup.c @@ -0,0 +1,6 @@ +#include +#include + +/* Xen stack for bringing up the first CPU. */ +unsigned char __initdata cpu0_boot_stack[PAGE_SIZE] + __aligned(PAGE_SIZE); --=20 2.38.1 From nobody Thu May 2 22:49:10 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=1673010910; cv=none; d=zohomail.com; s=zohoarc; b=TvqilIdhNxyZvsApEzHLKwdd9zxmswMxilJ9q9zUMwZxUBiHh512h0ljSVXmg+U1rKJPfyXyZAA0/G7NPlguQhv6uDpr8Zy8Ah47czhGAF/rasrHvfsccf3Q11fnkqOuxsqRi+SCKXDQYLdCvit5ERBHUhjonRU+0IwrSu5ZLoo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673010910; 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=Szof3vhqcf1cuBmqVq5Q2IZcNa/4nJpd7CeH5aS/VM8=; b=h2GL4b/Z1U0KFDmP1Dnk6FIq6+p9iYy1GvkK4nB2yqodEyG8Hx2vkqCaJJszBC48gk9xE2D2RQZjKT+LyNJkqg1NEkecNPSq9dizFbG/7LzQHxjj+Fy36I0Z/Rgq0cz7ZK98X1/8KmbAMlBefpjzaJsTTb3B03i5YKbrQitFpu0= 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 1673010910861273.94064577743745; Fri, 6 Jan 2023 05:15:10 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.472544.732825 (Exim 4.92) (envelope-from ) id 1pDmYa-00045H-CR; Fri, 06 Jan 2023 13:14:48 +0000 Received: by outflank-mailman (output) from mailman id 472544.732825; Fri, 06 Jan 2023 13:14:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pDmYa-000458-8K; Fri, 06 Jan 2023 13:14:48 +0000 Received: by outflank-mailman (input) for mailman id 472544; Fri, 06 Jan 2023 13:14:46 +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 1pDmYY-0003zy-Jd for xen-devel@lists.xenproject.org; Fri, 06 Jan 2023 13:14:46 +0000 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [2a00:1450:4864:20::136]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 16168da3-8dc4-11ed-b8d0-410ff93cb8f0; Fri, 06 Jan 2023 14:14:44 +0100 (CET) Received: by mail-lf1-x136.google.com with SMTP id bp15so1865644lfb.13 for ; Fri, 06 Jan 2023 05:14:44 -0800 (PST) Received: from fedora.. ([195.234.76.149]) by smtp.gmail.com with ESMTPSA id f14-20020a0565123b0e00b004b7033da2d7sm150221lfv.128.2023.01.06.05.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 05:14:43 -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: 16168da3-8dc4-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=Szof3vhqcf1cuBmqVq5Q2IZcNa/4nJpd7CeH5aS/VM8=; b=cQzbsV1We3uOandm0dnfdaj/H7IIIhcsfpN/Lxb7zZEiEQWUgLQ4F9PMzPlKUVHcXY jRSZco3lfG1JhL/PTtNL7XwLktSfpwQQPYNJ1d8F0CfgrXGn0EfOkFV8iO9DqQpHj6j5 60YsQ63IXJTO1yh7XAumMCtqfgb/wNJtY1saMKPfMfW913cDSM61f+kLg/zBzPlghdPq uuoErP5j9CAIfWku6Qdh1xr1Wa1dq4fIGHpkRozz7IuzyJxZGdgk779OoZINEAKJCGq6 tjhrvsqOEvkmRuxkyGpg/lQeYe0+5RkvngIsCvKtpTzVl3YD0IPli5DJGsdkopklAup8 kwPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Szof3vhqcf1cuBmqVq5Q2IZcNa/4nJpd7CeH5aS/VM8=; b=FwZCyupFCjNZq1d+nmAg73AMVK7AvMOoT3uGXLJp62W529RSlzmU6dY6PqcMPO6MpO aj57YQnlGK1jvnGO9uDLkCePYxwXa/0cKjVq0gX0edZPH/ciAm2HHST1+FDCgYvluUJw BKFVGxJxWDjCEVtGAiVvJ+/LbGyoHq0teaGg2F03I1VQhRgkQeyMRo9+tUbsPBOlOE4Y dSkF1fdRPvSyzifY3sFCHvnf79S2ZK1O1BD7100gnK3TR1mHJwtC8yRQE6NqS9sbTuds PrEy8RbbawVjuiOg5w64I90leJcfaPcmAy4RNCMISsdW0cyqFhv6ReHQjIqX0Lzl6i/E jmrA== X-Gm-Message-State: AFqh2kq462u/jLGdE86KSGpch86/sVfnVHZJbydqR4c4xIIL/p05zGD4 Tl2K2Hzv9vpWkx7m9t9KvWlRyXbUuNYmZHrf X-Google-Smtp-Source: AMrXdXvNq2lNiXoqpUOykfZiuBP8QUksdxBOvF4zWSj54AMf05ZpoqtWPB5OqFs7UVSr9Xh6n0qkVA== X-Received: by 2002:a05:6512:32cc:b0:4cb:4378:9c6 with SMTP id f12-20020a05651232cc00b004cb437809c6mr3292688lfg.23.1673010883600; Fri, 06 Jan 2023 05:14:43 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v1 4/8] xen/riscv: introduce sbi call to putchar to console Date: Fri, 6 Jan 2023 15:14:25 +0200 Message-Id: <09da5a3184242152af6af060720a007738a55d6e.1673009740.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1673010912275100013 Content-Type: text/plain; charset="utf-8" The patch introduce sbi_putchar() SBI call which is necessary to implement initial early_printk Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/Makefile | 1 + xen/arch/riscv/include/asm/sbi.h | 34 ++++++++++++++++++++++++ xen/arch/riscv/sbi.c | 44 ++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 xen/arch/riscv/include/asm/sbi.h create mode 100644 xen/arch/riscv/sbi.c diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile index 5a67a3f493..60db415654 100644 --- a/xen/arch/riscv/Makefile +++ b/xen/arch/riscv/Makefile @@ -1,5 +1,6 @@ obj-$(CONFIG_RISCV_64) +=3D riscv64/ obj-y +=3D setup.o +obj-y +=3D sbi.o =20 $(TARGET): $(TARGET)-syms $(OBJCOPY) -O binary -S $< $@ diff --git a/xen/arch/riscv/include/asm/sbi.h b/xen/arch/riscv/include/asm/= sbi.h new file mode 100644 index 0000000000..34b53f8eaf --- /dev/null +++ b/xen/arch/riscv/include/asm/sbi.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: (GPL-2.0-or-later) */ +/* + * Copyright (c) 2021 Vates SAS. + * + * Taken from xvisor, modified by Bobby Eshleman (bobby.eshleman@gmail.com= ). + * + * Taken/modified from Xvisor project with the following copyright: + * + * Copyright (c) 2019 Western Digital Corporation or its affiliates. + */ + +#ifndef __CPU_SBI_H__ +#define __CPU_SBI_H__ + +#define SBI_EXT_0_1_CONSOLE_PUTCHAR 0x1 + +struct sbiret { + long error; + long value; +}; + +struct sbiret sbi_ecall(unsigned long ext, unsigned long fid, unsigned lon= g arg0, + unsigned long arg1, unsigned long arg2, + unsigned long arg3, unsigned long arg4, + unsigned long arg5); + +/** + * Writes given character to the console device. + * + * @param ch The data to be written to the console. + */ +void sbi_console_putchar(int ch); + +#endif // __CPU_SBI_H__ diff --git a/xen/arch/riscv/sbi.c b/xen/arch/riscv/sbi.c new file mode 100644 index 0000000000..67cf5dd982 --- /dev/null +++ b/xen/arch/riscv/sbi.c @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Taken and modified from the xvisor project with the copyright Copyright= (c) + * 2019 Western Digital Corporation or its affiliates and author Anup Patel + * (anup.patel@wdc.com). + * + * Modified by Bobby Eshleman (bobby.eshleman@gmail.com). + * + * Copyright (c) 2019 Western Digital Corporation or its affiliates. + * Copyright (c) 2021 Vates SAS. + */ + +#include +#include + +struct sbiret sbi_ecall(unsigned long ext, unsigned long fid, unsigned lon= g arg0, + unsigned long arg1, unsigned long arg2, + unsigned long arg3, unsigned long arg4, + unsigned long arg5) +{ + struct sbiret ret; + register unsigned long a0 asm ("a0") =3D arg0; + register unsigned long a1 asm ("a1") =3D arg1; + register unsigned long a2 asm ("a2") =3D arg2; + register unsigned long a3 asm ("a3") =3D arg3; + register unsigned long a4 asm ("a4") =3D arg4; + register unsigned long a5 asm ("a5") =3D arg5; + register unsigned long a6 asm ("a6") =3D fid; + register unsigned long a7 asm ("a7") =3D ext; + + asm volatile ("ecall" + : "+r" (a0), "+r" (a1) + : "r" (a2), "r" (a3), "r" (a4), "r" (a5), "r" (a6), "r" (a7) + : "memory"); + ret.error =3D a0; + ret.value =3D a1; + + return ret; +} + +void sbi_console_putchar(int ch) +{ + sbi_ecall(SBI_EXT_0_1_CONSOLE_PUTCHAR, 0, ch, 0, 0, 0, 0, 0); +} --=20 2.38.1 From nobody Thu May 2 22:49:10 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=1673010910; cv=none; d=zohomail.com; s=zohoarc; b=EPbYkCUXhMvNmIxfaaU3XB3YqW+yvATpl/aaFBvIi388GuzwfsO0+sP2T6CB7QB8uL+tsHmqU78z3n9dAEn01/OilgaTybYJZ5bc7DY620mpewQSpIaHc2KbRlqsXSwxw+ELv+Z2an0ptRJ9IAUk5z/VlOhgNrGd4g3YfO0eilI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673010910; 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=V/C7mq9n+LLhC4Y4ZbcEJdqsm6p7eqTbyDE7iupd4oI=; b=KcjND/T387ZoE4Jy7VdoKAcisjRoDxBmroSDont/87k7Me46I9hwH+wwrmiy5h7Nhn3GkgctDRDwfSVht7Z+UtCmyAmj++1u2TIaCKLgL4iW2jwnsaEQ/c3el1aIxHHZzBwRlwRDryx6PQRPf5F73rielPI660k4EgKvbWRZuTQ= 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 1673010910925793.516240844463; Fri, 6 Jan 2023 05:15:10 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.472545.732830 (Exim 4.92) (envelope-from ) id 1pDmYa-00049s-Qr; Fri, 06 Jan 2023 13:14:48 +0000 Received: by outflank-mailman (output) from mailman id 472545.732830; Fri, 06 Jan 2023 13:14:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pDmYa-00049H-K4; Fri, 06 Jan 2023 13:14:48 +0000 Received: by outflank-mailman (input) for mailman id 472545; Fri, 06 Jan 2023 13:14:47 +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 1pDmYZ-0003zy-CT for xen-devel@lists.xenproject.org; Fri, 06 Jan 2023 13:14:47 +0000 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [2a00:1450:4864:20::12d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 16d71d02-8dc4-11ed-b8d0-410ff93cb8f0; Fri, 06 Jan 2023 14:14:45 +0100 (CET) Received: by mail-lf1-x12d.google.com with SMTP id z26so1886263lfu.8 for ; Fri, 06 Jan 2023 05:14:45 -0800 (PST) Received: from fedora.. ([195.234.76.149]) by smtp.gmail.com with ESMTPSA id f14-20020a0565123b0e00b004b7033da2d7sm150221lfv.128.2023.01.06.05.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 05:14:44 -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: 16d71d02-8dc4-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=V/C7mq9n+LLhC4Y4ZbcEJdqsm6p7eqTbyDE7iupd4oI=; b=DmPgp211+8J2th3XIdLG7IFTx4S08FyDzOd2EKY33xrDl/G3AFncyIEwd9hidIynjW My5wV8H1swatr8xVCeu/nA4fhbDyYXH215UKAkYHa/zjrp9Gws+38Z0SsYUN1qcFFlVS rbuwrpYwBVF7X3vdf8bKHyA62wshCC0L+uXcVvoBk/Rr8XdlqLdoiJCiSiST7hPNYHVG bwBJ1t1ISSHFQfFYPJ9W79L+cI51pnkYJ0WQScbMrNDxRYFC9gaAJUsN5oAuuwX10gj6 VJ+sERai9LxYoUtqqt3lpvj1a3yeLGGtY+m4VUcEfkRPxvXvNfUJ5SmYw0VU59TpGiu8 vevg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=V/C7mq9n+LLhC4Y4ZbcEJdqsm6p7eqTbyDE7iupd4oI=; b=NnkWNNRrOhmeW9ToyNCn7stmnwK2/uLmmA2pUXs4BQzMTP+qb0vuO3bJ76tfXOwC4A nD4ioATkBrNxHEWERPXobYdVR+QkDLa5Y+23oZKGHJTrYaMQZFvppysDvrH6Hqt6jp9V Hx/vCtfxDQX1bPD3J1V/qInD0QL482p5YXYYuMihOi/rifWPaoyHk+n75RsnDlcrID08 QFUbj1RVeiu9cenpbfWCx9gHzOoQw3U5vlJKCyJcZnmBrUetzGU3qurpvSTqzFdeUa8l d14rkFt2/Dz8WEneNpt9FwPquKLOra1YZoHUpjZEbBYxl/VCbrjj/eKA80PEwydiOMbZ QGaQ== X-Gm-Message-State: AFqh2kpQm1xgce9MP5LoGvanJpv00kkSmKBAX96JBrCOcyKqVzSkHOK4 jCDGqYQrvpr8sYL1dBh6P8xyJfzL61IzToK6 X-Google-Smtp-Source: AMrXdXuzdj7/0NVCbmFTZQ7fqbaayzfjRYlIo5wrF/b9HwI6nUYbU6E3dM8LqLQZDIL0pVc1/Rrufg== X-Received: by 2002:a05:6512:16a8:b0:4b5:b7ba:cae with SMTP id bu40-20020a05651216a800b004b5b7ba0caemr16054266lfb.48.1673010884899; Fri, 06 Jan 2023 05:14:44 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , George Dunlap , Jan Beulich , Julien Grall , Wei Liu Subject: [PATCH v1 5/8] xen/include: include in Date: Fri, 6 Jan 2023 15:14:26 +0200 Message-Id: <940bf18969634564fa5d206d02eb2a116c9e0ea0.1673009740.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1673010912258100011 Content-Type: text/plain; charset="utf-8" should be included because second argument of early_puts has type 'size_t' which is defined in Signed-off-by: Oleksii Kurochko Acked-by: Julien Grall --- xen/include/xen/early_printk.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/include/xen/early_printk.h b/xen/include/xen/early_printk.h index 0f76c3a74f..abb34687da 100644 --- a/xen/include/xen/early_printk.h +++ b/xen/include/xen/early_printk.h @@ -4,6 +4,8 @@ #ifndef __XEN_EARLY_PRINTK_H__ #define __XEN_EARLY_PRINTK_H__ =20 +#include + #ifdef CONFIG_EARLY_PRINTK void early_puts(const char *s, size_t nr); #else --=20 2.38.1 From nobody Thu May 2 22:49:10 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=1673010915; cv=none; d=zohomail.com; s=zohoarc; b=bAlG78htCUa3mN0kgGh+fTLgMyyULuFpE2W2sR7PprWMwaCfJsjFzQG3224UFB4S5fl1qklgkMGa8VD/u/F/FUnKqzZAxCinq7/wFFVd/pJZDRQ7PLfBd8E//6Y4MGmNh8MNEk4eSERi3jCnjTrK2GBw4+haVVXfUw2x2FWdOUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673010915; 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=deWE8GI9Ntl4m3olds6B452/c7DgLQANjeRayM/Lyr4=; b=SQ//pKQvlbVSISvMj8EjUAGI1/H24/AaZrbHeBN2//Dx/cjOT86sElMMAjzFBVVHVLDr8yx0qYWKzBVWl2H7XICzOx/8iAhg6TIdcrx18JdTqPWcMNksBRLGzlHLgUL3q5jPNAsEgKpKzNQvh1MQahioXpGxDq/POr0mbrzTaZ8= 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 1673010915228704.3103184019653; Fri, 6 Jan 2023 05:15:15 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.472547.732851 (Exim 4.92) (envelope-from ) id 1pDmYc-0004fO-NY; Fri, 06 Jan 2023 13:14:50 +0000 Received: by outflank-mailman (output) from mailman id 472547.732851; Fri, 06 Jan 2023 13:14:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pDmYc-0004ef-FG; Fri, 06 Jan 2023 13:14:50 +0000 Received: by outflank-mailman (input) for mailman id 472547; Fri, 06 Jan 2023 13:14:48 +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 1pDmYa-0003zy-CY for xen-devel@lists.xenproject.org; Fri, 06 Jan 2023 13:14:48 +0000 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [2a00:1450:4864:20::130]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 176521e3-8dc4-11ed-b8d0-410ff93cb8f0; Fri, 06 Jan 2023 14:14:46 +0100 (CET) Received: by mail-lf1-x130.google.com with SMTP id bu8so1902321lfb.4 for ; Fri, 06 Jan 2023 05:14:46 -0800 (PST) Received: from fedora.. ([195.234.76.149]) by smtp.gmail.com with ESMTPSA id f14-20020a0565123b0e00b004b7033da2d7sm150221lfv.128.2023.01.06.05.14.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 05:14:45 -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: 176521e3-8dc4-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=deWE8GI9Ntl4m3olds6B452/c7DgLQANjeRayM/Lyr4=; b=KkPDjBNkaIRh+ppwZJdsQCOYaVYRO59kzdiLFP1dy8UBa5sP3DpybFKTltLHwEWE5g KAYOkw4Ci8qbPUnqpCIYzjYOAAvc5e5XHrQJWr5LnptUGHBoVk2xY8Q+UTnTPPfYY1nB uEVVSm42l9BMNhgPTuLO4qNUCxGOzEIZmVmRuXkZleKJbitUzjbO8a+s4sZMXEM8PAkF EbAeJCKxY0SikI/TczNSG4E2MiRweJNsScgLFwAnlxnoQd/3S2zzPPQjcB5/dBm1SCrC wn8XpSFiW60HixsnBnthHs0wFp2MdPqZspdADTGemwPHVSi7qrXnDJopky9SG7Vmw21Y DLzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=deWE8GI9Ntl4m3olds6B452/c7DgLQANjeRayM/Lyr4=; b=0zdFsieWuRshahHRoaJ9HeeX6qiAUOeXOnenmFvBW1lo5+x1Jlz48JYZOaX5ph/nox dVSTAVu/bbX4OA51/snCrLS/2JX7soPJBiwhEmnvYNrKTD9CZRcdRbB1U//ZC5BBqWiD NMxl+oQsSQo/G1p5gxgIGcfQ5KYDv+VvcVd3PSdw5I9PfmlzeNU7dqGc83s7F39ThWCV 6EsYLKov/07OP7tgaI1o8fLj2eF/QTkEdvePfODSK25Xl7/L/QiotQDyltA//kgWtNVV 9BzDyz8cS7Zhy5O1JefXeMy5mHDGMMfsjyN8bpnJu7/9qprHyYC4gsAcwUKJovwKIBTB Pzyg== X-Gm-Message-State: AFqh2kq8jRR7RN1xDTOzD+E+o/gcHn7QfqfLcsVzimM4kDQuEIlwAnxV jgbOMKD+Bc47tu+Ti7e2Ma/+8U9pxGokCBR6 X-Google-Smtp-Source: AMrXdXtd7Mm879/iojPZdzolaaaSsCDSS6dg4V03gg7DzzioaB2FFkJaTLjtD/LgOltwFLEIDf5Tag== X-Received: by 2002:a05:6512:4020:b0:4b6:f595:89a7 with SMTP id br32-20020a056512402000b004b6f59589a7mr16272641lfb.14.1673010885964; Fri, 06 Jan 2023 05:14:45 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v1 6/8] xen/riscv: introduce early_printk basic stuff Date: Fri, 6 Jan 2023 15:14:27 +0200 Message-Id: <3f30a60729b45ee01adc2d4c0eec5a89bb083abd.1673009740.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1673010916215100001 Content-Type: text/plain; charset="utf-8" The patch introduces a basic stuff of early_printk functionality which will be enough to print 'hello from C environment" Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/Kconfig.debug | 7 ++++++ xen/arch/riscv/Makefile | 1 + xen/arch/riscv/early_printk.c | 27 +++++++++++++++++++++++ xen/arch/riscv/include/asm/early_printk.h | 12 ++++++++++ 4 files changed, 47 insertions(+) create mode 100644 xen/arch/riscv/early_printk.c create mode 100644 xen/arch/riscv/include/asm/early_printk.h diff --git a/xen/arch/riscv/Kconfig.debug b/xen/arch/riscv/Kconfig.debug index e69de29bb2..940630fd62 100644 --- a/xen/arch/riscv/Kconfig.debug +++ b/xen/arch/riscv/Kconfig.debug @@ -0,0 +1,7 @@ +config EARLY_PRINTK + bool "Enable early printk config" + default DEBUG + depends on RISCV_64 + help + + Enables early printk debug messages diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile index 60db415654..e8630fe68d 100644 --- a/xen/arch/riscv/Makefile +++ b/xen/arch/riscv/Makefile @@ -1,6 +1,7 @@ obj-$(CONFIG_RISCV_64) +=3D riscv64/ obj-y +=3D setup.o obj-y +=3D sbi.o +obj-$(CONFIG_EARLY_PRINTK) +=3D early_printk.o =20 $(TARGET): $(TARGET)-syms $(OBJCOPY) -O binary -S $< $@ diff --git a/xen/arch/riscv/early_printk.c b/xen/arch/riscv/early_printk.c new file mode 100644 index 0000000000..f357f3220b --- /dev/null +++ b/xen/arch/riscv/early_printk.c @@ -0,0 +1,27 @@ +/* + * RISC-V early printk using SBI + * + * Copyright (C) 2021 Bobby Eshleman + */ +#include +#include + +void early_puts(const char *s, size_t nr) +{ + while ( nr-- > 0 ) + { + if (*s =3D=3D '\n') + sbi_console_putchar('\r'); + sbi_console_putchar(*s); + s++; + } +} + +void early_printk(const char *str) +{ + while (*str) + { + early_puts(str, 1); + str++; + } +} diff --git a/xen/arch/riscv/include/asm/early_printk.h b/xen/arch/riscv/inc= lude/asm/early_printk.h new file mode 100644 index 0000000000..05106e160d --- /dev/null +++ b/xen/arch/riscv/include/asm/early_printk.h @@ -0,0 +1,12 @@ +#ifndef __EARLY_PRINTK_H__ +#define __EARLY_PRINTK_H__ + +#include + +#ifdef CONFIG_EARLY_PRINTK +void early_printk(const char *str); +#else +static inline void early_printk(const char *s) {}; +#endif + +#endif /* __EARLY_PRINTK_H__ */ --=20 2.38.1 From nobody Thu May 2 22:49:10 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=1673010911; cv=none; d=zohomail.com; s=zohoarc; b=At1ML6VHOPnrTKmat7dnknWKE2hUCavG1ll9hsfswFe93xSiOtYfwFNNC4aP7ynadrlh5ZicoZaIpglgCdyhT2WK/z4WF86KBkwt0k+OfUECbdPy2xP+XSFR+ePZjwMhLlCU31qVmM8BSqPsrqmUWzNR/a5TUcgkrf9r2uQY8rw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673010911; 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=/Qi8VnEIuZ7tu3k7g7nrwofraJgO1NpoRR5W+cQW214=; b=WQk1WlkerRWjQrdYZWkDqFapzbcsR08tswgG8hLMdGOqQW75IINEiwjy1lEeZRWuM4dXu+Hzx9AdLV/TSn2u4po66QMwmPITSO2o5PqGS5LHaG93SsTNAnyo4sOOWKQ9ooxx/BmEbEboPwVpyhccZAN9g1seXMikKq1Y8mRZjRk= 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 1673010911039966.7584508546131; Fri, 6 Jan 2023 05:15:11 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.472546.732847 (Exim 4.92) (envelope-from ) id 1pDmYc-0004b0-9A; Fri, 06 Jan 2023 13:14:50 +0000 Received: by outflank-mailman (output) from mailman id 472546.732847; Fri, 06 Jan 2023 13:14:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pDmYc-0004ZS-0y; Fri, 06 Jan 2023 13:14:50 +0000 Received: by outflank-mailman (input) for mailman id 472546; Fri, 06 Jan 2023 13:14:48 +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 1pDmYa-0002z5-5I for xen-devel@lists.xenproject.org; Fri, 06 Jan 2023 13:14:48 +0000 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [2a00:1450:4864:20::12f]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 180c2e86-8dc4-11ed-91b6-6bf2151ebd3b; Fri, 06 Jan 2023 14:14:47 +0100 (CET) Received: by mail-lf1-x12f.google.com with SMTP id cf42so1914091lfb.1 for ; Fri, 06 Jan 2023 05:14:47 -0800 (PST) Received: from fedora.. ([195.234.76.149]) by smtp.gmail.com with ESMTPSA id f14-20020a0565123b0e00b004b7033da2d7sm150221lfv.128.2023.01.06.05.14.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 05:14:46 -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: 180c2e86-8dc4-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=/Qi8VnEIuZ7tu3k7g7nrwofraJgO1NpoRR5W+cQW214=; b=IUO9MIUCR9uzevVnoE6Q5BoLbKRfVemQHPUHAEoYTQT3tphPo6e4/4rUj/rYQLAvQX 5iqss+xdYJai0JXiu5wZ8CbZrItkTyIG0h28Xdz/rgcuE4tUCZxm9SKAcs6jjj31yu68 AUm0+UBq8a3vRf90sO+kGhFnD6ZCthJqi5ifsGvZpMomyC4JBhCISalm6Tmcs49jMoE3 Z0kSgzSdSlTeV//BPmlZIOl5GMM7wXL5GC/Avh7rhY4HXo3xbWF3sAGJuWH0yu4ipGUH VyyDRfok7u/KqekTkgoRn2mNY6Fx2E4YnoHWhOQXyg86MbWAgijpBqtre+bLF+hpV2dT trGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=/Qi8VnEIuZ7tu3k7g7nrwofraJgO1NpoRR5W+cQW214=; b=z1goe7/QVe31MFZFwXDra6gie3EfYvBWLMPL6THzaQTzWLM4jE7AL1dxRRNOpRFCpH aEME83JKovQfiioOdQyBwoVg+NH02PejfiAOCzP4+sNHZdkkUy48XR/8ZKAZWVhDVND1 R0RLBczI+Iwm5lclOmrQPDgBygJ70J1W76ek0nrKrr19L0VoyeuU3DY/2B8FFLyiq0vl Y+RMgMEgF7eblVV+jBvIbGuxOLV/CqboBcD+MCdglt+UEagPyQFl1peAJUSqc6bNhRz7 wxE3p6ewQnHFtFotb4F/zvzloinckwlPaZxGy7VKr7boW8N2dM2ZKn9HxQ6tPAzTPL88 MwAg== X-Gm-Message-State: AFqh2kr7+gd46GFlM1LUT1c1U/rP5EYIJ/cUK8sApLKMGtivicz3cLHM u1C8aFv9sDkUKpBO7AmLFrntlEnnMeXCWTnZ X-Google-Smtp-Source: AMrXdXsxlHbO2bPPbcGhGWP/ZxA8JWr/SwPBqT0WRMNphDupmhWfQ7F9toeww1dIfqqiphwz81zoYA== X-Received: by 2002:a05:6512:308f:b0:4cb:1645:7259 with SMTP id z15-20020a056512308f00b004cb16457259mr11225608lfd.61.1673010886967; Fri, 06 Jan 2023 05:14:46 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v1 7/8] xen/riscv: print hello message from C env Date: Fri, 6 Jan 2023 15:14:28 +0200 Message-Id: <21fb02aa340fe3a7a95dfbb950b33ae7a363496e.1673009740.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1673010912178100009 Content-Type: text/plain; charset="utf-8" Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/riscv64/head.S | 4 +--- xen/arch/riscv/setup.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S index ddc7104701..4e399016e9 100644 --- a/xen/arch/riscv/riscv64/head.S +++ b/xen/arch/riscv/riscv64/head.S @@ -5,6 +5,4 @@ ENTRY(start) li t0, PAGE_SIZE add sp, sp, t0 =20 -_start_hang: - wfi - j _start_hang + tail start_xen diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index 2c7dca1daa..785566103b 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -1,6 +1,18 @@ #include #include =20 +#include + /* Xen stack for bringing up the first CPU. */ unsigned char __initdata cpu0_boot_stack[PAGE_SIZE] __aligned(PAGE_SIZE); + +void __init noreturn start_xen(void) +{ + early_printk("Hello from C env\n"); + + for ( ;; ) + asm volatile ("wfi"); + + unreachable(); +} --=20 2.38.1 From nobody Thu May 2 22:49:10 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=1673010911; cv=none; d=zohomail.com; s=zohoarc; b=ZpBnruF1XDSbjQtFpGvPuB7JbfmUH0nCojYLjUwbzqBSwmTrZi7Kh6ENUZk8LdpoI1Ji92B+WgbR8M5GgrwEWlAUcselMUcWckKCB73uqSLUGPh7E1kq0WOTU1TMx6tDeh0jrXRIOvphruYbIy44qRiGrn37LgEKFBcModGgphg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673010911; 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=zkuUnAoSkk9s+gFXJpwU6jCUW0aPzs/gF76MvPyHXnI=; b=Z5335gAJnwr8cDJ5At+sbdTfZUnwNB420DbPqmGo+rcnyM/h2VsMkfHVn+dnXPmYGs+y2QkHqUp7MO+edpH86ivEhAOI2DZU10CcYQfIGJlqswcHzaTYsp9Q2devnZWApHKMHwnlaI+qpKz7VvfS/Sq1p6aUEAhNC6pWnj1hdPY= 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 1673010911691372.32713459134493; Fri, 6 Jan 2023 05:15:11 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.472548.732867 (Exim 4.92) (envelope-from ) id 1pDmYe-00059H-BB; Fri, 06 Jan 2023 13:14:52 +0000 Received: by outflank-mailman (output) from mailman id 472548.732867; Fri, 06 Jan 2023 13:14:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pDmYe-00057p-41; Fri, 06 Jan 2023 13:14:52 +0000 Received: by outflank-mailman (input) for mailman id 472548; Fri, 06 Jan 2023 13:14:50 +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 1pDmYc-0003zy-5N for xen-devel@lists.xenproject.org; Fri, 06 Jan 2023 13:14:50 +0000 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [2a00:1450:4864:20::135]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 18918d88-8dc4-11ed-b8d0-410ff93cb8f0; Fri, 06 Jan 2023 14:14:48 +0100 (CET) Received: by mail-lf1-x135.google.com with SMTP id bt23so1893102lfb.5 for ; Fri, 06 Jan 2023 05:14:48 -0800 (PST) Received: from fedora.. ([195.234.76.149]) by smtp.gmail.com with ESMTPSA id f14-20020a0565123b0e00b004b7033da2d7sm150221lfv.128.2023.01.06.05.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 05:14:47 -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: 18918d88-8dc4-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=zkuUnAoSkk9s+gFXJpwU6jCUW0aPzs/gF76MvPyHXnI=; b=MVGTWNTTVQ4gdBPkwAo6PykkJ/JZNdEmbXh+V9u38VeofVDL6lNjpAk8ebSnjOy2aC qdLCnQD+QuMrhICGYxaMiQjun2jKwVFXKP+D+RGUuQ8/NnBlnGiAymNJ+tVOGEdV39T4 hYUvy4IYESRjdG7JvciMGqn+fDjDRtJTPGZI+ZrdYeRG9gwdj3qMjkacvklP4Hml+O2/ zbDxQY3UwHMbjR6fq/YTOZSb0EmYs3XrB3pAcrUfObI5XefUYO75+bAAyoBcZcWktlOs fQRD2eR4Rjy9b/ghj/nGUgUiiWydaIrR42doT6+DO44J8H2wblCMCupD0rV6CukG3VaH HSPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=zkuUnAoSkk9s+gFXJpwU6jCUW0aPzs/gF76MvPyHXnI=; b=W8TdNl3tHDppVRxm80uT4J3Ub7KUvhuqmKNlk3k+2wOwyPtAfMtixr61r9b+jjeT1N S1uVJ65AjV5LYw6YPLk9UGW4o8JY5LquhjEiOyXPYAKTE3FFBiNUEG1VbgF6jQc8kaSt EPkzXZBDXUtvbln0CD6Whj/iclLSgyq8VjfrJURQkzgRwfloDtOMOd3H0VeVb+mQ81mC fFrxzdG5yLW0mPGKMjzhFUmDhUKl9IeEJUo6KxjiML15Rd9Fv5eiUKiKfuCyGYddvVtB VQ0n8QcgNn5bBNsy6bPmNxYj79FhRUnPRcjvGwR3larjU9hDzacUSoLe+pOWY4BZvwvX kbLw== X-Gm-Message-State: AFqh2krlsZ14pK5xLJzAlW7U5jb7oYk5/ckd9GvnCJ072d5Ec8BZitHl parp1EziKAR36dyAB7mWXh1dBoG2of7SucNy X-Google-Smtp-Source: AMrXdXuUGrBpflnPuMb2DD1qolCCvG4jfT8bJ+rtMFDENSeIxdQCNUSBSPGNfD78+DSR6H0Ar5nG1Q== X-Received: by 2002:ac2:53ab:0:b0:4cb:145d:c407 with SMTP id j11-20020ac253ab000000b004cb145dc407mr9542521lfh.7.1673010887872; Fri, 06 Jan 2023 05:14:47 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Doug Goldstein Subject: [PATCH v1 8/8] automation: add RISC-V smoke test Date: Fri, 6 Jan 2023 15:14:29 +0200 Message-Id: <90078a83982b37846e9845c8ffc50c92f3be1f47.1673009740.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1673010912265100012 Content-Type: text/plain; charset="utf-8" Add check if there is a message 'Hello from C env' presents in log file to be sure that stack is set and C part of early printk is working. Also qemu-system-riscv was added to riscv64.dockerfile as it is required for RISC-V smoke test. Signed-off-by: Oleksii Kurochko --- automation/build/archlinux/riscv64.dockerfile | 3 ++- automation/scripts/qemu-smoke-riscv64.sh | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 automation/scripts/qemu-smoke-riscv64.sh diff --git a/automation/build/archlinux/riscv64.dockerfile b/automation/bui= ld/archlinux/riscv64.dockerfile index ff8b2b955d..375c78ecd5 100644 --- a/automation/build/archlinux/riscv64.dockerfile +++ b/automation/build/archlinux/riscv64.dockerfile @@ -9,7 +9,8 @@ RUN pacman --noconfirm --needed -Syu \ inetutils \ riscv64-linux-gnu-binutils \ riscv64-linux-gnu-gcc \ - riscv64-linux-gnu-glibc + riscv64-linux-gnu-glibc \ + qemu-system-riscv =20 # Add compiler path ENV CROSS_COMPILE=3Driscv64-linux-gnu- diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/= qemu-smoke-riscv64.sh new file mode 100755 index 0000000000..e0f06360bc --- /dev/null +++ b/automation/scripts/qemu-smoke-riscv64.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -ex + +# Run the test +rm -f smoke.serial +set +e + +timeout -k 1 2 \ +qemu-system-riscv64 \ + -M virt \ + -smp 1 \ + -nographic \ + -m 2g \ + -kernel binaries/xen \ + |& tee smoke.serial + +set -e +(grep -q "Hello from C env" smoke.serial) || exit 1 +exit 0 --=20 2.38.1