From nobody Sat Apr 27 18:36:29 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=1673279244; cv=none; d=zohomail.com; s=zohoarc; b=l6PVqxnqNJQdODGBpgb5ZD3aWNBP/LohmuAgiHc0o0mlH5fqhcp5MtV+ilrOrR3UXOxKV7Qk3XxfLZC2hBUE2U7X03k5qqxwMIa4vmYyLxFehSCjBelkoRQCSRlZ2wiyyKyppNeMmtPknE03BoeHgBMWSD8z+aZL07FU/UnuKsA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673279244; 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=yxR8yQrVeJYFYtv18lIm8lC/4hVNKMWmQGoHK/HMNYg=; b=dsqMS+JCu8pBBpzQ6KHtH/KjJjfJVWoGI1gyRuQkbNXaFF+tQCK4hQ3oi9MlEWVX5LsACjFMTaO4GpCVGL9bfL+NxzTzhujnmqmaval+MMdR9DJQsEu7KOEPKySnMnokHWWT0TYG8cBm3x/Wx3SEv/iFSG8mvkiODxxgrJ9aDVM= 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 1673279244371584.0993058783694; Mon, 9 Jan 2023 07:47:24 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.473747.734495 (Exim 4.92) (envelope-from ) id 1pEuMb-0001eS-VJ; Mon, 09 Jan 2023 15:47:05 +0000 Received: by outflank-mailman (output) from mailman id 473747.734495; Mon, 09 Jan 2023 15:47:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pEuMb-0001eL-Ri; Mon, 09 Jan 2023 15:47:05 +0000 Received: by outflank-mailman (input) for mailman id 473747; Mon, 09 Jan 2023 15:47:05 +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 1pEuMa-0001Ok-VG for xen-devel@lists.xenproject.org; Mon, 09 Jan 2023 15:47:04 +0000 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [2a00:1450:4864:20::636]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id dc623eab-9034-11ed-b8d0-410ff93cb8f0; Mon, 09 Jan 2023 16:47:03 +0100 (CET) Received: by mail-ej1-x636.google.com with SMTP id jo4so21168042ejb.7 for ; Mon, 09 Jan 2023 07:47:03 -0800 (PST) Received: from 2a02.2378.102e.bce5.ip.kyivstar.net ([2a02:2378:102e:bce5:dfc0:9312:b994:6b21]) by smtp.gmail.com with ESMTPSA id 22-20020a170906311600b0082535e2da13sm3851561ejx.6.2023.01.09.07.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 07:47:02 -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: dc623eab-9034-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=yxR8yQrVeJYFYtv18lIm8lC/4hVNKMWmQGoHK/HMNYg=; b=MbfkYVQ21dyKLh0n1Yq8pvnM6WE4dqWitMH1Q14NyKLDFl9bDMfQKTQDnwjA2JmXDc 99p/3TMEdJ5o+TUivAORi3ew2+4FRY0D3NvOGwi1nUkMa402TjOowdFxlZgaqRnjz0dX AmASVl2pEpkya66dzeJ9Beua3rAIbKil93GWaoMsluzUMhkCjkehqXp4rrC1Q04RPciy kqweKCTzoRzNadmxtEK8rgOpoChkJssmd4GV6M8siXBJ1cgM9k+Fr6+mMkKhmNprBYs2 9gy9fGkhqDMI35pcyw+Vx0KgzW3RddIg4yk7WbQk8ESfVbUalfBMvQC7SQNCuTZmqHlG Yxfw== 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=yxR8yQrVeJYFYtv18lIm8lC/4hVNKMWmQGoHK/HMNYg=; b=JQnDK2sNoOv3d/OgIMwxQusymbKmCIUuI6df0MyKTXBz4lyI6/WMYoyNcjF1oKV4/M 0kGGX5uviMHNIuJVJRtyOq7Xpv2CdnTYat7b615AV3ScyaR3vi1X+cgADWAKjvSTr+7q CV3mHzb7sn+Ro2OQKWA39Jkqz8m+HZIlayBeAjPj8UquNWbpQG15Trt1LALDlIuYQcIy clFoiScw06gv3pJnCAkWl6lXZSrdjhS6fJoROZfNzbu4jbq93JvX4I30QbTuuVj005Tw Tm9IyvsgP9vi6cbfg7vzZNgCzVdz5Y1cqI/u2m2nW9HC4Qb1cxdiVDDo9ZQza2o4HzJX +u1A== X-Gm-Message-State: AFqh2koVgebcjP8fihLk/snYU2SvDj74AT5TTnWhYRdPDtvYmBeY4Poy uJRBo6AQsbWt5nY7/6rTGvS977EELL8c5A== X-Google-Smtp-Source: AMrXdXvkuJjLqc1ipzuRLKNWMvua3yBg6XMcbn6YVmn6JREdqV4ci4d6f62zaxqkCK+t4sEfWHylHQ== X-Received: by 2002:a17:907:a0cc:b0:78d:f455:b5fa with SMTP id hw12-20020a170907a0cc00b0078df455b5famr55538052ejc.58.1673279222751; Mon, 09 Jan 2023 07:47:02 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Julien Grall , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v2 1/8] xen/riscv: introduce dummy asm/init.h Date: Mon, 9 Jan 2023 17:46:48 +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: 1673279245393100003 Content-Type: text/plain; charset="utf-8" The following patches require which includes Signed-off-by: Oleksii Kurochko --- Changes in V2: - Add explanation comment to the comment message --- 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 Sat Apr 27 18:36:29 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=1673279245; cv=none; d=zohomail.com; s=zohoarc; b=aAzFWfCfWbcnkQt5R/zTFCDOOHL2nGpe25Xz7QIoL8tfXvFQX03s1Au+wT+SaoRB16Yv2XUaX/dlrjprPlksakQiL/1pixtyRlmEpjHDPwno6Nv9IxHo5w8DZ7tvAhf17J8XISC7I79nWfen83Hsp9h/oUykZoKNymia5hOW+mc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673279245; 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=MwR1sb54ILTyXGbtU2ZO9pB2xjozIDX5an4zwc8vv24=; b=SxPOzX8hvVghD6vqaoY9US7UZiTGTxVwg4aU0/bErzQ5XBkQXbxTOIuPOG9rbib50nIUAKX9C8tEduuPPzSkAY4X6lHXqsAFmE2uX7q9EtJVeJPo0IThDnq4qxirRKTmgdq0Daen0TmLxd3oA1ra5vqE8DEGrNjmW9XDptjX1bY= 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 1673279245781509.8505034303521; Mon, 9 Jan 2023 07:47:25 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.473748.734506 (Exim 4.92) (envelope-from ) id 1pEuMe-0001vT-8B; Mon, 09 Jan 2023 15:47:08 +0000 Received: by outflank-mailman (output) from mailman id 473748.734506; Mon, 09 Jan 2023 15:47:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pEuMe-0001vF-2z; Mon, 09 Jan 2023 15:47:08 +0000 Received: by outflank-mailman (input) for mailman id 473748; Mon, 09 Jan 2023 15:47:06 +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 1pEuMc-0001Ok-Jv for xen-devel@lists.xenproject.org; Mon, 09 Jan 2023 15:47:06 +0000 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [2a00:1450:4864:20::633]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id dd5f96aa-9034-11ed-b8d0-410ff93cb8f0; Mon, 09 Jan 2023 16:47:04 +0100 (CET) Received: by mail-ej1-x633.google.com with SMTP id gh17so21186565ejb.6 for ; Mon, 09 Jan 2023 07:47:05 -0800 (PST) Received: from 2a02.2378.102e.bce5.ip.kyivstar.net ([2a02:2378:102e:bce5:dfc0:9312:b994:6b21]) by smtp.gmail.com with ESMTPSA id 22-20020a170906311600b0082535e2da13sm3851561ejx.6.2023.01.09.07.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 07:47:03 -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: dd5f96aa-9034-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=MwR1sb54ILTyXGbtU2ZO9pB2xjozIDX5an4zwc8vv24=; b=L7QA222PU0VUvuvMGGBDEY5WIvlPUOE7OnFknuP1vJWZ+5DsSu77SARWSBKusBvSlF VU1828ahEjw5maLmBJNeq0NvYEOVv7cN4Yc+7Wpk6f5gCQHbI6zMLWtEMeM4f+rJbGUU GLADZG2QCj6M1aaCP4RMM8FZxZlEXBozg/y87Fk0OIpQ+4UqwJzzDbdpRU5LhHzLtbdR FnmLP4SWJWlwYO+OXKR/tPpoNmMDgyB7yJnD8osLu0y33H5iVrXt0XqvsDb1K0yyEwY1 6KXhM4Yc5YJBeqRd+XxHwQq3GTR7VDRERVYx26NiJWfltrnzQXI9gMkolZimFpwHKb4I KRkg== 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=MwR1sb54ILTyXGbtU2ZO9pB2xjozIDX5an4zwc8vv24=; b=zwWgHIcYvFw6d94iT7lfj5qeUoj6dCvq+peAHTu/RK/9apxrWeYRsO7/esFgu+cK0E sPnfDz984IYcGoTZ0WcgEm6wVpcjpsCejPjDZxPWntcggaCalxRKASC45TGrToh4Vv/Q EX2QYDsGVKpmr4d6VenaDWcyau7cIf73qu0Q7U3vXMINb6w+kvxhwEkX7CisOktnjstD f2hdKwV5QCG0UI0OWK0xpTvekU6aryD4Ry++hNC8SAQKTas27m1BIpvuXmpV/Y+6OZ6l Nu4OIwjxq7dQO5i7tEjxTzA/Vl0Hq9D4ojaHKpAfPaNkoFqvvlm1bzB763mBaXwGTCKA 0TbA== X-Gm-Message-State: AFqh2koCt9f8BE/bFL1FWOCvDxWO5QxG7o3t2SqwbNxHJYmlMIY0MBJ/ YNhFK22wgSBJEbMRClg8TBZ43rb9ozbo4w== X-Google-Smtp-Source: AMrXdXvL4MYDqwCFCVKx5v3neXASMMTKKrCJr293/g3qz2bXcc55OuB2ZHUZv2Yb9p0KAYzdzrRApA== X-Received: by 2002:a17:907:c018:b0:7c1:bb3:45e4 with SMTP id ss24-20020a170907c01800b007c10bb345e4mr55092176ejc.21.1673279224277; Mon, 09 Jan 2023 07:47:04 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Julien Grall , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v2 2/8] xen/riscv: introduce asm/types.h header file Date: Mon, 9 Jan 2023 17:46:49 +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: 1673279247716100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Oleksii Kurochko --- Changes in V2: - Remove unneeded now types from --- xen/arch/riscv/include/asm/types.h | 22 ++++++++++++++++++++++ 1 file changed, 22 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..fbe352ef20 --- /dev/null +++ b/xen/arch/riscv/include/asm/types.h @@ -0,0 +1,22 @@ +#ifndef __RISCV_TYPES_H__ +#define __RISCV_TYPES_H__ + +#ifndef __ASSEMBLY__ + +#if defined(__SIZE_TYPE__) +typedef __SIZE_TYPE__ size_t; +#else +typedef unsigned long size_t; +#endif + +#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 Sat Apr 27 18:36:29 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=1673279243; cv=none; d=zohomail.com; s=zohoarc; b=NobcUfow2B6EWP06ew3csYyY3RcO27uIbGw6LWw/6Mm6OJdrwg6UG3qQj4OD/8byLanAiTCxrzZ+9JOiKlwUNGlX8bDVNtF/UWRJrCX83rAHmQaFbfJqYlK2bvLkx02qqintWPgVQPtBZKoZVbzD8EvPssrWSgT0YK+3jmhMgIQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673279243; 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=C4pVVB8xi310OysZICNFUHzxHNt1nf/1tEIawtEgWpc=; b=mnTiRXHCfSMFHW+km45xQx+Qjn/GZrvf4Wprgw13BRgCWJeS5y4lRnn+iPDjHEOJlVXoKErSXM2IsP8R2Ly0tEqBP373stg4nqz6uL4vSuU6p8JZXMYXC+v9gAkVUgrP91daR4FtOCuyi9jiZ2hQERB+RA+U7EKTcBBOQK+NufU= 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 16732792435796.1672639390036466; Mon, 9 Jan 2023 07:47:23 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.473749.734517 (Exim 4.92) (envelope-from ) id 1pEuMf-0002CT-G8; Mon, 09 Jan 2023 15:47:09 +0000 Received: by outflank-mailman (output) from mailman id 473749.734517; Mon, 09 Jan 2023 15:47:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pEuMf-0002CK-Bq; Mon, 09 Jan 2023 15:47:09 +0000 Received: by outflank-mailman (input) for mailman id 473749; Mon, 09 Jan 2023 15:47:08 +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 1pEuMd-0001Ok-W7 for xen-devel@lists.xenproject.org; Mon, 09 Jan 2023 15:47:08 +0000 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [2a00:1450:4864:20::633]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id de4035cc-9034-11ed-b8d0-410ff93cb8f0; Mon, 09 Jan 2023 16:47:05 +0100 (CET) Received: by mail-ej1-x633.google.com with SMTP id gh17so21186770ejb.6 for ; Mon, 09 Jan 2023 07:47:06 -0800 (PST) Received: from 2a02.2378.102e.bce5.ip.kyivstar.net ([2a02:2378:102e:bce5:dfc0:9312:b994:6b21]) by smtp.gmail.com with ESMTPSA id 22-20020a170906311600b0082535e2da13sm3851561ejx.6.2023.01.09.07.47.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 07:47:05 -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: de4035cc-9034-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=C4pVVB8xi310OysZICNFUHzxHNt1nf/1tEIawtEgWpc=; b=kNznxBbLQ/4OzsvHOcyh305lnTxgPvZLv3vD3O3+3t2rvt6aQlK2jR9FWI/YWgccMR VnOLnSUqE5mRKfrWnTx5LnR/uY5RTG19nJbjQfeRGpP0HroB+cNeuq8kvYvuzNEfB6Y7 LZeBtMr4+OT/q2y9RcYnguf9AzjQTdSysXaxgLNDRiMHDFCmdoBu6CX3Wdx0bxeknvRh 514Z27ruElHq0nZnD8Pjg8TwsRlmHZzzJq4Nz7TqjZixZRCcEg7ywvHVv1ofF6s/ImLU c+3L4nvMpi46mwBb/xzHI7WBKmzYuKFltG4gvld1iYtB+M7EE/5rMUt5glnSFpteonxa mjKA== 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=C4pVVB8xi310OysZICNFUHzxHNt1nf/1tEIawtEgWpc=; b=ypIV5VZkjbRbd6nY6erMjqjPBMsfvBzBnPeyzvti10vbBJLwmOk/zVd/Wg4KRLD9mG BCRvQ3Kuz1iDtcgvlpkfwWNzO3irgTAPT+1w+AkdQIJEV+fZRGha9z1z+pyGJTvI3buZ Lo1E1WgcfOB4NAmDV6UmrAMPWesXyIjIJ340S46tNwBMtew6rC2TDFNcR3HSbO5C1H7t 1+CGFfWl3OGcN0NDT5s9wbFwGGjPRTi08LsNRtuxzLf529CCOM8c+6NJll9qipwm5bie hFYGPaXaQjCDOh/erx348I5nebmIgK3Ye6qv3nm1yTl+3nqyNfmE4wC7DFyPiEmcg0q0 yXxg== X-Gm-Message-State: AFqh2kpvM/1U/h//2TsdLUtO3mcgpfQ/4Zp5f+C/EtN+GnmNcsAHgPUO QueGCrR40cOxKUeXZ8x7QjBoSmYujhaIOg== X-Google-Smtp-Source: AMrXdXt8ZBw2EErZkpU2Gr1NDyBk7nJqtVGI5o2yHEP4kiLKvjxrGf5Shm7rPDwNPBmK4Z4OloPCAQ== X-Received: by 2002:a17:907:d604:b0:7ad:d62d:9d31 with SMTP id wd4-20020a170907d60400b007add62d9d31mr58787345ejc.67.1673279225854; Mon, 09 Jan 2023 07:47:05 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Julien Grall , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v2 3/8] xen/riscv: introduce stack stuff Date: Mon, 9 Jan 2023 17:46:50 +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: 1673279245398100004 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 --- Changes in V2: - introduce STACK_SIZE define. - use consistent padding between instruction mnemonic and operand(s) --- xen/arch/riscv/Makefile | 1 + xen/arch/riscv/include/asm/config.h | 2 ++ xen/arch/riscv/riscv64/head.S | 8 +++++++- xen/arch/riscv/setup.c | 6 ++++++ 4 files changed, 16 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/include/asm/config.h b/xen/arch/riscv/include/a= sm/config.h index 0370f865f3..bdd2237f01 100644 --- a/xen/arch/riscv/include/asm/config.h +++ b/xen/arch/riscv/include/asm/config.h @@ -43,6 +43,8 @@ =20 #define SMP_CACHE_BYTES (1 << 6) =20 +#define STACK_SIZE (PAGE_SIZE) + #endif /* __RISCV_CONFIG_H__ */ /* * Local variables: diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S index 990edb70a0..c1f33a1934 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, STACK_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..41ef4912bd --- /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[STACK_SIZE] + __aligned(STACK_SIZE); --=20 2.38.1 From nobody Sat Apr 27 18:36:29 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=1673279248; cv=none; d=zohomail.com; s=zohoarc; b=YfPr5IQCHkzd6YPWvpd7WMxopVGlK3cLPVwfqdHWYC/ewEzDz1BXvtLlb9y3WUqdYrLtYKOcltbg9d1k2E+bKNPuABiU7/MRLiId3WDOsDtlg7twaFBHgG/vMpQPH812u5h5rMi7TCNuVtNIVQlzKUEmD0XtYCLpC4xDQXeBSy0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673279248; 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=UWY8J8kAj1GiWYViPSk623jkw9JIRhe7Xct39qK260A=; b=Fdbd+0/ORJ6rSsPqUCWfErFJH1lhauPpEu4rivQF34hCNZwf/gGNKEnJ5W+T/dr+4zPaVsmTsD5HpnWaS716UHskMK3EPkqJawAyt+v6Su3JO3Dj7eksN1g5B3bikw5tfsZ+FOGD/y+1l7xsk2SxST2jj/8pByWkFm9Q4eACzc4= 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 1673279248665881.1714523498958; Mon, 9 Jan 2023 07:47:28 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.473750.734528 (Exim 4.92) (envelope-from ) id 1pEuMg-0002U6-Ss; Mon, 09 Jan 2023 15:47:10 +0000 Received: by outflank-mailman (output) from mailman id 473750.734528; Mon, 09 Jan 2023 15:47:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pEuMg-0002Tr-N2; Mon, 09 Jan 2023 15:47:10 +0000 Received: by outflank-mailman (input) for mailman id 473750; Mon, 09 Jan 2023 15:47:10 +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 1pEuMf-0001Ok-Td for xen-devel@lists.xenproject.org; Mon, 09 Jan 2023 15:47:10 +0000 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [2a00:1450:4864:20::636]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id df406b08-9034-11ed-b8d0-410ff93cb8f0; Mon, 09 Jan 2023 16:47:07 +0100 (CET) Received: by mail-ej1-x636.google.com with SMTP id u19so21089343ejm.8 for ; Mon, 09 Jan 2023 07:47:08 -0800 (PST) Received: from 2a02.2378.102e.bce5.ip.kyivstar.net ([2a02:2378:102e:bce5:dfc0:9312:b994:6b21]) by smtp.gmail.com with ESMTPSA id 22-20020a170906311600b0082535e2da13sm3851561ejx.6.2023.01.09.07.47.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 07:47:07 -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: df406b08-9034-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=UWY8J8kAj1GiWYViPSk623jkw9JIRhe7Xct39qK260A=; b=faYE9gRMjOWUAZnlxR0n2k9ulExL3BU8gI18/Go4uLkUS4fR5scoMfT35S9KZX6uOZ HYcsprc8PFa524gIL0PuYzj83/O0v76JhM9H0K71qV4HBkB1VbcvsHS9CsBandHEWM6v h6RSj/hpZPc6kaZrGllx0TIOL5weII6SDKKXrdHybOsF0lkyVfqUnyMR+QA4cpiiNvAH jJykCOSQewTcwUzVCbX8SQHJeNvHvrZovH3LDTsOph02VLCdUgOFaLKIQ15PUsNNoKTf c4vgdZn2MqTMN0j/Th5xBT2e2TryjD1gKV9oV+Ni4u/sO3SC56gvlhVsd5lqKmhT3lyt Vngw== 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=UWY8J8kAj1GiWYViPSk623jkw9JIRhe7Xct39qK260A=; b=gXMB/0PkkuIUe3w+qUiNu0M81ModaJNGFYTQpRUVuFb9TO70Dgp0Ehz0w6XeOIIuOA AtiKyP8It5zziN7zdb69VmHkGBdUYg6L5ZQxPO/f7LqVsA5Ytd80QP6JQDZ0fhbvCvpr iwdoMdqj9LNiIzMndFwVt/JptU8GLWf7xpCFSIlXH1ZfuovW0dg2HxjvA5sruDmK/tcC hpU40rnLfKETMyPHiyiJMw8Q17WRZLnNgyhRWjIsgGvM1kVZbjPVRGu0OhM0FDx1EcqN uIA0HmoETt52I1e0d069Zs3Ckg9kt+pkML9hRPIHsiEqfeqIq1XjlWTVD1fcAolwZtmC Kvgg== X-Gm-Message-State: AFqh2kodYfOoFdBZB3XrolJPVZdCVJFnOT3DXg+7mTP6otPUxQhe0r7h rH5i3cRBi17eSh0n1Y3AF7Rp+9UTmrO53w== X-Google-Smtp-Source: AMrXdXs1yjbXpCwoz+bkJ3Hs45mkL4PCi7WcVeUtjcR0VS78Hau/5cELtha3tptBw3sIe+pxnYA3NA== X-Received: by 2002:a17:907:d48e:b0:7ae:b2e4:7b3f with SMTP id vj14-20020a170907d48e00b007aeb2e47b3fmr60936186ejc.8.1673279227517; Mon, 09 Jan 2023 07:47:07 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Julien Grall , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v2 4/8] xen/riscv: introduce sbi call to putchar to console Date: Mon, 9 Jan 2023 17:46:51 +0200 Message-Id: <9b85a963db538e4735a9f99fc9090ad79508cb2c.1673278109.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: 1673279249445100003 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 --- Changes in V2: - add an explanatory comment about sbi_console_putchar() function. - order the files alphabetically in Makefile --- 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..fd916e1004 100644 --- a/xen/arch/riscv/Makefile +++ b/xen/arch/riscv/Makefile @@ -1,4 +1,5 @@ obj-$(CONFIG_RISCV_64) +=3D riscv64/ +obj-y +=3D sbi.o obj-y +=3D setup.o =20 $(TARGET): $(TARGET)-syms 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 Sat Apr 27 18:36:29 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=1673279250; cv=none; d=zohomail.com; s=zohoarc; b=kEkeHWWLZmGZP0tTkb7Ob1gkkawxsNJO1ziGilh7an3iMEKnijgDhNUT07laz3zzTFAF+n0yyNybIk+QP61haH2iYWOLUPpcUSdzjwgO84pFN0dQN5yBXqn3c+PuFoshclVEiQ+AYvVM9P0Gu4hK5a7ImrkJYsFwrq4LODQX4OY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673279250; 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=bfnD404WY8hoWXz7M6QxUrNZUgpeIm9YCOZjEZ67MZU=; b=OhLDjAWw2o7l0H11YkITWL8Z4YkumZ9tlBYRlwYOUCRWWkyNzoY+nH8pacGFh9Rkb7Eo+0NjWc87b+TXf+1dzTm8ZC8ElZgAw0HLNmUnDDob31vDlVT7+nH0BG26ZzHjaVIuFb2FLgWR1+6HOYoGoaomn6YJQNUerRuPJ9Xtcr8= 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 1673279250528874.7021846630416; Mon, 9 Jan 2023 07:47:30 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.473751.734539 (Exim 4.92) (envelope-from ) id 1pEuMj-0002om-7b; Mon, 09 Jan 2023 15:47:13 +0000 Received: by outflank-mailman (output) from mailman id 473751.734539; Mon, 09 Jan 2023 15:47:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pEuMj-0002od-4H; Mon, 09 Jan 2023 15:47:13 +0000 Received: by outflank-mailman (input) for mailman id 473751; Mon, 09 Jan 2023 15:47:11 +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 1pEuMh-0001Ok-E9 for xen-devel@lists.xenproject.org; Mon, 09 Jan 2023 15:47:11 +0000 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [2a00:1450:4864:20::633]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id e03e858f-9034-11ed-b8d0-410ff93cb8f0; Mon, 09 Jan 2023 16:47:09 +0100 (CET) Received: by mail-ej1-x633.google.com with SMTP id vm8so21174205ejc.2 for ; Mon, 09 Jan 2023 07:47:09 -0800 (PST) Received: from 2a02.2378.102e.bce5.ip.kyivstar.net ([2a02:2378:102e:bce5:dfc0:9312:b994:6b21]) by smtp.gmail.com with ESMTPSA id 22-20020a170906311600b0082535e2da13sm3851561ejx.6.2023.01.09.07.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 07:47:08 -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: e03e858f-9034-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=bfnD404WY8hoWXz7M6QxUrNZUgpeIm9YCOZjEZ67MZU=; b=kCxCCMt//j+fO82VIWosCsH70bh7+2l51ewWKYmVjIJfFuALEKC6RrRaFxKMsNOt4u mjuZaTPIjMiAaysnpjOfy8Y3sEkrHlR7Oam+CrJ6Axc9x0SVjGV/b/BbWsFHm9jLJk4C h6Jxz1ee4Er1T0sYNM76oBiJYz5GJcC/Oi/yn+WiE7TAayD57bkjlkipn8eTTdtA3Mda 8jN+ffqM/G/pOQo7PkWw5pcIoyRztRVxBOyozQ6qQt9g8X0P57tELOcajQaAdFgG5NjN VRFtwC9G3baHMpe5qGiXbG9ibx0wWj++cniJ4OomX1iPIb3q9Fxrfg9y17pQQ/oMdDlt 5ABg== 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=bfnD404WY8hoWXz7M6QxUrNZUgpeIm9YCOZjEZ67MZU=; b=Km+BtszLjgFniMVsMY8mgkx2qZk6XqPEL4hokzUdgxOx1q8gJywT4w/Iqna9VWFDGF KHK2W1p7OubGUmpMLb13rxQjn/mire/1lmahExJFeMoMnambOAELyxRUPpEgbtYV9U9V CyBFNHjECFVtx5Y/HWQF6wem1Jf0nqIKp/hwK3Ng7SimXZjyn/hjPxl61UCnxbe13BMC C0oh0wqh+N5rf6+vBFeDtP2OR2aE1qxYea2SRUiblN1eoERjTD5nbfwIcjT2K+qD7wzn q0HxdHFfl8k+55ci2vTNLEiXkOddQuVKm2Js1thPsvzBKxfuJ1T6QqYf0JiDtBsM7qX7 0BeQ== X-Gm-Message-State: AFqh2kqTpZgHe36wmdhEVOCG2lrDJl2ZvlBUhxGYB6fFWRnceXW1yGJp G2mEOuHe6hEtzB6hfwMOt69alDR0yLjGWQ== X-Google-Smtp-Source: AMrXdXuqaCYbURIHqb86DXSLX04rTZYHXx+kJoChkuf3VUW7/sB/PJn0ZlqOSpiYG/s00ciULywomQ== X-Received: by 2002:a17:906:8447:b0:7c8:9f04:ae7e with SMTP id e7-20020a170906844700b007c89f04ae7emr55018487ejy.22.1673279229209; Mon, 09 Jan 2023 07:47:09 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Julien Grall , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , George Dunlap , Wei Liu , Julien Grall Subject: [PATCH v2 5/8] xen/include: include in Date: Mon, 9 Jan 2023 17:46:52 +0200 Message-Id: <3b292b680a02e2413ad6d9bd7c64bbe6a71e0d5b.1673278109.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: 1673279251455100005 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 --- Changes in V2: - add 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 Sat Apr 27 18:36:29 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=1673279252; cv=none; d=zohomail.com; s=zohoarc; b=SIm2F3s8pMB7TfQFyFNi7/i5hVauuiSAHleQCSTef/WD7/VAaXGlhH8OOYDyjM5/0Z4qrrL97dP2jtOVAG3d490DNUvOV7gq7aLsfqqfzNIJwXdiShkQHWnDL8d2vBnFnHH3UsGcEVfc38soTuvKSBB9gIJkRDFHxF9KXW75bgE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673279252; 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=a/b1TrvDNNnrrBRjP6bD1TxMqmwHjv5FMfqQgK0ByUg=; b=aMaOhDgyj4xldc8tkdKh+rHdEnBOOphPXuq4Kfoc4bFhTdQc18Xr4dsgFog6kHloB/soN8Q6QuOkFTwNdbklyNuisqiEr/Z1+MT2g7kN6/DCvlo14C1vvA3h8vvktw/VcgbZgQ7DnVaPA67DmHr5ONdXMRSAYREkPbHpvlSrg4Q= 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 16732792528411017.9653012296326; Mon, 9 Jan 2023 07:47:32 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.473752.734550 (Exim 4.92) (envelope-from ) id 1pEuMk-00037L-MO; Mon, 09 Jan 2023 15:47:14 +0000 Received: by outflank-mailman (output) from mailman id 473752.734550; Mon, 09 Jan 2023 15:47:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pEuMk-000373-Hs; Mon, 09 Jan 2023 15:47:14 +0000 Received: by outflank-mailman (input) for mailman id 473752; Mon, 09 Jan 2023 15:47:12 +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 1pEuMi-0002mL-IQ for xen-devel@lists.xenproject.org; Mon, 09 Jan 2023 15:47:12 +0000 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [2a00:1450:4864:20::532]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id e18a58d2-9034-11ed-91b6-6bf2151ebd3b; Mon, 09 Jan 2023 16:47:11 +0100 (CET) Received: by mail-ed1-x532.google.com with SMTP id s5so13089777edc.12 for ; Mon, 09 Jan 2023 07:47:11 -0800 (PST) Received: from 2a02.2378.102e.bce5.ip.kyivstar.net ([2a02:2378:102e:bce5:dfc0:9312:b994:6b21]) by smtp.gmail.com with ESMTPSA id 22-20020a170906311600b0082535e2da13sm3851561ejx.6.2023.01.09.07.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 07:47:10 -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: e18a58d2-9034-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=a/b1TrvDNNnrrBRjP6bD1TxMqmwHjv5FMfqQgK0ByUg=; b=RHU8wslsnUIOk0uJuOjVkpeHjI2zvT+TuWTUPIQBT8VG0gCJcnsUUdUqL0zrx7BlRA Ja4DMX7g8dlejSPSJdZnwcpTPDsROkFouutpy9jfH0AUv9F7DWb7fWnUgiMOgnhcN+cA K4Hj+xck+8lKZu1dWSshADexdjJBAQTgOwlC/i1NBhQIi3kZ/o2eoH6DgZztxByv5P1w DHwTWlWoPPteVHZhczHDwcDpyOGl6QpRVZK6yopgpRQw/CTHxukX5xICpq7Or3ph5OqF KlAilXyN5qRL2hzgdmMicADniLRmtR5lKVR7E7UE+WCLqEsEL/siJoPu+75ViPSuTA2C INCw== 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=a/b1TrvDNNnrrBRjP6bD1TxMqmwHjv5FMfqQgK0ByUg=; b=GfSymHcjSt7Xu7MTBR5v4/x7ncEsdBno0kGeSUMzEFRL48NkdOdmiYZPtHRuYpgu8K cW01tiXfzoLG3OV9ZtKrS5bUalqgFKxJkaB+IfrR5ckR6qiOEQc2/nRrmLpmWDPKOk3p qUkkvS4nITiZKZ7qCTLlGjWNf1BxKoFIqozYddFL6zBqSalDF0+uIst9nStmSAf90uZL EULUqJLAM4ghr2rPlUpzUe2L3S9XP3DRu3RkNxRI7VBuGvHyXpBOHDl/Nvf/ALJp/RT1 SfpX1GhCuBJpJO5xaWfb1NrscgvLgRx8Z8diNfTfHtcDPPQKVkmwU1M7nLX3fTMlC4ga suIg== X-Gm-Message-State: AFqh2koch8JGsQkwHPsAykOgv7SQ/imDE119Oqn7TxWmSFBk5VvsLuy1 ALBWlZ9DDguDQelsB4AJkED5LruIh0dfAA== X-Google-Smtp-Source: AMrXdXsMBfaLg7SGeLcx3dyX1xcH85/vA1FA9saSCXMCHzMRkNQd/aKJMn8Y/yKpnXpS2+KReFwA5Q== X-Received: by 2002:a05:6402:1f89:b0:47b:16c7:492c with SMTP id c9-20020a0564021f8900b0047b16c7492cmr63677275edc.25.1673279230974; Mon, 09 Jan 2023 07:47:10 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Julien Grall , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis , Bobby Eshleman Subject: [PATCH v2 6/8] xen/riscv: introduce early_printk basic stuff Date: Mon, 9 Jan 2023 17:46:53 +0200 Message-Id: <527727b2c9e26e6ef7714fe9a3fbe580caf1ae13.1673278109.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: 1673279253518100007 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". early_printk() function was changed in comparison with original as common isn't being built now so there is no vscnprintf. Because printk() relies on a serial driver (like the ns16550 driver) and drivers require working virtual memory (ioremap()) there is not print functionality early in Xen boot. This commit adds early printk implementation built on the putc SBI call. As sbi_console_putchar() is being already planned for deprecation it is used temporary now and will be removed or reworked after real uart will be ready. Signed-off-by: Bobby Eshleman Signed-off-by: Oleksii Kurochko --- Changes in V2: - add license to early_printk.c - add signed-off-by Bobby - add RISCV_32 to Kconfig.debug to EARLY_PRINTK config - update commit message - order the files alphabetically in Makefile --- xen/arch/riscv/Kconfig.debug | 7 +++++ xen/arch/riscv/Makefile | 1 + xen/arch/riscv/early_printk.c | 33 +++++++++++++++++++++++ xen/arch/riscv/include/asm/early_printk.h | 12 +++++++++ 4 files changed, 53 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..6ba0bd1e5a 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 || RISCV_32 + help + + Enables early printk debug messages diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile index fd916e1004..1a4f1a6015 100644 --- a/xen/arch/riscv/Makefile +++ b/xen/arch/riscv/Makefile @@ -1,3 +1,4 @@ +obj-$(CONFIG_EARLY_PRINTK) +=3D early_printk.o obj-$(CONFIG_RISCV_64) +=3D riscv64/ obj-y +=3D sbi.o obj-y +=3D setup.o diff --git a/xen/arch/riscv/early_printk.c b/xen/arch/riscv/early_printk.c new file mode 100644 index 0000000000..88da5169ed --- /dev/null +++ b/xen/arch/riscv/early_printk.c @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * RISC-V early printk using SBI + * + * Copyright (C) 2021 Bobby Eshleman + */ +#include +#include + +/* + * TODO:=20 + * sbi_console_putchar is already planned for deprication + * so it should be reworked to use UART directly. +*/ +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 Sat Apr 27 18:36:29 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=1673279253; cv=none; d=zohomail.com; s=zohoarc; b=HE9nRUxhXZrebuY/ARxDYrhRoX5qo6mK7+zC0Xs2w7rlBVdQJVtD0ex0+4bd+uG2Tvi08zGijeeRDUm3kGM0yeHOHc9U4GNJ/n0hp5IgZlQ9qatghiKTfHpbebQfVIV4bU5z+RklILW6Dhe2hhOYtRdZzrX2UHBHCixbbpX59fo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673279253; 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=fIal1kdq10TTB4IAGmI/j0NwEpx7kAoI5BB7eBhw2c4=; b=Omt5hW3ULmai6fkOfaGjW1vZAknivd9+eYaNxz68tJQyXe0x02QxM+F4bKHg+9B6UsKyukNv73QOStwJD1bT7F89q5/xHEb4owF0ht19ZC8pY54D8KhwnHNokUpzDKmat4AZGd4tWWkkz3cHD4UWyLjePUHho5TSOQZZOZEYdxk= 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 1673279253379268.2501901414488; Mon, 9 Jan 2023 07:47:33 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.473753.734562 (Exim 4.92) (envelope-from ) id 1pEuMm-0003PR-0m; Mon, 09 Jan 2023 15:47:16 +0000 Received: by outflank-mailman (output) from mailman id 473753.734562; Mon, 09 Jan 2023 15:47:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pEuMl-0003Or-QA; Mon, 09 Jan 2023 15:47:15 +0000 Received: by outflank-mailman (input) for mailman id 473753; Mon, 09 Jan 2023 15:47:15 +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 1pEuMk-0001Ok-UG for xen-devel@lists.xenproject.org; Mon, 09 Jan 2023 15:47:15 +0000 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [2a00:1450:4864:20::62e]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id e24e44e0-9034-11ed-b8d0-410ff93cb8f0; Mon, 09 Jan 2023 16:47:12 +0100 (CET) Received: by mail-ej1-x62e.google.com with SMTP id qk9so21190192ejc.3 for ; Mon, 09 Jan 2023 07:47:13 -0800 (PST) Received: from 2a02.2378.102e.bce5.ip.kyivstar.net ([2a02:2378:102e:bce5:dfc0:9312:b994:6b21]) by smtp.gmail.com with ESMTPSA id 22-20020a170906311600b0082535e2da13sm3851561ejx.6.2023.01.09.07.47.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 07:47:12 -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: e24e44e0-9034-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=fIal1kdq10TTB4IAGmI/j0NwEpx7kAoI5BB7eBhw2c4=; b=X6IzhvtXWr5L9CiA8iGBX4kCz93hvBhLwnP8ZtqJPSMr76fMAiVYmZ3vg8QaDnCgvr bzwQrLc6TMtZ/rCzBEcamajk03RWeXoiecRRdaQr6BEVq3QVGvSmZ3MlC0e+BqMEXQ7D T3ddrQktmO/+w4+jQGLGio6IxcQVEM0hiT1o2QhyTMbxG3FPcUJvpUhCOiiiZ1nmG2zy bWsy+dUeI8em63dtTOkABTf/0UGzBUa4PbGPuqqMPH8LUaRugXDXzCjoX2PE26OrEKSj JJrl2u/i6PzGKJf7mUVVvJtbgD75uTEaqsktxMjEgNXnnnV3vZceIWP0OvdthFtZUK+2 +LYA== 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=fIal1kdq10TTB4IAGmI/j0NwEpx7kAoI5BB7eBhw2c4=; b=7WHJDpAeOZNYZgFBgcO2Ydv7njRYvGPPJSxFo6KwTfzCSiRZkk5IJCd3XawluLW62k sQbZXDk3wSiJlz4G6XrwUhJY+TUVhFwo7fc6cygYAqy5aBBigi7oarrOYH7V7j0C65g0 RtE+afdI2tqnGWvJz7lqx4jzy3XPB0WIOMm905b82uunhuiQ7xyAy71dz8lOobbOcYbF k6+cfQAQ+FbmPKIqXbf219Z8lyvccXKssLaUMbnFaTNCN40oWMm8VG5XHY1aFybdxhlR uz7IWUuhd/2hdG3TgvJ8e4oCn57RIKY5MpycTAFF5JN8pPM6/eJuQwre1vedPNSTgNnC 34EA== X-Gm-Message-State: AFqh2kppSZQifeejXVtBRYlcnubmeDriv9urXX878EWBIaldsb2QSY5K US5CYU3zDW8VkI759ReQt6EekzcLzDObng== X-Google-Smtp-Source: AMrXdXsjwJwsKL7IqSx/UEmA78Tx6k+7Bgr/10WtTZ8nfNqziQbzWADBp4e3VxAIHznhJt2Cos4E5A== X-Received: by 2002:a17:906:4892:b0:84d:489b:f1b1 with SMTP id v18-20020a170906489200b0084d489bf1b1mr3172007ejq.75.1673279232532; Mon, 09 Jan 2023 07:47:12 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Julien Grall , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v2 7/8] xen/riscv: print hello message from C env Date: Mon, 9 Jan 2023 17:46:54 +0200 Message-Id: <837bb553a539713d4aa15bb169142018bf508afe.1673278109.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: 1673279255452100009 Content-Type: text/plain; charset="utf-8" Signed-off-by: Oleksii Kurochko Reviewed-by: Alistair Francis --- 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 c1f33a1934..d444dd8aad 100644 --- a/xen/arch/riscv/riscv64/head.S +++ b/xen/arch/riscv/riscv64/head.S @@ -5,6 +5,4 @@ ENTRY(start) li t0, STACK_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 41ef4912bd..586060c7e5 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[STACK_SIZE] __aligned(STACK_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 Sat Apr 27 18:36:29 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=1673279254; cv=none; d=zohomail.com; s=zohoarc; b=YJF+3lRaMPjcniuL8+w5lfRNhuBaP6lA93LZJlOYFtibC7wnuAUC02PwGbmqSHR4TbSzrwu1UuT9E9ChoiZepn+UiP4mxVpQBQqhITj4zDmW/VKKiRX71jXF2/xxReXQ2iqyFFtExbqdwqtq3lQlb570le35S3k6+T7kH1dtLLM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673279254; 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=h4Pz1P177MM0Pgd5YIF5gjJ+E47uWjB6mT+S1Msdqus=; b=TDdQi/Tfy4afYWoXN7SLbeLFCCX/8weYZReQroANBGPJ7x+nIDx5+gNAo0dmKO84Tdkz+rgohKVGDHPaYShhXKrNqEC3d2DRm26coLnoOSJTeyKVWUO28/jsDhpKGGcP2MpB/kKzmq0JSDgiXWbYRAppYSNAjmbk62Qj7S5Qgps= 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 1673279254008246.27882941891778; Mon, 9 Jan 2023 07:47:34 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.473754.734568 (Exim 4.92) (envelope-from ) id 1pEuMm-0003Vk-If; Mon, 09 Jan 2023 15:47:16 +0000 Received: by outflank-mailman (output) from mailman id 473754.734568; Mon, 09 Jan 2023 15:47:16 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pEuMm-0003Ut-7N; Mon, 09 Jan 2023 15:47:16 +0000 Received: by outflank-mailman (input) for mailman id 473754; Mon, 09 Jan 2023 15:47:15 +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 1pEuMl-0002mL-C1 for xen-devel@lists.xenproject.org; Mon, 09 Jan 2023 15:47:15 +0000 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [2a00:1450:4864:20::62a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id e35c2200-9034-11ed-91b6-6bf2151ebd3b; Mon, 09 Jan 2023 16:47:14 +0100 (CET) Received: by mail-ej1-x62a.google.com with SMTP id tz12so21150288ejc.9 for ; Mon, 09 Jan 2023 07:47:14 -0800 (PST) Received: from 2a02.2378.102e.bce5.ip.kyivstar.net ([2a02:2378:102e:bce5:dfc0:9312:b994:6b21]) by smtp.gmail.com with ESMTPSA id 22-20020a170906311600b0082535e2da13sm3851561ejx.6.2023.01.09.07.47.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 07:47:13 -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: e35c2200-9034-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=h4Pz1P177MM0Pgd5YIF5gjJ+E47uWjB6mT+S1Msdqus=; b=mvHWZ/Po8AsyALfPQ85VY4fsnq1mIOxUKh2/XXSLd3JqbaJ92Olup/1digm91cv0gC dZd2m45lB+qnUO7N3+Gpcrwsi95TSD6CfQv+6Ep4f/qviDGTQatchaK9RnzN856UYvTM Xt3Mj9juPPGHHILnnAtGCP8COymH5VVhJ5vR+FaxO23lgxlb0ZhBbDxMpsGg+HQ8x8Jb 9+eRg3CdQNLj+QUXl5SAPitFz6YudBRxknhEgxm+FQZ1VmDACgnkUpj2St8/xlCyAkNY KFyWSRmajDq/RxQ3gGmnBhn4XwCHuPqHZJppN41GxpyEbmKR7LPEYAlt3AAe4shjRGEU sTEQ== 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=h4Pz1P177MM0Pgd5YIF5gjJ+E47uWjB6mT+S1Msdqus=; b=iI1MeWRHQbc1qwod58ewcEhSs6J8rq82oCNWKkw/ENJ2y6Rwoa3JyW31UTcaQxDXDy 8AMCXrOXbHJUFoIWL0ozGf5enYlSxRHoRbLJN/MJkipxusm6Gp1nW21gZZ5tpcc7kIZd +gM8eCzorMTV1/DyV1A7edcfvUXmuR9FxZdOZ/shCOrAWderQUtKz9BE1ftOH92qTjLq Kp9TKSP5sciIywWKVhbxjiYP180GSANmdA2Q759+G5I2xnhDsrq1VE0cjkVEPBYaAXzV jgZ2TIJKqUSkFtJY03MfksGe9ChQ5rtGdCImvMaiDSn31dh8ByHujq47yF+3jkZvnuhp 7XBg== X-Gm-Message-State: AFqh2kp6LlHRyk3/FPa0cdH00+IrQKFw32TaWLSBt7SGCYcecRAA61sf /GZjhIEYnFE3mX97rx0lOPmMaie2U9kR6Q== X-Google-Smtp-Source: AMrXdXuPy+TC91tuEc1UgylA0Yqd8RJGvEiIih4KUnWHYbKwDvuGdEfAw/R1yhKsNCju7XVZMT5xYg== X-Received: by 2002:a17:907:c007:b0:7ad:f165:70c2 with SMTP id ss7-20020a170907c00700b007adf16570c2mr77178927ejc.27.1673279233938; Mon, 09 Jan 2023 07:47:13 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Julien Grall , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Doug Goldstein Subject: [PATCH v2 8/8] automation: add RISC-V smoke test Date: Mon, 9 Jan 2023 17:46:55 +0200 Message-Id: <494c2fd1e046de20c2fa24be3989cc6adde8fdbe.1673278109.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: 1673279255473100010 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. Signed-off-by: Oleksii Kurochko Acked-by: Stefano Stabellini --- Changes in V2: - Move changes in the dockerfile to separate patch and send it to mailing list separately: [PATCH] automation: add qemu-system-riscv to riscv64.dockerfile - Update test.yaml to wire up smoke test --- automation/gitlab-ci/test.yaml | 20 ++++++++++++++++++++ automation/scripts/qemu-smoke-riscv64.sh | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100755 automation/scripts/qemu-smoke-riscv64.sh diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index afd80adfe1..64f47a0ab9 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -54,6 +54,19 @@ tags: - x86_64 =20 +.qemu-riscv64: + extends: .test-jobs-common + variables: + CONTAINER: archlinux:riscv64 + LOGFILE: qemu-smoke-riscv64.log + artifacts: + paths: + - smoke.serial + - '*.log' + when: always + tags: + - x86_64 + .yocto-test: extends: .test-jobs-common script: @@ -234,6 +247,13 @@ qemu-smoke-x86-64-clang-pvh: needs: - debian-unstable-clang-debug =20 +qemu-smoke-riscv64-gcc: + extends: .qemu-riscv64 + script: + - ./automation/scripts/qemu-smoke-riscv64.sh 2>&1 | tee ${LOGFILE} + needs: + - riscv64-cross-gcc + # Yocto test jobs yocto-qemuarm64: extends: .yocto-test-arm64 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